Source-linked AI summary
ECG Arrhythmia Classification Using Transfer Learning from 2-Dimensional Deep CNN Features
Milad Salem, Shayan Taheri, Jiann Shiun-Yuan
TL;DR
Limited ECG datasets make it difficult to train deep networks that learn fine-grained arrhythmia features. The paper transfers ImageNet-trained DenseNet features to ECG spectrograms and achieves 97.23 percent accuracy on approximately 7,000 samples across four rhythm classes.
Problem
Small ECG datasets limit the practical training of deep neural networks despite their ability to learn fine-grained signal features.
Method
The study converts ECG signals into spectrograms and uses a pre-trained DenseNet-161 as a feature extractor with SVM classification.
Results
97.23 percent accuracy was achieved on approximately seven thousand ECG samples across four rhythm classes using DenseNet features and SVM.
Takeaways & Limitations
Feature maps learned from large generic image datasets can represent ECG spectrograms for arrhythmia classification.
Abstract
from arXiv · showhide
Due to the recent advances in the area of deep learning, it has been demonstrated that a deep neural network, trained on a huge amount of data, can recognize cardiac arrhythmias better than cardiologists. Moreover, traditionally feature extraction was considered an integral part of ECG pattern recognition; however, recent findings have shown that deep neural networks can carry out the task of feature extraction directly from the data itself. In order to use deep neural networks for their accuracy and feature extraction, high volume of training data is required, which in the case of independent studies is not pragmatic. To arise to this challenge, in this work, the identification and classification of four ECG patterns are studied from a transfer learning perspective, transferring knowledge learned from the image classification domain to the ECG signal classification domain. It is demonstrated that feature maps learned in a deep neural network trained on great amounts of generic input images can be used as general descriptors for the ECG signal spectrograms and result in features that enable classification of arrhythmias. Overall, an accuracy of 97.23 percent is achieved in classifying near 7000 instances by ten-fold cross validation.
I. INTRODUCTION
Deep neural networks can learn ECG features directly, but their data requirements limit independent studies. This work transfers image-domain DenseNet features to ECG spectrograms for four-rhythm classification.
- I. INTRODUCTION: Deep neural networks can automatically learn representative ECG features, reducing reliance on manual feature engineering.This supports end-to-end ECG classification while extracting deep features directly from the input data.
- I. INTRODUCTION: Limited ECG dataset volume makes training high-performing deep neural networks difficult.Deep models require substantial training data, while publicly available ECG datasets are comparatively small.
- I. INTRODUCTION: Transfer learning converts one-dimensional ECG signals into spectrogram images and reuses feature maps learned from large image datasets.The proposed approach uses a DenseNet pre-trained on ImageNet as an ECG spectrogram feature extractor.
- I. INTRODUCTION: The study classifies Normal, AF, VF, and ST rhythms using transferred image-domain features.These four target patterns are specified as Normal Sinus Rhythm, Atrial Fibrillation and Flutter, Ventricular Fibrillation, and ST Segment Change.
II. BACKGROUND
The paper focuses on arrhythmias as abnormal heart rhythms and distinguishes three clinically described rhythm patterns.
- II. BACKGROUND: Heart arrhythmia refers to illness conditions in which the heart beats faster, slower, or irregularly.The paper attributes these conditions commonly to disease.
- II. BACKGROUND: The studied abnormalities include ventricular fibrillation, atrial fibrillation, and ST-segment change.The paper describes ventricular fibrillation as rapid irregular ventricular activity, atrial fibrillation as rapid random atrial disturbance, and ST change as elevation or depression relative to baseline.
B. The Challenge of Fine-Grained Arrhythmia Classification
Fine-grained ECG rhythms are difficult to classify because datasets are small and relevant patterns can be subtle. The paper addresses this constraint with transfer learning and off-the-shelf CNN features.
- B. The Challenge of Fine-Grained Arrhythmia Classification: Small or missing datasets for abnormal rhythms make deep-learning ECG classification difficult.Fine-grained, similar ECG patterns can be hard to detect, while deep networks require very large training sets.
- B. The Challenge of Fine-Grained Arrhythmia Classification: The study uses transfer learning and off-the-shelf CNN features to pursue accurate abnormal-rhythm detection with limited training data.The stated target case is a small training dataset.
- B. The Challenge of Fine-Grained Arrhythmia Classification: Transfer learning transfers knowledge between domains when data, experience, or computing resources are insufficient.The paper applies this idea by leveraging a pre-trained CNN for automatic feature extraction.
- B. The Challenge of Fine-Grained Arrhythmia Classification: ImageNet knowledge from DenseNet is used to represent ECG spectrograms and classify a small dataset of ECG instances.The paper argues that patterns learned from diverse animal and object images can represent ECG spectrograms.
- B. The Challenge of Fine-Grained Arrhythmia Classification: DenseNet-161 provides outputs from its convolutional layers for feature extraction in the transfer-learning pipeline.The architecture has 161 convolutional layers, with layer outputs examined as candidate features.
III. METHODOLOGY
The pipeline segments annotated ECG recordings, converts each instance into a spectrogram, extracts features with pre-trained DenseNet, and classifies them with SVM.
- III. METHODOLOGY: ECG instances are transformed into spectrogram images, processed by a pre-trained 161-layer DenseNet, and classified using SVM.Features are extracted from 12 intermediate convolutional layers, and ten-fold cross-validation selects the optimum layer.
- III. METHODOLOGY: The classification system consists of sequential signal selection, spectrogram conversion, DenseNet feature extraction, and SVM classification stages.The paper identifies these classification steps as the stages shown in Fig. 1.
B. Data Sets in Use
The study combines four annotated ECG datasets and selects 7,008 instances using annotation-guided windows designed to capture several beats.
- The source data comprise atrial fibrillation, malignant ventricular arrhythmia, European ST-T, and Normal datasets with cardiologist annotations.
- Each data instance contains 500 samples, corresponding to approximately 3 to 7 beats.
- Selection follows rhythm-change, ST-level, or beat annotations to locate relevant ECG segments.
- 7,008 ECG data instances were selected to represent the rhythms of interest across the datasets.
D. Transformation from 1D Signal to 2D Image
ECG recordings are converted into spectrogram images so image-trained convolutional features can represent signal changes and class-related patterns.
- 31 signal partitions were used to create spectrograms that encode changing signal power through partition-wise Fourier transforms.
- Spectrograms transform each ECG data instance into an image suitable for a pre-trained image-classification network.
- The sample spectrogram figure presents one transformed data instance for each class.
- Convolutional layers contain feature maps activated by specific patterns, motivating examination of intermediate representations.
F. Feature Selection and classification
Feature selection reduces DenseNet representations by retaining feature maps judged important for ECG classification.
- Feature vectors are reduced by selecting highly important feature maps because ImageNet-trained layers contain patterns that may not suit ECG extraction.
A. Experimental Setup
The experiment uses a pre-trained DenseNet-161 to extract features from spectrograms, then evaluates those features with a linear SVM using ten-fold cross-validation.
- DenseNet-161 was pre-trained on 1,000 generic image classes and used to extract features from ECG spectrograms.
- Outputs from 12 randomly examined layers served as feature vectors for classification.
- A linear SVM classified the extracted vectors using ten-fold cross-validation.
B. Results
DenseNet features classified by SVM achieved the best result from layer 112 with feature selection, reaching 97.23% accuracy. Spectrogram conversion and transferred CNN features improved classification, while ST was consistently hardest to classify.
- B. Results: Feature selection generally increased overall accuracy by nearly 2 percent, and layer 112 remained optimal before and after selection.Different layers produced feature maps with different performance on the task.
- B. Results: ST was the hardest class across layers, with the lowest F1 score regardless of the selected layer.The results indicate that layers differed in their ability to extract features from different class inputs.
- B. Results: 97.23 percent accuracy was achieved using layer 112 for DenseNet feature extraction, SVM classification, and feature selection.The final confusion matrix is shown in Fig. 4, and class-specific results are reported in Table I.
- B. Results: Spectrogram transformation improved model accuracy, while DenseNet feature extraction further improved discrimination of the spectrograms.The comparison includes SVM models trained on raw one-dimensional signals and spectrograms.
- B. Results: Transfer learning with DenseNet features outperformed the compared approaches, despite the relatively small ECG dataset.Table II reports comparisons with raw-signal and spectrogram SVM models and related works.
V. CONCLUSION
The study uses a pre-trained deep CNN to extract features from ECG spectrograms and classifies four rhythm classes with an SVM. It achieves 97.23% accuracy on approximately 7,000 samples and reports that generic image-trained feature maps represent ECG spectrograms effectively.
- V. CONCLUSION: A pre-trained 161-layered DenseNet extracts features from ECG spectrograms, which an SVM uses to classify four rhythm classes.The four classes are Normal, AF, VF, and ST.
- V. CONCLUSION: 97.23 percent accuracy was achieved on a small dataset of approximately seven thousand ECG samples.The study classifies four rhythm classes using the transferred CNN features and SVM.
- V. CONCLUSION: Feature maps learned from millions of generic images can represent ECG spectrograms for arrhythmia classification.The conclusion also states that spectrograms preserve fine-grained ECG details.