Electrocardiogram heartbeat classification based on a deep convolutional neural network and focal loss

Comput Biol Med. 2020 Aug:123:103866. doi: 10.1016/j.compbiomed.2020.103866. Epub 2020 Jul 5.

Abstract

The electrocardiogram (ECG) is an effective tool for cardiovascular disease diagnosis and arrhythmia detection. Most methods proposed in the literature include the following steps: 1) denoizing, 2) segmentation into heartbeats, 3) feature extraction, and 4) classification. In this paper, we present a deep learning method based on a convolutional neural network (CNN) model. CNN models can perform feature extraction automatically and jointly with the classification step. In other words, our proposed method does not require a feature extraction step with hand-crafted techniques. Our proposed method is also based on an algorithm for heartbeat segmentation that is different from most existing methods. In particular, the segmentation algorithm defines each ECG heartbeat to start at an R-peak and end after 1.2 times the median RR time interval in a 10-s window. This method is simple and effective, as it does not use any form of filtering or processing that requires assumptions about the signal morphology or spectrum. Although enhanced ECG heartbeat classification algorithms have been proposed in the literature, they failed to achieve high performance in detecting some heartbeat categories, especially for imbalanced datasets. To overcome this challenge, we propose an optimization step for the deep CNN model using a novel loss function called focal loss. This function focuses on minority heartbeat classes by increasing their importance. We trained and evaluated our proposed model with the MIT-BIH and INCART datasets to identify five arrhythmia categories (N, S, V, Q, and F) based on the Association for Advancement of Medical Instrumentation (AAMI) standard. The evaluation results revealed that the focal loss function improved the classification accuracy for the minority classes as well as the overall metrics. Our proposed method achieved 98.41% overall accuracy, 98.38% overall F1-score, 98.37% overall precision, and 98.41% overall recall. In addition, our method achieved better performance than that of existing state-of-the-art methods.

Keywords: AAMI standard; Convolutional neural network; ECG Classification; Focal loss; Heartbeat category; INCART; Imbalanced data; MIT-BIH.

Publication types

  • Research Support, Non-U.S. Gov't

MeSH terms

  • Algorithms
  • Arrhythmias, Cardiac / diagnosis
  • Electrocardiography*
  • Heart Rate
  • Humans
  • Neural Networks, Computer
  • Signal Processing, Computer-Assisted*