This page contains our feature engineering pipeline source code for our manuscript submitted to NEJM AI:
Machine Learning to Infer a Health State Using Biomedical Signals: Detection of Hypoglycemia in People with Diabetes while Driving Real Cars
Hypoglycemia, one of the most dangerous acute complications of diabetes, poses a substantial risk for vehicle accidents. To date, both reliable detection and warning of hypoglycemia while driving remain unmet needs, as current sensing approaches are restricted by diagnostic delay, invasiveness, low availability, and high costs. This research aimed to develop and evaluate a machine learning (ML) approach for the detection of hypoglycemia during driving via data collected on driving characteristics and gaze/head motion.
We collected driving and gaze/head motion data (47,998 observations) during controlled euglycemia and hypoglycemia from 30 individuals with type 1 diabetes (24 males; mean age (±SD), 40.1±10.3 years; mean glycated hemoglobin, 6.9±0.7% [51.9±8.0 mmol/mol]) while participants drove a real car. Machine learning (ML) models were built and evaluated to detect hypoglycemia based solely on data on driving characteristics and gaze/head motion.
The ML approach detected hypoglycemia with high accuracy (area under the receiver operating characteristic curve [AUROC], 0.80±0.11). When restricted to either driving characteristics or gaze/head motion data only, the detection performance remained high (AUROC, 0.73±0.07 and 0.70±0.16, respectively).
Hypoglycemia could be detected non-invasively during real car driving with an ML approach that used only data on driving characteristics and gaze/head motion, thus improving driving safety and self-management for people with diabetes. Interpretable ML also provided novel insights into behavioral changes in people driving in hypoglycemia.