I have trained a model to predict my blood sugar [P]
Our take
![I have trained a model to predict my blood sugar [P]](https://preview.redd.it/v3bputi1cmgh1.png?width=140&height=91&auto=webp&s=5fcaa20e54e37915fc9d5911c43947f4a7ddb940)
The recent release of a blood sugar prediction model, trained and shared by /u/0xdeadf1sh on Reddit, represents a compelling intersection of personal health management and accessible AI. This isn’t just another research paper locked behind a paywall; it's a working model, openly available under the MIT license, demonstrating the power of transformer architectures for real-world, high-stakes applications. The project highlights a growing trend towards personalized AI solutions, moving beyond generalized models to address individual needs. It echoes concerns raised in Conference Reviews: Asking Too Much? about the scope and expectations of academic reviews, as this project tackles a complex problem with a clearly defined goal and a practical implementation. The developer’s willingness to share, even at a relatively early stage, and solicit feedback is commendable, fostering a collaborative spirit often lacking in the field, a sentiment also explored in No replies to rebuttals and comments even by AC where the lack of engagement from reviewers can hinder progress.
The technical details are noteworthy. Employing a BERT-style encoder-only transformer, the model cleverly incorporates both past and future data – carbs, insulin, and blood glucose – to predict future glucose levels. The use of DILATE and pinball loss functions, alongside the Kovatchev risk space reparameterization, demonstrates a sophisticated understanding of the nuances of glycemic control. The tiered model sizes, ranging from a remarkably compact nano version to a larger model with 17 million parameters, showcase an awareness of resource constraints and accessibility. The rapid finetuning time, less than 10 minutes even for the larger models, is particularly impressive and suggests a potential for widespread adoption, particularly on resource-constrained devices like smartphones. This is a significant step beyond traditional continuous glucose monitoring (CGM) systems, which primarily provide real-time data and alerts, by offering a predictive element that could empower users to proactively manage their blood sugar levels.
Beyond the technical achievement, the project’s significance lies in its democratization of AI tools for healthcare. The open-source nature of the code and trained weights lowers the barrier to entry for researchers and individuals interested in exploring AI-powered diabetes management. It exemplifies the potential for individuals to leverage readily available tools and datasets to address personal health challenges, rather than relying solely on commercial solutions. The acknowledgement of ongoing limitations – specifically the reliance on announced carbs and insulin – is also a mark of authenticity and encourages further development. The developer’s transparency about the model’s shortcomings and their commitment to improvement fosters trust and invites community contributions. This proactive sharing aligns with a broader movement toward more open and collaborative AI development, a theme frequently discussed within the machine learning community.
Looking ahead, it's intriguing to consider the potential for this type of personalized predictive model to evolve. Could future iterations incorporate automated carb and insulin prediction, removing the need for manual input? What are the ethical implications of relying on AI for such critical health decisions, and how can we ensure fairness and accuracy across diverse populations? The availability of the nano version, with its minimal parameter count, is particularly encouraging, suggesting a pathway towards embedding such models directly into wearable devices. This project isn’t just about predicting blood sugar; it’s about exploring a future where AI empowers individuals to take greater control of their health and well-being.
| It's an encoder-only transformer that consumes past(blood glucose + carbs + insulin) and future(carbs + insulin) and predicts future blood glucose for the next 2 hours. Announced meals and boluses/basal are used to condition its predictions. The context size is variable (8 - 24 hours), and model can work in autoregressive mode to predict the next >2 hours. It also predicts time by looking at the context, but it never consumes time. The architecture is BERT-style: bidirectional attention with future BG masked. DILATE loss was used to fit the median line; pinball loss to fit the uncertainty bands. The two are "mixed" via Kendall-Gal. All blood glucose is in kovatchev risk space reparameterized to [40, 400] range. I have trained 4 model classes (nano, small, medium, large) and 3 variants for each (pretrained on simulator only, pretrained + finetuned on ohiot1dm, pretrained and finetuned on ohiot1dm + azt1d + shanghait1dm). The largest one has ~17 million parameters (16 heads across 16 layers). Pretraining for the largest model took ~48 hours. Finetuning took <10 minutes. There is also another version finetuned on my own data that I am currently running on my phone. Source is available here, released under the MIT license. The repo also contains links to trained weights and evaluation data. I've worked on this project since March. There are still things to improve (e.g. it always requires announced carbs + insulin, would be better if it could also predict without them), but I have decided to publish it here to get your opinion (and also answer your questions, if any). Edit: my model is getting fat-shamed ;_; so I just want to emphasize that there is a nano version with less than 40K parameters. [link] [comments] |
Read on the original site
Open the publisher's page for the full experience