This study presents a novel method for non-invasively predicting blood glucose by using HRV (heart rate variability) features derived from sleep-stage ECG data, corrected for age-related autonomic nervous system changes. The age-corrected HRV features improved blood glucose prediction accuracy by 25.6% compared to conventional methods, and REM sleep HRV proved particularly important for prediction. This is an exploratory study opening possibilities for non-invasive blood glucose monitoring in diabetes management.


1. Introduction: The Importance of Diabetes Management and Non-Invasive Blood Glucose Measurement

Diabetes affects over 537 million adults worldwide and remains one of the leading causes of death. Effective blood glucose management is critical for preventing diabetic complications, yet conventional invasive blood glucose measurement methods discourage active patient engagement due to discomfort and inconvenience. This has driven growing demand for reliable non-invasive blood glucose measurement methods.

Recent advances in biosignal processing technology have drawn attention to the potential of physiological signals, particularly heart rate variability (HRV), for non-invasive blood glucose prediction. HRV reflects the activity of the autonomic nervous system (ANS), which plays a central role in blood glucose homeostasis. Previous studies have repeatedly reported significant correlations between HRV parameters and blood glucose levels. For example, Im et al. (2023) observed decreased HRV in patients with poor glycemic control, and Kajisa et al. (2024) reported a moderate negative correlation between sleep-time blood glucose levels and HRV in healthy adults.

However, existing HRV-based blood glucose prediction studies had several important limitations. The biggest issue was insufficient consideration of age-related autonomic nervous system changes. HRV naturally decreases with age, and failing to correct for this can compromise analytical accuracy. Stojmenski et al. (2023) demonstrated that age and sex correction significantly improves HRV-based blood glucose prediction performance, but studies combining this with sleep-stage HRV dynamics were virtually nonexistent.

Furthermore, while sleep's impact on blood glucose regulation is increasingly recognized, research on sleep-stage-specific HRV dynamics remains limited. Reports indicate that poor sleep quality in diabetic patients increases nocturnal blood glucose variability, and Cheng et al. (2023) found that HRV metrics measured during stable sleep and REM sleep stages were significantly associated with fasting blood glucose and HbA1c levels in Type 2 diabetes patients. This suggests that autonomic responses related to blood glucose may manifest more clearly during specific sleep stages.

Against this background, this study aimed to apply a novel age-correction technique to HRV features obtained through sleep-stage-specific ECG analysis and evaluate its impact on non-invasive blood glucose prediction accuracy. The hypothesis was that age-corrected, sleep-stage-specific HRV features would significantly outperform existing approaches by addressing fundamental limitations of autonomic function assessment across diverse age groups.


2. Results and Discussion

2.1 Performance of the Age-Corrected HRV Model

The age-corrected model achieved a mean R<sup>2</sup> of 0.161+/-0.010 in 5-fold cross-validation, with a mean absolute error (MAE) of 0.182+/-0.006 and a Pearson correlation coefficient of 0.409 (p<0.001). This represents a substantial +25.6% improvement (absolute +0.034) in R<sup>2</sup> compared to the uncorrected baseline model (R<sup>2</sup>=0.132, MAE=0.185). This result was confirmed as statistically significant by t-test (p<0.01).

Among several machine learning models compared, the BayesianRidge regression model achieved optimal blood glucose prediction performance. See Figure 1 below. These initial results suggest that age correction can enhance the predictive utility of HRV features for blood glucose prediction, though further validation in larger cohorts is needed.

Refer to caption Figure 1: Optimal blood glucose prediction performance via Bayesian Ridge regression (R<sup>2</sup> = 0.161, MAE = 0.182).

Cross-validation analysis also revealed very robust model stability across all folds. The coefficient of variation was only 5.9%, with all folds achieving R<sup>2</sup> above 0.15, demonstrating consistent generalization potential. See Figure 2 below.

Refer to caption Figure 2: Model stability confirmed through cross-validation (R<sup>2</sup> = 0.161 +/- 0.010, CV = 5.9%)


2.2 Feature Importance and Ablation Analysis

The top 3 most important predictive features were sleep-stage-specific HRV measurements, all with age correction applied (see Table 1). Specifically, hrv_rem_mean_rr_age_normalized (r=0.443, p=0.004) and hrv_ds_mean_rr_age_normalized (r=0.438, p=0.005) ranked highest, alongside diastolic blood pressure (DBP, r=0.437). The dominance of age-corrected features at the top directly demonstrates that the age-correction strategy successfully mitigated age-related confounding factors.

Figure 3 below shows the full predictive feature rankings, where age-corrected HRV features clearly dominate the top positions with strong statistical significance (12 of 15 features at p<0.05).

Refer to caption Figure 3: Age-corrected HRV features rank highly in predictive importance (12 of 15 features p<0.05).

Table 1: Top 5 Predictive Features Based on Correlation with Blood Glucose Levels

FeatureCorrelation (r)p-value
hrv_rem_mean_rr_age_normalized0.4430.004
hrv_ds_mean_rr_age_normalized0.4380.005
Diastolic blood pressure0.4370.005
hrv_rs_mean_rr_age_normalized0.3950.011
systolic blood pressure0.3880.013

2.3 Systematic Ablation Study Results

The systematic ablation study results, summarized in Figure 4, show that multi-modal integration significantly outperformed single-mode approaches, and that the 15-feature configuration proved optimal for blood glucose prediction.

Refer to caption Figure 4: Superior performance of multi-modal integration; 15-feature configuration is optimal for blood glucose prediction.

The ablation study identified key architectural contributions (see Table 2).

Table 2: Ablation Study Results (15-feature baseline)

  • Age correction improved performance by +25.6%.
  • Sleep-stage-specific HRV features are essential for positive predictive performance.
  • Multi-modal integration significantly outperformed single-mode approaches.
  • Clinical features alone yielded negative predictive capability.

These results underscore that both age correction and multi-modal integration (particularly sleep-stage-specific HRV) are essential for robust blood glucose prediction.

The architectural contributions are visually summarized in Figure 5, showing a +25.6% substantial performance improvement through age correction versus uncorrected features (R<sup>2</sup> = 0.161 vs 0.132).

Refer to caption Figure 5: Ablation study results showing age correction provides +25.6% performance improvement (R<sup>2</sup> = 0.161 vs 0.132).


2.4 Clinical Accuracy and Model Stability

The model demonstrated strong clinical tolerance. 68.2% of predictions fell within +/-1.0 mmol/L of actual blood glucose values, increasing to 84.1% within +/-1.5 mmol/L and 95.3% within +/-2.0 mmol/L. Cross-validation stability was also very high, with a mean R<sup>2</sup> of 0.161+/-0.010 and all folds achieving R<sup>2</sup> above 0.15, confirming consistent generalization potential.


2.5 Sleep-Stage-Specific Analysis

Table 3: Individual Sleep Stage Contributions to Blood Glucose Prediction

Sleep StagePredictive Contribution
REM SleepHighest
Deep SleepComplementary insights
Rapid SleepModerate

Note: REM sleep features demonstrated the highest predictive capability, consistent with known autonomic-metabolic connections during this stage.

This preliminary study suggests that age-corrected HRV features can improve non-invasive blood glucose prediction accuracy, achieving an initial 25.6% improvement over existing approaches. The methodology addresses fundamental limitations of autonomic function assessment across diverse age groups, providing a preliminary solution for the age-related performance degradation noted in previous HRV research. The preliminary R<sup>2</sup> of 0.161, while modest, provides continuous predictions rather than binary classification, comparing favorably with recent ECG-based glucose detection studies that achieved 75-78% binary classification accuracy. The preliminary tolerance analysis showing 84.1% of predictions within +/-1.5 mmol/L suggests potential, but extensive clinical validation is needed to assess clinical utility.

The superior performance of REM sleep features aligns with known physiology. REM sleep exhibits diverse autonomic activity reflecting complex metabolic regulation, which may enhance sensitivity to glucose-related autonomic modulation (see Table 3). Deep sleep's parasympathetic dominance provides complementary metabolic insights.


3. Conclusions

This preliminary study presents the initial potential of a novel age-corrected heart rate variability (HRV) feature technique for improving non-invasive blood glucose prediction accuracy through sleep-stage-specific ECG analysis. The methodology achieved a 25.6% improvement in prediction performance (age-corrected features R<sup>2</sup> = 0.161 vs. uncorrected features R<sup>2</sup> = 0.132, p < 0.01), and systematic ablation studies confirmed that age correction plays a critical role in model performance.

This research is at the proof-of-concept stage and requires extensive validation before clinical consideration. Tested on single-channel ECG data from 43 subjects, it provides preliminary evidence that sleep-stage-specific analysis, particularly REM sleep HRV features, may offer advantages over conventional measurements.

Important limitations include the small sample size (n=43), lack of demographic diversity, and the preliminary nature of validation. Future research should focus on large-scale multi-center validation (n>>200), diverse population testing, and prospective clinical trials to establish clinical utility. This study should therefore be regarded as an exploratory study requiring further validation.

Beyond blood glucose prediction, the age-correction framework addresses fundamental challenges of autonomic function assessment across diverse populations, with potential extension to other HRV-based biomedical applications including cardiovascular disease risk stratification and sleep disorder diagnosis. This research lays a preliminary foundation for sleep-aware and age-adjusted physiological monitoring in diabetes management.

Several important limitations currently constrain the interpretation and generalizability of this preliminary study. The small cohort (n=43) limits statistical power and generalizability, and demographic homogeneity may not represent broader populations. The single-site nature of the data necessitates multi-center validation for robustness, and preliminary cross-validation results require independent dataset confirmation before definitive conclusions. Current performance levels remain insufficient for clinical application, and the simple age-correction approach may not capture the full complexity of autonomic changes across diverse populations. These limitations make extensive further research essential--including large-scale multi-center validation (n>>200), diverse demographic testing, and prospective clinical trials--before clinical utility can be established. This study should be regarded as an exploratory study providing preliminary evidence for the blood glucose prediction potential of age-corrected HRV features.


4. Methodology

The study included 43 adult subjects with complete multi-modal data comprising overnight ECG recordings, extracted RR-intervals, clinical blood glucose measurements, and validated sleep quality assessments. Inclusion criteria were adults with clinical blood glucose measurement records and overnight ECG recordings of sufficient quality for accurate RR-interval extraction.

4.1 Data Acquisition and Signal Processing

ECG Recording

Single-channel ECG signals were acquired at a 250Hz sampling frequency using standard monitoring equipment. Raw signals underwent scaling verification to ensure physiological amplitude ranges (+/-5mV), addressing equipment variability that could affect subsequent analysis.

RR-Interval Extraction

R-peak detection was performed using an adaptive threshold algorithm and manually verified for quality control. RR-intervals were extracted through systematic artifact removal using statistical outlier detection (intervals deviating more than 3 standard deviations from local means were excluded).

Sleep Stage Classification

Sleep stages were identified using criteria established by the American Academy of Sleep Medicine (AASM).

  1. Deep Sleep (DS): Slow-wave sleep dominated by parasympathetic activity.
  2. REM Sleep: Rapid eye movement stage with diverse autonomic activity.
  3. Rapid Sleep (RS): Transitional sleep state with intermediate autonomic characteristics.

4.2 HRV Feature Extraction

Time-domain HRV parameters were calculated separately for each sleep stage following Task Force guidelines.

Standard HRV Metrics Per Sleep Stage

  1. Mean RR interval (ms).
  2. Root mean square of successive differences (RMSSD, ms).
  3. Standard deviation of NN intervals (SDNN, ms).
  4. Percentage of successive RR intervals differing by more than 50ms (pNN50, %).
  5. RR interval range (max - min, ms).

4.3 Age-Correction Technique

A novel mathematical age-correction approach was developed to compensate for age-related autonomic decline. The formula is:

HRV_age_normalized = (HRV_raw / (age_factor + epsilon))

where:

age_factor = (age / 65.0)

epsilon = 0.1 (numerical stability coefficient)

This formula scales HRV features relative to expected age-related decline using age 65 as a reference point representing typical autonomic function changes in healthy populations. The stability coefficient epsilon prevents numerical instability while maintaining the normalization effect.

Age correction was specifically applied to mean RR interval features across all sleep stages.

  • hrv_ds_mean_rr_age_normalized (deep sleep mean RR interval age-corrected)
  • hrv_rem_mean_rr_age_normalized (REM sleep mean RR interval age-corrected)
  • hrv_rs_mean_rr_age_normalized (rapid sleep mean RR interval age-corrected)

4.4 Target Variable Engineering

Primary Target

Clinical blood glucose measurements were log-transformed to address distributional asymmetry and improve regression stability.

y_target = ln(glucose_mmol_L)

This transformation normalizes the glucose distribution and stabilizes variance across physiological ranges, improving machine learning performance.


4.5 Feature Selection Strategy

A systematic correlation-based feature selection approach was used.

  1. Correlation analysis: Pearson correlation coefficients were computed for all features against the log-transformed glucose target.
  2. Statistical filtering: Features with p-values below 0.2 were retained to balance statistical relevance with inclusion.
  3. Ranked selection: The top 15 features were selected by absolute correlation strength for final modeling.

This conservative approach prevents overfitting on small datasets while retaining relevant predictive features, following best practices in biomedical feature selection.


4.6 Machine Learning Implementation

Model Selection

The BayesianRidge regression model was selected for its robust performance on small datasets and built-in uncertainty quantification.

Hyperparameters: alpha1=alpha2=lambda1=lambda2=1x10^-6

These parameters provide optimal regularization for small sample sizes while maintaining model flexibility.

Cross-Validation

5-fold cross-validation with stratified sampling ensured robust performance estimation and prevented overfitting. Performance metrics included:

  • Coefficient of determination (R<sup>2</sup>)
  • Mean absolute error (MAE)
  • Pearson correlation coefficient with significance testing.

4.7 Ablation Study Design

Systematic ablation analysis validated contributions of individual components.

  1. Full model: All features including age-corrected HRV.
  2. No age correction: Raw HRV features without age correction.
  3. No sleep HRV: Sleep-stage-specific HRV features excluded.
  4. ECG only: Only ECG-derived features.
  5. Clinical features only: Traditional clinical parameters without HRV.

This approach quantifies the specific contribution of each methodological component.


4.8 Implementation Details

All analyses were performed using Google Cloud Platform's TPU v3-8 (128GB HBM). The software stack was based on Python 3.9, TensorFlow 2.19.0 (PJRT runtime), and TPU-optimized libraries (NumPy, SciPy, Scikit-learn, XGBoost, Statsmodels). Custom modules handled ECG signal processing and feature extraction. Reproducibility was ensured through fixed random seeds (seed=42) and Docker containerization.


Closing Thoughts

This preliminary study successfully demonstrated the potential of age-corrected heart rate variability (HRV) features in the field of non-invasive blood glucose prediction. In particular, the approach of correcting for age-related autonomic changes and leveraging sleep-stage-specific HRV data achieved a 25.6% improvement in prediction performance over conventional methods, marking a significant contribution. Despite the limitations of a small-cohort study, it confirmed the importance of HRV during REM sleep and laid an important foundation for advancing non-invasive monitoring technology in diabetes management. Future large-scale studies and clinical validation will be essential to determine whether this technology can provide tangible benefits for diabetes patients.

Related writing

HarvestStartup · Engineering LeadershipEnglish

Fighting Cancer: How GitLab Founder Sid Sijbrandij Beat Cancer with Founder Mode

The remarkable story of GitLab founder Sid Sijbrandij who, after being diagnosed with a rare bone cancer in 2022, approached treatment in 'Founder Mode' - applying maximized diagnostics, developing 10+ personalized therapies, and running treatments in parallel to overcome the limitations of modern medicine and achieve remission, pointing toward the future of cancer treatment.

Mar 29, 2026Read more
HarvestData & Decision-Making · HealthEnglish

Comparison of Deep Learning Models for Non-Invasive Interstitial Glucose Prediction Using Wearable Sensors in Healthy Cohorts

This pilot study compares deep learning models for predicting blood glucose (interstitial glucose, IG) using only biosignals from wearable devices in healthy individuals. Without requiring food logs or exercise data, the BiLSTM model achieved the best prediction performance (RMSE 13.42 mg/dL) using only wrist-worn sensor data, opening possibilities for convenient non-invasive blood glucose monitoring in daily life.

Feb 2, 2026Read more
HarvestData & Decision-Making · HealthEnglish

A Deep Learning Framework for Virtual Continuous Glucose Monitoring and Prediction Based on Life-Log Data

This study proposes a 'Virtual CGM (V-CGM)' deep learning model that predicts current and future blood glucose levels using only life-log data such as food intake and exercise records, without actual blood glucose measurements. Built on LSTM-based encoder-decoder architecture with food name embeddings and autocorrelation techniques, the model was developed from data of 171 healthy adults and offers a cost-effective alternative to expensive CGM devices.

Feb 2, 2026Read more