Application of Extension Neural Network Type 2 and Chaos Theory to the Electrocardiogram Recognition System

In this study, we combined the extension neural network type 2 (ENN2) with the chaos theory in the electrocardiogram (ECG) recognition system. The self-developed hardware measurement circuit and LabVIEW human–machine interface were used to measure and capture ECG signals. The master–slave chaos system was adopted to change the stored ECG data into a chaotic dynamic error distribution graph to obtain the chaotic eye coordinates of specific ECG signals. ENN2 was used for recognition. There were 36 research subjects. The first half of the data were measured using the signal capture circuit, while the second half were provided by the medical center of Massachusetts Institute of Technology (MIT). According to the results of analysis, the proposed method has a high accuracy when applied to the classification of ECG recognition, with a recognition rate of up to 89%. Hence, the automatic diagnosis ECG system designed in this study can effectively categorize irregular heart rhythms and reduce the huge labor cost for reading.


Introduction
Increasing attention has been paid to the prevention and diagnosis of heart disease in recent years. A common diagnostic method is using medical devices to obtain the electrocardiogram (ECG) signs of human hearts through noninvasive methods, so as to investigate heart conditions and then detect and diagnose different heart diseases.
In the past several years, many papers have put forward different methods of obtaining the eigenvalue and diagnosing heart diseases, and increasing attention has been paid to the methods of recognizing ECG identities in recent years. Reference 1 proposed to adopt the linear discrimination classification methods to recognize the ECG eigenvalues of ECG patterns and RR interval lengths. After these three kinds of eigenvalue are combined in different ways, the training data are used to develop an eigenvalue combination with the highest efficacy. Then, the test data are adopted to demonstrate the classification system. What is worthy of attention is that most of the methods of obtaining the eigenvalue integrate the RR interval length with other types of eigenvalue, such as the formal eigenvalue based on wavelet transformation, (2,3) the coefficient based on the Hermite function, (4) and the eigenvalue directly obtained from the time and frequency domains of ECG. The classification methods include the linear discrimination classification, (5,6) the support vector machine, (7,8) the artificial neural network (ANN), (9,10) and the fuzzy theory. (11,12) In accordance with the Hermite function theory, in Ref. 7, the hierarchical classification with statistical values and the Hermite function were combined to obtain the eigenvalue of heart beat signals and then the support vector machine was used to classify ECG signals. In Ref. 13, chaotic ECG signals were employed to recognize personal identity and combined three kinds of eigenvalue, including the relevance dimension analyzed by the chaos theory and Lyapunov, with the ANN learning and the recognition function.
The data of this study can be divided into two parts. The first part includes the data about irregular heart rhythm provided by the medical center of Massachusetts Institute of Technology (MIT). MIT-BIH is one of the standard ECG databases recognized internationally and can be used to provide and test all studies on irregular heart rhythm. (14) The other part includes actual subjects, and the developed hardware circuit is used to measure and obtain ECG signals. As there are many methods of obtaining eigenvalue and the calculation is complicated, this study will combine the extension neural network type 2 (ENN2) with the chaos theory for the ECGbased identity recognition in order to effectively obtain the eigenvalue of original signals and reduce the amount of data for measurement. Additionally, to facilitate the acquisition, analysis, and recognition of signals in the future, in this study, we adopted LabVIEW to develop a human-machine interface to integrate the signals measured in real time with the proposed algorithm and display them in the graph control images.

Overall system architecture
The method of applying ENN2 and the chaos theory to the ECG recognition system in this paper includes three parts: the measurement and acquisition of ECG signals, the acquisition of the eigenvalue of the chaotic eye coordinate of the chaos theory, and the recognition of ENN2 and the human-machine interface. The overall system framework is shown in Fig. 1.

Step 1: Signal measurement and acquisition
The data of about 18 subjects in the first half were obtained through the hardware circuitbased measurement of the subjects; then, the data acquisition (DAQ) of LabVIEW transmits the data to the server for storage. The data in the second half were provided by the irregular heart rhythm databases in MIT-BIH. The ECG signals of 36 subjects were collected.
Step 2: Chaos theory The master-slave chaos system was used to turn the measured original ECG signals and MIT-BIH data into a chaotic dynamic error distribution graph, and the obtained chaotic eye coordinate was taken as the eigenvalue. Seventy two chaotic eye coordinates were obtained.

Step 3: ENN2 and human-machine interface
Then, ENN2 was adopted to classify and recognize the chaotic eye coordinates. Finally, the recognition results were presented on the human-machine interface. Figure 2 shows the actual circuit for the measurement and acquisition of ECG signals, including the electrode, the acquisition circuit consisting of the front-back amplifier and filter, and the DAQ card of analog-to-digital signals. Finally, the signals were transmitted to the human-machine interface designed with LabVIEW. Front-level amplifier: As some signals to be measured were very weak, the front-level amplifier is often adopted to amplify the ECG signals. Therefore, in this study, we used the AD620 meter amplifier. The meter is an amplifier of high gain and DC coupling, featuring difference input, single-end output, high input resistance, and a high common mode rejection ratio. More importantly, its amplified signals are more accurate, its disturbance signals are less, it can operate with a low voltage, and it is easy to use.

ECG signal measurement and acquisition hardware circuit
Filter: AD620 was adopted to amplify ECG signals; then, the filter was used to put the measurement range in a frequency range. In this study, we used the second-order Butterworth filter (15,16) to set the cut-off frequency of the low-and high-pass filters as 100 and 0.05 Hz, respectively.
Back-level amplifier: After going through the front-level amplifier and the filter, signals must be amplified with the back-electrode amplifier. In this paper, the IC-LM324 nonreverse amplifier was taken as the second gain of circuit, as shown in Fig. 3.

Chaos theory
The chaos theory was proposed by the American meteorologist Edward Norton Lorenz to discuss the instability of nonlinear dynamic systems. Owing to chaotic attractors, the signals from the chaos theory would generate a sequential but noncycle movement track. Owing to the minor change, this track would cause great change to the results. (17) Therefore, it is especially suitable for numerical values featuring massive original signals and a small variation range. The chaotic system consists of the master system and the slave system, as shown in Eqs. (1) and (2). The chaotic dynamic error generated by the mutual subtraction of the numerical values between the two systems leads to the different tracks of the master and slave systems. In the field of engineering, if the slave system follows the master system and the operational tracks of the two systems are adjusted to synchronize gradually, it is called a chaotic synchronous system. (18)  n n    ( ) slave y y y L y y y y y y y y y After the mutual subtraction and calculation between Eqs. (4) and (5), the dynamic error equation of the Lorenz master-slave chaotic system was obtained, as shown in the Eq. (6) matrix.
x is the master system, and the initial value is set as "0". y is the ECG signal value of the slave system. The coefficients of the Lorenz attractors are as follows: α = 10, β = 28, γ = (−8/3).

ENN2
ENN2 combines neural networks with the extension theory within a structure very similar to that of ENN. (19) The neural network enables parallel computing and learning, whereas the extension theory serves as the basis of a novel distance measurement for classification purposes. ENN2 provides stability by retaining old information in memory as well as plasticity in conforming to new information. (20) Figure 4 presents a schematic illustration showing the architecture of the ENN2, comprising an input layer and an output layer. Nodes in the input layer receive input patterns and generate an image of the input pattern using a set of weighted parameters. This network includes two connection values (weights) between the input and output nodes. One of the connections represents the lower bound and the other connection represents the upper bound. Output nodes L mj w and U mj w provide the connections between the jth and mth input nodes.
This image is further enhanced in the process characterized by the output layer. In the output layer, only one output node remains active to indicate the classification of the input pattern.
In the context of ENN2, unsupervised learning is based on a follow-the-leader approach, which does not require information pertaining to the initial number of clusters or an initial guess at the coordinates of the cluster center. ENN2 employs a threshold referred to as a distance parameter (DP) λ as well as a novel extension distance (ED) function to oversee the clustering process. λ measures the distance between the desired boundary and the center of the cluster. A pattern designated as the center of the first cluster is used to compute the initial weights using the distance parameter λ. A comparison is then conducted between the first cluster and the next pattern. If the distance is less than the vigilance parameter (i.e., equal to the number of features), it is then clustered with the first cluster. Otherwise, it is designated as the center of a new cluster. This process is then applied to all patterns until a stable cluster is achieved. Before examining the learning process, a number of variables must be defined: jth feature of the ith input pattern; Z k center of the cluster k; λ distance parameter; N p total number of input patterns; n number of features; k number of existing clusters; M k number of patterns belonging to cluster k.
The detailed unsupervised learning algorithm of ENN2 is outlined in the following.
Step 1: After setting the desired DP, it is used to measure the distance between the center of the cluster and the desired boundary. The adjustment of this user-defined parameter must be based on the engineering of the system.
Step 2: The first pattern is produced, and M 1 = 1. The center coordinates and weights of the first cluster are then calculated as follows.
Step 3: The input pattern vectors are read by letting i = 2, and go to the next step.
Step 4: Read the ith input pattern before calculating the extension distance ED m between X i and the current mth cluster center as follows.
This proposed ED is a modification of the extension distance in Eq. (11). It can be used to describe the distance between x and a real interval 〈w L , w U 〉. It is possible to quantitatively express the concept of distance, as defined by the positional relationship between a point and an interval. When using classical math to derive the distance to points within the interval, the distance value is calculated as zero. The proposed extension distance can be used to describe the various positions of a point in the interval.
Step 5: Find the p in which ED p = min{ED m } for m = 1, 2, …, k. (12) Step 6: If ED p > n, then create a new cluster center. According to the definition of the proposed extension distance, if x lies in the interval, then the distance is smaller than 1. Thus, has n features in the clustering process, where ED p > n indicates that X i does not belong to the pth cluster, then a new cluster center will be created.
Otherwise, the pattern X i belongs to the cluster p, then update the weights and the center of the cluster p.
Step 7: Changing the input pattern X i from cluster "o" (the old one) to "k" (the new one) leads to the modification of the weights and the center of the cluster "o" as follows.   Figure 5 presents the result of the tuning of weights in the two clusters, which clearly indicates changes in ED o and ED k . The cluster x ij changes from "o" to "k" owing to the fact that ED′ o > ED′ k . From this step, it is clear to see that the process of learning is based entirely on adjusting the weights of the oth and kth clusters. This gives the proposed method an advantage over unsupervised learning algorithms in terms of speed, thereby enabling rapid adaptation when new information is encountered. Thus, the clustering process retains stability as well as plasticity.
Step 8: Set i = i + 1 and iteratively repeat Steps (4-8) until all of the patterns have been compared with the existing clusters.
Step 9: Once the clustering process reaches convergence, the algorithm ends; otherwise, return to Step 3.

Chaotic dynamic error scatter diagram
To demonstrate the performance and accuracy of the identity recognition proposed by this paper, 18 subjects and 18 MIT-BIH databases of irregular heart rhythm were taken as the data for identity recognition, and the 36 experiment subjects were males and females ranging from 20 to 50. The MIT-BIH databases included four common heart beat classifications: normal beat (NB), heart beat resisted by the left bundle branch block beat (LBBBB), heart beat resisted by the right bundle branch block beat (RBBBB), and heart beat caused by the atrial premature contractions beat (APCB). (2) The measured and collected ECG data were calculated with the Lorenz master-slave chaotic system of the chaos theory to obtain the chaotic dynamic error distribution graph. Figure 6 is the chaotic dynamic error distribution graph of a heart beat classification (LBBB). Each distribution graph had two chaotic eyes, and the total number of coordinates was 4 (C 1 -C 4 ). In this study, Y-axis values (C 1 and C 3 ) of the left and right chaotic eye coordinates were taken as a new eigenvalue to obtain 72 chaotic eye coordinate eigenvalues. The distribution of the chaotic eye coordinates of the four heart beat classifications is shown in Fig. 7.

ENN2 identification classification results
The 72 numerical values of chaotic eye coordinates obtained were classified through ENN2. When λ was 4.199, the accuracy of recognition was as high as 89%. Figure 8 shows the results of the ENN2-based classification.
As shown in Table 1, different values of λ, ranging from 2.5 to 7, can lead to different levels of recognition accuracy, ranging from 69 to 89%. Figures 9 to 12 show the results of ENN2based recognition when λ is 3.46, 2.55, 6.998, and 5.598, respectively.      Figure 13 shows the display image of the human-machine interface developed through the combination of LabVIEW and the MATLAB program, which contains the measured ECG signals, the dynamic error distribution graphs calculated through the chaos theory, the display of the numerical values of chaotic eye coordinates, and the results of ENN2-based classification and recognition.

Conclusions
In this study, we finished the development of the ECG recognition system of hardware and software; the designed ECG measurement and capture circuit framework is simple. The subjects' heart conditions can be determined through the results of analysis using the selfdeveloped LabVIEW human-machine interface. Additionally, the ECG hardware circuit was adopted to measure and obtain signals, and the master-slave chaotic system of the chaos theory was used to make a dynamic error distribution graph out of the stored data. The chaotic eyes were taken as eigenvalue, and ENN2 was adopted for classification to diagnose the heart conditions of the subjects, with a recognition accuracy of up to 89%. According to the empirical results, the chaotic dynamic error distribution graph and chaotic eyes were generated using the master-slave chaotic system. The left and right chaotic eye coordinates were taken as the eigenvalue, which could greatly reduce the capture of the eigenvalue of the traditional ECG in the time domain and then reduce the calculation time and system complexity of the recognition. Moreover, it could effectively facilitate diagnosis.