Convolution-Free Waveform Transformers for Multi-Lead ECG Classification

Annamalai Natarajan, Gregory Boverman, Yale Chang, Corneliu Antonescu, Jonathan RubinCinc 2021

Abstract

Researchers from Philips and the University of Arizona have developed "Waveformer," a transformer-based model designed to classify cardiac abnormalities in multi-lead electrocardiograms (ECGs) without traditional convolutional neural networks (CNNs). By adapting pretrained Vision Transformer (ViT) weights—originally optimized for 2D image recognition—to 1D ECG signals, the team achieved a top-tier ranking in the 2021 PhysioNet/CinC Challenge. Waveformer demonstrates that cross-domain transfer learning and attention mechanisms can provide both high diagnostic accuracy and clinical interpretability through attention maps.

Introduction

Electrocardiograms (ECGs) are the clinical gold standard for diagnosing cardiovascular diseases. While the 12-lead ECG is the standard in clinical settings, there is an increasing demand for automated interpretation of signals from fewer leads (e.g., 2 or 6 leads) common in wearable and portable devices.

Traditional deep learning approaches for ECG classification predominantly utilize CNNs for feature extraction. However, cardiac abnormalities are often transient and can be obscured within long recordings. Transformers, characterized by their self-attention mechanisms, are inherently suited for this task as they can dynamically weigh the importance of different signal segments. This study introduces Waveformer, a "convolution-free" architecture that leverages transfer learning from the computer vision domain to address these challenges.

Methods

The Waveformer architecture departs from standard CNN-based designs by employing a patching strategy and a transformer-based backbone.

Architecture and Patching

Instead of using convolutional layers to downsample the signal, the raw ECG is partitioned into contiguous segments, or "patches," of 64 samples. These patches are then transformed into one-dimensional vectors via a linear projection. This projection is specifically calibrated to match the input dimensions required by pretrained Vision Transformer (ViT) weights.

The Waveformer architecture overview, illustrating the flow from raw ECG segments to classification via a Transformer Encoder and MLP Head.

Cross-Domain Transfer Learning

A key innovation of Waveformer is its use of weights from a ViT model pretrained on 2D images (ImageNet). The architecture is tailored to allow these "vision" weights to process 1D waveforms, suggesting that fundamental patterns of attention are transferable across disparate data modalities.

Hybrid Feature Integration

The model utilizes a hybrid approach for final classification. The deep features learned by the 12-layer transformer encoder (with 12 attention heads) are concatenated with 22 "wide" features, which include static demographic data and basic ECG metrics, before being passed to the final MLP head.

Results and Discussion

The model was evaluated using a massive combined dataset of approximately 88,000 ECG recordings from six major sources provided by the PhysioNet/CinC Challenge 2021.

Performance and Scalability

Waveformer placed 11th out of 39 officially ranked teams, achieving an average challenge metric of 0.47 on the hidden test set. The model demonstrated exceptional accuracy for specific conditions such as pacing rhythms and bundle branch blocks (AUROCs of 0.98–0.99). Notably, the model showed robust performance across various lead configurations; while 12-lead setups performed best, the performance drop for 2-lead configurations was minimal (~0.05), indicating high suitability for wearable applications.

Interpretability via Attention Maps

One of the primary advantages of the transformer architecture is the ability to generate attention maps. These heatmaps visualize which segments of the ECG the model prioritized during classification, providing a level of transparency similar to a cardiologist's visual inspection.

Attention maps and corresponding ECG signals showing the model's focus on specific cardiac events for various diagnoses.

Limitations

Despite its success, Waveformer exhibited a significant performance gap between training and test sets (~0.2), suggesting a tendency toward overfitting. Additionally, the model struggled with "low QRS voltage" signals, which were occasionally misidentified as normal sinus rhythms. The authors also noted that while the architecture is conceptually convolution-free, the linear projection of segments can be mathematically implemented as a convolution, making the approach "almost" convolution-free in practice.

Conclusion

Waveformer represents a significant step toward applying transformer architectures to medical signal processing. By successfully repurposing 2D vision weights for 1D ECG analysis, the researchers have demonstrated a flexible and interpretable alternative to traditional CNNs, with strong potential for deployment in both clinical and wearable diagnostic tools.

Summary updated

BibTeX
@inproceedings{natarajan2021convolution,
  author = {Annamalai Natarajan and Gregory Boverman and Yale Chang and Corneliu Antonescu and Jonathan Rubin},
  title = {{Convolution-Free Waveform Transformers for Multi-Lead ECG Classification}},
  booktitle = {Cinc},
  year = {2021},
  doi = {10.23919/cinc53138.2021.9662697},
}
Figure