Calibrating Glucose Sensors at the Edge: A Stress Generation Model for Tiny ML Drift Compensation
Abstract
:1. Introduction
2. Research Questions
3. Related Work
4. Paper Contribution
Case Study
5. Materials and Methods
5.1. Simulator
5.2. Model Description
- : this aspect was deeply studied in the literature. It indicates the diffusion of glucose from the blood to the measurement site of CGM: the interstitium. This diffusion process causes an attenuation of the amplitude and phase delay of the compared to the profile. The time constant that describes this process has a variability within and between subjects and ranges from 6 to 15 min [16]. In this study, based on the equation reported in [17], it is calculated considering also the previous value of estimated :
- : the measurement sensor error is introduced into the model to characterize the commercial sensor response. Although the commonly used simulator employs global metrics to evaluate the behavior of a specific sensor, this model has set its goal to achieve a response that more accurately mimics the real signals obtained from the sensors. As the technical user guides report, when the sensors are used, they show an error compared to the reference measure obtained from a gold standard blood glucose. Data obtained in a clinical study were compared with the response of the YSI 2300 STAT PlusTM glucose analyze (YSI Incorporated, Yellow Springs, Ohio 45387 USA). In this way, from the sensor datasheet it was possible to obtain the concurrency of the measurement and measurement error on a group of adult subjects [18]:To simulate the sensor response, for each YSI interval of values reported in Table 1 as columns, based on the probabilities reported in each row of the same column, the CGM upperlimit in the interval is calculated as:In the above equation, the values mCGMj and MCGMj represent the minimum and maximum limits of the interval corresponding to row j, respectively.This operation is repeated for all intervals, ensuring an increasing response in the extraction process. If is the set of points obtained above, the values between them are computed based on linear interpolation as:In Figure 2, there is a representation of how the sensor response is obtained. The dotted lines represent the thresholds at which the pairs of values are determined (CGMi, YSIi), while the red line gives the complete sensor response resulting by the linear interpolation.To better describe this process, the algorithm is described with pseudocode (Algorithm 1). In the algorithm description, bins represents the number of intervals that can be defined in the YSI values, which in this specific case is equal to 11.
- : the noise that affects the measure is defined as white noise with an amplitude included in of the measure.
- sensor response changes over time due to multiple factors, such as the biological body response that causes electrode oxidation and sensor degradation [19]. For these reasons, commercial sensors can measure glucose concentrations for a duration of 8–14 days depending on the type of device [20]. In this paper, the drift is modeled as a linear effect in which the slope of the line is obtained based on the range of values on the first day of observation, to simulate the effect reported in [21].
Algorithm 1 Generate CGM Data Points with Adjusted Concentrations |
Require:, YSI, mCGM, MCGM, P |
Ensure: CGM, interpolator |
|
5.3. Model Evaluation
Model on Specific Sensor
6. Result
6.1. Model Evaluation
Model on the Specific Sensor
7. Deployability on MCU
8. Discussion and Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- World Health Organization. Available online: https://www.who.int/health-topics/diabetes#tab=tab_1 (accessed on 3 April 2023).
- Basu, S.; Yudkin, J.S. Estimation of global insulin use for type 2 diabetes, 2018-30: A microsimulation analysis. Lancet Diabetes Endocrinol. 2018, 7, 25–33. [Google Scholar] [CrossRef] [PubMed]
- International Diabetes Federation. Diabetes Facts & Figures. Sito Web. Available online: https://idf.org/about-diabetes/diabetes-facts-figures/ (accessed on 26 March 2024).
- Dovc, K.; Battelino, T. Time in range centered diabetes care. Clin. Pediatr. Endocrinol. 2021, 30, 1–10. [Google Scholar] [CrossRef] [PubMed]
- Heinemann, L. Continuous Glucose Monitoring (CGM) or Blood Glucose Monitoring (BGM): Interactions and Implications. J. Diabetes Sci. Technol. 2018, 12, 873–879. [Google Scholar] [CrossRef]
- Martens, T.; Beck, R.W.; Bailey, R.; Ruedy, K.J.; Calhoun, P.; Peters, A.L.; Pop-Busui, R.; Philis-Tsimikas, A.; Bao, S.; Umpierrez, G.; et al. Effect of Continuous Glucose Monitoring on Glycemic Control in Patients With Type 2 Diabetes Treated With Basal Insulin: A Randomized Clinical Trial. JAMA 2021, 325, 2262–2272. [Google Scholar] [CrossRef]
- Luijf, Y.M.; Mader, J.K.; Doll, W.; Pieber, T.; Farret, A.; Place, J.; Renard, E.; Bruttomesso, D.; Filippi, A.; Avogaro, A.; et al. Accuracy and reliability of continuous glucose monitoring systems: A head-to-head comparison. Diabetes Technol. Ther. 2013, 15, 722–727. [Google Scholar] [CrossRef]
- Krouwer, J.S.; Cembrowski, G.S. A review of standards and statistics used to describe blood glucose monitor performance. J. Diabetes Sci. Technol. 2010, 4, 75–83. [Google Scholar] [CrossRef]
- Facchinetti, A.; Del Favero, S.; Sparacino, G.; Castle, J.R.; Ward, W.K.; Cobelli, C. Modeling the glucose sensor error. IEEE Trans. Biomed. Eng. 2013, 61, 620–629. [Google Scholar] [CrossRef] [PubMed]
- Facchinetti, A.; Del Favero, S.; Sparacino, G.; Cobelli, C. Model of glucose sensor error components: Identification and assessment for new Dexcom G4 generation devices. Med. Biol. Eng. Comput. 2015, 53, 1259–1269. [Google Scholar] [CrossRef] [PubMed]
- Vettoretti, M.; Del Favero, S.; Sparacino, G.; Facchinetti, A. Modeling the error of factory-calibrated continuous glucose monitoring sensors: Application to Dexcom G6 sensor data. In Proceedings of the 2019 41st Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), Berlin, Germany, 23–27 July 2019; pp. 750–753. [Google Scholar]
- Liu, C.; Vehí, J.; Avari, P.; Reddy, M.; Oliver, N.; Georgiou, P.; Herrero, P. Long-term glucose forecasting using a physiological model and deconvolution of the continuous glucose monitoring signal. Sensors 2019, 19, 4338. [Google Scholar] [CrossRef] [PubMed]
- Drecogna, M.; Vettoretti, M.; Del Favero, S.; Facchinetti, A.; Sparacino, G. Data gap modeling in continuous glucose monitoring sensor data. In Proceedings of the 2021 43rd Annual International Conference of the IEEE Engineering in Medicine & Biology Society (EMBC), Mexico City, Mexico, 1–5 November 2021; pp. 4379–4382. [Google Scholar]
- Talukder, S.; Kundu, S.; Kumar, R. Dynamic Calibration of Nonlinear Sensors with Time-Drifts and Delays by Bayesian Inference. arXiv 2022, arXiv:2208.13819. [Google Scholar]
- Xie, J. Simglucose v0.2.1. 2018. Available online: https://github.com/jxx123/simglucose (accessed on 21 March 2024).
- Schiavon, M.; Dalla Man, C.; Dube, S.; Slama, M.; Kudva, Y.C.; Peyser, T.; Basu, A.; Basu, R.; Cobelli, C. Modeling plasma-to-interstitium glucose kinetics from multitracer plasma and microdialysis data. Diabetes Technol. Ther. 2015, 17, 825–831. [Google Scholar] [CrossRef] [PubMed]
- Acciaroli, G.; Vettoretti, M.; Facchinetti, A.; Sparacino, G. Calibration of CGM systems. In Glucose Monitoring Devices; Elsevier: Amsterdam, The Netherlands, 2020; pp. 173–201. [Google Scholar]
- Dexcom, I. User Guide G7. 2023. Available online: https://dexcompdf.s3.us-west-2.amazonaws.com/en-us/G7-CGM-Users-Guide.pdf (accessed on 10 March 2024).
- Alva, S.; Bailey, T.; Brazg, R.; Budiman, E.S.; Castorino, K.; Christiansen, M.P.; Forlenza, G.; Kipnes, M.; Liljenquist, D.R.; Liu, H. Accuracy of a 14-day factory-calibrated continuous glucose monitoring system with advanced algorithm in pediatric and adult population with diabetes. J. Diabetes Sci. Technol. 2022, 16, 70–77. [Google Scholar] [CrossRef] [PubMed]
- Das, S.K.; Nayak, K.K.; Krishnaswamy, P.; Kumar, V.; Bhat, N. Electrochemistry and other emerging technologies for continuous glucose monitoring devices. ECS Sensors Plus 2022, 1, 031601. [Google Scholar]
- Acciaroli, G.; Vettoretti, M.; Facchinetti, A.; Sparacino, G. Calibration of minimally invasive continuous glucose monitoring sensors: State-of-the-art and current perspectives. Biosensors 2018, 8, 24. [Google Scholar] [CrossRef] [PubMed]
- STM32Cube.AI Developer Cloud. Available online: https://stm32ai-cs.st.com/home (accessed on 3 April 2024).
CGM | YSI Value Range [mg/dL] | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
[mg/dL] | <40 | 40–60 | 61–80 | 81–120 | 121–160 | 161–200 | 201–250 | 251–300 | 301–350 | 351–400 | >400 |
<40 | 61.54 | 4.71 | 1.53 | 0.04 | 0.06 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
40–60 | 34.62 | 63.56 | 14.85 | 0.99 | 0.04 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
61–80 | 3.85 | 29.45 | 65.02 | 9.44 | 0.21 | 0.10 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
81–120 | 0.00 | 2.20 | 18.48 | 77.51 | 12.57 | 0.71 | 0.18 | 0.00 | 0.00 | 0.00 | 0.00 |
121–160 | 0.00 | 0.09 | 0.03 | 11.90 | 74.01 | 15.15 | 1.46 | 0.13 | 0.00 | 0.00 | 0.00 |
161–200 | 0.00 | 0.00 | 0.09 | 0.13 | 12.95 | 69.46 | 16.85 | 1.42 | 0.09 | 0.00 | 0.00 |
201–250 | 0.00 | 0.00 | 0.00 | 0.00 | 0.17 | 14.48 | 67.77 | 16.82 | 1.11 | 0.34 | 1.69 |
251–300 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.10 | 13.57 | 67.27 | 25.91 | 4.37 | 0.00 |
301–350 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.18 | 14.13 | 61.01 | 33.90 | 3.37 |
351–400 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.23 | 11.57 | 53.29 | 26.97 |
>400 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.31 | 8.11 | 67.98 |
RMSE [mg/dL] | MSE [(mg/dL)2] | MAE [mg/dL] | R2 [(mg/dL)2] | |
---|---|---|---|---|
RFR | 20.55 | 422.24 | 16.13 | 0.42 |
SVR | 20.90 | 436.89 | 16.22 | 0.41 |
Software Version | Optimization | Allocation Inputs | Allocate Output | MACC | Flash Size | RAM Size |
---|---|---|---|---|---|---|
9.0.0 | RAM | TRUE | TRUE | 800 | Total: 24 KiB | Total: 2 KiB |
Weights: 15.43 KiB | Activation: 20 B | |||||
Library: 8 KiB | Library: 2 KiB | |||||
In/Out: 0 B/0 B |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Sabatini, A.; Cenerini, C.; Vollero, L.; Pau, D. Calibrating Glucose Sensors at the Edge: A Stress Generation Model for Tiny ML Drift Compensation. BioMedInformatics 2024, 4, 1519-1530. https://doi.org/10.3390/biomedinformatics4020083
Sabatini A, Cenerini C, Vollero L, Pau D. Calibrating Glucose Sensors at the Edge: A Stress Generation Model for Tiny ML Drift Compensation. BioMedInformatics. 2024; 4(2):1519-1530. https://doi.org/10.3390/biomedinformatics4020083
Chicago/Turabian StyleSabatini, Anna, Costanza Cenerini, Luca Vollero, and Danilo Pau. 2024. "Calibrating Glucose Sensors at the Edge: A Stress Generation Model for Tiny ML Drift Compensation" BioMedInformatics 4, no. 2: 1519-1530. https://doi.org/10.3390/biomedinformatics4020083
APA StyleSabatini, A., Cenerini, C., Vollero, L., & Pau, D. (2024). Calibrating Glucose Sensors at the Edge: A Stress Generation Model for Tiny ML Drift Compensation. BioMedInformatics, 4(2), 1519-1530. https://doi.org/10.3390/biomedinformatics4020083