The proposed DL model is built with Python 3.5, Tensorflow, and Keras. This model was carried out on the MIT-BIH arrhythmia database. Figures 6 and 7 show an observation of accuracy and loss along epochs of the training phase. There are 100 epochs set for training. Because of its 100-percent accuracy, this model is suitable for use in ECG applications. From the above experimental results, the loss function proposed in this paper obtains a high AUC on both S and V events, which proves that the new loss function has a positive effect on class imbalance. With the introduction of 5-minute segments, the sensitivity of this paper on S-type events has been greatly improved compared with the literature; the sensitivity on V-type events is also higher than that of the existing algorithm.
4.1 MIT-BIH arrhythmia database
The MIT-BIH Arrhythmia Database includes 48 half-hour-long samples of two-channel Holter recordings from 47 people who were examined between 1975 and 1979 by the BIH Arrhythmia Laboratory. The remaining 25 recordings came from the same group and were chosen to include less common but clinically significant arrhythmias that are not well represented in small random samples. A total of 4000 24-hour Holter recordings were collected from inpatients (60%) and outpatients (40%) at Beth Israel Hospital in Boston. 23 recordings were randomly chosen from this group.
The training of neural networks requires many manually labeled data sets. The more samples that can be provided for learning, the better the real data distribution can be reflected, and the smaller the generalization error of the obtained model is. Labeling data requires huge costs. When enough training samples cannot be obtained, data augmentation is often considered. In two-dimensional image processing, the data can generally be amplified by adding noise, cropping, rotation, scale change, etc., but doing the same processing on one-dimensional ECG signals will introduce errors and even change the signal's own meaning. Therefore, in the case of insufficient and unbalanced samples, this paper improves the loss function, increases the weight of the few-sample category, and increases the weight of the easy-to-misclassify sample category, so that the network can focus on the learning of the minority and difficult-to-identify classes. Negative effects of class imbalance at present, most of the literature generally has low sensitivity to S-type events, and when performing multi-classification tasks, S-type samples are easily mistakenly classified as N-type events. On the one hand, it is because the sample size of class S is too small to reflect the overall true distribution; on the other hand, the samples of class S in the training set DS1 are not typical enough, which is different from the distribution of samples of class S in the test set DS2 or the real distribution of samples of class S. The difference is large and cannot be generally representative; and the waveforms of abnormal supraventricular beats and normal-like beats are highly similar, resulting in a lot of overlap in the distribution of these two types of samples, which are easy to misclassify. These problems all bring certain difficulties to the classification task. This paper overcomes the problem of neural network degradation caused by the increase in layers by improving the training method, network architecture, and combining the two identity mappings in residual networks and dense networks so that the model can learn deeper features. To a certain extent, the performance of S-type events has improved. However, it can be seen from the experimental results that the method used in this paper still has room for improvement and improvement. Considering that the nature of the ECG signal is a time series, the state at a certain time point is not independent, but also related to the previous output. So, CNN reflects more of the morphological information of ECG than the long-short memory network can reflect the relationship of the sequence in the time domain, so it has obvious advantages in dealing with time series problems. In the follow-up work, this paper will combine CNN and long-term memory networks to build a network and explore the impact of this combination on arrhythmia classification. The heartbeat-based end-to-end arrhythmia classification method proposed in this paper combines artificial intelligence with ECG signal classification and recognition, achieves the classification task well, and has a good ability to identify class S and V arrhythmia events. It also achieves high sensitivity and provides a new technical reference scheme for the automatic classification of arrhythmias.