Identifying Electrocardiogram Abnormalities Using a Handcrafted-Rule-Enhanced Neural Network

Yuexin Bian, Jintai Chen, Xiaojun Chen, Xiaoxian Yang, Danny Z. Chen, Jian Wu

TL;DR

This paper introduces HRNN, a novel Handcrafted-Rule-enhanced Neural Network for ECG abnormality classification. By combining deep learning with handcrafted clinical rules, HRNN significantly outperforms existing methods and shows promise in identifying mislabeled ECG samples, improving diagnostic accuracy and data quality.

What Problem Does This Paper Address?

Cardiac abnormalities are a major health concern, and Electrocardiograms (ECGs) are crucial for diagnosis. While deep learning has shown potential for automating ECG analysis, current methods often fail to capture the nuanced information that human clinicians rely on. For instance, deep learning models might overlook specific waveform segments (like R-peaks) that are critical for diagnosing certain conditions, leading to diagnostic inconsistencies. This gap highlights the need for methods that can integrate established clinical knowledge with the pattern recognition capabilities of deep learning.

Methods

The core innovation is the Handcrafted-Rule-enhanced Neural Network (HRNN). HRNN comprises two main components:

  1. Deep Learning Module (fCNN): This module uses a modified 1D ResNet-34 architecture to automatically extract features from ECG signals, patient age, and gender. The network is designed to process ECGs as 1D signals, considering their temporal nature.
  2. Rule Inference Module: This module incorporates handcrafted rules derived from clinical knowledge. It first segments and delineates key cardiac cycles and segments (like P waves, QRS complexes, and T waves) from the ECG signal. Then, it applies specific rules (e.g., based on amplitude, duration, or intervals of these segments) to predict the presence or absence of 15 different ECG abnormalities.

These two modules act as "meta-learners." Their predictions are then fused by a Super Learner, which is a weighted combination of the outputs from the deep learning and rule inference modules. This fusion aims to leverage the strengths of both approaches, with the rule inference module particularly helping with rare abnormalities where deep learning might struggle. The model is trained using a weighted cross-entropy loss that incorporates the rule-based predictions to guide the deep learning module.

Datasets

The authors evaluated HRNN on two large-scale public ECG datasets from the "Hefei Hi-tech Cup ECG Intelligence Competition":

  • TianChi ECG dataset-1: Contains 24,106 samples for multi-label classification of 55 classes.
  • TianChi ECG dataset-2: Contains 20,096 samples for multi-label classification of 34 classes.

These datasets are described as covering comprehensive ECG disease classes commonly found in clinical applications. The standard 12-lead ECG format was used, with additional leads synthesized for the datasets if they were not originally present.

Key Insights and Ideas

  • Bridging the Gap: The paper effectively demonstrates that simply applying deep learning to ECGs isn't enough. Integrating explicit clinical knowledge through handcrafted rules is crucial for improving diagnostic accuracy, especially for subtle or rare abnormalities.
  • Complementary Strengths: The rule inference module excels at capturing precise quantitative criteria that clinicians use, while the deep learning module handles complex pattern recognition. The super learner effectively combines these complementary strengths.
  • Interpretability Boost: By incorporating rules, the model gains a degree of interpretability. The rule inference module provides explicit reasons for its predictions, which can be more transparent than the "black box" nature of pure deep learning models.
  • Mislabeled Sample Detection: A significant finding is HRNN's ability to identify potentially mislabeled ECG samples. This capability is invaluable for improving the quality and reliability of large ECG datasets, which are often subject to human annotation errors.

Key Results

HRNN significantly outperformed four state-of-the-art methods (1D Transformer-XL, 1D ResNet-34, SE-ECGNet, and MLWGAT) on both TianChi ECG datasets.

  • TianChi ECG dataset-1: HRNN achieved the highest overall recall (OR) and average per-class recall (CR) scores, outperforming others by over 4% and 13% respectively. It also showed competitive F1 scores.
  • TianChi ECG dataset-2: HRNN achieved the highest overall recall (OR) and average per-class recall (CR) scores, outperforming others by over 5% and 16% respectively. It also achieved a high average per-class F1 score (CF1).
  • Ablation Studies: Incorporating patient age and gender information improved performance. The rule inference module was shown to be critical for enhancing ECG abnormality identification, particularly for metrics like OR and CR.
  • Sensitivity Analysis: HRNN demonstrated higher sensitivity (recall) across various ECG abnormalities compared to other methods, even for categories not explicitly covered by its rules.

Limitations and Future Work

  • Rule Coverage: While the rule inference module is powerful, it doesn't cover all possible ECG abnormalities. The authors suggest future work could involve leveraging graph neural networks to model dependencies between different abnormalities and training rule modules with back-propagation.
  • Mislabeled Sample Impact: The paper notes that while HRNN can detect mislabeled samples, its OF1 scores might be slightly lower in some cases due to a higher rate of false positives. However, they argue that some of these "false positives" might actually be correct identifications of mislabeled data, suggesting a need for further validation.
  • Future Directions: The authors propose extending HRNN by:
  • Encoding rules into neural networks and training rule modules with back-propagation.
  • Leveraging graph neural networks to model dependencies among abnormalities.
  • Utilizing such dependencies for more accurate automatic ECG diagnosis.

Summary updated

BibTeX
@article{bian2023identifying,
  author = {Yuexin Bian and Jintai Chen and Xiaojun Chen and Xiaoxian Yang and Danny Z. Chen and Jian Wu},
  title = {{Identifying Electrocardiogram Abnormalities Using a Handcrafted-Rule-Enhanced Neural Network}},
  journal = {IEEE ACM Trans. Comput. Biol. Bioinform.},
  year = {2023},
  doi = {10.1109/tcbb.2022.3140785},
}
Figure