Using Multitask Learning to Improve 12-Lead Electrocardiogram Classification

J. Weston Hughes, Taylor Sittler, Anthony D. Joseph, Jeffrey E. Olgin, Joseph E. Gonzalez, Geoffrey H. TisonarXiv 2018

Summary

Deep learning models for medical diagnosis often struggle with "rare" conditions due to a lack of training data. This research demonstrates that a multi-task learning approach—training a single 12-lead ECG classifier to recognize many conditions at once—significantly boosts performance on rare diagnoses by "sharing" knowledge learned from more common heart conditions.

The Challenge of Class Imbalance

The 12-lead electrocardiogram (ECG) is the clinical gold standard for non-invasively diagnosing heart abnormalities. While automated ECG interpretation has existed for decades, traditional heuristic methods often struggle with complex rhythm diagnoses. Recent breakthroughs in Convolutional Neural Networks (CNNs) have shown promise in single-lead wearable data, but applying them to 12-lead clinical data faces a major hurdle: class imbalance.

Many critical heart conditions are rare, appearing in only a tiny fraction of clinical records. Training a model on a rare class in isolation usually results in poor performance because the network doesn't see enough examples to learn robust features. The authors set out to see if "multi-tasking"—learning to identify common and rare conditions simultaneously—could solve this "long tail" problem.

Methods: Multi-Task Architecture

The researchers implemented a 34-layer deep CNN with residual connections (a ResNet-style architecture). The model processes 10 seconds of 12-channel ECG data sampled at 250Hz, represented as a 12 x 2500 matrix.

Instead of a single output, the final layer is flattened and fed into multiple independent logistic regression "heads." Each head predicts a different diagnosis. The model minimizes the sum of sigmoid cross-entropy losses across all predicted classes. This forces the shared "backbone" of the network to learn features that are useful for many different types of heart conditions at once.

Datasets and Labeling

The study used a dataset of 41,522 deidentified ECGs collected from UCSF between 2010 and 2017. Labels for 24 distinct diagnostic classes were extracted from cardiologist-confirmed text reports using string matching and manual verification.

To combat imbalance, the researchers oversampled minority classes (up to 4,000 examples per class) while ensuring common classes remained well-represented. Performance was evaluated using the F1 score (the harmonic mean of precision and recall), which provides a more honest assessment of model performance on rare events where false positives are costly.

Key Insights: Shared Supervision

The "aha moment" of this research is that common classes provide a form of supervision for rare ones. By learning what a "normal" sinus rhythm or a common "atrial fibrillation" looks like, the model develops a sophisticated understanding of ECG morphology that it can then apply to identify rare conditions like "Complete Heart Block."

The authors found that relatedness is key: adding even one related common class to a rare class task can be as effective as adding dozens of unrelated classes. For example, training a model on both 1st and 2nd-degree heart blocks significantly improved the detection of the rarer 2nd-degree block.

Results and Performance Gains

The multi-task approach showed dramatic improvements over single-class models, especially for the rarest conditions:

  • Complete Heart Block (Rare): The F1 score jumped from a dismal 0.09 (single-class) to 0.62 (multi-task).
  • 2nd Degree AV Block (Rare): Performance improved from 0.58 to 0.73 when trained alongside other classes.
  • Common Classes: The model maintained high performance on frequent conditions, such as Sinus Rhythm (0.91 F1) and Atrial Fibrillation (0.85 F1).

Limitations and Future Work

The authors noted that this technique has limits. For extremely rare conditions (fewer than 100 total examples), the multi-tasking benefit was not as apparent, suggesting a minimum data threshold is still required. Future directions include exploring few-shot learning techniques and "freezing" shared layers to fine-tune output heads on small, high-quality datasets for specific clinical needs.

Summary updated

BibTeX
@misc{hughes2018using,
  author = {J. Weston Hughes and Taylor Sittler and Anthony D. Joseph and Jeffrey E. Olgin and Joseph E. Gonzalez and Geoffrey H. Tison},
  title = {{Using Multitask Learning to Improve 12-Lead Electrocardiogram Classification}},
  year = {2018},
  eprint = {1812.00497},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1812.00497},
}
Figure