MMA-RNN: A multi-level multi-task attention-based recurrent neural network for discrimination and localization of atrial fibrillation

Yifan Sun, Jingyan Shen, Yunfan Jiang, Zhaohui Huang, Minsheng Hao, Xuegong Zhang

TL;DR

MMA-RNN is an end-to-end deep learning framework designed to simultaneously classify the type of Atrial Fibrillation (AF) in ECG signals and pinpoint the exact timing of AF episodes. By utilizing a hierarchical, multi-level attention mechanism, the model achieves state-of-the-art performance on the CPSC 2021 dataset, offering a robust solution for early diagnosis via wearable devices.

What Problem Does This Paper Address?

Atrial Fibrillation (AF) is a common heart arrhythmia that can lead to severe complications like stroke or heart failure. While many AI models can detect AF, they often struggle with two specific challenges:

  1. Sub-type Discrimination: Distinguishing between persistent AF (continuous) and paroxysmal AF (intermittent). These require different clinical management strategies.
  2. Localization: Identifying exactly when an AF episode starts and ends within a long, noisy ECG recording.

Most existing methods use a "two-stage" approach—first classifying the patient, then locating the episodes. This often leads to error accumulation: if the first stage misclassifies the patient, the second stage is doomed. Furthermore, traditional methods rely heavily on manual feature engineering (like R-peak detection), which is prone to noise and requires deep domain expertise.

Methods

The authors propose the Multi-level Multi-task Attention-based Recurrent Neural Network (MMA-RNN). Its core innovation lies in its hierarchical architecture that processes ECG data at three distinct granularities:

  • Time Point Level: Raw ECG signals are projected into a high-dimensional space and processed by a Bidirectional LSTM (Bi-LSTM) to capture local context.
  • Beat Level: An attention mechanism groups time points into "beats," allowing the model to focus on the most informative parts of a cardiac cycle.
  • Slice Level: Beats are aggregated into larger "slices" (roughly 10 beats long) using another Bi-LSTM and attention layer to capture long-term sequential patterns.

The model features a multi-head classifier:

  • Head 1 (Discrimination): Uses high-level slice features to classify the signal as Normal, Persistent AF, or Paroxysmal AF.
  • Head 2 (Localization): Uses low-level time-point features to perform many-to-many binary classification (Normal vs. Abnormal) for every single point in the sequence.

By training these tasks simultaneously in an end-to-end fashion, the model allows information to flow between the high-level "big picture" and the low-level "details," improving the accuracy of both.

Datasets

The study uses the CPSC 2021 (China Physiological Signal Challenge) dataset.

  • Composition: 1,425 ECG records from 104 patients.
  • Labels: Three classes (Normal, Persistent AF, Paroxysmal AF) with annotated onset and offset points for paroxysmal episodes.
  • Characteristics: Signals were sampled at 200Hz and varied significantly in length (from 8 seconds to over 6 hours), making it a realistic and challenging benchmark.

Key Insights and Ideas

  • Hierarchical Synergy: The "aha moment" is that localization and discrimination shouldn't be separate steps. Low-level features (like the exact moment a rhythm changes) provide vital clues for high-level classification, and vice versa.
  • Attention as an Interpreter: The attention mechanism doesn't just improve accuracy; it acts as a pointer. Visualizations show the model naturally places higher "weight" on the boundaries of AF episodes, mimicking how a human cardiologist might scan a strip for transitions.
  • Handling Variable Length: Because the model uses a hierarchical structure with attention-based aggregation, it can process ECG strips of any length without the need for complex padding or rigid windowing.

Key Results

The model was evaluated using the official CPSC 2021 scoring metric ($U$ score), which combines discrimination accuracy ($U_r$) and localization precision ($U_e$).

  • Superior Performance: MMA-RNN achieved a total $U$ score of 2.2975, significantly outperforming established baselines like UNIWA, WHS, and CUICM.
  • Discrimination: It achieved a $U_r$ score of 0.9437 (out of 1.0), showing near-perfect ability to distinguish between the three rhythm types.
  • Localization: It achieved a $U_e$ score of 1.3538, indicating high precision in identifying episode boundaries within a margin of just 1-2 heartbeats.
  • Ablation Success: Removing the "information interaction" between the two heads caused a noticeable drop in performance, proving that the multi-task approach is essential.

Limitations and Future Work

While the results are promising, the authors note a few areas for growth:

  • Parameter Sensitivity: The model's performance is sensitive to the "slice length" chosen. If slices are too long or too short, the hierarchical aggregation becomes less effective.
  • Computational Efficiency: Although described as "economical" for wearables, the paper does not provide specific benchmarks for power consumption or latency on mobile hardware.
  • Generalization: The authors suggest that this multi-level architecture could be applied to other time-series tasks, such as EEG analysis or identifying motifs in gene expression, but these applications remain to be tested.

Summary updated

Abstract

Background:Atrial fibrillation significantly impacts individual health, public wellness, and healthcare expenditure. The primary tool for its detection is the Electrocardiograph (ECG), a non-invasive test that generates abundant data requiring expert human analysis. This task becomes exceedingly complex when interpreting ECG signals with cyclical patterns, fluctuating lengths, and vulnerability to noise. Despite these challenges, there exists a significant gap in the research focusing on further differentiating persistent and paroxysmal atrial fibrillation, a task akin to multi-class discrimination, and pinpointing the exact start and end of abnormal episodes, a process central to localization.Methodology:We present the Multi-level Multi-task Attention-based Recurrent Neural Network (MMA-RNN), a solution founded on a hierarchical structure that leverages Bidirectional Long and Short-Term Memory Networks (Bi-LSTM) and attention layers to discern three-level sequential features. This framework enhances information synergy and reduces error accumulation by deploying a multi-head classifier that concurrently tackles both previously mentioned critical tasks, facilitating a more streamlined and accurate analysis.Results:We affirm the proficiency of our model through rigorous testing on the CPSC 2021 dataset, where it achieved 0.9437 out of 1 in discrimination and 1.3538 out of 1.6479 in localization. Our method also exhibited superior performance in line with official evaluation benchmarks.Conclusions:Our innovative algorithm holds the potential for real-time AF monitoring through wearable technology, promoting proactive healthcare and early intervention.
BibTeX
@article{sun2024mma,
  author = {Yifan Sun and Jingyan Shen and Yunfan Jiang and Zhaohui Huang and Minsheng Hao and Xuegong Zhang},
  title = {{MMA-RNN: A multi-level multi-task attention-based recurrent neural network for discrimination and localization of atrial fibrillation}},
  journal = {Biomedical Signal Processing and Control},
  year = {2024},
  url = {https://openreview.net/forum?id=nQmnGY6S77},
}
Figure