AnAutomaticSystemforAtrialFibrillationbyUsinga...

9
Research Article An Automatic System for Atrial Fibrillation by Using a CNN-LSTM Model Fengying Ma , 1 Jingyao Zhang, 1 Wei Chen , 2,3 Wei Liang , 1 and Wenjia Yang 2,3 1 School of Electrical Engineering and Automation, Qilu University of Technology (Shandong Academy of Sciences), Jinan, China 2 School of Mechanical Electronic & Information Engineering, China University of Mining and Technology-Beijing, Beijing 100083, China 3 School of Computer Science & Technology, China University of Mining and Technology, Xuzhou 221116, China Correspondence should be addressed to Wei Chen; [email protected] and Wei Liang; [email protected] Received 18 June 2020; Revised 24 July 2020; Accepted 27 July 2020; Published 28 August 2020 Guest Editor: Chi-Hua Chen Copyright © 2020 Fengying Ma et al. is is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. Atrial fibrillation (AF) is a common abnormal heart rhythm disease. erefore, the development of an AF detection system is of great significance to detect critical illnesses. In this paper, we proposed an automatic recognition method named CNN-LSTM to automatically detect the AF heartbeats based on deep learning. e model combines convolutional neural networks (CNN) to extract local correlation features and uses long short-term memory networks (LSTM) to capture the front-to-back dependencies of electrocardiogram (ECG) sequence data. e CNN-LSTM is feeded by processed data to automatically detect AF signals. Our study uses the MIT-BIH Atrial Fibrillation Database to verify the validity of the model. We achieved a high classification accuracy for the heartbeat data of the test set, with an overall classification accuracy rate of 97.21%, sensitivity of 97.34%, and specificity of 97.08%. e experimental results show that our model can robustly detect the onset of AF through ECG signals and achieve stable classification performance, thereby providing a suitable candidate for the automatic classification of AF. 1. Introduction Heart disease is the leading cause of human death, and the number of deaths due to cardiovascular diseases accounts for a large proportion of the total number of deaths worldwide [1]. Most cardiovascular diseases are often ac- companied by arrhythmia. Among them, atrial fibrillation (AF) is the most common persistent arrhythmia. In our country, there are more than 10 million people suffering from AF. Its incidence increases with age, but in recent years, its incidence has shown an increasing trend in people of younger age groups [2–4]. Simultaneously, a series of complications related to AF, such as stroke, heart failure, and other diseases, also lead to high morbidity and mortality [5–7]. However, AF also shows strong unpredictability, and capturing AF signals in real time is difficult [8, 9]. Elec- trocardiogram (ECG) detection technology forms an im- portant basis for AF diagnosis [10–12]. erefore, the application of automatic detection technology for diagnosing AF is necessary. Consequently, machine learning has significantly contributed to the development of real-time monitoring of AF, and timely intervention in the effective detection of AF can avoid serious consequences caused by an exacerbation of the disease [13]. With developments in information technology and ar- tificial intelligence technology, the automatic classification of AF has made great progress. e traditional ECG clas- sification algorithm is composed of two parts: feature ex- traction and classifier. First, principal component analysis, latent Dirichlet allocation, and other methods are designed for feature extraction and then placed into a support vector machine or random forest, among others, for classification in the classifier. A complete ECG signal is shown in Figure 1 where AF is mainly seen by the disappearance of the p wave or irregular RR intervals. e RR interval is the amount of time change between two R waves, and the feature recog- nition method based on the RR interval shows high accu- racy. Because the wave value of the R wave has the largest Hindawi Discrete Dynamics in Nature and Society Volume 2020, Article ID 3198783, 9 pages https://doi.org/10.1155/2020/3198783

Transcript of AnAutomaticSystemforAtrialFibrillationbyUsinga...

Page 1: AnAutomaticSystemforAtrialFibrillationbyUsinga CNN-LSTMModeldownloads.hindawi.com/journals/ddns/2020/3198783.pdf · CNN layer LSTM layer Figure 6:CNN-LSTMnetworkstructure. Table 1:eparametersofthemodel.

Research ArticleAn Automatic System for Atrial Fibrillation by Using aCNN-LSTM Model

Fengying Ma 1 Jingyao Zhang1 Wei Chen 23 Wei Liang 1 and Wenjia Yang23

1School of Electrical Engineering and Automation Qilu University of Technology (Shandong Academy of Sciences) Jinan China2School of Mechanical Electronic amp Information Engineering China University of Mining and Technology-BeijingBeijing 100083 China3School of Computer Science amp Technology China University of Mining and Technology Xuzhou 221116 China

Correspondence should be addressed to Wei Chen chenwdavior163com and Wei Liang dzhlw0918qlueducn

Received 18 June 2020 Revised 24 July 2020 Accepted 27 July 2020 Published 28 August 2020

Guest Editor Chi-Hua Chen

Copyright copy 2020 Fengying Ma et al 1is is an open access article distributed under the Creative Commons Attribution Licensewhich permits unrestricted use distribution and reproduction in any medium provided the original work is properly cited

Atrial fibrillation (AF) is a common abnormal heart rhythm disease 1erefore the development of an AF detection system is ofgreat significance to detect critical illnesses In this paper we proposed an automatic recognition method named CNN-LSTM toautomatically detect the AF heartbeats based on deep learning 1e model combines convolutional neural networks (CNN) toextract local correlation features and uses long short-termmemory networks (LSTM) to capture the front-to-back dependencies ofelectrocardiogram (ECG) sequence data 1e CNN-LSTM is feeded by processed data to automatically detect AF signals Ourstudy uses the MIT-BIH Atrial Fibrillation Database to verify the validity of the model We achieved a high classification accuracyfor the heartbeat data of the test set with an overall classification accuracy rate of 9721 sensitivity of 9734 and specificity of97081e experimental results show that our model can robustly detect the onset of AF through ECG signals and achieve stableclassification performance thereby providing a suitable candidate for the automatic classification of AF

1 Introduction

Heart disease is the leading cause of human death and thenumber of deaths due to cardiovascular diseases accountsfor a large proportion of the total number of deathsworldwide [1] Most cardiovascular diseases are often ac-companied by arrhythmia Among them atrial fibrillation(AF) is the most common persistent arrhythmia In ourcountry there are more than 10 million people sufferingfromAF Its incidence increases with age but in recent yearsits incidence has shown an increasing trend in people ofyounger age groups [2ndash4] Simultaneously a series ofcomplications related to AF such as stroke heart failure andother diseases also lead to high morbidity and mortality[5ndash7] However AF also shows strong unpredictability andcapturing AF signals in real time is difficult [8 9] Elec-trocardiogram (ECG) detection technology forms an im-portant basis for AF diagnosis [10ndash12] 1erefore theapplication of automatic detection technology for

diagnosing AF is necessary Consequently machine learninghas significantly contributed to the development of real-timemonitoring of AF and timely intervention in the effectivedetection of AF can avoid serious consequences caused by anexacerbation of the disease [13]

With developments in information technology and ar-tificial intelligence technology the automatic classificationof AF has made great progress 1e traditional ECG clas-sification algorithm is composed of two parts feature ex-traction and classifier First principal component analysislatent Dirichlet allocation and other methods are designedfor feature extraction and then placed into a support vectormachine or random forest among others for classificationin the classifier A complete ECG signal is shown in Figure 1where AF is mainly seen by the disappearance of the p waveor irregular RR intervals 1e RR interval is the amount oftime change between two R waves and the feature recog-nition method based on the RR interval shows high accu-racy Because the wave value of the R wave has the largest

HindawiDiscrete Dynamics in Nature and SocietyVolume 2020 Article ID 3198783 9 pageshttpsdoiorg10115520203198783

peak in the ECG signal locating it is easy However the lowamplitudes of the P and T waves make it challenging forthem to be detected and the feature extraction algorithm isstill not mature enough With developments in machinelearning traditional models have some insurmountabledefects First traditional algorithms need to design featureextraction methods to extract useful information andcombine machine learning algorithms for classification1isprocess may be accompanied with the loss of some infor-mation When the extracted features cannot fully reflect thedata the classification results may appear to have largererrors Second it mainly relies on considerable prior expertknowledge and sufficient biomedical signal processing ca-pabilities On this basis designing a good classifier algorithmis also necessary but achieving optimal results is difficult

Unlike traditional machine learning algorithms deeplearning-based methods have the ability to mine complexrelations and useful features of data and have been widelyresearched and applied in the automatic classification of AFXu et al proposed a framework that combined an improvedfrequency slice wavelet transform and a convolutionalneural network (CNN) for automatic AF beat recognitionand achieved good performance [14] Wei et al constructeda synchronous feature of each heartbeat of an ECG signalthrough a recursive complex network and subsequently usedCNN to detect AF by analyzing the eigenvalues of the re-cursive complex network [15] Andersen et al proposed anend-to-end model combining CNN and recurrent neuralnetworks to classify ECG signals as AF or a normal sinusrhythm [11] Pourbabaee et al developed a deep learningmachine to screen and identify patients with paroxysmal AF[16] Dang et al proposed a model that uses a CNN-BLSTMnetwork to diagnose arrhythmia and uses ECG signals toautomatically detect AF achieving relatively good results[17] Several researchers have shown that combining thedeep learning features with the classifier will significantlyimprove the performance of the system and make theclassification results more ideal Although the above re-search can effectively solve the classification problem of AFwe can observe that various neural networks have the abilityto extract complex nonlinear characteristics from theoriginal data without human intervention however learn-ing the thinking mechanism of the ECG signal features withhigh accuracy required for monitoring is still a difficult taskCNN and long short-term memory networks (LSTM) arevery efficient for feature extraction of ECG signals and thissuperiority is applied herein to the AF detection algorithm

In this study we proposed a new diagnosis method forAF named CNN-LSTM which can automatically detect AFfrom ECG signals 1e contributions of this study are asfollows

(i) We propose an automatic recognition methodnamed CNN-LSTM that uses heartbeat features asinput datasets to automatically identify AF in anECG signal

(ii) CNN has advantages in image processing whileLSTM can compensate for the shortcomings ofCNN in the context sequence 1erefore the

combination of CNN and LSTM can effectivelyimprove accuracy in the field of AF recognition

(iii) 1e use of multiscale signals representing the AFcharacteristics as the input of the network reducescomputing resources 1e design can be used toextract multiscale features and improve the gener-alization ability of the network model and thisstudy provides a high-precision classificationmethod to meet the real-time monitoring needs ofAF

In the following sections we provide a detailed ex-perimental process and verify the performance of themethod in the open access database 1is automatedmethod can analyze a large amount of data in a short timewhile ensuring high accuracy thus it may become apractical tool for providing real-time monitoring forpatients and reducing the work pressure on doctors

Section 1 of this article deals with the background ofcurrent research on AF and related research algorithmsthat have been implemented Section 2 covers the datasource and related network structure required for theexperiment Section 3 presents the experimental detailsresults and analysis of the results Section 4 presents theconcluding statements and prospects for future work

2 Material and Methods

21 Description of Dataset Our experimental research isbased on data from the MIT-BIH Atrial Fibrillation Data-base which is publicly available from PhysioNet [18 19]1is database includes 25 long-term ECG Holter recordsfrom different subjects (mainly paroxysmal attacks) Itcontains two ECG signal channels with AF annotations 1esampling rate of this database is 250Hz and these recordsalso include beat notes manually marked by expertclinicians

We preprocess the ECG signal to train and evaluate theautomatic AF prediction method based on the CNN-LSTMmodel As the duration of the AF recording in these data isdifferent from the normal recording duration all ECGsignals are divided into the same duration and data balanceis performed to better apply the learning of the model Aftersegmentation 960000 short-term ECG segments were ob-tained comprising 480000 segments of AF records and480000 segments of normal records Figure 2 shows acomparison of the AF signal and the normal signal1e ECGsignal segment is divided into a training set and a test set Tobetter detect the classification effect of the model the signalprocessing and segmentation of the dataset are random innature

22Networks 1is section first reviews the CNN and LSTMnetwork models which are closely related to the modelstructure proposed herein 1en our proposed researchmodel is put forward and the structure parameters andmathematical expressions of the model are described indetail

2 Discrete Dynamics in Nature and Society

In this section we describe the network structure modelproposed in this paper which mainly includes two con-volutional layers one LSTM layers fully connected layersand other computing operations

221 Convolutional Neural Network CNN is a feedforwardneural network and it mainly includes an input layer aconvolutional layer a pooling layer and an output layer Itsspecial network structure has great advantages in featureextraction and learning especially in the field of imagerecognition and thus it can achieve great success Itsstructure is shown in Figure 3

1e CNN is connected to the input layer through aconvolution kernel 1e convolution kernel performs dotmultiplication through a sliding window to achieve multi-scale feature extraction Simultaneously the weight-sharingmechanism of the convolution layer makes it more effectivefor feature extraction greatly reducing the number of freevariables that need to be learned Subsequently we add apooling layer after the convolutional layer to reduce thefeature matrix and network complexity Because the input

ECG signals are one-dimensional time series we use one-dimensional convolution in the convolution layer as shownin Figure 4

Before the data training we normalized the data 1econvolutional layer extracts features from the original input1e output of the a-th neuron of the one-dimensionalconvolutional layer is shown in the following equation

Oa δ 1113944n

j1WjXaminusj+n + b⎛⎝ ⎞⎠ (1)

1e input sequence is Xl(l 1 2 n) where W de-notes a matrix of weight coefficients b is an offset coefficientand n is the number of convolution kernels 1en the resultof the convolution is input into an activation function δ (inthis case ReLU) and then the result of the convolution layeris fed back to the pooling layer

222 Long Short-Term Memory Network LSTM is a specialrecurrent neural network LSTM is suitable for applicationssuch as natural language processing [20 21] and biomedical

P PR QRS ST T U

Figure 1 A complete ECG signal

AF

15

10

05

00

ndash05

mV

ndash10

ndash15

0 200 400 600 800 1000 1200

(a)

N

ndash05

0 200 400 600 800 1000 1200

10

05

00mV

ndash10

(b)

Figure 2 Comparison of AF signal and N signal

Discrete Dynamics in Nature and Society 3

signal processing [22 23] LSTM improves the standardRNN model and adds a gate mechanism It overcomes theproblems of gradient disappearance gradient explosion andlength dependence of traditional RNNs 1e hidden layer ofLSTM comprises an input gate a forget gate and an outputgate 1e structure is shown in Figure 5

1e input of the LSTM hidden layer includes not onlythe input Xt of the current sequence but also the state Ctminus1 ofthe hidden layer at the previous time then the output vectorhtminus1 and the output ht and Ct of the current state are cal-culated 1e key part of LSTM is what information we willdiscard from the cell state Ctminus1 at the last moment and howmuch information can be transferred to the current state Ct1is decision is made through a forget door 1e next step isto decide how much new information is added to the nextstate Finally we determine the output value based on thecurrent Ct and ht 1e update method of LSTM is as follows

ft δ Wf htminus1 Xt1113858 1113859 + bf1113872 1113873

it δ Wi htminus1 Xt1113858 1113859 + bi( 1113857

jt tanh Wc htminus1 Xt1113858 1113859 + bc( 1113857

Ot δ Wo htminus1 Xt1113858 1113859 + bo( 1113857

ht Ot lowast tanh Ct( 1113857

(2)

where Ct is the state information of the memory unit jt isthe accumulated information at the current moment W isthe weight coefficient matrix b is the bias term σ is thesigmoid activation function and tanh is the hyperbolictangent activation function

223 Proposed Architecture Neural networks have theirown unique feature learning method 1e CNN modelconverts the original input into a fixed-length vector rep-resentation through convolution kernels sliding windowsand pooling to capture local features in the input but theoriginal data arrive 1e dependency relation is difficult tolearn and LSTM can better understand the content of theinput information through the memory unit that cancompensate for the defects of the CNN 1erefore a CNN-LSTM deep learning model is proposed to achieve the au-tomatic classification of AF in this paper [24 25]

Figure 6 shows the proposed CNN-LSTM network ar-chitecture After inputting the ECG signal the convolutionallayer and the pooling layer in the CNN first extract localfeatures and subsequently enter the hidden layer of LSTM toobtain optimal feature representation Finally the nonlinearfunction softmax in the fully connected layer is classifiedinto the corresponding categories CNN adds some pro-cessing such as normalization that can avoid overfitting andspeed up training

3 Experimental Results

31PerformanceEvaluation To estimate the performance ofheartbeat classification the performance of the model isusually evaluated with accuracy specificity and sensitivity[26ndash28] 1ey are defined as follows

sensitivity TP

TP + FNtimes 100

specificity TN

TN + FPtimes 100

accuracy TN + TP

TN + FP + FN + TPtimes 100

(3)

where TP denotes the number of correctly classified AFsignals FP denotes the number of incorrectly classified AFsignals TN is the number of correctly classified N signalsand FN is the number of misclassified N signals 1e resultsof the experimental study are presented in the next section

32 Implementation Details and Results 1e experimentherein uses the TensorFlow neural network frameworkBefore the experiment started the data labels were convertedinto corresponding one-hot vectors1e experiment is basedon an equal number of AF records and normal records fortraining and testing and the signal processing of the datasetis random During the experiment parameter optimizationwas performed the batch size was set to 128 the learningrate was 001 multiple iteration training was performed andthe Adam updater was used to update the weights to obtainthe best classification results Table 1 lists the relevant pa-rameters of the experimental network

Convolutional layer

Pooling layer

Pooling layerPooling layer

Fully connected layer

Input Output

Figure 3 CNN structure

4 Discrete Dynamics in Nature and Society

Figure 7 shows the loss and accuracy curves of the CNN-LSTM model It indicates performance change in thetraining set as the number of iterations increases 1enetwork continues to converge and the model does notappear to be overfitting

Figure 8 shows the receiver operating characteristiccurve (ROC) curve of the test set 1e abscissa of the curve isthe false positive rate and the ordinate is the true positiverate AUC denotes the area under the ROC curve 1e AUCrealized by the model was 097 1e closer the AUC value isto 1 the better is the performance of the model

Figure 9 shows the confusionmatrix of the test set whichis used to measure the accuracy of a classifier 1e upper leftcorner is TP the upper right corner is FP the lower left

corner is FN and the lower right corner is FP We canconvert the result of the quantity in the confusionmatrix to aratio between 0 and 1 to facilitate standardizedmeasurements

As mentioned above the CNN-LSTM model achievedan overall classification accuracy of 9728 on the test setwith a sensitivity of 9751 and a specificity of 9706

In this study by combining the deep learning model ofCNN and LSTM ie using CNN and LSTM to extract thecharacteristics of the ECG the model can automaticallyextract features and achieve higher accuracy

Table 2 shows a series of scientific studies based on ECGsignals in theMIT-BIHAF database It mainly includes threeevaluation indices accuracy sensitivity and specificity

X

X

X

σσ σtanh

tanh

Ctndash1

htndash1

ht

Ct

ht

+

Xt

ft it Otjt

Figure 5 LSTM hidden layer structure diagram

Input layer

Convolutional layer

Pooling layer

Figure 4 One-dimensional convolutional neural network structure

Discrete Dynamics in Nature and Society 5

Input ECG data points

ECG signals

1st convolution layer

2nd pooling layer

2nd convolution layer

1st pooling layer

LSTM layer

Fully connected layer

Somax

CNN layer

LSTM layer

Figure 6 CNN-LSTM network structure

Table 1 1e parameters of the model

Network layer type Kernel size StridesInput layer mdash mdashCon1d 17 1Pooling1d 5 5Con2d 7 1Pooling2d 5 5LSTM mdash mdashFully connected layer mdash mdashSoftmax mdash mdash

10

08

06

04

02

Num

eric

al v

alue

0 10000 20000 30000 40000 50000 60000Iteration

Loss and accuracy curves of CNN-LSTM model

LossAccuracy

Figure 7 Loss and accuracy curves

6 Discrete Dynamics in Nature and Society

1rough a comparison we can observe that out proposedCNN-LSTM network model has improved on the inputsignal of the model and network structure compared withother deep learning methods and achieved good results

4 Conclusion

In this study we conducted an in-depth study of the ECGclassification algorithm and constructed a network

10

08

06

04

02

00

True

pos

itive

rate

ROC

00 02 04 06 08 10False positive rate

AUC = 097

Figure 8 ROC curves

4859

4862

146

133

4500

4000

3500

NAF

AF

N

3000

2500

2000

1500

1000

500

Figure 9 Confusion matrix of test set

Table 2 Comparison with previous work on the MIT-BIH AF database

Author Database Features Classifier Accuracy () Sensitivity () Specificity ()Xu etal [15] AFDB MESWT CNN 8585 7905 8999Wei etal [14] AFDB RCN CNN 9459 9428 9491

Andersen etal [11]AFDB

RRI LSTM+CNN 874 986 864MITDBNSRDB

Dang etal [17] AFDB RR CNN-BLSTM 9659 9993 9703P-QRS-T CNN-LSTM 9407 9425 9273

Proposed model AFDB Deep features CNN-LSTM 9721 9734 9708

Discrete Dynamics in Nature and Society 7

combining CNN and LSTM 1is network can extract thecharacteristics of ECG signals and classify them Comparedwith traditional ECG classification methods our proposedCNN-LSTM network structure used the MIT-BIH AF da-tabase and achieved a high classification accuracy 1e ex-perimental results confirm that our proposed CNN-LSTMnetwork is effective for the automatic detection and clas-sification of AF In addition this method occupies fewercomputing resources and can theoretically achieve real-timeperformance thereby contributing to the development ofwearable ECG detection devices Our future research mayinvolve the use of a model that classifies AF tasks undernonfixed scale inputs to achieve further optimization of theneural network

Data Availability

1e data used to support the findings of this study have notbeen made available because the data also form part of anongoing study1e original data of the study can be obtainedat httpsphysionetorg

Conflicts of Interest

1e authors declare that they have no conflicts of interest

Acknowledgments

1is study was supported by the Shandong UniversityUndergraduate Teaching Reform Research Project (approvalnumber M2018X078) and the Shandong Province GraduateEducation Quality Improvement Program 2018 (approvalnumber SDYAL18088) 1is study was also partially sup-ported by the Major Science and Technology InnovationProjects of Shandong Province (grant no 2019JZZY010731)

References

[1] H Wang N Mohsen A Christine et al ldquoGlobal regionaland national life expectancy all-cause mortality and cause-specifc mortality for 249 causes of death 1980ndash2015 a Sys-tematic Analysis for the Global Burden of Disease Study2015rdquo 8e Lancet vol 388 no 10053 pp 1459ndash1544 2016

[2] C R C Wyndham ldquoAtrial fibrillation the most commonarrhythmiardquo Texas Heart Institute Journal vol 27 no 3pp 257ndash267 2000

[3] C-H Chen F Song F-J Hwang and L Wu ldquoA probabilitydensity function generator based on neural networksrdquoPhysica A Statistical Mechanics and Its Applications vol 541Article ID 123344 (2020)

[4] V Markides and R J Schilling ldquoAtrial fibrillation classifi-cation pathophysiology mechanisms and drug treatmentrdquoHeart vol 89 no 8 pp 939ndash943 2003

[5] L Mainardi Sornmo and S Cerutti Understanding AtrialFibrillation 8e Signal Processing Contribution MorganClaypool Publishers San Rafael CA USA 2008

[6] E J Benjamin P A Wolf R B DrsquoAgostino H SilbershatzW B Kannel and D Levy ldquoImpact of atrial fibrillation on therisk of deathrdquo Circulation vol 98 no 10 pp 946ndash952 1998

[7] C-H Chen ldquoA cell probe-based method for vehicle speedestimationrdquo IEICE Transactions on Fundamentals of

Electronics Communications and Computer Sciencesvol E103A no 1 pp 265ndash267 2020

[8] C-H Chen F-J Hwang and H-Y Kung ldquoTravel timeprediction system based on data clustering for waste collec-tion vehiclesrdquo IEICE Transactions on Information and Sys-tems vol E102D no 7 pp 1374ndash1383 2019

[9] J R Mehall R M Kohut Jr E W SchneebergerW H Merrill and R K Wolf ldquoAbsence of correlation be-tween symptoms and rhythm in ldquoSymptomaticrdquo atrial fi-brillationrdquo 8e Annals of 8oracic Surgery vol 83 no 6pp 2118ndash2121 2007

[10] S George I Rodriguez D Ipe P T Sager I Gussak andB Vajdic ldquoComputerized extraction of electrocardiogramsfrom continuous 12- lead holter recordings reduces mea-surement variability in a thorough QT studyrdquo 8e Journal ofClinical Pharmacology vol 52 no 12 pp 1891ndash1900 2012

[11] R S Andersen A Peimankar and S Puthusserypady ldquoAdeep learning approach for real-time detection of atrial fi-brillationrdquo Expert Systems with Applications vol 115pp 465ndash473 2019

[12] S Asgari A Mehrnia and M Moussavi ldquoAutomatic detec-tion of atrial fibrillation using stationary wavelet transformand support vector machinerdquo Computers in Biology andMedicine vol 60 pp 132ndash142 2015

[13] Z Yao Z Zhu and Y Chen ldquoAtrial fibrillation detection bymulti-scale convolutional neural networksrdquo in Proceedings ofthe 2017 International Conference on Information FusionIEEE Xirsquoan China July 2017

[14] X Xu S Wei C Ma K Luo L Zhang and C Liu ldquoAtrialfibrillation beat identification using the combination of mod-ified frequency slice wavelet transform and convolutionalneural networksrdquo Journal of Healthcare Engineering vol 2018Article ID 2102918 8 pages 2018

[15] X J Wei C Zhang M Liu et al ldquoAtrial fibrillation detectionby the combination of recurrence complex network andconvolution neural networkrdquo Journal of Probability andStatistics vol 2019 Article ID 8057820 9 pages 2019

[16] B Pourbabaee M J Roshtkhari and K Khorasani ldquoDeepconvolutional neural networks and learning ECG features forscreening paroxysmal atrial fibrillation patientsrdquo IEEETransactions on Systems Man and Cybernetics Systemsvol 48 no 12 pp 2095ndash2104 2018

[17] H Dang ldquoA novel deep arrhythmia-diagnosis network foratrial fibrillation classification using electrocardiogram sig-nalsrdquo IEEE Access vol 7 pp 2169ndash3536 2019

[18] A L Goldberger L A N Amaral L Glass et al ldquoPhysioBankPhysioToolkit and PhysioNetrdquo Circulation vol 101 no 23pp e215ndashe220 2000

[19] G Moody ldquoA new method for detecting atrial fibrillationusing rr intervalsrdquo Computers in Cardiology vol 10pp 227ndash230 1983

[20] W DeMulder S Bethard andM-F Moens ldquoA survey on theapplication of recurrent neural networks to statistical lan-guage modelingrdquo Computer Speech amp Language vol 30 no 1pp 61ndash98 2015

[21] H Palangi L Deng Y Shen et al ldquoDeep sentence embeddingusing long short-term memory networks analysis and ap-plication to information retrievalrdquo IEEEACM Transactionson Audio Speech and Language Processing vol 24 no 4pp 694ndash707 2016

[22] O Faust A Shenfield M Kareem T R San H Fujita andU R Acharya ldquoAutomated detection of atrial fibrillationusing long short-term memory network with RR interval

8 Discrete Dynamics in Nature and Society

signalsrdquo Computers in Biology and Medicine vol 102pp 327ndash335 2018

[23] P Cao X Li K Mao et al ldquoA novel data augmentationmethod to enhance deep neural networks for detection ofatrial fibrillationrdquo Biomedical Signal Processing and Controlvol 56 Article ID 101675 2020

[24] J Lu L A Hendricks M Rohrbach et al ldquoLong-term re-current convolutional networks for visual recognition anddescriptionrdquo IEEE Transactions on Pattern Analysis MachineIntelligence vol 39 no 4 pp 677ndash691 2017

[25] W-P XiongT-C Li et al ldquoResearch on partial least squaresmethod based on deep confidence network in traditionalchinese medicinerdquo Discrete Dynamics in Nature and Societyvol 2020 Article ID 4142824 10 pages 2020

[26] F Ma J Zhang W Liang et al ldquoAutomated classification ofatrial fibrillation using artificial neural network for wearabledevicesrdquo Mathematical Problems in Engineering vol 2020Article ID 9159158 6 pages 2020

[27] C ZhangJ He et al ldquoA crash severity prediction methodbased on improved neural network and factor AnalysisrdquoDiscrete Dynamics in Nature and Society vol 2020 Article ID4013185 13 pages 2020

[28] D M W Powers ldquoEvaluation from precision recall andffactor to roc informedness markedness correlationrdquo Journalof Machine Learning Technologies vol 2 pp 37ndash63 2011

Discrete Dynamics in Nature and Society 9

Page 2: AnAutomaticSystemforAtrialFibrillationbyUsinga CNN-LSTMModeldownloads.hindawi.com/journals/ddns/2020/3198783.pdf · CNN layer LSTM layer Figure 6:CNN-LSTMnetworkstructure. Table 1:eparametersofthemodel.

peak in the ECG signal locating it is easy However the lowamplitudes of the P and T waves make it challenging forthem to be detected and the feature extraction algorithm isstill not mature enough With developments in machinelearning traditional models have some insurmountabledefects First traditional algorithms need to design featureextraction methods to extract useful information andcombine machine learning algorithms for classification1isprocess may be accompanied with the loss of some infor-mation When the extracted features cannot fully reflect thedata the classification results may appear to have largererrors Second it mainly relies on considerable prior expertknowledge and sufficient biomedical signal processing ca-pabilities On this basis designing a good classifier algorithmis also necessary but achieving optimal results is difficult

Unlike traditional machine learning algorithms deeplearning-based methods have the ability to mine complexrelations and useful features of data and have been widelyresearched and applied in the automatic classification of AFXu et al proposed a framework that combined an improvedfrequency slice wavelet transform and a convolutionalneural network (CNN) for automatic AF beat recognitionand achieved good performance [14] Wei et al constructeda synchronous feature of each heartbeat of an ECG signalthrough a recursive complex network and subsequently usedCNN to detect AF by analyzing the eigenvalues of the re-cursive complex network [15] Andersen et al proposed anend-to-end model combining CNN and recurrent neuralnetworks to classify ECG signals as AF or a normal sinusrhythm [11] Pourbabaee et al developed a deep learningmachine to screen and identify patients with paroxysmal AF[16] Dang et al proposed a model that uses a CNN-BLSTMnetwork to diagnose arrhythmia and uses ECG signals toautomatically detect AF achieving relatively good results[17] Several researchers have shown that combining thedeep learning features with the classifier will significantlyimprove the performance of the system and make theclassification results more ideal Although the above re-search can effectively solve the classification problem of AFwe can observe that various neural networks have the abilityto extract complex nonlinear characteristics from theoriginal data without human intervention however learn-ing the thinking mechanism of the ECG signal features withhigh accuracy required for monitoring is still a difficult taskCNN and long short-term memory networks (LSTM) arevery efficient for feature extraction of ECG signals and thissuperiority is applied herein to the AF detection algorithm

In this study we proposed a new diagnosis method forAF named CNN-LSTM which can automatically detect AFfrom ECG signals 1e contributions of this study are asfollows

(i) We propose an automatic recognition methodnamed CNN-LSTM that uses heartbeat features asinput datasets to automatically identify AF in anECG signal

(ii) CNN has advantages in image processing whileLSTM can compensate for the shortcomings ofCNN in the context sequence 1erefore the

combination of CNN and LSTM can effectivelyimprove accuracy in the field of AF recognition

(iii) 1e use of multiscale signals representing the AFcharacteristics as the input of the network reducescomputing resources 1e design can be used toextract multiscale features and improve the gener-alization ability of the network model and thisstudy provides a high-precision classificationmethod to meet the real-time monitoring needs ofAF

In the following sections we provide a detailed ex-perimental process and verify the performance of themethod in the open access database 1is automatedmethod can analyze a large amount of data in a short timewhile ensuring high accuracy thus it may become apractical tool for providing real-time monitoring forpatients and reducing the work pressure on doctors

Section 1 of this article deals with the background ofcurrent research on AF and related research algorithmsthat have been implemented Section 2 covers the datasource and related network structure required for theexperiment Section 3 presents the experimental detailsresults and analysis of the results Section 4 presents theconcluding statements and prospects for future work

2 Material and Methods

21 Description of Dataset Our experimental research isbased on data from the MIT-BIH Atrial Fibrillation Data-base which is publicly available from PhysioNet [18 19]1is database includes 25 long-term ECG Holter recordsfrom different subjects (mainly paroxysmal attacks) Itcontains two ECG signal channels with AF annotations 1esampling rate of this database is 250Hz and these recordsalso include beat notes manually marked by expertclinicians

We preprocess the ECG signal to train and evaluate theautomatic AF prediction method based on the CNN-LSTMmodel As the duration of the AF recording in these data isdifferent from the normal recording duration all ECGsignals are divided into the same duration and data balanceis performed to better apply the learning of the model Aftersegmentation 960000 short-term ECG segments were ob-tained comprising 480000 segments of AF records and480000 segments of normal records Figure 2 shows acomparison of the AF signal and the normal signal1e ECGsignal segment is divided into a training set and a test set Tobetter detect the classification effect of the model the signalprocessing and segmentation of the dataset are random innature

22Networks 1is section first reviews the CNN and LSTMnetwork models which are closely related to the modelstructure proposed herein 1en our proposed researchmodel is put forward and the structure parameters andmathematical expressions of the model are described indetail

2 Discrete Dynamics in Nature and Society

In this section we describe the network structure modelproposed in this paper which mainly includes two con-volutional layers one LSTM layers fully connected layersand other computing operations

221 Convolutional Neural Network CNN is a feedforwardneural network and it mainly includes an input layer aconvolutional layer a pooling layer and an output layer Itsspecial network structure has great advantages in featureextraction and learning especially in the field of imagerecognition and thus it can achieve great success Itsstructure is shown in Figure 3

1e CNN is connected to the input layer through aconvolution kernel 1e convolution kernel performs dotmultiplication through a sliding window to achieve multi-scale feature extraction Simultaneously the weight-sharingmechanism of the convolution layer makes it more effectivefor feature extraction greatly reducing the number of freevariables that need to be learned Subsequently we add apooling layer after the convolutional layer to reduce thefeature matrix and network complexity Because the input

ECG signals are one-dimensional time series we use one-dimensional convolution in the convolution layer as shownin Figure 4

Before the data training we normalized the data 1econvolutional layer extracts features from the original input1e output of the a-th neuron of the one-dimensionalconvolutional layer is shown in the following equation

Oa δ 1113944n

j1WjXaminusj+n + b⎛⎝ ⎞⎠ (1)

1e input sequence is Xl(l 1 2 n) where W de-notes a matrix of weight coefficients b is an offset coefficientand n is the number of convolution kernels 1en the resultof the convolution is input into an activation function δ (inthis case ReLU) and then the result of the convolution layeris fed back to the pooling layer

222 Long Short-Term Memory Network LSTM is a specialrecurrent neural network LSTM is suitable for applicationssuch as natural language processing [20 21] and biomedical

P PR QRS ST T U

Figure 1 A complete ECG signal

AF

15

10

05

00

ndash05

mV

ndash10

ndash15

0 200 400 600 800 1000 1200

(a)

N

ndash05

0 200 400 600 800 1000 1200

10

05

00mV

ndash10

(b)

Figure 2 Comparison of AF signal and N signal

Discrete Dynamics in Nature and Society 3

signal processing [22 23] LSTM improves the standardRNN model and adds a gate mechanism It overcomes theproblems of gradient disappearance gradient explosion andlength dependence of traditional RNNs 1e hidden layer ofLSTM comprises an input gate a forget gate and an outputgate 1e structure is shown in Figure 5

1e input of the LSTM hidden layer includes not onlythe input Xt of the current sequence but also the state Ctminus1 ofthe hidden layer at the previous time then the output vectorhtminus1 and the output ht and Ct of the current state are cal-culated 1e key part of LSTM is what information we willdiscard from the cell state Ctminus1 at the last moment and howmuch information can be transferred to the current state Ct1is decision is made through a forget door 1e next step isto decide how much new information is added to the nextstate Finally we determine the output value based on thecurrent Ct and ht 1e update method of LSTM is as follows

ft δ Wf htminus1 Xt1113858 1113859 + bf1113872 1113873

it δ Wi htminus1 Xt1113858 1113859 + bi( 1113857

jt tanh Wc htminus1 Xt1113858 1113859 + bc( 1113857

Ot δ Wo htminus1 Xt1113858 1113859 + bo( 1113857

ht Ot lowast tanh Ct( 1113857

(2)

where Ct is the state information of the memory unit jt isthe accumulated information at the current moment W isthe weight coefficient matrix b is the bias term σ is thesigmoid activation function and tanh is the hyperbolictangent activation function

223 Proposed Architecture Neural networks have theirown unique feature learning method 1e CNN modelconverts the original input into a fixed-length vector rep-resentation through convolution kernels sliding windowsand pooling to capture local features in the input but theoriginal data arrive 1e dependency relation is difficult tolearn and LSTM can better understand the content of theinput information through the memory unit that cancompensate for the defects of the CNN 1erefore a CNN-LSTM deep learning model is proposed to achieve the au-tomatic classification of AF in this paper [24 25]

Figure 6 shows the proposed CNN-LSTM network ar-chitecture After inputting the ECG signal the convolutionallayer and the pooling layer in the CNN first extract localfeatures and subsequently enter the hidden layer of LSTM toobtain optimal feature representation Finally the nonlinearfunction softmax in the fully connected layer is classifiedinto the corresponding categories CNN adds some pro-cessing such as normalization that can avoid overfitting andspeed up training

3 Experimental Results

31PerformanceEvaluation To estimate the performance ofheartbeat classification the performance of the model isusually evaluated with accuracy specificity and sensitivity[26ndash28] 1ey are defined as follows

sensitivity TP

TP + FNtimes 100

specificity TN

TN + FPtimes 100

accuracy TN + TP

TN + FP + FN + TPtimes 100

(3)

where TP denotes the number of correctly classified AFsignals FP denotes the number of incorrectly classified AFsignals TN is the number of correctly classified N signalsand FN is the number of misclassified N signals 1e resultsof the experimental study are presented in the next section

32 Implementation Details and Results 1e experimentherein uses the TensorFlow neural network frameworkBefore the experiment started the data labels were convertedinto corresponding one-hot vectors1e experiment is basedon an equal number of AF records and normal records fortraining and testing and the signal processing of the datasetis random During the experiment parameter optimizationwas performed the batch size was set to 128 the learningrate was 001 multiple iteration training was performed andthe Adam updater was used to update the weights to obtainthe best classification results Table 1 lists the relevant pa-rameters of the experimental network

Convolutional layer

Pooling layer

Pooling layerPooling layer

Fully connected layer

Input Output

Figure 3 CNN structure

4 Discrete Dynamics in Nature and Society

Figure 7 shows the loss and accuracy curves of the CNN-LSTM model It indicates performance change in thetraining set as the number of iterations increases 1enetwork continues to converge and the model does notappear to be overfitting

Figure 8 shows the receiver operating characteristiccurve (ROC) curve of the test set 1e abscissa of the curve isthe false positive rate and the ordinate is the true positiverate AUC denotes the area under the ROC curve 1e AUCrealized by the model was 097 1e closer the AUC value isto 1 the better is the performance of the model

Figure 9 shows the confusionmatrix of the test set whichis used to measure the accuracy of a classifier 1e upper leftcorner is TP the upper right corner is FP the lower left

corner is FN and the lower right corner is FP We canconvert the result of the quantity in the confusionmatrix to aratio between 0 and 1 to facilitate standardizedmeasurements

As mentioned above the CNN-LSTM model achievedan overall classification accuracy of 9728 on the test setwith a sensitivity of 9751 and a specificity of 9706

In this study by combining the deep learning model ofCNN and LSTM ie using CNN and LSTM to extract thecharacteristics of the ECG the model can automaticallyextract features and achieve higher accuracy

Table 2 shows a series of scientific studies based on ECGsignals in theMIT-BIHAF database It mainly includes threeevaluation indices accuracy sensitivity and specificity

X

X

X

σσ σtanh

tanh

Ctndash1

htndash1

ht

Ct

ht

+

Xt

ft it Otjt

Figure 5 LSTM hidden layer structure diagram

Input layer

Convolutional layer

Pooling layer

Figure 4 One-dimensional convolutional neural network structure

Discrete Dynamics in Nature and Society 5

Input ECG data points

ECG signals

1st convolution layer

2nd pooling layer

2nd convolution layer

1st pooling layer

LSTM layer

Fully connected layer

Somax

CNN layer

LSTM layer

Figure 6 CNN-LSTM network structure

Table 1 1e parameters of the model

Network layer type Kernel size StridesInput layer mdash mdashCon1d 17 1Pooling1d 5 5Con2d 7 1Pooling2d 5 5LSTM mdash mdashFully connected layer mdash mdashSoftmax mdash mdash

10

08

06

04

02

Num

eric

al v

alue

0 10000 20000 30000 40000 50000 60000Iteration

Loss and accuracy curves of CNN-LSTM model

LossAccuracy

Figure 7 Loss and accuracy curves

6 Discrete Dynamics in Nature and Society

1rough a comparison we can observe that out proposedCNN-LSTM network model has improved on the inputsignal of the model and network structure compared withother deep learning methods and achieved good results

4 Conclusion

In this study we conducted an in-depth study of the ECGclassification algorithm and constructed a network

10

08

06

04

02

00

True

pos

itive

rate

ROC

00 02 04 06 08 10False positive rate

AUC = 097

Figure 8 ROC curves

4859

4862

146

133

4500

4000

3500

NAF

AF

N

3000

2500

2000

1500

1000

500

Figure 9 Confusion matrix of test set

Table 2 Comparison with previous work on the MIT-BIH AF database

Author Database Features Classifier Accuracy () Sensitivity () Specificity ()Xu etal [15] AFDB MESWT CNN 8585 7905 8999Wei etal [14] AFDB RCN CNN 9459 9428 9491

Andersen etal [11]AFDB

RRI LSTM+CNN 874 986 864MITDBNSRDB

Dang etal [17] AFDB RR CNN-BLSTM 9659 9993 9703P-QRS-T CNN-LSTM 9407 9425 9273

Proposed model AFDB Deep features CNN-LSTM 9721 9734 9708

Discrete Dynamics in Nature and Society 7

combining CNN and LSTM 1is network can extract thecharacteristics of ECG signals and classify them Comparedwith traditional ECG classification methods our proposedCNN-LSTM network structure used the MIT-BIH AF da-tabase and achieved a high classification accuracy 1e ex-perimental results confirm that our proposed CNN-LSTMnetwork is effective for the automatic detection and clas-sification of AF In addition this method occupies fewercomputing resources and can theoretically achieve real-timeperformance thereby contributing to the development ofwearable ECG detection devices Our future research mayinvolve the use of a model that classifies AF tasks undernonfixed scale inputs to achieve further optimization of theneural network

Data Availability

1e data used to support the findings of this study have notbeen made available because the data also form part of anongoing study1e original data of the study can be obtainedat httpsphysionetorg

Conflicts of Interest

1e authors declare that they have no conflicts of interest

Acknowledgments

1is study was supported by the Shandong UniversityUndergraduate Teaching Reform Research Project (approvalnumber M2018X078) and the Shandong Province GraduateEducation Quality Improvement Program 2018 (approvalnumber SDYAL18088) 1is study was also partially sup-ported by the Major Science and Technology InnovationProjects of Shandong Province (grant no 2019JZZY010731)

References

[1] H Wang N Mohsen A Christine et al ldquoGlobal regionaland national life expectancy all-cause mortality and cause-specifc mortality for 249 causes of death 1980ndash2015 a Sys-tematic Analysis for the Global Burden of Disease Study2015rdquo 8e Lancet vol 388 no 10053 pp 1459ndash1544 2016

[2] C R C Wyndham ldquoAtrial fibrillation the most commonarrhythmiardquo Texas Heart Institute Journal vol 27 no 3pp 257ndash267 2000

[3] C-H Chen F Song F-J Hwang and L Wu ldquoA probabilitydensity function generator based on neural networksrdquoPhysica A Statistical Mechanics and Its Applications vol 541Article ID 123344 (2020)

[4] V Markides and R J Schilling ldquoAtrial fibrillation classifi-cation pathophysiology mechanisms and drug treatmentrdquoHeart vol 89 no 8 pp 939ndash943 2003

[5] L Mainardi Sornmo and S Cerutti Understanding AtrialFibrillation 8e Signal Processing Contribution MorganClaypool Publishers San Rafael CA USA 2008

[6] E J Benjamin P A Wolf R B DrsquoAgostino H SilbershatzW B Kannel and D Levy ldquoImpact of atrial fibrillation on therisk of deathrdquo Circulation vol 98 no 10 pp 946ndash952 1998

[7] C-H Chen ldquoA cell probe-based method for vehicle speedestimationrdquo IEICE Transactions on Fundamentals of

Electronics Communications and Computer Sciencesvol E103A no 1 pp 265ndash267 2020

[8] C-H Chen F-J Hwang and H-Y Kung ldquoTravel timeprediction system based on data clustering for waste collec-tion vehiclesrdquo IEICE Transactions on Information and Sys-tems vol E102D no 7 pp 1374ndash1383 2019

[9] J R Mehall R M Kohut Jr E W SchneebergerW H Merrill and R K Wolf ldquoAbsence of correlation be-tween symptoms and rhythm in ldquoSymptomaticrdquo atrial fi-brillationrdquo 8e Annals of 8oracic Surgery vol 83 no 6pp 2118ndash2121 2007

[10] S George I Rodriguez D Ipe P T Sager I Gussak andB Vajdic ldquoComputerized extraction of electrocardiogramsfrom continuous 12- lead holter recordings reduces mea-surement variability in a thorough QT studyrdquo 8e Journal ofClinical Pharmacology vol 52 no 12 pp 1891ndash1900 2012

[11] R S Andersen A Peimankar and S Puthusserypady ldquoAdeep learning approach for real-time detection of atrial fi-brillationrdquo Expert Systems with Applications vol 115pp 465ndash473 2019

[12] S Asgari A Mehrnia and M Moussavi ldquoAutomatic detec-tion of atrial fibrillation using stationary wavelet transformand support vector machinerdquo Computers in Biology andMedicine vol 60 pp 132ndash142 2015

[13] Z Yao Z Zhu and Y Chen ldquoAtrial fibrillation detection bymulti-scale convolutional neural networksrdquo in Proceedings ofthe 2017 International Conference on Information FusionIEEE Xirsquoan China July 2017

[14] X Xu S Wei C Ma K Luo L Zhang and C Liu ldquoAtrialfibrillation beat identification using the combination of mod-ified frequency slice wavelet transform and convolutionalneural networksrdquo Journal of Healthcare Engineering vol 2018Article ID 2102918 8 pages 2018

[15] X J Wei C Zhang M Liu et al ldquoAtrial fibrillation detectionby the combination of recurrence complex network andconvolution neural networkrdquo Journal of Probability andStatistics vol 2019 Article ID 8057820 9 pages 2019

[16] B Pourbabaee M J Roshtkhari and K Khorasani ldquoDeepconvolutional neural networks and learning ECG features forscreening paroxysmal atrial fibrillation patientsrdquo IEEETransactions on Systems Man and Cybernetics Systemsvol 48 no 12 pp 2095ndash2104 2018

[17] H Dang ldquoA novel deep arrhythmia-diagnosis network foratrial fibrillation classification using electrocardiogram sig-nalsrdquo IEEE Access vol 7 pp 2169ndash3536 2019

[18] A L Goldberger L A N Amaral L Glass et al ldquoPhysioBankPhysioToolkit and PhysioNetrdquo Circulation vol 101 no 23pp e215ndashe220 2000

[19] G Moody ldquoA new method for detecting atrial fibrillationusing rr intervalsrdquo Computers in Cardiology vol 10pp 227ndash230 1983

[20] W DeMulder S Bethard andM-F Moens ldquoA survey on theapplication of recurrent neural networks to statistical lan-guage modelingrdquo Computer Speech amp Language vol 30 no 1pp 61ndash98 2015

[21] H Palangi L Deng Y Shen et al ldquoDeep sentence embeddingusing long short-term memory networks analysis and ap-plication to information retrievalrdquo IEEEACM Transactionson Audio Speech and Language Processing vol 24 no 4pp 694ndash707 2016

[22] O Faust A Shenfield M Kareem T R San H Fujita andU R Acharya ldquoAutomated detection of atrial fibrillationusing long short-term memory network with RR interval

8 Discrete Dynamics in Nature and Society

signalsrdquo Computers in Biology and Medicine vol 102pp 327ndash335 2018

[23] P Cao X Li K Mao et al ldquoA novel data augmentationmethod to enhance deep neural networks for detection ofatrial fibrillationrdquo Biomedical Signal Processing and Controlvol 56 Article ID 101675 2020

[24] J Lu L A Hendricks M Rohrbach et al ldquoLong-term re-current convolutional networks for visual recognition anddescriptionrdquo IEEE Transactions on Pattern Analysis MachineIntelligence vol 39 no 4 pp 677ndash691 2017

[25] W-P XiongT-C Li et al ldquoResearch on partial least squaresmethod based on deep confidence network in traditionalchinese medicinerdquo Discrete Dynamics in Nature and Societyvol 2020 Article ID 4142824 10 pages 2020

[26] F Ma J Zhang W Liang et al ldquoAutomated classification ofatrial fibrillation using artificial neural network for wearabledevicesrdquo Mathematical Problems in Engineering vol 2020Article ID 9159158 6 pages 2020

[27] C ZhangJ He et al ldquoA crash severity prediction methodbased on improved neural network and factor AnalysisrdquoDiscrete Dynamics in Nature and Society vol 2020 Article ID4013185 13 pages 2020

[28] D M W Powers ldquoEvaluation from precision recall andffactor to roc informedness markedness correlationrdquo Journalof Machine Learning Technologies vol 2 pp 37ndash63 2011

Discrete Dynamics in Nature and Society 9

Page 3: AnAutomaticSystemforAtrialFibrillationbyUsinga CNN-LSTMModeldownloads.hindawi.com/journals/ddns/2020/3198783.pdf · CNN layer LSTM layer Figure 6:CNN-LSTMnetworkstructure. Table 1:eparametersofthemodel.

In this section we describe the network structure modelproposed in this paper which mainly includes two con-volutional layers one LSTM layers fully connected layersand other computing operations

221 Convolutional Neural Network CNN is a feedforwardneural network and it mainly includes an input layer aconvolutional layer a pooling layer and an output layer Itsspecial network structure has great advantages in featureextraction and learning especially in the field of imagerecognition and thus it can achieve great success Itsstructure is shown in Figure 3

1e CNN is connected to the input layer through aconvolution kernel 1e convolution kernel performs dotmultiplication through a sliding window to achieve multi-scale feature extraction Simultaneously the weight-sharingmechanism of the convolution layer makes it more effectivefor feature extraction greatly reducing the number of freevariables that need to be learned Subsequently we add apooling layer after the convolutional layer to reduce thefeature matrix and network complexity Because the input

ECG signals are one-dimensional time series we use one-dimensional convolution in the convolution layer as shownin Figure 4

Before the data training we normalized the data 1econvolutional layer extracts features from the original input1e output of the a-th neuron of the one-dimensionalconvolutional layer is shown in the following equation

Oa δ 1113944n

j1WjXaminusj+n + b⎛⎝ ⎞⎠ (1)

1e input sequence is Xl(l 1 2 n) where W de-notes a matrix of weight coefficients b is an offset coefficientand n is the number of convolution kernels 1en the resultof the convolution is input into an activation function δ (inthis case ReLU) and then the result of the convolution layeris fed back to the pooling layer

222 Long Short-Term Memory Network LSTM is a specialrecurrent neural network LSTM is suitable for applicationssuch as natural language processing [20 21] and biomedical

P PR QRS ST T U

Figure 1 A complete ECG signal

AF

15

10

05

00

ndash05

mV

ndash10

ndash15

0 200 400 600 800 1000 1200

(a)

N

ndash05

0 200 400 600 800 1000 1200

10

05

00mV

ndash10

(b)

Figure 2 Comparison of AF signal and N signal

Discrete Dynamics in Nature and Society 3

signal processing [22 23] LSTM improves the standardRNN model and adds a gate mechanism It overcomes theproblems of gradient disappearance gradient explosion andlength dependence of traditional RNNs 1e hidden layer ofLSTM comprises an input gate a forget gate and an outputgate 1e structure is shown in Figure 5

1e input of the LSTM hidden layer includes not onlythe input Xt of the current sequence but also the state Ctminus1 ofthe hidden layer at the previous time then the output vectorhtminus1 and the output ht and Ct of the current state are cal-culated 1e key part of LSTM is what information we willdiscard from the cell state Ctminus1 at the last moment and howmuch information can be transferred to the current state Ct1is decision is made through a forget door 1e next step isto decide how much new information is added to the nextstate Finally we determine the output value based on thecurrent Ct and ht 1e update method of LSTM is as follows

ft δ Wf htminus1 Xt1113858 1113859 + bf1113872 1113873

it δ Wi htminus1 Xt1113858 1113859 + bi( 1113857

jt tanh Wc htminus1 Xt1113858 1113859 + bc( 1113857

Ot δ Wo htminus1 Xt1113858 1113859 + bo( 1113857

ht Ot lowast tanh Ct( 1113857

(2)

where Ct is the state information of the memory unit jt isthe accumulated information at the current moment W isthe weight coefficient matrix b is the bias term σ is thesigmoid activation function and tanh is the hyperbolictangent activation function

223 Proposed Architecture Neural networks have theirown unique feature learning method 1e CNN modelconverts the original input into a fixed-length vector rep-resentation through convolution kernels sliding windowsand pooling to capture local features in the input but theoriginal data arrive 1e dependency relation is difficult tolearn and LSTM can better understand the content of theinput information through the memory unit that cancompensate for the defects of the CNN 1erefore a CNN-LSTM deep learning model is proposed to achieve the au-tomatic classification of AF in this paper [24 25]

Figure 6 shows the proposed CNN-LSTM network ar-chitecture After inputting the ECG signal the convolutionallayer and the pooling layer in the CNN first extract localfeatures and subsequently enter the hidden layer of LSTM toobtain optimal feature representation Finally the nonlinearfunction softmax in the fully connected layer is classifiedinto the corresponding categories CNN adds some pro-cessing such as normalization that can avoid overfitting andspeed up training

3 Experimental Results

31PerformanceEvaluation To estimate the performance ofheartbeat classification the performance of the model isusually evaluated with accuracy specificity and sensitivity[26ndash28] 1ey are defined as follows

sensitivity TP

TP + FNtimes 100

specificity TN

TN + FPtimes 100

accuracy TN + TP

TN + FP + FN + TPtimes 100

(3)

where TP denotes the number of correctly classified AFsignals FP denotes the number of incorrectly classified AFsignals TN is the number of correctly classified N signalsand FN is the number of misclassified N signals 1e resultsof the experimental study are presented in the next section

32 Implementation Details and Results 1e experimentherein uses the TensorFlow neural network frameworkBefore the experiment started the data labels were convertedinto corresponding one-hot vectors1e experiment is basedon an equal number of AF records and normal records fortraining and testing and the signal processing of the datasetis random During the experiment parameter optimizationwas performed the batch size was set to 128 the learningrate was 001 multiple iteration training was performed andthe Adam updater was used to update the weights to obtainthe best classification results Table 1 lists the relevant pa-rameters of the experimental network

Convolutional layer

Pooling layer

Pooling layerPooling layer

Fully connected layer

Input Output

Figure 3 CNN structure

4 Discrete Dynamics in Nature and Society

Figure 7 shows the loss and accuracy curves of the CNN-LSTM model It indicates performance change in thetraining set as the number of iterations increases 1enetwork continues to converge and the model does notappear to be overfitting

Figure 8 shows the receiver operating characteristiccurve (ROC) curve of the test set 1e abscissa of the curve isthe false positive rate and the ordinate is the true positiverate AUC denotes the area under the ROC curve 1e AUCrealized by the model was 097 1e closer the AUC value isto 1 the better is the performance of the model

Figure 9 shows the confusionmatrix of the test set whichis used to measure the accuracy of a classifier 1e upper leftcorner is TP the upper right corner is FP the lower left

corner is FN and the lower right corner is FP We canconvert the result of the quantity in the confusionmatrix to aratio between 0 and 1 to facilitate standardizedmeasurements

As mentioned above the CNN-LSTM model achievedan overall classification accuracy of 9728 on the test setwith a sensitivity of 9751 and a specificity of 9706

In this study by combining the deep learning model ofCNN and LSTM ie using CNN and LSTM to extract thecharacteristics of the ECG the model can automaticallyextract features and achieve higher accuracy

Table 2 shows a series of scientific studies based on ECGsignals in theMIT-BIHAF database It mainly includes threeevaluation indices accuracy sensitivity and specificity

X

X

X

σσ σtanh

tanh

Ctndash1

htndash1

ht

Ct

ht

+

Xt

ft it Otjt

Figure 5 LSTM hidden layer structure diagram

Input layer

Convolutional layer

Pooling layer

Figure 4 One-dimensional convolutional neural network structure

Discrete Dynamics in Nature and Society 5

Input ECG data points

ECG signals

1st convolution layer

2nd pooling layer

2nd convolution layer

1st pooling layer

LSTM layer

Fully connected layer

Somax

CNN layer

LSTM layer

Figure 6 CNN-LSTM network structure

Table 1 1e parameters of the model

Network layer type Kernel size StridesInput layer mdash mdashCon1d 17 1Pooling1d 5 5Con2d 7 1Pooling2d 5 5LSTM mdash mdashFully connected layer mdash mdashSoftmax mdash mdash

10

08

06

04

02

Num

eric

al v

alue

0 10000 20000 30000 40000 50000 60000Iteration

Loss and accuracy curves of CNN-LSTM model

LossAccuracy

Figure 7 Loss and accuracy curves

6 Discrete Dynamics in Nature and Society

1rough a comparison we can observe that out proposedCNN-LSTM network model has improved on the inputsignal of the model and network structure compared withother deep learning methods and achieved good results

4 Conclusion

In this study we conducted an in-depth study of the ECGclassification algorithm and constructed a network

10

08

06

04

02

00

True

pos

itive

rate

ROC

00 02 04 06 08 10False positive rate

AUC = 097

Figure 8 ROC curves

4859

4862

146

133

4500

4000

3500

NAF

AF

N

3000

2500

2000

1500

1000

500

Figure 9 Confusion matrix of test set

Table 2 Comparison with previous work on the MIT-BIH AF database

Author Database Features Classifier Accuracy () Sensitivity () Specificity ()Xu etal [15] AFDB MESWT CNN 8585 7905 8999Wei etal [14] AFDB RCN CNN 9459 9428 9491

Andersen etal [11]AFDB

RRI LSTM+CNN 874 986 864MITDBNSRDB

Dang etal [17] AFDB RR CNN-BLSTM 9659 9993 9703P-QRS-T CNN-LSTM 9407 9425 9273

Proposed model AFDB Deep features CNN-LSTM 9721 9734 9708

Discrete Dynamics in Nature and Society 7

combining CNN and LSTM 1is network can extract thecharacteristics of ECG signals and classify them Comparedwith traditional ECG classification methods our proposedCNN-LSTM network structure used the MIT-BIH AF da-tabase and achieved a high classification accuracy 1e ex-perimental results confirm that our proposed CNN-LSTMnetwork is effective for the automatic detection and clas-sification of AF In addition this method occupies fewercomputing resources and can theoretically achieve real-timeperformance thereby contributing to the development ofwearable ECG detection devices Our future research mayinvolve the use of a model that classifies AF tasks undernonfixed scale inputs to achieve further optimization of theneural network

Data Availability

1e data used to support the findings of this study have notbeen made available because the data also form part of anongoing study1e original data of the study can be obtainedat httpsphysionetorg

Conflicts of Interest

1e authors declare that they have no conflicts of interest

Acknowledgments

1is study was supported by the Shandong UniversityUndergraduate Teaching Reform Research Project (approvalnumber M2018X078) and the Shandong Province GraduateEducation Quality Improvement Program 2018 (approvalnumber SDYAL18088) 1is study was also partially sup-ported by the Major Science and Technology InnovationProjects of Shandong Province (grant no 2019JZZY010731)

References

[1] H Wang N Mohsen A Christine et al ldquoGlobal regionaland national life expectancy all-cause mortality and cause-specifc mortality for 249 causes of death 1980ndash2015 a Sys-tematic Analysis for the Global Burden of Disease Study2015rdquo 8e Lancet vol 388 no 10053 pp 1459ndash1544 2016

[2] C R C Wyndham ldquoAtrial fibrillation the most commonarrhythmiardquo Texas Heart Institute Journal vol 27 no 3pp 257ndash267 2000

[3] C-H Chen F Song F-J Hwang and L Wu ldquoA probabilitydensity function generator based on neural networksrdquoPhysica A Statistical Mechanics and Its Applications vol 541Article ID 123344 (2020)

[4] V Markides and R J Schilling ldquoAtrial fibrillation classifi-cation pathophysiology mechanisms and drug treatmentrdquoHeart vol 89 no 8 pp 939ndash943 2003

[5] L Mainardi Sornmo and S Cerutti Understanding AtrialFibrillation 8e Signal Processing Contribution MorganClaypool Publishers San Rafael CA USA 2008

[6] E J Benjamin P A Wolf R B DrsquoAgostino H SilbershatzW B Kannel and D Levy ldquoImpact of atrial fibrillation on therisk of deathrdquo Circulation vol 98 no 10 pp 946ndash952 1998

[7] C-H Chen ldquoA cell probe-based method for vehicle speedestimationrdquo IEICE Transactions on Fundamentals of

Electronics Communications and Computer Sciencesvol E103A no 1 pp 265ndash267 2020

[8] C-H Chen F-J Hwang and H-Y Kung ldquoTravel timeprediction system based on data clustering for waste collec-tion vehiclesrdquo IEICE Transactions on Information and Sys-tems vol E102D no 7 pp 1374ndash1383 2019

[9] J R Mehall R M Kohut Jr E W SchneebergerW H Merrill and R K Wolf ldquoAbsence of correlation be-tween symptoms and rhythm in ldquoSymptomaticrdquo atrial fi-brillationrdquo 8e Annals of 8oracic Surgery vol 83 no 6pp 2118ndash2121 2007

[10] S George I Rodriguez D Ipe P T Sager I Gussak andB Vajdic ldquoComputerized extraction of electrocardiogramsfrom continuous 12- lead holter recordings reduces mea-surement variability in a thorough QT studyrdquo 8e Journal ofClinical Pharmacology vol 52 no 12 pp 1891ndash1900 2012

[11] R S Andersen A Peimankar and S Puthusserypady ldquoAdeep learning approach for real-time detection of atrial fi-brillationrdquo Expert Systems with Applications vol 115pp 465ndash473 2019

[12] S Asgari A Mehrnia and M Moussavi ldquoAutomatic detec-tion of atrial fibrillation using stationary wavelet transformand support vector machinerdquo Computers in Biology andMedicine vol 60 pp 132ndash142 2015

[13] Z Yao Z Zhu and Y Chen ldquoAtrial fibrillation detection bymulti-scale convolutional neural networksrdquo in Proceedings ofthe 2017 International Conference on Information FusionIEEE Xirsquoan China July 2017

[14] X Xu S Wei C Ma K Luo L Zhang and C Liu ldquoAtrialfibrillation beat identification using the combination of mod-ified frequency slice wavelet transform and convolutionalneural networksrdquo Journal of Healthcare Engineering vol 2018Article ID 2102918 8 pages 2018

[15] X J Wei C Zhang M Liu et al ldquoAtrial fibrillation detectionby the combination of recurrence complex network andconvolution neural networkrdquo Journal of Probability andStatistics vol 2019 Article ID 8057820 9 pages 2019

[16] B Pourbabaee M J Roshtkhari and K Khorasani ldquoDeepconvolutional neural networks and learning ECG features forscreening paroxysmal atrial fibrillation patientsrdquo IEEETransactions on Systems Man and Cybernetics Systemsvol 48 no 12 pp 2095ndash2104 2018

[17] H Dang ldquoA novel deep arrhythmia-diagnosis network foratrial fibrillation classification using electrocardiogram sig-nalsrdquo IEEE Access vol 7 pp 2169ndash3536 2019

[18] A L Goldberger L A N Amaral L Glass et al ldquoPhysioBankPhysioToolkit and PhysioNetrdquo Circulation vol 101 no 23pp e215ndashe220 2000

[19] G Moody ldquoA new method for detecting atrial fibrillationusing rr intervalsrdquo Computers in Cardiology vol 10pp 227ndash230 1983

[20] W DeMulder S Bethard andM-F Moens ldquoA survey on theapplication of recurrent neural networks to statistical lan-guage modelingrdquo Computer Speech amp Language vol 30 no 1pp 61ndash98 2015

[21] H Palangi L Deng Y Shen et al ldquoDeep sentence embeddingusing long short-term memory networks analysis and ap-plication to information retrievalrdquo IEEEACM Transactionson Audio Speech and Language Processing vol 24 no 4pp 694ndash707 2016

[22] O Faust A Shenfield M Kareem T R San H Fujita andU R Acharya ldquoAutomated detection of atrial fibrillationusing long short-term memory network with RR interval

8 Discrete Dynamics in Nature and Society

signalsrdquo Computers in Biology and Medicine vol 102pp 327ndash335 2018

[23] P Cao X Li K Mao et al ldquoA novel data augmentationmethod to enhance deep neural networks for detection ofatrial fibrillationrdquo Biomedical Signal Processing and Controlvol 56 Article ID 101675 2020

[24] J Lu L A Hendricks M Rohrbach et al ldquoLong-term re-current convolutional networks for visual recognition anddescriptionrdquo IEEE Transactions on Pattern Analysis MachineIntelligence vol 39 no 4 pp 677ndash691 2017

[25] W-P XiongT-C Li et al ldquoResearch on partial least squaresmethod based on deep confidence network in traditionalchinese medicinerdquo Discrete Dynamics in Nature and Societyvol 2020 Article ID 4142824 10 pages 2020

[26] F Ma J Zhang W Liang et al ldquoAutomated classification ofatrial fibrillation using artificial neural network for wearabledevicesrdquo Mathematical Problems in Engineering vol 2020Article ID 9159158 6 pages 2020

[27] C ZhangJ He et al ldquoA crash severity prediction methodbased on improved neural network and factor AnalysisrdquoDiscrete Dynamics in Nature and Society vol 2020 Article ID4013185 13 pages 2020

[28] D M W Powers ldquoEvaluation from precision recall andffactor to roc informedness markedness correlationrdquo Journalof Machine Learning Technologies vol 2 pp 37ndash63 2011

Discrete Dynamics in Nature and Society 9

Page 4: AnAutomaticSystemforAtrialFibrillationbyUsinga CNN-LSTMModeldownloads.hindawi.com/journals/ddns/2020/3198783.pdf · CNN layer LSTM layer Figure 6:CNN-LSTMnetworkstructure. Table 1:eparametersofthemodel.

signal processing [22 23] LSTM improves the standardRNN model and adds a gate mechanism It overcomes theproblems of gradient disappearance gradient explosion andlength dependence of traditional RNNs 1e hidden layer ofLSTM comprises an input gate a forget gate and an outputgate 1e structure is shown in Figure 5

1e input of the LSTM hidden layer includes not onlythe input Xt of the current sequence but also the state Ctminus1 ofthe hidden layer at the previous time then the output vectorhtminus1 and the output ht and Ct of the current state are cal-culated 1e key part of LSTM is what information we willdiscard from the cell state Ctminus1 at the last moment and howmuch information can be transferred to the current state Ct1is decision is made through a forget door 1e next step isto decide how much new information is added to the nextstate Finally we determine the output value based on thecurrent Ct and ht 1e update method of LSTM is as follows

ft δ Wf htminus1 Xt1113858 1113859 + bf1113872 1113873

it δ Wi htminus1 Xt1113858 1113859 + bi( 1113857

jt tanh Wc htminus1 Xt1113858 1113859 + bc( 1113857

Ot δ Wo htminus1 Xt1113858 1113859 + bo( 1113857

ht Ot lowast tanh Ct( 1113857

(2)

where Ct is the state information of the memory unit jt isthe accumulated information at the current moment W isthe weight coefficient matrix b is the bias term σ is thesigmoid activation function and tanh is the hyperbolictangent activation function

223 Proposed Architecture Neural networks have theirown unique feature learning method 1e CNN modelconverts the original input into a fixed-length vector rep-resentation through convolution kernels sliding windowsand pooling to capture local features in the input but theoriginal data arrive 1e dependency relation is difficult tolearn and LSTM can better understand the content of theinput information through the memory unit that cancompensate for the defects of the CNN 1erefore a CNN-LSTM deep learning model is proposed to achieve the au-tomatic classification of AF in this paper [24 25]

Figure 6 shows the proposed CNN-LSTM network ar-chitecture After inputting the ECG signal the convolutionallayer and the pooling layer in the CNN first extract localfeatures and subsequently enter the hidden layer of LSTM toobtain optimal feature representation Finally the nonlinearfunction softmax in the fully connected layer is classifiedinto the corresponding categories CNN adds some pro-cessing such as normalization that can avoid overfitting andspeed up training

3 Experimental Results

31PerformanceEvaluation To estimate the performance ofheartbeat classification the performance of the model isusually evaluated with accuracy specificity and sensitivity[26ndash28] 1ey are defined as follows

sensitivity TP

TP + FNtimes 100

specificity TN

TN + FPtimes 100

accuracy TN + TP

TN + FP + FN + TPtimes 100

(3)

where TP denotes the number of correctly classified AFsignals FP denotes the number of incorrectly classified AFsignals TN is the number of correctly classified N signalsand FN is the number of misclassified N signals 1e resultsof the experimental study are presented in the next section

32 Implementation Details and Results 1e experimentherein uses the TensorFlow neural network frameworkBefore the experiment started the data labels were convertedinto corresponding one-hot vectors1e experiment is basedon an equal number of AF records and normal records fortraining and testing and the signal processing of the datasetis random During the experiment parameter optimizationwas performed the batch size was set to 128 the learningrate was 001 multiple iteration training was performed andthe Adam updater was used to update the weights to obtainthe best classification results Table 1 lists the relevant pa-rameters of the experimental network

Convolutional layer

Pooling layer

Pooling layerPooling layer

Fully connected layer

Input Output

Figure 3 CNN structure

4 Discrete Dynamics in Nature and Society

Figure 7 shows the loss and accuracy curves of the CNN-LSTM model It indicates performance change in thetraining set as the number of iterations increases 1enetwork continues to converge and the model does notappear to be overfitting

Figure 8 shows the receiver operating characteristiccurve (ROC) curve of the test set 1e abscissa of the curve isthe false positive rate and the ordinate is the true positiverate AUC denotes the area under the ROC curve 1e AUCrealized by the model was 097 1e closer the AUC value isto 1 the better is the performance of the model

Figure 9 shows the confusionmatrix of the test set whichis used to measure the accuracy of a classifier 1e upper leftcorner is TP the upper right corner is FP the lower left

corner is FN and the lower right corner is FP We canconvert the result of the quantity in the confusionmatrix to aratio between 0 and 1 to facilitate standardizedmeasurements

As mentioned above the CNN-LSTM model achievedan overall classification accuracy of 9728 on the test setwith a sensitivity of 9751 and a specificity of 9706

In this study by combining the deep learning model ofCNN and LSTM ie using CNN and LSTM to extract thecharacteristics of the ECG the model can automaticallyextract features and achieve higher accuracy

Table 2 shows a series of scientific studies based on ECGsignals in theMIT-BIHAF database It mainly includes threeevaluation indices accuracy sensitivity and specificity

X

X

X

σσ σtanh

tanh

Ctndash1

htndash1

ht

Ct

ht

+

Xt

ft it Otjt

Figure 5 LSTM hidden layer structure diagram

Input layer

Convolutional layer

Pooling layer

Figure 4 One-dimensional convolutional neural network structure

Discrete Dynamics in Nature and Society 5

Input ECG data points

ECG signals

1st convolution layer

2nd pooling layer

2nd convolution layer

1st pooling layer

LSTM layer

Fully connected layer

Somax

CNN layer

LSTM layer

Figure 6 CNN-LSTM network structure

Table 1 1e parameters of the model

Network layer type Kernel size StridesInput layer mdash mdashCon1d 17 1Pooling1d 5 5Con2d 7 1Pooling2d 5 5LSTM mdash mdashFully connected layer mdash mdashSoftmax mdash mdash

10

08

06

04

02

Num

eric

al v

alue

0 10000 20000 30000 40000 50000 60000Iteration

Loss and accuracy curves of CNN-LSTM model

LossAccuracy

Figure 7 Loss and accuracy curves

6 Discrete Dynamics in Nature and Society

1rough a comparison we can observe that out proposedCNN-LSTM network model has improved on the inputsignal of the model and network structure compared withother deep learning methods and achieved good results

4 Conclusion

In this study we conducted an in-depth study of the ECGclassification algorithm and constructed a network

10

08

06

04

02

00

True

pos

itive

rate

ROC

00 02 04 06 08 10False positive rate

AUC = 097

Figure 8 ROC curves

4859

4862

146

133

4500

4000

3500

NAF

AF

N

3000

2500

2000

1500

1000

500

Figure 9 Confusion matrix of test set

Table 2 Comparison with previous work on the MIT-BIH AF database

Author Database Features Classifier Accuracy () Sensitivity () Specificity ()Xu etal [15] AFDB MESWT CNN 8585 7905 8999Wei etal [14] AFDB RCN CNN 9459 9428 9491

Andersen etal [11]AFDB

RRI LSTM+CNN 874 986 864MITDBNSRDB

Dang etal [17] AFDB RR CNN-BLSTM 9659 9993 9703P-QRS-T CNN-LSTM 9407 9425 9273

Proposed model AFDB Deep features CNN-LSTM 9721 9734 9708

Discrete Dynamics in Nature and Society 7

combining CNN and LSTM 1is network can extract thecharacteristics of ECG signals and classify them Comparedwith traditional ECG classification methods our proposedCNN-LSTM network structure used the MIT-BIH AF da-tabase and achieved a high classification accuracy 1e ex-perimental results confirm that our proposed CNN-LSTMnetwork is effective for the automatic detection and clas-sification of AF In addition this method occupies fewercomputing resources and can theoretically achieve real-timeperformance thereby contributing to the development ofwearable ECG detection devices Our future research mayinvolve the use of a model that classifies AF tasks undernonfixed scale inputs to achieve further optimization of theneural network

Data Availability

1e data used to support the findings of this study have notbeen made available because the data also form part of anongoing study1e original data of the study can be obtainedat httpsphysionetorg

Conflicts of Interest

1e authors declare that they have no conflicts of interest

Acknowledgments

1is study was supported by the Shandong UniversityUndergraduate Teaching Reform Research Project (approvalnumber M2018X078) and the Shandong Province GraduateEducation Quality Improvement Program 2018 (approvalnumber SDYAL18088) 1is study was also partially sup-ported by the Major Science and Technology InnovationProjects of Shandong Province (grant no 2019JZZY010731)

References

[1] H Wang N Mohsen A Christine et al ldquoGlobal regionaland national life expectancy all-cause mortality and cause-specifc mortality for 249 causes of death 1980ndash2015 a Sys-tematic Analysis for the Global Burden of Disease Study2015rdquo 8e Lancet vol 388 no 10053 pp 1459ndash1544 2016

[2] C R C Wyndham ldquoAtrial fibrillation the most commonarrhythmiardquo Texas Heart Institute Journal vol 27 no 3pp 257ndash267 2000

[3] C-H Chen F Song F-J Hwang and L Wu ldquoA probabilitydensity function generator based on neural networksrdquoPhysica A Statistical Mechanics and Its Applications vol 541Article ID 123344 (2020)

[4] V Markides and R J Schilling ldquoAtrial fibrillation classifi-cation pathophysiology mechanisms and drug treatmentrdquoHeart vol 89 no 8 pp 939ndash943 2003

[5] L Mainardi Sornmo and S Cerutti Understanding AtrialFibrillation 8e Signal Processing Contribution MorganClaypool Publishers San Rafael CA USA 2008

[6] E J Benjamin P A Wolf R B DrsquoAgostino H SilbershatzW B Kannel and D Levy ldquoImpact of atrial fibrillation on therisk of deathrdquo Circulation vol 98 no 10 pp 946ndash952 1998

[7] C-H Chen ldquoA cell probe-based method for vehicle speedestimationrdquo IEICE Transactions on Fundamentals of

Electronics Communications and Computer Sciencesvol E103A no 1 pp 265ndash267 2020

[8] C-H Chen F-J Hwang and H-Y Kung ldquoTravel timeprediction system based on data clustering for waste collec-tion vehiclesrdquo IEICE Transactions on Information and Sys-tems vol E102D no 7 pp 1374ndash1383 2019

[9] J R Mehall R M Kohut Jr E W SchneebergerW H Merrill and R K Wolf ldquoAbsence of correlation be-tween symptoms and rhythm in ldquoSymptomaticrdquo atrial fi-brillationrdquo 8e Annals of 8oracic Surgery vol 83 no 6pp 2118ndash2121 2007

[10] S George I Rodriguez D Ipe P T Sager I Gussak andB Vajdic ldquoComputerized extraction of electrocardiogramsfrom continuous 12- lead holter recordings reduces mea-surement variability in a thorough QT studyrdquo 8e Journal ofClinical Pharmacology vol 52 no 12 pp 1891ndash1900 2012

[11] R S Andersen A Peimankar and S Puthusserypady ldquoAdeep learning approach for real-time detection of atrial fi-brillationrdquo Expert Systems with Applications vol 115pp 465ndash473 2019

[12] S Asgari A Mehrnia and M Moussavi ldquoAutomatic detec-tion of atrial fibrillation using stationary wavelet transformand support vector machinerdquo Computers in Biology andMedicine vol 60 pp 132ndash142 2015

[13] Z Yao Z Zhu and Y Chen ldquoAtrial fibrillation detection bymulti-scale convolutional neural networksrdquo in Proceedings ofthe 2017 International Conference on Information FusionIEEE Xirsquoan China July 2017

[14] X Xu S Wei C Ma K Luo L Zhang and C Liu ldquoAtrialfibrillation beat identification using the combination of mod-ified frequency slice wavelet transform and convolutionalneural networksrdquo Journal of Healthcare Engineering vol 2018Article ID 2102918 8 pages 2018

[15] X J Wei C Zhang M Liu et al ldquoAtrial fibrillation detectionby the combination of recurrence complex network andconvolution neural networkrdquo Journal of Probability andStatistics vol 2019 Article ID 8057820 9 pages 2019

[16] B Pourbabaee M J Roshtkhari and K Khorasani ldquoDeepconvolutional neural networks and learning ECG features forscreening paroxysmal atrial fibrillation patientsrdquo IEEETransactions on Systems Man and Cybernetics Systemsvol 48 no 12 pp 2095ndash2104 2018

[17] H Dang ldquoA novel deep arrhythmia-diagnosis network foratrial fibrillation classification using electrocardiogram sig-nalsrdquo IEEE Access vol 7 pp 2169ndash3536 2019

[18] A L Goldberger L A N Amaral L Glass et al ldquoPhysioBankPhysioToolkit and PhysioNetrdquo Circulation vol 101 no 23pp e215ndashe220 2000

[19] G Moody ldquoA new method for detecting atrial fibrillationusing rr intervalsrdquo Computers in Cardiology vol 10pp 227ndash230 1983

[20] W DeMulder S Bethard andM-F Moens ldquoA survey on theapplication of recurrent neural networks to statistical lan-guage modelingrdquo Computer Speech amp Language vol 30 no 1pp 61ndash98 2015

[21] H Palangi L Deng Y Shen et al ldquoDeep sentence embeddingusing long short-term memory networks analysis and ap-plication to information retrievalrdquo IEEEACM Transactionson Audio Speech and Language Processing vol 24 no 4pp 694ndash707 2016

[22] O Faust A Shenfield M Kareem T R San H Fujita andU R Acharya ldquoAutomated detection of atrial fibrillationusing long short-term memory network with RR interval

8 Discrete Dynamics in Nature and Society

signalsrdquo Computers in Biology and Medicine vol 102pp 327ndash335 2018

[23] P Cao X Li K Mao et al ldquoA novel data augmentationmethod to enhance deep neural networks for detection ofatrial fibrillationrdquo Biomedical Signal Processing and Controlvol 56 Article ID 101675 2020

[24] J Lu L A Hendricks M Rohrbach et al ldquoLong-term re-current convolutional networks for visual recognition anddescriptionrdquo IEEE Transactions on Pattern Analysis MachineIntelligence vol 39 no 4 pp 677ndash691 2017

[25] W-P XiongT-C Li et al ldquoResearch on partial least squaresmethod based on deep confidence network in traditionalchinese medicinerdquo Discrete Dynamics in Nature and Societyvol 2020 Article ID 4142824 10 pages 2020

[26] F Ma J Zhang W Liang et al ldquoAutomated classification ofatrial fibrillation using artificial neural network for wearabledevicesrdquo Mathematical Problems in Engineering vol 2020Article ID 9159158 6 pages 2020

[27] C ZhangJ He et al ldquoA crash severity prediction methodbased on improved neural network and factor AnalysisrdquoDiscrete Dynamics in Nature and Society vol 2020 Article ID4013185 13 pages 2020

[28] D M W Powers ldquoEvaluation from precision recall andffactor to roc informedness markedness correlationrdquo Journalof Machine Learning Technologies vol 2 pp 37ndash63 2011

Discrete Dynamics in Nature and Society 9

Page 5: AnAutomaticSystemforAtrialFibrillationbyUsinga CNN-LSTMModeldownloads.hindawi.com/journals/ddns/2020/3198783.pdf · CNN layer LSTM layer Figure 6:CNN-LSTMnetworkstructure. Table 1:eparametersofthemodel.

Figure 7 shows the loss and accuracy curves of the CNN-LSTM model It indicates performance change in thetraining set as the number of iterations increases 1enetwork continues to converge and the model does notappear to be overfitting

Figure 8 shows the receiver operating characteristiccurve (ROC) curve of the test set 1e abscissa of the curve isthe false positive rate and the ordinate is the true positiverate AUC denotes the area under the ROC curve 1e AUCrealized by the model was 097 1e closer the AUC value isto 1 the better is the performance of the model

Figure 9 shows the confusionmatrix of the test set whichis used to measure the accuracy of a classifier 1e upper leftcorner is TP the upper right corner is FP the lower left

corner is FN and the lower right corner is FP We canconvert the result of the quantity in the confusionmatrix to aratio between 0 and 1 to facilitate standardizedmeasurements

As mentioned above the CNN-LSTM model achievedan overall classification accuracy of 9728 on the test setwith a sensitivity of 9751 and a specificity of 9706

In this study by combining the deep learning model ofCNN and LSTM ie using CNN and LSTM to extract thecharacteristics of the ECG the model can automaticallyextract features and achieve higher accuracy

Table 2 shows a series of scientific studies based on ECGsignals in theMIT-BIHAF database It mainly includes threeevaluation indices accuracy sensitivity and specificity

X

X

X

σσ σtanh

tanh

Ctndash1

htndash1

ht

Ct

ht

+

Xt

ft it Otjt

Figure 5 LSTM hidden layer structure diagram

Input layer

Convolutional layer

Pooling layer

Figure 4 One-dimensional convolutional neural network structure

Discrete Dynamics in Nature and Society 5

Input ECG data points

ECG signals

1st convolution layer

2nd pooling layer

2nd convolution layer

1st pooling layer

LSTM layer

Fully connected layer

Somax

CNN layer

LSTM layer

Figure 6 CNN-LSTM network structure

Table 1 1e parameters of the model

Network layer type Kernel size StridesInput layer mdash mdashCon1d 17 1Pooling1d 5 5Con2d 7 1Pooling2d 5 5LSTM mdash mdashFully connected layer mdash mdashSoftmax mdash mdash

10

08

06

04

02

Num

eric

al v

alue

0 10000 20000 30000 40000 50000 60000Iteration

Loss and accuracy curves of CNN-LSTM model

LossAccuracy

Figure 7 Loss and accuracy curves

6 Discrete Dynamics in Nature and Society

1rough a comparison we can observe that out proposedCNN-LSTM network model has improved on the inputsignal of the model and network structure compared withother deep learning methods and achieved good results

4 Conclusion

In this study we conducted an in-depth study of the ECGclassification algorithm and constructed a network

10

08

06

04

02

00

True

pos

itive

rate

ROC

00 02 04 06 08 10False positive rate

AUC = 097

Figure 8 ROC curves

4859

4862

146

133

4500

4000

3500

NAF

AF

N

3000

2500

2000

1500

1000

500

Figure 9 Confusion matrix of test set

Table 2 Comparison with previous work on the MIT-BIH AF database

Author Database Features Classifier Accuracy () Sensitivity () Specificity ()Xu etal [15] AFDB MESWT CNN 8585 7905 8999Wei etal [14] AFDB RCN CNN 9459 9428 9491

Andersen etal [11]AFDB

RRI LSTM+CNN 874 986 864MITDBNSRDB

Dang etal [17] AFDB RR CNN-BLSTM 9659 9993 9703P-QRS-T CNN-LSTM 9407 9425 9273

Proposed model AFDB Deep features CNN-LSTM 9721 9734 9708

Discrete Dynamics in Nature and Society 7

combining CNN and LSTM 1is network can extract thecharacteristics of ECG signals and classify them Comparedwith traditional ECG classification methods our proposedCNN-LSTM network structure used the MIT-BIH AF da-tabase and achieved a high classification accuracy 1e ex-perimental results confirm that our proposed CNN-LSTMnetwork is effective for the automatic detection and clas-sification of AF In addition this method occupies fewercomputing resources and can theoretically achieve real-timeperformance thereby contributing to the development ofwearable ECG detection devices Our future research mayinvolve the use of a model that classifies AF tasks undernonfixed scale inputs to achieve further optimization of theneural network

Data Availability

1e data used to support the findings of this study have notbeen made available because the data also form part of anongoing study1e original data of the study can be obtainedat httpsphysionetorg

Conflicts of Interest

1e authors declare that they have no conflicts of interest

Acknowledgments

1is study was supported by the Shandong UniversityUndergraduate Teaching Reform Research Project (approvalnumber M2018X078) and the Shandong Province GraduateEducation Quality Improvement Program 2018 (approvalnumber SDYAL18088) 1is study was also partially sup-ported by the Major Science and Technology InnovationProjects of Shandong Province (grant no 2019JZZY010731)

References

[1] H Wang N Mohsen A Christine et al ldquoGlobal regionaland national life expectancy all-cause mortality and cause-specifc mortality for 249 causes of death 1980ndash2015 a Sys-tematic Analysis for the Global Burden of Disease Study2015rdquo 8e Lancet vol 388 no 10053 pp 1459ndash1544 2016

[2] C R C Wyndham ldquoAtrial fibrillation the most commonarrhythmiardquo Texas Heart Institute Journal vol 27 no 3pp 257ndash267 2000

[3] C-H Chen F Song F-J Hwang and L Wu ldquoA probabilitydensity function generator based on neural networksrdquoPhysica A Statistical Mechanics and Its Applications vol 541Article ID 123344 (2020)

[4] V Markides and R J Schilling ldquoAtrial fibrillation classifi-cation pathophysiology mechanisms and drug treatmentrdquoHeart vol 89 no 8 pp 939ndash943 2003

[5] L Mainardi Sornmo and S Cerutti Understanding AtrialFibrillation 8e Signal Processing Contribution MorganClaypool Publishers San Rafael CA USA 2008

[6] E J Benjamin P A Wolf R B DrsquoAgostino H SilbershatzW B Kannel and D Levy ldquoImpact of atrial fibrillation on therisk of deathrdquo Circulation vol 98 no 10 pp 946ndash952 1998

[7] C-H Chen ldquoA cell probe-based method for vehicle speedestimationrdquo IEICE Transactions on Fundamentals of

Electronics Communications and Computer Sciencesvol E103A no 1 pp 265ndash267 2020

[8] C-H Chen F-J Hwang and H-Y Kung ldquoTravel timeprediction system based on data clustering for waste collec-tion vehiclesrdquo IEICE Transactions on Information and Sys-tems vol E102D no 7 pp 1374ndash1383 2019

[9] J R Mehall R M Kohut Jr E W SchneebergerW H Merrill and R K Wolf ldquoAbsence of correlation be-tween symptoms and rhythm in ldquoSymptomaticrdquo atrial fi-brillationrdquo 8e Annals of 8oracic Surgery vol 83 no 6pp 2118ndash2121 2007

[10] S George I Rodriguez D Ipe P T Sager I Gussak andB Vajdic ldquoComputerized extraction of electrocardiogramsfrom continuous 12- lead holter recordings reduces mea-surement variability in a thorough QT studyrdquo 8e Journal ofClinical Pharmacology vol 52 no 12 pp 1891ndash1900 2012

[11] R S Andersen A Peimankar and S Puthusserypady ldquoAdeep learning approach for real-time detection of atrial fi-brillationrdquo Expert Systems with Applications vol 115pp 465ndash473 2019

[12] S Asgari A Mehrnia and M Moussavi ldquoAutomatic detec-tion of atrial fibrillation using stationary wavelet transformand support vector machinerdquo Computers in Biology andMedicine vol 60 pp 132ndash142 2015

[13] Z Yao Z Zhu and Y Chen ldquoAtrial fibrillation detection bymulti-scale convolutional neural networksrdquo in Proceedings ofthe 2017 International Conference on Information FusionIEEE Xirsquoan China July 2017

[14] X Xu S Wei C Ma K Luo L Zhang and C Liu ldquoAtrialfibrillation beat identification using the combination of mod-ified frequency slice wavelet transform and convolutionalneural networksrdquo Journal of Healthcare Engineering vol 2018Article ID 2102918 8 pages 2018

[15] X J Wei C Zhang M Liu et al ldquoAtrial fibrillation detectionby the combination of recurrence complex network andconvolution neural networkrdquo Journal of Probability andStatistics vol 2019 Article ID 8057820 9 pages 2019

[16] B Pourbabaee M J Roshtkhari and K Khorasani ldquoDeepconvolutional neural networks and learning ECG features forscreening paroxysmal atrial fibrillation patientsrdquo IEEETransactions on Systems Man and Cybernetics Systemsvol 48 no 12 pp 2095ndash2104 2018

[17] H Dang ldquoA novel deep arrhythmia-diagnosis network foratrial fibrillation classification using electrocardiogram sig-nalsrdquo IEEE Access vol 7 pp 2169ndash3536 2019

[18] A L Goldberger L A N Amaral L Glass et al ldquoPhysioBankPhysioToolkit and PhysioNetrdquo Circulation vol 101 no 23pp e215ndashe220 2000

[19] G Moody ldquoA new method for detecting atrial fibrillationusing rr intervalsrdquo Computers in Cardiology vol 10pp 227ndash230 1983

[20] W DeMulder S Bethard andM-F Moens ldquoA survey on theapplication of recurrent neural networks to statistical lan-guage modelingrdquo Computer Speech amp Language vol 30 no 1pp 61ndash98 2015

[21] H Palangi L Deng Y Shen et al ldquoDeep sentence embeddingusing long short-term memory networks analysis and ap-plication to information retrievalrdquo IEEEACM Transactionson Audio Speech and Language Processing vol 24 no 4pp 694ndash707 2016

[22] O Faust A Shenfield M Kareem T R San H Fujita andU R Acharya ldquoAutomated detection of atrial fibrillationusing long short-term memory network with RR interval

8 Discrete Dynamics in Nature and Society

signalsrdquo Computers in Biology and Medicine vol 102pp 327ndash335 2018

[23] P Cao X Li K Mao et al ldquoA novel data augmentationmethod to enhance deep neural networks for detection ofatrial fibrillationrdquo Biomedical Signal Processing and Controlvol 56 Article ID 101675 2020

[24] J Lu L A Hendricks M Rohrbach et al ldquoLong-term re-current convolutional networks for visual recognition anddescriptionrdquo IEEE Transactions on Pattern Analysis MachineIntelligence vol 39 no 4 pp 677ndash691 2017

[25] W-P XiongT-C Li et al ldquoResearch on partial least squaresmethod based on deep confidence network in traditionalchinese medicinerdquo Discrete Dynamics in Nature and Societyvol 2020 Article ID 4142824 10 pages 2020

[26] F Ma J Zhang W Liang et al ldquoAutomated classification ofatrial fibrillation using artificial neural network for wearabledevicesrdquo Mathematical Problems in Engineering vol 2020Article ID 9159158 6 pages 2020

[27] C ZhangJ He et al ldquoA crash severity prediction methodbased on improved neural network and factor AnalysisrdquoDiscrete Dynamics in Nature and Society vol 2020 Article ID4013185 13 pages 2020

[28] D M W Powers ldquoEvaluation from precision recall andffactor to roc informedness markedness correlationrdquo Journalof Machine Learning Technologies vol 2 pp 37ndash63 2011

Discrete Dynamics in Nature and Society 9

Page 6: AnAutomaticSystemforAtrialFibrillationbyUsinga CNN-LSTMModeldownloads.hindawi.com/journals/ddns/2020/3198783.pdf · CNN layer LSTM layer Figure 6:CNN-LSTMnetworkstructure. Table 1:eparametersofthemodel.

Input ECG data points

ECG signals

1st convolution layer

2nd pooling layer

2nd convolution layer

1st pooling layer

LSTM layer

Fully connected layer

Somax

CNN layer

LSTM layer

Figure 6 CNN-LSTM network structure

Table 1 1e parameters of the model

Network layer type Kernel size StridesInput layer mdash mdashCon1d 17 1Pooling1d 5 5Con2d 7 1Pooling2d 5 5LSTM mdash mdashFully connected layer mdash mdashSoftmax mdash mdash

10

08

06

04

02

Num

eric

al v

alue

0 10000 20000 30000 40000 50000 60000Iteration

Loss and accuracy curves of CNN-LSTM model

LossAccuracy

Figure 7 Loss and accuracy curves

6 Discrete Dynamics in Nature and Society

1rough a comparison we can observe that out proposedCNN-LSTM network model has improved on the inputsignal of the model and network structure compared withother deep learning methods and achieved good results

4 Conclusion

In this study we conducted an in-depth study of the ECGclassification algorithm and constructed a network

10

08

06

04

02

00

True

pos

itive

rate

ROC

00 02 04 06 08 10False positive rate

AUC = 097

Figure 8 ROC curves

4859

4862

146

133

4500

4000

3500

NAF

AF

N

3000

2500

2000

1500

1000

500

Figure 9 Confusion matrix of test set

Table 2 Comparison with previous work on the MIT-BIH AF database

Author Database Features Classifier Accuracy () Sensitivity () Specificity ()Xu etal [15] AFDB MESWT CNN 8585 7905 8999Wei etal [14] AFDB RCN CNN 9459 9428 9491

Andersen etal [11]AFDB

RRI LSTM+CNN 874 986 864MITDBNSRDB

Dang etal [17] AFDB RR CNN-BLSTM 9659 9993 9703P-QRS-T CNN-LSTM 9407 9425 9273

Proposed model AFDB Deep features CNN-LSTM 9721 9734 9708

Discrete Dynamics in Nature and Society 7

combining CNN and LSTM 1is network can extract thecharacteristics of ECG signals and classify them Comparedwith traditional ECG classification methods our proposedCNN-LSTM network structure used the MIT-BIH AF da-tabase and achieved a high classification accuracy 1e ex-perimental results confirm that our proposed CNN-LSTMnetwork is effective for the automatic detection and clas-sification of AF In addition this method occupies fewercomputing resources and can theoretically achieve real-timeperformance thereby contributing to the development ofwearable ECG detection devices Our future research mayinvolve the use of a model that classifies AF tasks undernonfixed scale inputs to achieve further optimization of theneural network

Data Availability

1e data used to support the findings of this study have notbeen made available because the data also form part of anongoing study1e original data of the study can be obtainedat httpsphysionetorg

Conflicts of Interest

1e authors declare that they have no conflicts of interest

Acknowledgments

1is study was supported by the Shandong UniversityUndergraduate Teaching Reform Research Project (approvalnumber M2018X078) and the Shandong Province GraduateEducation Quality Improvement Program 2018 (approvalnumber SDYAL18088) 1is study was also partially sup-ported by the Major Science and Technology InnovationProjects of Shandong Province (grant no 2019JZZY010731)

References

[1] H Wang N Mohsen A Christine et al ldquoGlobal regionaland national life expectancy all-cause mortality and cause-specifc mortality for 249 causes of death 1980ndash2015 a Sys-tematic Analysis for the Global Burden of Disease Study2015rdquo 8e Lancet vol 388 no 10053 pp 1459ndash1544 2016

[2] C R C Wyndham ldquoAtrial fibrillation the most commonarrhythmiardquo Texas Heart Institute Journal vol 27 no 3pp 257ndash267 2000

[3] C-H Chen F Song F-J Hwang and L Wu ldquoA probabilitydensity function generator based on neural networksrdquoPhysica A Statistical Mechanics and Its Applications vol 541Article ID 123344 (2020)

[4] V Markides and R J Schilling ldquoAtrial fibrillation classifi-cation pathophysiology mechanisms and drug treatmentrdquoHeart vol 89 no 8 pp 939ndash943 2003

[5] L Mainardi Sornmo and S Cerutti Understanding AtrialFibrillation 8e Signal Processing Contribution MorganClaypool Publishers San Rafael CA USA 2008

[6] E J Benjamin P A Wolf R B DrsquoAgostino H SilbershatzW B Kannel and D Levy ldquoImpact of atrial fibrillation on therisk of deathrdquo Circulation vol 98 no 10 pp 946ndash952 1998

[7] C-H Chen ldquoA cell probe-based method for vehicle speedestimationrdquo IEICE Transactions on Fundamentals of

Electronics Communications and Computer Sciencesvol E103A no 1 pp 265ndash267 2020

[8] C-H Chen F-J Hwang and H-Y Kung ldquoTravel timeprediction system based on data clustering for waste collec-tion vehiclesrdquo IEICE Transactions on Information and Sys-tems vol E102D no 7 pp 1374ndash1383 2019

[9] J R Mehall R M Kohut Jr E W SchneebergerW H Merrill and R K Wolf ldquoAbsence of correlation be-tween symptoms and rhythm in ldquoSymptomaticrdquo atrial fi-brillationrdquo 8e Annals of 8oracic Surgery vol 83 no 6pp 2118ndash2121 2007

[10] S George I Rodriguez D Ipe P T Sager I Gussak andB Vajdic ldquoComputerized extraction of electrocardiogramsfrom continuous 12- lead holter recordings reduces mea-surement variability in a thorough QT studyrdquo 8e Journal ofClinical Pharmacology vol 52 no 12 pp 1891ndash1900 2012

[11] R S Andersen A Peimankar and S Puthusserypady ldquoAdeep learning approach for real-time detection of atrial fi-brillationrdquo Expert Systems with Applications vol 115pp 465ndash473 2019

[12] S Asgari A Mehrnia and M Moussavi ldquoAutomatic detec-tion of atrial fibrillation using stationary wavelet transformand support vector machinerdquo Computers in Biology andMedicine vol 60 pp 132ndash142 2015

[13] Z Yao Z Zhu and Y Chen ldquoAtrial fibrillation detection bymulti-scale convolutional neural networksrdquo in Proceedings ofthe 2017 International Conference on Information FusionIEEE Xirsquoan China July 2017

[14] X Xu S Wei C Ma K Luo L Zhang and C Liu ldquoAtrialfibrillation beat identification using the combination of mod-ified frequency slice wavelet transform and convolutionalneural networksrdquo Journal of Healthcare Engineering vol 2018Article ID 2102918 8 pages 2018

[15] X J Wei C Zhang M Liu et al ldquoAtrial fibrillation detectionby the combination of recurrence complex network andconvolution neural networkrdquo Journal of Probability andStatistics vol 2019 Article ID 8057820 9 pages 2019

[16] B Pourbabaee M J Roshtkhari and K Khorasani ldquoDeepconvolutional neural networks and learning ECG features forscreening paroxysmal atrial fibrillation patientsrdquo IEEETransactions on Systems Man and Cybernetics Systemsvol 48 no 12 pp 2095ndash2104 2018

[17] H Dang ldquoA novel deep arrhythmia-diagnosis network foratrial fibrillation classification using electrocardiogram sig-nalsrdquo IEEE Access vol 7 pp 2169ndash3536 2019

[18] A L Goldberger L A N Amaral L Glass et al ldquoPhysioBankPhysioToolkit and PhysioNetrdquo Circulation vol 101 no 23pp e215ndashe220 2000

[19] G Moody ldquoA new method for detecting atrial fibrillationusing rr intervalsrdquo Computers in Cardiology vol 10pp 227ndash230 1983

[20] W DeMulder S Bethard andM-F Moens ldquoA survey on theapplication of recurrent neural networks to statistical lan-guage modelingrdquo Computer Speech amp Language vol 30 no 1pp 61ndash98 2015

[21] H Palangi L Deng Y Shen et al ldquoDeep sentence embeddingusing long short-term memory networks analysis and ap-plication to information retrievalrdquo IEEEACM Transactionson Audio Speech and Language Processing vol 24 no 4pp 694ndash707 2016

[22] O Faust A Shenfield M Kareem T R San H Fujita andU R Acharya ldquoAutomated detection of atrial fibrillationusing long short-term memory network with RR interval

8 Discrete Dynamics in Nature and Society

signalsrdquo Computers in Biology and Medicine vol 102pp 327ndash335 2018

[23] P Cao X Li K Mao et al ldquoA novel data augmentationmethod to enhance deep neural networks for detection ofatrial fibrillationrdquo Biomedical Signal Processing and Controlvol 56 Article ID 101675 2020

[24] J Lu L A Hendricks M Rohrbach et al ldquoLong-term re-current convolutional networks for visual recognition anddescriptionrdquo IEEE Transactions on Pattern Analysis MachineIntelligence vol 39 no 4 pp 677ndash691 2017

[25] W-P XiongT-C Li et al ldquoResearch on partial least squaresmethod based on deep confidence network in traditionalchinese medicinerdquo Discrete Dynamics in Nature and Societyvol 2020 Article ID 4142824 10 pages 2020

[26] F Ma J Zhang W Liang et al ldquoAutomated classification ofatrial fibrillation using artificial neural network for wearabledevicesrdquo Mathematical Problems in Engineering vol 2020Article ID 9159158 6 pages 2020

[27] C ZhangJ He et al ldquoA crash severity prediction methodbased on improved neural network and factor AnalysisrdquoDiscrete Dynamics in Nature and Society vol 2020 Article ID4013185 13 pages 2020

[28] D M W Powers ldquoEvaluation from precision recall andffactor to roc informedness markedness correlationrdquo Journalof Machine Learning Technologies vol 2 pp 37ndash63 2011

Discrete Dynamics in Nature and Society 9

Page 7: AnAutomaticSystemforAtrialFibrillationbyUsinga CNN-LSTMModeldownloads.hindawi.com/journals/ddns/2020/3198783.pdf · CNN layer LSTM layer Figure 6:CNN-LSTMnetworkstructure. Table 1:eparametersofthemodel.

1rough a comparison we can observe that out proposedCNN-LSTM network model has improved on the inputsignal of the model and network structure compared withother deep learning methods and achieved good results

4 Conclusion

In this study we conducted an in-depth study of the ECGclassification algorithm and constructed a network

10

08

06

04

02

00

True

pos

itive

rate

ROC

00 02 04 06 08 10False positive rate

AUC = 097

Figure 8 ROC curves

4859

4862

146

133

4500

4000

3500

NAF

AF

N

3000

2500

2000

1500

1000

500

Figure 9 Confusion matrix of test set

Table 2 Comparison with previous work on the MIT-BIH AF database

Author Database Features Classifier Accuracy () Sensitivity () Specificity ()Xu etal [15] AFDB MESWT CNN 8585 7905 8999Wei etal [14] AFDB RCN CNN 9459 9428 9491

Andersen etal [11]AFDB

RRI LSTM+CNN 874 986 864MITDBNSRDB

Dang etal [17] AFDB RR CNN-BLSTM 9659 9993 9703P-QRS-T CNN-LSTM 9407 9425 9273

Proposed model AFDB Deep features CNN-LSTM 9721 9734 9708

Discrete Dynamics in Nature and Society 7

combining CNN and LSTM 1is network can extract thecharacteristics of ECG signals and classify them Comparedwith traditional ECG classification methods our proposedCNN-LSTM network structure used the MIT-BIH AF da-tabase and achieved a high classification accuracy 1e ex-perimental results confirm that our proposed CNN-LSTMnetwork is effective for the automatic detection and clas-sification of AF In addition this method occupies fewercomputing resources and can theoretically achieve real-timeperformance thereby contributing to the development ofwearable ECG detection devices Our future research mayinvolve the use of a model that classifies AF tasks undernonfixed scale inputs to achieve further optimization of theneural network

Data Availability

1e data used to support the findings of this study have notbeen made available because the data also form part of anongoing study1e original data of the study can be obtainedat httpsphysionetorg

Conflicts of Interest

1e authors declare that they have no conflicts of interest

Acknowledgments

1is study was supported by the Shandong UniversityUndergraduate Teaching Reform Research Project (approvalnumber M2018X078) and the Shandong Province GraduateEducation Quality Improvement Program 2018 (approvalnumber SDYAL18088) 1is study was also partially sup-ported by the Major Science and Technology InnovationProjects of Shandong Province (grant no 2019JZZY010731)

References

[1] H Wang N Mohsen A Christine et al ldquoGlobal regionaland national life expectancy all-cause mortality and cause-specifc mortality for 249 causes of death 1980ndash2015 a Sys-tematic Analysis for the Global Burden of Disease Study2015rdquo 8e Lancet vol 388 no 10053 pp 1459ndash1544 2016

[2] C R C Wyndham ldquoAtrial fibrillation the most commonarrhythmiardquo Texas Heart Institute Journal vol 27 no 3pp 257ndash267 2000

[3] C-H Chen F Song F-J Hwang and L Wu ldquoA probabilitydensity function generator based on neural networksrdquoPhysica A Statistical Mechanics and Its Applications vol 541Article ID 123344 (2020)

[4] V Markides and R J Schilling ldquoAtrial fibrillation classifi-cation pathophysiology mechanisms and drug treatmentrdquoHeart vol 89 no 8 pp 939ndash943 2003

[5] L Mainardi Sornmo and S Cerutti Understanding AtrialFibrillation 8e Signal Processing Contribution MorganClaypool Publishers San Rafael CA USA 2008

[6] E J Benjamin P A Wolf R B DrsquoAgostino H SilbershatzW B Kannel and D Levy ldquoImpact of atrial fibrillation on therisk of deathrdquo Circulation vol 98 no 10 pp 946ndash952 1998

[7] C-H Chen ldquoA cell probe-based method for vehicle speedestimationrdquo IEICE Transactions on Fundamentals of

Electronics Communications and Computer Sciencesvol E103A no 1 pp 265ndash267 2020

[8] C-H Chen F-J Hwang and H-Y Kung ldquoTravel timeprediction system based on data clustering for waste collec-tion vehiclesrdquo IEICE Transactions on Information and Sys-tems vol E102D no 7 pp 1374ndash1383 2019

[9] J R Mehall R M Kohut Jr E W SchneebergerW H Merrill and R K Wolf ldquoAbsence of correlation be-tween symptoms and rhythm in ldquoSymptomaticrdquo atrial fi-brillationrdquo 8e Annals of 8oracic Surgery vol 83 no 6pp 2118ndash2121 2007

[10] S George I Rodriguez D Ipe P T Sager I Gussak andB Vajdic ldquoComputerized extraction of electrocardiogramsfrom continuous 12- lead holter recordings reduces mea-surement variability in a thorough QT studyrdquo 8e Journal ofClinical Pharmacology vol 52 no 12 pp 1891ndash1900 2012

[11] R S Andersen A Peimankar and S Puthusserypady ldquoAdeep learning approach for real-time detection of atrial fi-brillationrdquo Expert Systems with Applications vol 115pp 465ndash473 2019

[12] S Asgari A Mehrnia and M Moussavi ldquoAutomatic detec-tion of atrial fibrillation using stationary wavelet transformand support vector machinerdquo Computers in Biology andMedicine vol 60 pp 132ndash142 2015

[13] Z Yao Z Zhu and Y Chen ldquoAtrial fibrillation detection bymulti-scale convolutional neural networksrdquo in Proceedings ofthe 2017 International Conference on Information FusionIEEE Xirsquoan China July 2017

[14] X Xu S Wei C Ma K Luo L Zhang and C Liu ldquoAtrialfibrillation beat identification using the combination of mod-ified frequency slice wavelet transform and convolutionalneural networksrdquo Journal of Healthcare Engineering vol 2018Article ID 2102918 8 pages 2018

[15] X J Wei C Zhang M Liu et al ldquoAtrial fibrillation detectionby the combination of recurrence complex network andconvolution neural networkrdquo Journal of Probability andStatistics vol 2019 Article ID 8057820 9 pages 2019

[16] B Pourbabaee M J Roshtkhari and K Khorasani ldquoDeepconvolutional neural networks and learning ECG features forscreening paroxysmal atrial fibrillation patientsrdquo IEEETransactions on Systems Man and Cybernetics Systemsvol 48 no 12 pp 2095ndash2104 2018

[17] H Dang ldquoA novel deep arrhythmia-diagnosis network foratrial fibrillation classification using electrocardiogram sig-nalsrdquo IEEE Access vol 7 pp 2169ndash3536 2019

[18] A L Goldberger L A N Amaral L Glass et al ldquoPhysioBankPhysioToolkit and PhysioNetrdquo Circulation vol 101 no 23pp e215ndashe220 2000

[19] G Moody ldquoA new method for detecting atrial fibrillationusing rr intervalsrdquo Computers in Cardiology vol 10pp 227ndash230 1983

[20] W DeMulder S Bethard andM-F Moens ldquoA survey on theapplication of recurrent neural networks to statistical lan-guage modelingrdquo Computer Speech amp Language vol 30 no 1pp 61ndash98 2015

[21] H Palangi L Deng Y Shen et al ldquoDeep sentence embeddingusing long short-term memory networks analysis and ap-plication to information retrievalrdquo IEEEACM Transactionson Audio Speech and Language Processing vol 24 no 4pp 694ndash707 2016

[22] O Faust A Shenfield M Kareem T R San H Fujita andU R Acharya ldquoAutomated detection of atrial fibrillationusing long short-term memory network with RR interval

8 Discrete Dynamics in Nature and Society

signalsrdquo Computers in Biology and Medicine vol 102pp 327ndash335 2018

[23] P Cao X Li K Mao et al ldquoA novel data augmentationmethod to enhance deep neural networks for detection ofatrial fibrillationrdquo Biomedical Signal Processing and Controlvol 56 Article ID 101675 2020

[24] J Lu L A Hendricks M Rohrbach et al ldquoLong-term re-current convolutional networks for visual recognition anddescriptionrdquo IEEE Transactions on Pattern Analysis MachineIntelligence vol 39 no 4 pp 677ndash691 2017

[25] W-P XiongT-C Li et al ldquoResearch on partial least squaresmethod based on deep confidence network in traditionalchinese medicinerdquo Discrete Dynamics in Nature and Societyvol 2020 Article ID 4142824 10 pages 2020

[26] F Ma J Zhang W Liang et al ldquoAutomated classification ofatrial fibrillation using artificial neural network for wearabledevicesrdquo Mathematical Problems in Engineering vol 2020Article ID 9159158 6 pages 2020

[27] C ZhangJ He et al ldquoA crash severity prediction methodbased on improved neural network and factor AnalysisrdquoDiscrete Dynamics in Nature and Society vol 2020 Article ID4013185 13 pages 2020

[28] D M W Powers ldquoEvaluation from precision recall andffactor to roc informedness markedness correlationrdquo Journalof Machine Learning Technologies vol 2 pp 37ndash63 2011

Discrete Dynamics in Nature and Society 9

Page 8: AnAutomaticSystemforAtrialFibrillationbyUsinga CNN-LSTMModeldownloads.hindawi.com/journals/ddns/2020/3198783.pdf · CNN layer LSTM layer Figure 6:CNN-LSTMnetworkstructure. Table 1:eparametersofthemodel.

combining CNN and LSTM 1is network can extract thecharacteristics of ECG signals and classify them Comparedwith traditional ECG classification methods our proposedCNN-LSTM network structure used the MIT-BIH AF da-tabase and achieved a high classification accuracy 1e ex-perimental results confirm that our proposed CNN-LSTMnetwork is effective for the automatic detection and clas-sification of AF In addition this method occupies fewercomputing resources and can theoretically achieve real-timeperformance thereby contributing to the development ofwearable ECG detection devices Our future research mayinvolve the use of a model that classifies AF tasks undernonfixed scale inputs to achieve further optimization of theneural network

Data Availability

1e data used to support the findings of this study have notbeen made available because the data also form part of anongoing study1e original data of the study can be obtainedat httpsphysionetorg

Conflicts of Interest

1e authors declare that they have no conflicts of interest

Acknowledgments

1is study was supported by the Shandong UniversityUndergraduate Teaching Reform Research Project (approvalnumber M2018X078) and the Shandong Province GraduateEducation Quality Improvement Program 2018 (approvalnumber SDYAL18088) 1is study was also partially sup-ported by the Major Science and Technology InnovationProjects of Shandong Province (grant no 2019JZZY010731)

References

[1] H Wang N Mohsen A Christine et al ldquoGlobal regionaland national life expectancy all-cause mortality and cause-specifc mortality for 249 causes of death 1980ndash2015 a Sys-tematic Analysis for the Global Burden of Disease Study2015rdquo 8e Lancet vol 388 no 10053 pp 1459ndash1544 2016

[2] C R C Wyndham ldquoAtrial fibrillation the most commonarrhythmiardquo Texas Heart Institute Journal vol 27 no 3pp 257ndash267 2000

[3] C-H Chen F Song F-J Hwang and L Wu ldquoA probabilitydensity function generator based on neural networksrdquoPhysica A Statistical Mechanics and Its Applications vol 541Article ID 123344 (2020)

[4] V Markides and R J Schilling ldquoAtrial fibrillation classifi-cation pathophysiology mechanisms and drug treatmentrdquoHeart vol 89 no 8 pp 939ndash943 2003

[5] L Mainardi Sornmo and S Cerutti Understanding AtrialFibrillation 8e Signal Processing Contribution MorganClaypool Publishers San Rafael CA USA 2008

[6] E J Benjamin P A Wolf R B DrsquoAgostino H SilbershatzW B Kannel and D Levy ldquoImpact of atrial fibrillation on therisk of deathrdquo Circulation vol 98 no 10 pp 946ndash952 1998

[7] C-H Chen ldquoA cell probe-based method for vehicle speedestimationrdquo IEICE Transactions on Fundamentals of

Electronics Communications and Computer Sciencesvol E103A no 1 pp 265ndash267 2020

[8] C-H Chen F-J Hwang and H-Y Kung ldquoTravel timeprediction system based on data clustering for waste collec-tion vehiclesrdquo IEICE Transactions on Information and Sys-tems vol E102D no 7 pp 1374ndash1383 2019

[9] J R Mehall R M Kohut Jr E W SchneebergerW H Merrill and R K Wolf ldquoAbsence of correlation be-tween symptoms and rhythm in ldquoSymptomaticrdquo atrial fi-brillationrdquo 8e Annals of 8oracic Surgery vol 83 no 6pp 2118ndash2121 2007

[10] S George I Rodriguez D Ipe P T Sager I Gussak andB Vajdic ldquoComputerized extraction of electrocardiogramsfrom continuous 12- lead holter recordings reduces mea-surement variability in a thorough QT studyrdquo 8e Journal ofClinical Pharmacology vol 52 no 12 pp 1891ndash1900 2012

[11] R S Andersen A Peimankar and S Puthusserypady ldquoAdeep learning approach for real-time detection of atrial fi-brillationrdquo Expert Systems with Applications vol 115pp 465ndash473 2019

[12] S Asgari A Mehrnia and M Moussavi ldquoAutomatic detec-tion of atrial fibrillation using stationary wavelet transformand support vector machinerdquo Computers in Biology andMedicine vol 60 pp 132ndash142 2015

[13] Z Yao Z Zhu and Y Chen ldquoAtrial fibrillation detection bymulti-scale convolutional neural networksrdquo in Proceedings ofthe 2017 International Conference on Information FusionIEEE Xirsquoan China July 2017

[14] X Xu S Wei C Ma K Luo L Zhang and C Liu ldquoAtrialfibrillation beat identification using the combination of mod-ified frequency slice wavelet transform and convolutionalneural networksrdquo Journal of Healthcare Engineering vol 2018Article ID 2102918 8 pages 2018

[15] X J Wei C Zhang M Liu et al ldquoAtrial fibrillation detectionby the combination of recurrence complex network andconvolution neural networkrdquo Journal of Probability andStatistics vol 2019 Article ID 8057820 9 pages 2019

[16] B Pourbabaee M J Roshtkhari and K Khorasani ldquoDeepconvolutional neural networks and learning ECG features forscreening paroxysmal atrial fibrillation patientsrdquo IEEETransactions on Systems Man and Cybernetics Systemsvol 48 no 12 pp 2095ndash2104 2018

[17] H Dang ldquoA novel deep arrhythmia-diagnosis network foratrial fibrillation classification using electrocardiogram sig-nalsrdquo IEEE Access vol 7 pp 2169ndash3536 2019

[18] A L Goldberger L A N Amaral L Glass et al ldquoPhysioBankPhysioToolkit and PhysioNetrdquo Circulation vol 101 no 23pp e215ndashe220 2000

[19] G Moody ldquoA new method for detecting atrial fibrillationusing rr intervalsrdquo Computers in Cardiology vol 10pp 227ndash230 1983

[20] W DeMulder S Bethard andM-F Moens ldquoA survey on theapplication of recurrent neural networks to statistical lan-guage modelingrdquo Computer Speech amp Language vol 30 no 1pp 61ndash98 2015

[21] H Palangi L Deng Y Shen et al ldquoDeep sentence embeddingusing long short-term memory networks analysis and ap-plication to information retrievalrdquo IEEEACM Transactionson Audio Speech and Language Processing vol 24 no 4pp 694ndash707 2016

[22] O Faust A Shenfield M Kareem T R San H Fujita andU R Acharya ldquoAutomated detection of atrial fibrillationusing long short-term memory network with RR interval

8 Discrete Dynamics in Nature and Society

signalsrdquo Computers in Biology and Medicine vol 102pp 327ndash335 2018

[23] P Cao X Li K Mao et al ldquoA novel data augmentationmethod to enhance deep neural networks for detection ofatrial fibrillationrdquo Biomedical Signal Processing and Controlvol 56 Article ID 101675 2020

[24] J Lu L A Hendricks M Rohrbach et al ldquoLong-term re-current convolutional networks for visual recognition anddescriptionrdquo IEEE Transactions on Pattern Analysis MachineIntelligence vol 39 no 4 pp 677ndash691 2017

[25] W-P XiongT-C Li et al ldquoResearch on partial least squaresmethod based on deep confidence network in traditionalchinese medicinerdquo Discrete Dynamics in Nature and Societyvol 2020 Article ID 4142824 10 pages 2020

[26] F Ma J Zhang W Liang et al ldquoAutomated classification ofatrial fibrillation using artificial neural network for wearabledevicesrdquo Mathematical Problems in Engineering vol 2020Article ID 9159158 6 pages 2020

[27] C ZhangJ He et al ldquoA crash severity prediction methodbased on improved neural network and factor AnalysisrdquoDiscrete Dynamics in Nature and Society vol 2020 Article ID4013185 13 pages 2020

[28] D M W Powers ldquoEvaluation from precision recall andffactor to roc informedness markedness correlationrdquo Journalof Machine Learning Technologies vol 2 pp 37ndash63 2011

Discrete Dynamics in Nature and Society 9

Page 9: AnAutomaticSystemforAtrialFibrillationbyUsinga CNN-LSTMModeldownloads.hindawi.com/journals/ddns/2020/3198783.pdf · CNN layer LSTM layer Figure 6:CNN-LSTMnetworkstructure. Table 1:eparametersofthemodel.

signalsrdquo Computers in Biology and Medicine vol 102pp 327ndash335 2018

[23] P Cao X Li K Mao et al ldquoA novel data augmentationmethod to enhance deep neural networks for detection ofatrial fibrillationrdquo Biomedical Signal Processing and Controlvol 56 Article ID 101675 2020

[24] J Lu L A Hendricks M Rohrbach et al ldquoLong-term re-current convolutional networks for visual recognition anddescriptionrdquo IEEE Transactions on Pattern Analysis MachineIntelligence vol 39 no 4 pp 677ndash691 2017

[25] W-P XiongT-C Li et al ldquoResearch on partial least squaresmethod based on deep confidence network in traditionalchinese medicinerdquo Discrete Dynamics in Nature and Societyvol 2020 Article ID 4142824 10 pages 2020

[26] F Ma J Zhang W Liang et al ldquoAutomated classification ofatrial fibrillation using artificial neural network for wearabledevicesrdquo Mathematical Problems in Engineering vol 2020Article ID 9159158 6 pages 2020

[27] C ZhangJ He et al ldquoA crash severity prediction methodbased on improved neural network and factor AnalysisrdquoDiscrete Dynamics in Nature and Society vol 2020 Article ID4013185 13 pages 2020

[28] D M W Powers ldquoEvaluation from precision recall andffactor to roc informedness markedness correlationrdquo Journalof Machine Learning Technologies vol 2 pp 37ndash63 2011

Discrete Dynamics in Nature and Society 9