^{1}

^{*}

^{1}

^{2}

This paper proposes the fractal patterns classifier for multiple cardiac arrhythmias on field-programmable gate array (FPGA) device. Fractal dimension transformation (FDT) is employed to adjoin the fractal features of QRS-complex, including the supraventricular ectopic beat, bundle branch ectopic beat, and ventricular ectopic beat. FDT with fractal dimension (FD) is addressed for constructing various symptomatic patterns, which can produce family functions and enhance features, making clear differences between normal and unhealthy subjects. The probabilistic neural network (PNN) is proposed for recognizing multiple cardiac arrhythmias. Numerical experiments verify the efficiency and higher accuracy with the software simulation in order to formulate the mathematical model logical circuits. FDT results in data self-similarity for the same arrhythmia category, the number of dataset requirement and PNN architecture can be reduced. Its simplified model can be easily embedded in the FPGA chip. The prototype classifier is tested using the MIT-BIH arrhythmia database, and the tests reveal its practicality for monitoring ECG signals.

The electrocardiogram (ECG) signal can be measured non-invasively by placing electrodes on the body surface that provides information of myocardium electric activity and heart physiological function. An ECG signal shows as an almost periodic signal, and can reveal symptomatic information in the dysfunction duration. Currently, portable and stationary monitoring devices have been used on healthcare systems. Holter recorder is a well-known portable device and used to record the electrical activity with surface electrodes placed on the chest. However, its diagnostics is off-line analysis from the recorded data, and uses a cardiogram to identify arrhythmic types of the patients. Stationary monitors, such as dedicated or PCbased devices, have also been used on healthcare systems, which results in expensive solutions and limiting the portability [1,2]. Since telemedicine has also been used to acquire patient’s information, and has portable configuration for patient monitoring in remote non-clinical environments, it can be used in home healthcare, elder communities, and public place to acquire patient’s information. It has become a commonly used technology due to its low-cost, compactness, and short design-cycle. This remote device is an embedded hardware with FPGA, Bluetooth, RFID, and Zigbee. Via wireless transmission between the biosensor and supervision device, FPGA makes the ECG signal processing and sends digital signal to a remote monitor [

FPGA device provides the flexibility and potential alternative to design hardware, including built-in DSP, analog and digital I/O, signal generation, communication, and specific functions for signal processing and controllers. It has been applied for digital filters design [4,5], signal analysis and classification [6,7], fault detection [

To overcome the drawbacks, an iterated function system (IFS) is proposed for modeling the non-linear interpolation function [10-14]. Its modification, the so-called FDT function, is simple in form and consists of sinusoiddal terms to the affine maps, making the model more flexible for processing irregular signals. FDT functions with FD are used to construct the fractal patterns from ECG signals in the time-domain, including the “Q-R Segment” and “R-S Segment”. The transform method results in data self-similarity and enhances the features for the same category. The PNN-based classifier is developed to perform the classification tasks. The performance of this method is presented and promising results are given for classification applications, such as the straightforward mathematical operation, flexible pattern mechanism, and high tolerance capability [15-17]. These algorithms can be easily programmed into the FPGA chip. The FPGA device has an inherent parallel architecture allowing designers to execute the multiple inputs and control loops simultaneously without slowing down the execution time and applications. From the test results, they appear to be computationally efficient and accurately recognize for patterns classification.

An IFS has been proposed for image compression and signal modeling, and is capable of producing family functions with different fractal dimensions (FDs). It is a finite set for contraction mappings, and has been used to create images, various waveforms and patterns for medical image classification and biomedical signal analysis [10,11]. IFS is implemented with similarity maps, and the resulting data are self-similar. The significant removal of redundancy is related to the self-similarity of natural patterns. In modeling the pattern of a function or data sequence x[t], t = 1, 2, 3, , N, the pth interpolation map W_{p}, p = 1, 2, 3, , P, can be presented as

For each map, W_{p} maps the data sequence x_{p}[t] onto the subsequences with N_{p} sampling data in the interval [N_{p}_{1}, N_{p}_{2}], and the maps can be constructed side by side. The remaining map parameters c_{p}, d_{p}, and f_{p} can be solved by minimizing the sum of squared errors between the transformed data and the original data in the range of the pth map, and can be justified by the Collage Theorem [12,13]:

where, N_{p}_{ }= N_{p}_{2} – N_{p}_{1} + 1and N = N_{1} + N_{2} + N_{3} + ⋯ + N_{p} + ⋯ + N_{P}. To improve the constraint, non-linear interpolation is used to adjoin the data among the interpolation points, which makes the model more flexible for processing non-linear and irregular signals. Non-linear terms as sinusoidal functions can be added to W_{p}. The non-linear interpolation function can be represented as

A fractal pattern of ECG signal can be adjoined with several segments such as P-R interval, P-R segment, Q-R-S complex, S-T segment, or Q-T interval. The nonlinear function with fractal dimension (FD) will change the ECG signals into fractal patterns at different scale parameters. FD must be a parameter between 1 and 2 for processing one-dimensional signals. The non-linear interpolation function, FDT with FD, can be modified as

where D is a FD parameter (1 < D < 2). The remaining map parameters c_{p}, d_{p}, f_{p}, and g_{p} can be solved by

Apply sequence data x_{p }[t] are the sampling data from the ECG signals. The fractal patterns can be reconstructed as [

Equations (5) and (6) are used to extract the features from the ECG signals, and Equation (9) is utilized to construct the fractal patterns of cardiac arrhythmias.

The PNN consists of four layers, including the input layer, hidden layer, summation layer, and output layer, that has the parallelism distributed process, learning, and pattern recognition ability. In this study, we have considered the sequence data x_{p}[t], t=1, 2, 3, , N_{p}, with P segments from the ECG signal, and a fractal pattern F can be represented as

The vector F can be also combined as F = [j_{11}, j_{12}, j_{13}, , j_{1N1}|j_{21}, j_{22}, j_{23}, , j_{2N2}|…|j_{P}_{1}, j_{P}_{2}, j_{P}_{3}, , j_{PNP}] = [f_{1}, f_{2}, f_{3}, , f_{i}, , f_{N}], i = 1, 2, 3, , N, N = N_{1}_{ }+ N_{2}_{ }+ N_{3}_{ }+ + N_{P}, and each feature f_{i} is connected to the input nodes of input layer. The number of input nodes is equal to the number N. The number of hidden nodes H_{k} (k = 1, 2, 3, , K) is equal to the number of training data, while the number of summation nodes S_{j} and output nodes O_{j} (j = 1, 2, 3, , m) equals to the types of cardiac arrhythmias. Therefore, its architecture can be easily to determined without any trial-and-error procedure. The weights (connecting the kth hidden node and the ith input node) and (connecting the jth summation node and the kth hidden node) are determined by K input-output training pairs. In the hidden node, a normalized Gaussian function H_{k} is applied to the Euclidean distance E_{d} between the unknown pattern F and K training patterns. The function Hk is inversely proportional to the distance E_{d}. If E_{d} approaches zero, the unknown pattern F is similar to any training data. This concept can be used for analyzing pattern relations. The output O_{j} can be computed by

where the weights are created by training data F(k) = [f_{1}(k), f_{2}(k), f_{3}(k), , f_{N}(k)], k=1, 2, 3, , k, , K;

the weights are the desired outputs associated with each stored pattern. The value of will be equal to “1” or “0”. The value will be set to be “1” when the kth training data belonged to the jth class; s_{k} is the smoothing parameter. Finally, the maximum output O_{max} = [O_{1}, O_{2}, O_{3}, , O_{j}, , O_{m}] indicates the type of cardiac arrhythmias.

In Equation (11), the smoothing parameter s_{1} = s_{2}_{ }= s_{3} = = s_{K} = s (s ¹ 0) would refine the classification accuracy. The non-linear optimization method, such as gradient descent method, steepest descent method or Newton-Raphson method [15-17], is employed to adjust the parameter s and minimize the error with iteration procedures. It is intended to minimize the predicted squared error function, and is updated by using pattern learning as

where T_{j} is the desired output for training pattern, h is the learning rate, and q is the iteration number. The PNN based classifier has a dynamic and fast adaptation ability with continuity add-in or delete-off training data by automatically tuning the desired outputs and parameters s of hidden nodes.

The field-programmable gate array (FPGA) is a semiconductor device that can be configured by the customer or the designer after manufacturing. It has the array architecture of logical elements, which can be used to design any logical functions to implement the given applications, such as an application-specific integrated circuit (ASIC). FPGA is also a programmability device, like programmable ROMs, and its programming techniques include antifuse-based device (Programmed Once) and static-memory-based device (Reprogrammed an Unlimited Number of Times). A typical FPGA consists of configurable logic blocks (CLB), input/output blocks (IOB), and programmable interconnects [4-9]. Each CLB can design the logical functions and latching data with combinational logic and sequential logic (AND, OR, Flipflops, and Registers). IOBs provide the interface between external pins and internal logics. Programmable intercomnects link the CLBs, I/O pins, and other resources on-chip memory through the routing paths, where interconnection among these blocks can be programmed by using hardware description language (HDL). Then, the designs can transferred the descriptions to gate-level netlists and dataflowflow on a chip. The prototype device can be implemented, tested, debugged, and modified as needed in a short design cycle.

Custom-design platforms have been provided to the FPGA implementation, such as Verilog, ModelSim, and Quartus II, and its development environment can simulate and verify the logic designs before initiating the compilation process [18-20]. However, HDL is a low level textbased programming language used for FPGA hardware design. Currently, LabVIEW extends the graphical programming tools to FPGA-based hardware. It has parallel execution, data acquisition, and floating-point arithmetic (Data Word Length: 8, 16, and 32 bit) functions to process signals on FPGA, and embeds specific functions for math, signal analysis/generation, comparison logic, linear/ non-linear control, analog and digital I/O, and timing. In this workspace, designers can quickly develop specific and reliable embedded systems containing FPGA-chips, real-time processor, and human machine interface (HMI). Graphical user interface for windows application has shorter design cycle, reprogrammability, and flexibility, which is much better than text-based languages. Under this development environment, we use saturation arithmetic functions to configure the combinational logics without prior complex digital design or electronic design automation (EDA) tools, and then to embed intelligent algorithms on the compact chip.

An ECG signal is measured with the modified limb lead II (ML II), and its typical waveform consists of the Pwave, QRS-complex, and T-wave. The QRS-complex provides distinct information in monitoring heartbeats, which can be used to discriminate the arrhythmic types. Centered on the R-wave peak, the QRS-complex can be divided into the Q-R segment and R-S segment (P = 2). For 50 sampling points (25 points before R-peak and 25 points after R-peak, N = N_{1} + N_{2} = 50), the remaining map parameters can be solved by Equations (7) and (8) in the Matlab workspace. By using FD between 1 and 2, the fractal patterns are constructed with Equations (5), (6), and (9). The FDTs with fractal dimension D = 1.6 is chosen in this study. For a QRS-complex of normal beat (Patient Number: MIT-103), related parameters c_{p}, d_{p}, f_{p}, and g_{p}, p = 1, 2, are computed as shown in

where and, w and _{ }are the constant coefficients; R, r = 0, 1, 2, , R, is the number of series term (R = 10 in this study); z_{r}, r = 0, 1, 2, , R, represent the series coefficients and are also constant values. These coefficients can be computed and completed to verify the expanded function accuracy in the Matlab workspace, as shown in

In this section, we focus on classifier design and collection of the annotated ECG beats for PNN training data. The ECG signals are obtained from the MIT-BIH arrhythmia database, including patient numbers: 100, 103, 107, 109, 111, 118, 119, 124, 200, 202, 207, 209, 212, 213, 214, 217, 221, 231, 232, and 233 [^{–4}), PNN converges to the nearest local minimum for less than five learning cycles. The related data of the PNN-based classifier are shown in

In the hidden layer, a normalized Gaussian function must be also expanded into a Maclaurin series as

where div is dividend, div = 1 in this sudy, and, d is the constant coefficient, and R is the number of series term (R = 6 in this study); y_{r} are the series coefficients. Related data can be computed and stored in the memory elements as shown in

Note: 1) No. 1: ·; 2) No. 2~7: V; 3) No. 8~9: A; 4) No. 10~12: L; 5) No. 13~16: R; 6) No. 17~20: P; 7) No. 21~22: F.

term d_{ }can be computed with multiplication and addition. Then input the results to Gaussian function H_{k}. _{k}.

For seven categories, the weighting factors, k = 1, 2, 3, , 22, j = 1, 2, 3, , 7, are encoded as binary values with signal “1” belonging to category j and the rest of the factors are zero. The weighting matrix []_{7}_{´}_{22} is sparse with 22 nonzero elements. The numerator of Equation (12) is a matrix vector computation, where each output S_{j} is formed by multiplying each of 22 outputs of the hidden node by one of 22 weighting factors, and can be presented as

The number of addition and multiplication operations can be reduced leading to an increased speed in the arithmetic process. In the summation layer, the outputs of summation node H_{k} are computed with 15 adders. For the same category, their outputs of hidden nodes are summed in the summation-node CLB. The implementation of output node O_{j} would require 6 adders and 7 dividers, and can be presented as

as shown by the denominator of Equation (12), the number of the addition operations can also be reduced. The structure of summation-node and output-node CLBs are shown in

In

The FPGA implementation of the proposed classifier is applied to examine multiple cardiac arrhythmias. With MIT-BIH arrhythmias database, the records of patient

numbers 107, 118, 119, 200, 209, 211, 214, 217, and 231 are selected for testing. Tested ECG signals were generated using LabVIEW and Matlab software on a PC Pentium-IV, 3.0 GHz, 480 MB RAM. The design platform of SOPC-NIOS II EDA/SOPC series (NIOS II-EP2C35 Chip, 700 K system gates, EEPROM) was used in this study. The ECG signals have been digitized and bandpass filtered, thus lowand high-frequency noises appears smaller in amplitude [

The proposed classifier is tested with the software simulation, in order to examine the implementation of FPGA modules. After the designated modules, the designated circuit can be programmed into the FPGA chip through the download cable. In feature extraction, fractal features are extracted by using 50 FDTs. Then 50 features are reconstructed into one fractal pattern. Since the FDT module is a simplified module, it is worth noting that each FDT function must be first examined before programming them into the FPGA chip. The average fractal patterns from the same category are obtained from the selected patients. For training data, fractal patterns are computed by FDT module and high-level programming language (HLPL) in the Matlab workspace, respectively.

The learning performance of the proposed classifier was tested with 22-set training data. In the learning stage, the optimal parameter s can be computed in the Matlab workspace. The proposed method has a fast learning process with slight iteration for adjusting parameter s. It takes 0.195 seconds to classify the 22-set training data into 7 categories. Then this optimal value was used to determine the parameter s of 22 hidden-node modules and was obtain to minimize the misclassification errors. Under the optimal parameter, decision boundaries can become increasingly non-linear, the network approaches a nearest neighboring classifier. In the recalling stage, all outputs

approach the desired targets for 7 categories. The output values of the proposed classifier are shown in

Note: 1) No. 1: ·; 2) No. 2-7: V; 3) No. 8-9: A; 4) No. 10-12: L; 5) No. 13-16: R; 6) No. 17-20: P; 7) No. 21-22: F.

Clinical diagnostic subjects have multiple cardiac arrhythmias such as supraventricular ectopic beat, ventricular ectopic beat, bundle branch ectopic beat, fusion, and paced beats. For example, patient number 200 has normal heartbeats and V-heartbeats with annotation labels in 1.5 minute segment. Test results reveal that the accuracy is 94% as shown in

In this study, the parameters of FDT functions have been directly computed by Collage theorem. Each FDT CLB has the same structure; it only assigns the segmented remaining map parameters and series coefficients. Most of them are repeatable uses. Owing to the enhancement in features by the FDT functions, the number of training data, data storage, and processing needs can be reduced. For classification applications, artificial neural network (ANN) has been presented for this study. However, it has some limitations including very slow learning process, need iteration for updating weights, and need to determine the network architecture such as the number of hidden layers and hidden nodes. The weights, input-layer to hidden-layer and hidden-layer to output-layer, are always nonzero values. This will increase the requirement of the addition and multiplication operations and memory storage. In addition, sigmoid activation functions of hidden and output nodes [

ules, including the arithmetic process and memory storage. The proposed classifier provides a promising way for implementing the portable bio-monitor and telemedicine.

A fractal-pattern classifier using FPGA for the realizetion of FDTs and PNN to recognize multiple cardiac arrhythmias was proposed. The FDT modules are employed to construct various fractal patterns, and make the difference between normal and unhealthy subjects. The PNN module is proposed for recognizing multiple cardiac arrhythmias. Numerical experiments have been conducted with MITBIH arrhythmia database. The proposed classifier has excellent computational efficiency, high accuracy, and flexibility for patterns recognition. Then programs were downloaded to the FPGA chip to integrate all the modules, real-time processing, compression, transmission and input/output. This prototype can be further integrated in telemedicine and portable non-invasive devices.

This work is supported in part by the National Science Council of Taiwan under contract number: NSC97-2614-E-244-001, August 1 2008- July 31 2009.