ECG-Based Electrolyte Prediction: Evaluating Regression and Probabilistic Methods

Philipp Von Bachmann, Daniel Gedon, Fredrik K. Gustafsson, Antônio H. Ribeiro, Erik Lampa, Stefan Gustafsson, Johan Sundström, Thomas B. SchönarXiv 2022 · DOI

TL;DR

This paper explores using deep neural networks (DNNs) to predict continuous electrolyte levels directly from ECG signals, a non-invasive alternative to blood tests. While DNNs show promise and outperform traditional methods, prediction accuracy varies significantly across electrolytes, and uncertainty estimates need further calibration for clinical use.

What Problem Does This Paper Address?

Electrolyte imbalances are a common and serious issue in hospitalized patients, potentially leading to severe health consequences like cardiac arrest. Current methods for measuring electrolytes rely on blood tests, which are invasive, time-consuming, and not always accessible. The electrocardiogram (ECG), a readily available and non-invasive tool for assessing heart activity, is known to be influenced by electrolyte levels. However, accurately predicting continuous electrolyte concentrations directly from ECGs using machine learning, particularly deep learning, is an underexplored area. This research aims to bridge this gap by investigating the feasibility and effectiveness of DNNs for this task.

Methods

The researchers employed deep neural networks (DNNs), specifically a ResNet architecture, for ECG-based electrolyte prediction. They explored several approaches:

  • Deep Direct Regression: A standard DNN approach where the network directly outputs continuous predictions, trained using mean-squared error.
  • Discretization and Classification/Ordinal Regression: To understand prediction difficulty and explore simpler tasks, electrolyte levels were discretized into multiple classes. This allowed for training classification and ordinal regression models.
  • Probabilistic Regression: To provide a measure of confidence in predictions, the DNN was extended to output uncertainty estimates. They investigated aleatoric uncertainty (inherent data noise) and epistemic uncertainty (model knowledge gaps) using Gaussian and ensemble methods, as well as Laplace approximation.

They compared their DNN performance against traditional machine learning models like Gradient Boosting and Random Forest, which were pre-processed with Principal Component Analysis (PCA).

Datasets

The study utilized a novel, large-scale dataset comprising over 290,000 ECG recordings from adult patients attending emergency departments in Stockholm, Sweden, collected between 2009 and 2017. This dataset was linked to blood measurements of four key analytes: potassium, calcium, sodium, and creatinine. A crucial inclusion criterion was that ECGs and blood measurements were acquired within a ±60 minute window to ensure label quality. The data was split into training, validation, and two test sets: a random test set and a temporal test set to assess robustness to data shifts over time.

Key Insights and Ideas

  • Electrolyte-Specific Performance: The prediction accuracy for electrolytes varies significantly. Potassium predictions were notably better than those for calcium, sodium, and creatinine. This is attributed to the complex interplay of electrolytes and their distinct manifestations in the ECG.
  • DNNs Outperform Traditional Models: Deep neural networks, particularly the ResNet architecture, demonstrated superior performance in predicting continuous electrolyte levels compared to traditional machine learning methods like Gradient Boosting and Random Forest.
  • Discretization vs. Continuous Prediction: While discretizing electrolyte levels can lead to good classification performance, it doesn't fully address the core problem of predicting continuous concentration values. The performance drops significantly when trying to predict more granular levels.
  • Probabilistic Regression Potential: Probabilistic regression offers a way to quantify uncertainty, which is crucial for clinical applications. However, the current uncertainty estimates are not perfectly calibrated, meaning they don't always accurately reflect the prediction error.
  • Age-Related Trends: Older patients tend to exhibit more extreme electrolyte concentration values, a trend observed across all four electrolytes.

Key Results

  • Potassium Prediction: The DNN achieved a Mean Squared Error (MSE) of 0.152 for potassium, outperforming traditional models which had MSEs around 0.215-0.220.
  • Calcium Prediction: While the DNN showed promise, its performance on calcium was less impressive, with predictions appearing horizontally aligned in scatter plots, indicating a weaker learned relationship.
  • Classification Performance: For binary classification (hypo/hyper conditions), the model achieved competitive AUROC scores, particularly for potassium.
  • Uncertainty Calibration: While aleatoric uncertainty showed the highest correlation with prediction error (MSE), the overall uncertainty estimates were found to be not particularly well-calibrated.

Limitations and Future Work

The authors acknowledge several limitations:

  • Varying Electrolyte Performance: The significant difference in prediction accuracy across electrolytes suggests that some are inherently harder to predict from ECGs than others.
  • Uncertainty Calibration: The probabilistic regression models' uncertainty estimates are not perfectly calibrated, limiting their immediate clinical utility.
  • Dataset Size for Calcium: The relatively smaller dataset size for calcium compared to potassium might have impacted prediction accuracy.

Future work suggested includes:

  • Larger and More Diverse Datasets: Investigating the problem with even larger datasets, potentially including more diverse patient populations and electrolyte combinations.
  • Combined Models: Exploring models that predict multiple electrolytes simultaneously, given their interconnectedness.
  • Improved Uncertainty Calibration: Developing methods to enhance the calibration of uncertainty estimates for more reliable clinical decision-making.
  • Clinical Validation: Further validating the models and uncertainty estimates in real-world clinical settings.

Summary updated

BibTeX
@misc{bachmann2022ecg,
  author = {Philipp Von Bachmann and Daniel Gedon and Fredrik K. Gustafsson and Antônio H. Ribeiro and Erik Lampa and Stefan Gustafsson and Johan Sundström and Thomas B. Schön},
  title = {{ECG-Based Electrolyte Prediction: Evaluating Regression and Probabilistic Methods}},
  year = {2022},
  eprint = {2212.13890},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2212.13890},
}
Figure