Source-linked AI summary

Lead-agnostic Self-supervised Learning for Local and Global Representations of Electrocardiogram

Jungwoo Oh, Hyunseung Chung, Joon-myoung Kwon, Dong-gyun Hong, Edward Choi

arXiv:2203.06889v2cs.LGeess.SP

TL;DR

Prior ECG self-supervised methods mainly capture global context and assume the same leads are available during pre-training and fine-tuning. This paper combines local and global contrastive learning with random lead masking, and reports better performance than prior state-of-the-art methods on two downstream tasks. The reported limitations include experiments at one sampling rate and no in-depth hyperparameter optimization.

  • Problem

    Prior ECG self-supervised methods focus on global context and assume the pre-training and fine-tuning lead sets match, although the available lead set may be unknown beforehand.

    Source: §1 · p. 2
  • Method

    The method combines Wav2Vec 2.0 and CMSC for local and global contrastive learning and uses random lead masking during pre-training.

    Source: §3.1 · p. 5, §6 · p. 10
  • Results

    The proposed W2V+CMSC+RLM method outperforms state-of-the-art methods on cardiac arrhythmia classification and patient identification.

    Source: §1 · p. 2, §6 · p. 10
  • Takeaways & Limitations

    The experiments support the method's use on tasks requiring local ECG variability for classification and global trends for patient identification.

    Source: §1 · p. 2

    All experiments used 500 Hz ECG samples, and the authors did not investigate optimal hyperparameters in depth, including the RLM probability.

    Source: §6 · p. 11

Abstract

from arXiv · show

In recent years, self-supervised learning methods have shown significant improvement for pre-training with unlabeled data and have proven helpful for electrocardiogram signals. However, most previous pre-training methods for electrocardiogram focused on capturing only global contextual representations. This inhibits the models from learning fruitful representation of electrocardiogram, which results in poor performance on downstream tasks. Additionally, they cannot fine-tune the model with an arbitrary set of electrocardiogram leads unless the models were pre-trained on the same set of leads. In this work, we propose an ECG pre-training method that learns both local and global contextual representations for better generalizability and performance on downstream tasks. In addition, we propose random lead masking as an ECG-specific augmentation method to make our proposed model robust to an arbitrary set of leads. Experimental results on two downstream tasks, cardiac arrhythmia classification and patient identification, show that our proposed approach outperforms other state-of-the-art methods.

1. Introduction

The paper addresses two limitations of ECG pre-training: reliance on scarce expert labels and methods that capture only global context or assume fixed lead sets. It combines local and global contrastive learning with random lead masking and reports stronger performance on arrhythmia classification and patient identification than prior state-of-the-art methods.

1. Introduction

  • Earlier supervised ECG methods relied on labels that only clinical practitioners or professional cardiologists could annotate, limiting training samples and burdening practitioners.The accumulation of ECG recordings in healthcare facilities motivates learning from unlabeled data.Source: §1 · p. 1
  • The method combines local and global contextual information, which the authors describe as the first ECG pre-training approach to consider both together.Earlier ECG self-supervised methods are described as exploiting global context rather than local context.Source: §1 · pp. 1–2
  • Random Lead Masking (RLM) is proposed to support robust downstream performance when an arbitrary number of leads is available.The authors note that pre-training and fine-tuning for each lead combination is impractical when the lead set is not known beforehand.Source: §1 · p. 2
  • The proposed method outperforms previous state-of-the-art ECG pre-training methods on cardiac arrhythmia classification and patient identification.The authors motivate these tasks as requiring local variability features and global patient-level trends, respectively.Source: §1 · p. 2

2. Related Works

Related work covers ECG use in diagnosis and identification, prior contrastive approaches, and the distinction between global and local representation learning. The paper situates its framework among these approaches by describing global ECG methods and local contrastive learning in speech.

2. Related Works

  • Standard ECGs use 12 leads, but reduced-channel systems are also used because retaining all leads is not common in real-world settings.The passage notes that standard recordings require attaching at least ten electrodes.Source: §2 · p. 2
  • Prior ECG diagnosis work includes deep residual networks for heartbeat and myocardial infarction classification and a Transformer-based heartbeat classifier for arrhythmia classification.The cited works are Kachuee et al. (2018) and Yan et al. (2019).Source: §2 · p. 2
  • ECG biometric identification is presented as a promising alternative because cardiac activity is difficult to mimic, unlike fingerprints or facial images described as vulnerable to copying.The passage cites Labati et al. (2019) and Li et al. (2020).Source: §2 · p. 2
  • Global contrastive learning brings positive views together and separates negative views, while speech work also uses local contrastive learning across different frames.The passage cites Chen et al. (2020) and Grill et al. (2020) for image views, and Oord et al. (2018) and Baevski et al. (2020) for speech methods.Source: §2 · pp. 2–3
  • The framework illustration describes local contrastive learning on masked time steps and global agreement between temporally adjacent ECG segments.The figure passage identifies blue and red arrows as positive and negative pairs, respectively.Source: §2 · p. 3, Figure 1 · p. 3

Representation learning for electrocardiogram

  • ECG self-supervised methods include 3KG's augmented vectorcardiogram views and CMSC's positive pairs from different temporal segments of the same patient's ECG.Kiyasseh et al. (2021) report that CMLC performs consistently worse than CMSC and speculate that diseases may not be equally visible across leads at one time point.Source: Representation learning for… · pp. 3–4

3. Pre-training

The pre-training method combines local and global contrastive learning, then uses Random Lead Masking to prepare a single model for fine-tuning with arbitrary lead sets.

3.1. Contrastive Learning

  • Adjacent non-overlapping ECG segments form positive pairs, while segments from other ECG recordings serve as negatives for CMSC global learning.Each recording is divided into two 5-second segments by fixing its duration at 10 seconds.Source: §3.1 · p. 4
  • Wav2Vec 2.0 and CMSC are integrated to learn local and global ECG context through contrastive learning.The local task compares contextualized representations with quantized features; the global task uses patient-specific contrastive learning over temporally pooled representations.Source: §3.1 · pp. 4–5

3.2. Random Lead Masking

  • Random Lead Masking independently masks each lead with probability 0.5, exposing the model to varied lead combinations during pre-training.This reduces dependence on all 12 leads and is intended to support fine-tuning with arbitrary lead sets.Source: §3.2 · p. 5

4. Fine-tuning

The fine-tuning evaluation covers cardiac arrhythmia classification and patient identification, using task-specific training and evaluation procedures.

Fine-tuning

  • The experiments compare five lead configurations, from 12 leads down to one lead (I).The 4-lead configuration is excluded because lead III can be derived from leads I and II.Source: §4 · p. 5

Cardiac Arrhythmia Classification

  • Arrhythmia classification predicts 26 SNOMED-CT multilabels and is evaluated with the CinC Score, a weighted accuracy measure ranging from -1 to 1.The score grants partial credit for symptomatically similar misdiagnoses and penalizes dissimilar ones.Source: §4 · p. 5

Patient Identification

  • Patient identification uses ArcFace loss because softmax dot-product training does not enforce high similarity among same-patient ECGs and diversity across patients.ArcFace adds an angular margin penalty to optimize cosine similarity for intra-patient and inter-patient ECGs.Source: §4 · p. 6
  • Patient identification uses gallery and probe sets with shared patients, then matches ECGs by cosine similarity between their representation vectors.The additional fully connected layer is discarded for testing.Source: §4 · pp. 5–6

5. Experiments

The experiments compare a single 12-lead pretrained model fine-tuned on reduced-lead combinations with models pretrained separately for each combination, then examine RLM ablations. In the single-model setup, the combined method leads both tasks, while the results also vary with lead combination and pretraining configuration.

5. Experiments

  • Evaluation includes single 12-lead pretraining with padded reduced-lead fine-tuning, separate pretraining per lead combination as an upper bound, and an RLM ablation; 3KG is omitted from the latter two experiments.The authors state that fewer leads prevent meaningful ECG-to-VCG 3-D perturbations for 3KG.Source: §5 · p. 6

5.1. Datasets

  • Pretraining uses 189,051 12-lead recordings from six PhysioNet 2021 datasets; identification testing uses 2,127 PTB-XL cross-session patient pairs excluded from pretraining.PTB-XL contains patient IDs, allowing the authors to evaluate identification across different ECG sessions.Source: §5.1 · pp. 6–7

5.2. Implementation Details

  • The models use a four-block convolutional feature extractor and a BERT-BASE-sized 12-layer Transformer; pretraining took 24 hours on four RTX A6000 GPUs.The Transformer has dimension 768, 12 attention heads, and a feed-forward dimension of 3,072.Source: §5.2 · pp. 7–8

5.3. Fine-tuning a Single 12-lead Model on Padded Leads

  • Across lead combinations, W2V+CMSC+RLM improved CinC Score by 0.0298 vs W2V and 0.1366 vs CMSC, and identification accuracy by 6.4%p and 6.67%p, respectively.These results are for a single 12-lead pretrained model fine-tuned on reduced leads with unavailable leads filled with zero.Source: Table 1 · p. 7, §5.3 · p. 8
  • W2V+CMSC+RLM also outperformed methods learning local or global context separately; P-3-lead performed better than P-2-lead or P-6-lead across methods.The authors attribute the P-3-lead advantage to its additional precordial lead V2; they report a significant gap between W2V+CMSC+RLM and W2V+CMSC for all lead combinations.Source: §5.3 · p. 9

5.4. Pre-training and Fine-tuning for Each Lead Combination

  • For separately pretrained reduced-lead models, W2V led classification and W2V+CMSC led identification; W2V+CMSC+RLM was worse than W2V+CMSC across reduced-lead combinations.The respective leaders were exceptions at 12 leads.Source: §5.4 · p. 9

5.5. Ablation of RLM

  • RLM improved W2V classification across lead combinations, though identification fell for some; CMSC+RLM improved performance over CMSC on both tasks across all cases.The authors hypothesize that RLM helps W2V capture local rather than global context, while expanding lead combinations for CMSC.Source: §5.5 · pp. 9–10

6. Discussion and Future Work

The paper combines W2V and CMSC to learn local and global ECG representations and adds random lead masking (RLM). The authors report that the combined method outperforms state-of-the-art methods, while noting augmentation and experimental-scope limitations.

6. Discussion and Future Work

  • The method combines W2V and CMSC to learn global and local ECG representations, while RLM randomly masks leads during pre-training.The stated aim is a single pre-trained model that remains robust when all 12 leads are unavailable at fine-tuning.Source: §6 · p. 10
  • W2V+CMSC+RLM outperforms state-of-the-art methods, and RLM is intended to support fine-tuning when fewer than 12 leads are available.RLM randomly masks each lead during pre-training.Source: §6 · p. 10
  • Adding four physiological augmentations to W2V+CMSC+RLM decreased performance across lead combinations except P-1-lead on Dx.The authors speculate that the dataset lacked high noise levels and that baseline shift introduced too many alterations; excluding baseline shift improved performance, but RLM alone performed better in most cases.Source: §6 · pp. 10–11
  • Physiological augmentations without RLM mostly decreased performance, with a particularly large gap on reduced leads; more advanced augmentations are left for future work.This comparison included variants with and without baseline shift.Source: §6 · p. 11
  • The experiments used an RLM probability of 0.5 without an in-depth hyperparameter search, and all ECG samples had a 500 Hz sampling rate.The authors identify frequency-agnostic self-supervised learning as future work.Source: §6 · p. 11

Appendix A. Visualization of Training Process for Patient Identification

Figure 2A concerns the patient-identification training process using ArcFace loss. For validation or testing, normalized global ECG representations are compared with gallery samples using cosine similarity.

Appendix A. Visualization of Training Process for Patient Identification

  • Figure 2A depicts the patient-identification training process using ArcFace loss.Its caption also mentions validation and testing.Source: Figure 2A · p. 14
  • For validation or testing, the method discards weight vectors and uses normalized global representation vectors of ECG samples.Source: Appendix A · p. 14, Figure 2A · p. 14
  • Each probe sample is compared with gallery samples by cosine similarity, and the closest pair is considered to share an identity.Source: Appendix A · p. 14

Appendix B. Visualization of ECG-specific Augmentations

Figure 3B visualizes ECG-specific augmentations. The described perturbations include powerline noise, electromyographic noise, baseline wander, and baseline shift.

Appendix B. Visualization of ECG-specific Augmentations

  • Powerline noise adds interference to the original ECG signals, with K = 1, frequency 50 Hz, and randomly sampled amplitude and phase.Source: Appendix B · p. 15
  • Electromyographic noise is described as high-frequency noise commonly arising from muscle contraction, with a randomly sampled amplitude.Source: Appendix B · p. 15
  • Baseline wander is treated as a low-frequency ECG artifact, while baseline shift changes the signal baseline over randomly sampled spans.Source: Appendix B · p. 15
  • Figure 3B presents visualizations of ECG-specific augmentations.The appendix describes powerline noise, electromyographic noise, baseline wander, and baseline shift.Source: Appendix B · p. 15, Figure 3B · p. 16
Loading 2203.06889v2…