120 points | 11d ago | Discuss on Hacker News | Back to Radar
Do you have a GitHub repo or something btw?
JK, as the spouse of someone with T1D I really appreciate seeing this!
It's possible that accounting for heart rate as well as carbs & insulin might have better results, with enough data.
0xdeadf1sh: good luck with your quest!
During training I artificially wobble the carb amounts so they are more like guesstimates than true carbs. This also partially fixed the quantile bands (before that they were too narrow).
Removing carbs will remove most (not all) need for insulin.
Epilepsy-keto is in the same realm as this, but even harder, because you need high ketones & low glucose. You're literally eating 10-20g carbs a day. The maximum that I ever ate while maintaining epilepsy keto was 50g carbs/day, and it was only possible by doing heavy exercise (120 squats with your body weight in the bar).
What are the issues for long term?
Have you read up on any of the Faustman lab work on using the BCG vaccine to treat T1D? I’m cautiously hopefully but not sure if it can or should be believed…
I have heard of T1D’s who have done this successfully but afaik it’s not a widely encouraged practice. Also, as I’m sure you’re aware, it makes social eating way more complicated than most people can comfortably tolerate.
> Also, as I’m sure you’re aware, it makes social eating way more complicated than most people can comfortably tolerate.
Yes, it makes social-drug-using extremely hard. You will learn:
1. most "food" outside is not food, but a thin layer of food on top of addiction/poison 2. people saying "I will do anything to fix my life destroying disease" are mostly lying 3. alcohol is poison too (you lose tolerance to it in keto overtime) 4. etc etc
BG forecasting and insulin response has always seemed to me to be such a personal thing (everyone has such a different response based on the various factors, and there are _so_ many factors) that the one-size-fits-all models in CGMs seemed the lowest common denominator. We live in an age where personal data collection is easier than ever (with wearable BLE hardware) and timeseries forecasting models are better than ever, making this research even more valuable.
Thanks so much for publishing your work!
You don't even need a datacenter GPU. I trained all of my models on a laptop RTX 4070.
Is there anyway way to use xdrip or nightscout or similar to move the data into your (android) app?
I already use the official Freestyle Librelink app plus jugglucoNG (which btw is amazing if you don't use, has a lot of nice stats), and the latter can already export its data streams.
Side note, I'm very happy to see more (diy) work in this field (ever since AAPS I think). #wearenotwaiting !
(Hashtag context for non T1Ds: diy software, unsurprisingly, has been leagues ahead in capabilities than "official" software.)
You can copy the data from the app to nightscout, but I haven't added the reverse direction. My app allows me to read from multiple CGMs simultaneously (I did this because different CGM models have their own algorithms and you don't want your machine learning model to be fitted to one particular algorithm).
I do a lot of reverse engineering to connect my app directly to the CGM sensors, bypassing official vendor solutions (they suck anyway).
Interestingly I have noticed that I get sleepy when the model's predicted clock gets close to midnight rather than the actual clock when I travel between time zones.
Regarding exercise, my blood sugar gets higher during anaerobic exercises but lower when doing aerobics.
At the moment I consider heartrate a confounding variable rather than a good predictor of BG. I think it could work for sedentary populations for whom higher heartrate correlates well with some kind of aerobic activity.
> Regarding exercise, my blood sugar gets higher during anaerobic exercises but lower when doing aerobics.
Isn't all of that fine? You're OP, right? I thought you said your model figured out time of day from the data, right? So let it figure out that before-wakeup behavior too. And the anaerobic vs aerobic, can't it learn that too? Tbh that just sounds like good data. Or the models aren't strong enough to take it?
I have done a lot of work on health wearables, and "predict the time series" does a lot better when you can cross-reference it against the biological drivers of the function you're looking at. The other obvious one here would be meals - hard to think of how to flag that properly, lots of options.
You can directly export the timeseries over USB (though I just download from Garmin's portal which syncs via bluetooth/wifi.) It also shouldn't be hard to write your own bluetooth/wifi sync.
They did weaker on low-glucose detection, which is pretty bad in this particular case. But it's possible that's fixable by tweaking the loss function to care more about detecting low glucose. As far as I can tell, there's no structural reason the transformer model did better on low glucose, probably just that it was pretrained on a synthetic dataset that had more lows than the author's data.
I love gradient boosted trees because they're fast, easy to train and unreasonably good at tabular and forecasting problems like this one. Of course they can't compete with transformers for complex tasks like writing code, but they're amazing specialists.
I also track my IOB curve over time based on my actual bolus and cgm values, its close to generic curves but slightly different.
Comments are loaded live from Hacker News and are not stored by Mid or Real.
nuthje 11d ago on HN
0xdeadf1sh (author) 11d ago on HN
khimaros 7d ago on HN
0xdeadf1sh (author) 7d ago on HN
khimaros 6d ago on HN
0xdeadf1sh (author) 6d ago on HN
khimaros 6d ago on HN
0xdeadf1sh (author) 3d ago on HN
hypendev 7d ago on HN
From wearing a CGM, whoop, using an impedance analyzing scale (I know, I know), blood tests - all the data shows pretty much the same correlation. I mostly did it for fun, but also because I wanted to "figure out how different things impact my body".
While yes, there were some interesting discoveries like: - Some things raise my blood glucose more than I'd expect, pasta for example - those were the things I usually "knew" and foods I'd avoid eating.
- Sleep quality only had correlation with amount of activity/time I went to sleep, so my food and caffeine choice didn't impact it much.
The results were pretty much: Eating bad and moving less is bad for you. Eating good and moving more is good. What your intuition tells you is healthy and good for you, usually is. What it says isn't, usually isn't.
Could have saved me some time and money, but at least I had fun.