Automated detection of heart defects in athletes based on electrocardiography and artificial neural network

Electrocardiography (ECG) has proven to be one of the most efficient ways of tracking heart defects in athletes. However, the interpretation of electrocardiograms often require the expertise of a cardiologist. Meanwhile, an automated heart monitoring system could be used to ensure early heart defect detection in athletes, even in the absence of a cardiologist. In this paper, an automated heart defect detection model is proposed for athletes using ECG and Artificial Neural Network (ANN). We developed an ECG biomedical equipment to acquire 400 ECG data vectors from 40 participants, who comprises of athletes and non-athletes. Four classes of possible heart conditions among athletes, namely: normal, tachyarrhythmia, bradyarrhythmia and hypertrophic cardiomyopathy were considered. The ECG data collected were pre-processed and features were extracted based on first order moment. Different ANNs were trained to correctly classify the ECG data. By and large, the performances of ANNs that were trained based on Levenberg-Marquardt learning algorithm outperformed those trained based on Scale Conjugate Gradient learning algorithm. The network architecture with tansig activation function at both hidden and output layers and ten neurons in the hidden layer (TTLM) produced the best performance that cut across all the key performance indicators. The *Corresponding author: Emmanuel Adetiba, Department of Electrical and Information Engineering, Covenant University, Canaanland, P.M.B 1023, Ota, Nigeria; HRA, Institute for Systems Science, Durban University of Technology, P.O. Box 1334, Durban, South Africa E-mail: emmanuel.adetiba@ covenantuniversity.edu.ng Reviewing editor: Wei Meng, Wuhan University of Technology, China Additional information is available at the end of the article

He has authored and co-authored more than forty scholarly articles some of which are in ISI journals and CPCI conference proceedings. His research interests include Biomedical Signal Processing, Machine Intelligence and Software Defined Radio.

PUBLIC INTEREST STATEMENT
This paper seeks to develop an intelligent heart defect detection system that could potentially reduce sudden cardiac death among athletes. In medical science, electrocardiography has been accepted as one of the most efficient ways of tracking the electrical activities in the heart. However, the interpretation of electrocardiograms often require the expertise of a cardiologist. We herein present the architype of a wearable and cost effective heart monitoring system that could be leveraged to achieve early heart defect detection among athletes in the absence of a cardiologist. In application, the achievements in this work could be adopted to develop smart jerseys and/or smart boots that could be used in real-time sporting activities.

Introduction
Heart defects, in the context of this study, refer to the weaknesses and failings in the heart and its vasculature. These defects include coronary diseases and myocardial infarctions. Heart defects are mostly responsible for the disturbances in the regular beats of the heart, which is called arrhythmias (Maji, Mitra, & Pal, 2017). Cardiac arrhythmias cause the heart to pump less effectively and this may lead to chest pain and/or Sudden Cardiac Death (SCD) (Li, Bisera, Weil, & Tang, 2012).
SCD is a natural death due to cardiac causes that is heralded by abrupt loss of consciousness within one hour of onset of an acute change in cardiovascular status in an individual with known pre-existing heart disease but in whom the time and mode of death are unexpected (Ogunlade, 2011). The incidence of SCD has been reported to be approximately 1-2 per 1,00,000 persons-year worldwide and the number in athletes has increased in recent decades (Mehra, 2007). It is estimated that about 3,00,000 cases of SCD occur each year in Africa (Chin, 2014). More importantly, the risk of this incidence is two and a half times higher in athletes when compared to that of non-athletes. In fact, the American Heart Association and other studies have reported Hypertrophic Cardiomyopathy (HCM) to be the most common cause of SCD in athletes (Bent et al., 2015;Corrado, Basso, Rizzoli, Schiavon, & Thiene, 2003;Corrado & Zorzi, 2017;Grazioli et al., 2016;Maron et al., 1996;Smaali & Zaroui, 2017;Ullal, Abdelfattah, Ashley, & Froelicher, 2016).
HCM is a condition where the myocardium or heart muscle thickens, therefore, taking more space in the heart and consequently pumping less blood. SCD in athletes is usually as a result of repolarization due to potassium channel down regulation and myocardial ischemia. It may also be explained by the presence of multiple factors such as cardiac hypertrophy, increased sympathetic tone, genetic defects, drugs, doping agents or food ingredients. The combined effect of these factors may increase the repolarization homogeneity, which sometimes leads to the risk of arrhythmias and consequently SCD (Varró & Baczkó, 2010).
A study that was conducted at Lagos University Teaching Hospital (LUTH), Nigeria, in 2009 showed that 14 out of 712 randomly selected cases of heart defect in patients within the ages of 19 and 39 were previously undiagnosed (Mbakwem, Oke, & Ajuluchukwu, 2009). Most active athletes fall within this age bracket. Information on past occurrences of SCD among Africa athletes is presented in Table 1 to further illustrate the enormity of SCD.
The monitoring of vital physiological signals has proven to be one of the most efficient ways of tracking the health status of patients with heart defects. This process is known as Electrocardiography (ECG) (Lüderitz & de Luna, 2017). ECG is a non-invasive representation of the heart's electrical activity in a graphical form over a period of time as detected by electrodes placed on the surface of the skin and recorded by the ECG based biomedical device that is external to the body (Werner, 2014). It is a differential measurement across the surface of the body and can be analysed as a vector measurement of electrical potentials (Delano, 2012). A typical ECG waveform shown in Figure 1 consists of three primary features: the P wave, the QRS complex, and the T wave (Ashley & Niebauer, 2004).
Each wave corresponds to the electrical activity in specific parts of the heart. The P wave comes first and it represents the depolarization of the atria.
The delay between the P-wave and the QRS complex is known as the PR interval. This interval signifies the delay that occurs in the A-V node that gives the atria time to contract before depolarizing the ventricles. The QRS segment represents depolarization of the ventricles and is usually the strongest wave in an ECG. The last wave is the T wave and it represents the repolarization of the ventricles. The repolarization of the atria is usually hidden in the QRS complex.
The RR Interval is the time between QRS complexes. The instantaneous heart rate can be calculated from the time between any two QRS complexes. The PR segment is the flat, usually isoelectric segment between the end of the P wave and the start of the QRS complex. The ST segment is the flat, isoelectric section of the ECG between the end of the S wave and the beginning of the T wave. It represents the interval between ventricular depolarization and repolarization. The QT interval is the time from the beginning of the QRS complex, representing ventricular depolarization, to the end of the T wave, resulting from ventricular repolarization (Ashley & Niebauer, 2004). The change in the polarity of action potentials of the cells gives rise to a trace of voltage levels against time known as the ECG signal. Primarily, ECG can be used to: evaluate the electrical activity of the heart; measure the rate and regularity of heartbeats; determine the position of the chambers; identify any damage in the heart and; investigate the effect of drugs and devices used for heart regulation. However, the interpretation of electrocardiograms often require the professional knowledge of a cardiologist; but a real-time automated heart monitoring and analysis system can be used to ensure early heart defect detection in athletes, even in the absence of a well-trained cardiologist. In addition, electrocardiograms can be acquired and analysed in real-time in order to determine the heart's condition and initiate prompt remedial actions to reduce the burden on the patient in terms of hospital visits. In essence, the development of an efficient automated heart defect detection system will consequently reduce the rate of sudden deaths that are due to heart-related diseases among athletes.

Review of related works
Many researchers have worked towards efficient analysis of ECG signal. In recent times, a number of methods have been developed to detect ECG features. This includes amplitude and time intervals as well as frequency domain representations. Also, several researchers have developed various methodologies and algorithms for analyzing and classifying ECG signals. These methods include Digital Signal Processing (DSP), knowledge-based system, rule-based system, fuzzy logic system, Artificial Neural Network (ANN), and hybrid systems. Other methods involve genetic algorithm, Support Vector Machine (SVM), Self-Organizing Map (SOM), wavelet-domain hidden Markov models and Bayesian. Each of these techniques has its own advantages and disadvantages (Ponnle & Ogundepo, 2015).
An approach for effective feature extraction from ECG signal was described by Saxena et al. (Saxena, Sharma, & Chaudhary, 1997). Their approach utilized a composite method developed for data compression, signal retrieval and feature extraction with Error-Back Propagation (EBP) ANN. The results showed that the composite method can be used for efficient data management and feature extraction of ECG signals in many real-time applications. A modified combined wavelet transform technique was proposed in (Saxena, Kumar, & Hamde, 2002). The technique employed Quadratic Spline Wavelet (QSWT) for QRS detection and the Daubechies Six Coefficient (DU6) wavelet for P and T detection. Alexakis et al. (2003) used time interval and morphological features to classify ECG into normal and arrhythmic. The classification involved ANN and Linear Discriminant Analysis (LDA). Data from Diabetic Clinic of the Royal Hallamshire Hospital in Sheffield was used. Multi-Layer Perceptron ANN (MLP-ANN) gave more accurate results with an average accuracy of 85.07%. Povinelli, Roberts, Johnson, and Ropella (2002) used phase space-based method with ANN to identify life threatening arrhythmias. An average accuracy of 93.75% was reported. Tadejko and Rakowski (2007) presented the classification performance of an automatic classifier of ECG for the detection of abnormal beats with feature sets based on ECG morphology and RR-intervals. The configuration for the analysis of signal features and clustering was based on a Kohonen SOM. Also, it was used with Learning Vector Quantization (LVQ) algorithms on the data collected from the records recommended by the American National Standard Institute (ANSI)/Association for the Advancement of Medical Instrumentation (AAMI) EC57 standard. Jadhav, Nalbalwar, and Ghatol (2011) employed Modular Neural Network (MNN) model to classify arrhythmia into normal and abnormal. The authors performed experiments on University of California, Irvine (UCI) Arrhythmia data-set, and the experimental results presented were above 82.22% classification accuracy. The system developed by Das and Ari (2014) classified ECG signals into the five classes of beats recommended by AAMI standard by using mixture of features, which is a combination of S-transform (ST) and wavelet transform (WT) based features along with temporal features. The extracted feature set is independently classified using Multilayer Perceptron Neural Network (MLPNN). MIT-BIH database was used and average accuracy of 97.5% was achieved.
In this paper, an automated heart defect detection model is developed for athletes using ECG and ANN. Firstly, we developed a portable ECG biomedical equipment to acquire ECG signals from athletes and non-athletes some of whom presented history of heart defects. Four classes of heart conditions of athletes are considered in this study, namely: normal, tachyarrhythmia (TACHY), bradyarrhythmia (BRADY) and Hypertrophic Cardiomyopathy (HCM). The raw ECG data collected

Materials and method
This section provides detailed information about the experimental procedure adopted in the development of the proposed automated heart defect detection model for athletes. The objectives of this paper were achieved in five phases. First, an ECG biomedical system was designed and implemented using Arduino board, ECG circuits and probes. The developed biomedical system was later used to acquire ECG data from both athletes and non-athletes. Furthermore, the ECG data were pre-processed to remove unwanted signals, and the unique features (first-order moment statistics) of each data instance were extracted. Different ANN architectures were designed and trained with the ECG data that were previously collected. Finally, the performances of the ANNs were tested, validated, and evaluated based on the classification accuracy, sensitivity and specificity of the models when new input data were introduced. The block diagram representation of the whole process is shown in Figure 2.

Arduino-based ECG biomedical system
An Arduino-based ECG biomedical system was carefully designed and implemented to capture the electrical activity of the heart over a period of time. The system hardware comprises the electrodes, the electrocardiography circuit, the power source, and the Arduino board. The electrodes, which serve as electrical transducers, convert ECG signals to corresponding analog voltage signals. In the electrocardiography circuit, an instrumentation amplifier was employed to boost the ECG signal voltage. The introduction of the amplifier will also minimize the effect of distortion during ECG signal acquisition. The following characteristics were ensured in the choice of the instrumentation amplifier: low power consumption; very low offset voltage; low drift; very high Common Mode Rejection Ratio (CMRR); high precision; and small size. The Alternating Current (AC) signal voltage is usually small (<5 mV). A high CMRR of 100 dB was used so as to accommodate the large AC common mode component (up to 1.5 V) and the large variable DC component (300 mV) that often accompanies the signal voltage. In accordance with the specifications of the AAMI (Instrumentation, 1986), CMRR of 89 and 60 dB were considered for standard ECG and ambulatory recorders respectively. Also, the amplifier was outfitted with input amplifiers so as to eliminate the need for impedance matching. For safety reasons, the electrodes were properly isolated from the electrocardiography circuit. Considering the low power requirement of INA12X instrumentation amplifier, it became a preferred choice for battery-powered systems. With the realization of an amplification gain of three, the ECG voltage range increased to 0.3-3 mV.
The ECG circuitry consists of active and passive electronic components for analog signal filtering and processing. During the circuit design and implementation phase, a special consideration was given to safety and effectiveness without jeopardizing the portability and cost-effectiveness of the system. High voltage protection was ensured with the use of resistors and diode clamps so as to shield human subjects against electrostatic discharge. Also, a high-frequency rejection circuit was introduced in order to eliminate interfering signals from neighboring devices, power cable interference, muscle noise and radio frequency signals. Low-cost amplification of differential signals was achieved by using a high-precision, high-gain device, which also rejected common mode voltages. Another characteristic considered in the selection of the amplifier at this stage was its high input impedance. The circuit required this high input impedance because the behaviour of the bio-potential electrodes are subject to loading effects which could cause distortion of the signal. The common mode signals, i.e. 50/60 Hz mains hum, were cancelled out by Driven Right Leg (DRL) circuit. The DRL circuit was used instead of a ground electrode because it attenuates mains hum up to 100 times more than what the instrumentation amplifier can do by itself. At this stage, an amplifier gain of ten was achieved and the ECG voltage level range further increased to 3-30 mV.
Furthermore, a high-pass filter was designed to attenuate low-frequency signals that are generated due to respiration variations, motion noise, and baseline wander. A cut-off frequency of less than 0.67 Hz was chosen in order to accommodate the slowest possible heartbeat of 40 bpm. MCP607-I/SN operational amplifier was selected because of its low input offset voltage, unity gain stability, and gain-bandwidth product of 1.2 MHz. This makes the circuit design more suitable for high precision applications. Advanced filtering was achieved using the "Besselworth" filter, which is a combination of the Bessel and Butterworth filters. The filter exploits the combined advantages of quick roll-off in Butterworth filter and the absence of overshoot in Bessel filter to achieve a better rounded and sharper "knee" on the boundary between the pass and transition bands. "Besselworth" filter acts as an anti-aliasing filter. That is, it constrained the bandwidth of the ECG signal to satisfy the sampling theorem over the chosen frequency band. In order to eliminate higher frequency signals without compromising the integrity of the ECG signal, the cut-off frequency of the low-pass filter was set to 40 Hz. In essence, all the filter combinations employed in the circuit jointly resulted in a "notch filter" and its band pass frequencies were carefully selected to achieve the required ECG bandwidth.
Analogue-to-digital conversion and the serial data transmission were realized using ATMega328 microcontroller that is available on the Arduino board. ATMega328 is a low-power Complementary Metal Oxide Semiconductor (CMOS) 8-bit microcontroller. It operates based on Alf and Vegard's Reduced Instruction Set Computer (AVR-RISC) architecture (Bogen & Wollan, 1999). By executing powerful instructions in a single clock cycle, ATMega328 achieves a high throughput of approximately one million Instructions/Second/MHz. This offered a good tradeoff between power consumption optimization and processing speed. The AVR core combines a rich instruction set with 32 general-purpose working registers. All the 32 registers are directly connected to the Arithmetic Logic Unit (ALU), allowing two independent registers to be accessed with a single instruction execution per cycle. The resulting architecture was more code-efficient and the throughput was approximately ten times faster than conventional Complex Instruction Set Computer (CISC) microcontrollers. The full Arduino was used in this study.
All electronic components that made up the ECG biomedical system were etched to a shield to guarantee better precision, accuracy in connections, and easy integration with the microcontroller. The shield was constructed by Olimex®, Bulgaria. The complete system was powered by a 3.7 V, 1,500 mAh Lithium Polymer (Li-Po) battery. Li-Po batteries are lightweight and can be made in almost any shape and size. They equally have large energy capacities. This power source was favoured because of its advantages of mobility, portability and easy carriage. Also, Li-Po batteries are readily rechargeable.

ECG data acquisition
The developed biomedical system was used to collect ECG data from both athletes and non-athletes. During ECG data acquisition, electrodes of the portable ECG biomedical system were attached to the limbs of identified human subjects. The output of the electrodes is fed into the ECG circuit for filtering and further amplification. The analogue signal output was sampled at a frequency greater than twice the highest frequency of the signal, in accordance with Nyquist theorem. The sampled signal was further quantized and encoded into digital form. This digital signal was transmitted serially at a specific baud rate to match the host computer using the ATMega microcontroller on the Arduino board. Baud rate plays a significant role in serial data transmission; it specifies how fast data is sent over a serial line. Therefore, a 9600 8N1 serial protocol was utilized to achieve 9600-baud, 8 data bits, no parity, and 1 stop bit. Data were streamed through the serial interfaces one single bit at a time. Universal Serial Bus (USB), which always pairs its data line(s) with a clock signal, served as the synchronous serial interface. This process was implemented using C programming language and the Arduino Integrated Development Environment (IDE). The ECG data acquisition process is illustrated in Figure 3.

Study participants
Data acquisition in this study involves both athletes and non-athletes to ensure that data instances of all the four classes of heart conditions (i.e. normal, TACHY, BRADY, and HCM) are included. The selected athletes were footballers and basket ballers. The inclusion of each of the human subject was based on informed consent. Also, the ethical procedure for human subject related research was strictly adhered to as laid down by the University. Overall, a total of 40 participants were enlisted for this work. For each category as listed above, 10 different ECG data vectors were acquired per participant. The participants were grouped into four categories, which are: (i) Healthy participants whose normal ECG signals were obtained at resting state: ECG signals of healthy non-athletes with little or no involvement in heart health risk factors and absence of genetic or congenital heart diseases represent normal ECG signals obtained at resting state.
(ii) Participants whose ECG signals were obtained during exercise: the ECG signals were obtained, in the course of exercise, from ten healthy athletes with little or no involvement in heart health risk factors and absence of genetic or congenital heart diseases. The ECG signals in this category conspicuously present signs of TACHY.
(iii) Participants who had been previously diagnosed of BRADY by a certified medical professional at a hospital: these include ten participants with history of recreational drug use and abuse as well as cases of prolonged consumption of alcohol and cigarettes and; (iv) Participants who had been previously diagnosed of HCM by a certified medical professional at a hospital: these include active and retired professional athletes. Ten participants were also selected for this group. They mostly have inherited heart defects or were involved in long and tedious sports practices for a major part of their lives.
Thus, 100 data vectors were obtained for each of the four categories (i.e. Normal, TACHY, BRADY and HCM), culminating in a total of 400 ECG data vectors. 40 out of the 100 participants were females (47.5%) while the remaining 52.5% were males. The mean age of participants was 31.73. The mean age value showed that the population sample is composed of predominantly younger people. 62.5% of the participants have been (or are) involved in strenuous athletic activity. 50% of the participants have been previously diagnosed of certain cardiac defects. 35% of the participants were involved in long-term smoking (>4 years). 35% were involved in heavy alcohol consumption and 17.5% had history of recreational drug use and abuse.
A database was created to store the acquired ECG data as well as relevant information such as family and sports history. In order to ensure data privacy, anonymity of data was promised and done by using a string of characters for name encoding. Figure 4 shows the event of ECG data acquisition of one of the volunteers.

Pre-processing and feature extraction
ECG data were affected by interfering signals from baseline wandering and muscle tremor. Therefore, series of signal conditioning processes were performed to ensure signal quality. Low frequency signals, which are commonly introduced by human breath, were removed using the Fast Fourier Transform (FFT) in MATLAB R2016a software. Having removed the low frequency components, the processed signals were later converted back to time-domain using Inverse Fourier Transform (IFT) operations. Representative features of the ECG data samples were extracted to represent the large pre-processed data in a reduced form. This ensured that only necessary features were presented to the ANN with sufficient discriminatory ability to segregate between the different classes of heart conditions under investigation. It also helped in making better and timely decision during pattern classification. First-order statistical signal processing technique was adopted as the feature extraction strategy in order to avoid system complexity during implementation. Hence, statistical mean, median, mode, variance, standard deviation, skewness, kurtosis and Signal-to-Noise Ratio (SNR) were calculated for each data sample.

Yes
The statistical mean estimates the value around which central clustering occurred. It is the first moment of distribution and it is calculated using Equation (1): N is the total number of instances in each sample set and x j is the current value in the sample set.
The median represents the value that separate the upper half of the ECG samples from the bottom half. The value was such that the amplitude of the ECG signal is equally likely to fall above or below it. The median is different from the mean in the sense that it is not skewed so much by extremely large or small values, and by so doing gives a different representation of the ECG sample.
The mode represents the amplitude that appeared most often in an ECG signal sample. The mathematical expression for mode is given by Equation (2): l b , w, f m , f a , and f b represent the lower boundary of the modal class, the size of the modal class, the frequency corresponding to modal class, the frequency preceding the modal class and the frequency after the modal class respectively. (1)

Figure 4. Acquisition of ECG signal of a volunteer.
The variance is the representation of the squared deviation of the signal amplitude from its mean. Equation (3) gives the formula for variance.
Standard deviation is the second moment of distribution and it was computed as the square root of the mean of squares of deviations from the arithmetic mean of the distribution given as Equation (4).
Skewness measures the symmetry of the probability distribution. If the left tail (tail at small end of the distribution) is more pronounced than the right tail (tail at the large end of the distribution), the function is said to have negative skewness. However, if the reverse is true, then a positive skewness is obtained. But if the two are equal, that shows zero skewness. This third moment of distribution is calculated using Equation (5): Kurtosis, a measure of the combined weight of a distribution's tails relative to the rest of the distribution, is the fourth moment of distribution. Kurtosis is measured against the standard normal distribution, which has a kurtosis of three. It gives information on the peak of the graph, showing how high the graph is around the mean. It is calculated using Equation (6): In statistical signal processing, the mean describes the signal that is being measured while the standard deviation describes noise and other interference. Thus, the ratio of the mean to the standard deviation is called Signal to Noise Ratio (SNR) and it represents an important metric for the acquired signal. The SNR of each sample is computed using Equation (7).
The mean, median, mode, variance, standard deviation, skewness, kurtosis and SNR of each of the pre-processed 400 ECG data samples were computed using MATLAB 2016a software MathWorks Inc. (2016). These values capture the inherent statistical properties of the ECG data and are utilised as features for the different classes of heart conditions in this study. The choice of this low computational feature extraction strategy becomes necessary, primarily for ease of implementation of the heart defect detection model on an embedded platform.

ANN model design and development
ANN is a computational tool, which consists of simple processing elements that are interconnected to model human cognition or neural biology using mathematical operations. A neural network is characterized by: the pattern of connections between the neurons (architecture); the rule that determines the weights on the connections (training or learning algorithm); and the activation functions (MathWorks Inc.). MLP-ANN is the most commonly used neural network. A model is developed using MLP-ANN by mapping the input data to the desired output using historical data such that the model can produce correct output when the desired output is unknown (Sarkaleh & Shahbahrami, 2012).
The extracted statistical features (mean, median, mode, variance, standard deviation, skewness, kurtosis and SNR) of 360 ECG samples (90 from each class) formed the input training data-set. Thus, eight input neurons were in the input layer: one input neuron was used for each of the eight statistical features. Single hidden layer architecture was used so as to maintain model simplicity. More so, the ECG data acquired was considered large enough to produce a reliable model. The output data (target) is a vector of four values, representing the range of the four possible heart conditions considered in this study (i.e. NORMAL, TACHY, BRADY and HCM). The target outputs of the neural network for each class as shown in Table 2, are based on unary encoding (Oyewole, Olugbara, Adetiba, & Nepal, 2015). The training data and the target output data were of the same matrix dimension. The single-layered MLP-ANN was trained using variants of the back-propagation algorithm (Adetiba, Ekeh, Matthews, & Daramola, 2011). In this way, the difference between the obtained output and the expected output was repeatedly fed back into the system until the predicted output is near or equal to the target output.
Extensive experimentations were performed to determine the optimal network architecture of the automated heart defect detection model. Pure linear (P), logarithmic sigmoid (L), and tangent sigmoid (T) activation functions were used at the hidden and output layers at different times.
The MLP-ANN was trained based on Levenberg-Marquardt (LM) and Scale Conjugate Gradient (SCG) learning algorithms at different times. Eighteen ANNs were investigated. These ANNs were coded as: PPLM, LPLM, TPLM, PLLM, LLLM, TLLM, PTLM, LTLM, TTLM, PPSCG, LPSCG, TPSCG, PLSCG, LLSCG, TLSCG, PTSCG, LTSCG, and TTSCG. The first two letters represent the activation functions at the hidden layer and the output layer respectively while the remaining letters represent the learning algorithm employed. The number of neurons in the hidden layer was varied from 1 through 10. The ANN model design, training, validation, and testing were done using the Neural Network Toolbox in MATLAB 2016a that runs on an Intel Core i5-3210MCPU@2.50 GHz speed with 4 GB Random Access Memory (RAM) and 64-bit Windows 7 operating system. The MATLAB script was programmed to randomly divide the training data into training subset, validation subset, and testing subset in the ratio of 70:15:15 (Adetiba & Olugbara, 2015a, 2015b to achieve cross-validation. A sample ANN training visualization is shown in Figure 5.

Performance evaluation of ANN models
Adequate measures were taken to guarantee the reliability of the developed model. The training of each of the 18 ANNs was performed 20 times at each instance of number of neurons in the hidden layers. In essence, 3,600 network configurations were considered, tested, and evaluated. The performance evaluation of the ANNs was based on the following standard Key Performance Indicators (KPIs): accuracy; sensitivity and specificity. The indices of accuracy, sensitivity and specificity were derived from four parameters: True Positives (TP), False Negatives (FN), True Negatives (TN) and False Positives (FP). TP represents correctly classified heart conditions while FP represents heart conditions that were wrongly classified. TN represents correctly unclassified heart conditions while FN represents unclassified heart conditions. The mathematical expressions of the KPIs are given by Equations (8)-(10): The Mean Squared Error (MSE) was also calculated to quantify the error between the predicted values and the desired outcomes. In addition, the optimal network was verified with the remaining 40 ECG feature sets that were not previously used in the training. This was done to ensure that the developed model could be used to classify new ECG signals obtained from athletes correctly and examine how well it generalizes.  The performances of LPLM, TPLM, LTLM, and TTLM slightly increased up to 97, 97, 97, and 98% respectively when the number of neurons was further increased to 10 by adding one neuron at a time. Despite the increase in the number of neurons up to 10, the accuracies of PPLM and PTLM did not improved beyond 80 and 92% respectively. On the other hand, the improvement in the accuracies of PLLM, TLLM, and LLLM was gradual but the trend was not consistent. The ANNs achieved their best performances of 62, 57, and 52% respectively when the number of neurons was increased to 10, 9, and 8 respectively.

Figure 6. ECG data sample of (a) normal (b) TACHY (c) BRADY (d) HCM and histogram
showing the distribution of ECG data sample of (e) NORMAL (f) TACHY (g) BRADY (h) HCM. Figure 8 gives information about the classification accuracies of the ANNs when they were trained based on Scale Conjugate Gradient learning algorithm. The changes in performance were observed as the number of neurons in the hidden layer increased. The trend was quite similar to the results obtained when the ANNs were trained based on Levenberg-Marquardt learning algorithm, except that the performances were lower. With three neurons in their hidden layers, PPSCG, LPSCG, TPSCG, PTSCG, LTSCG, and TTSCG achieved classification accuracies of 80, 88, 89, 81, 87, and 89% respectively. LPSCG and TPSCG experienced slight and steady improvement in their accuracies (up to 96%) as the number of neurons increased from 3-10. There was no further improvement in the performances of PPSCG and LTSCG when the number of neurons was increased beyond 3. The accuracies of PTSCG and TTSCG began to oscillate when the number of neurons was increased beyond three, and the peak values of 86 and 93% were recorded when the number of neurons was six and five respectively. On the other hand, the classification accuracies of PLSCG, LLSCG and TLSCG were below 50% as the number of neurons increased from 1 through 10. Their best performances were 44, 45, and 49% when the number of neurons was increased to 10, 9, and 6 respectively.
The result on the number of neurons that produced the best performance in each of the ANNs is presented in Table 3. By and large, the performances of ANNs that were trained based on Levenberg-Marquardt learning algorithm outperformed those that were trained based on Scale Conjugate Gradient learning algorithm. All of the ANNs trained based on Levenberg-Marquardt learning algorithm have classification accuracies that are above 50%. The network architecture with tansig activation function at both hidden and output layers, and 10 neurons in the hidden layer produced the best performance that cut across all the key performance indicators. The classification accuracy,    Table 4 provides information on the amount of variation or dispersion in the key performance indicators over 20 different runs of training for each of the network architectures under investigation. The performance results of TTLM were significantly consistent and stable over 20 different runs. The deviations of test results from the mean value were smallest in TTLM (0.0096 in accuracy, 0.0128 in MSE, 0.0311 in sensitivity, and 0.0199 in specificity), making it the most reliable network architecture. The deviations were highest in TLSCG with 20.2083 in accuracy, 0.0176 in MSE, 0.2585 in sensitivity, and 0.0864 in specificity. The weight and bias vectors for TTLM are presented in Tables 5 and 6.
The generalization capability of the developed and trained TTLM model was verified using new input data-set that were not used originally for the training. To generate these new data-set, one ECG data vector was obtained from each of the 10 participants across the four categories, thereby resulting in 40 ECG data vectors. Testing the trained model with this new data-set produced acceptable results as illustrated in the confusion matrix shown in Figure 10. All the 10 instances for the Normal, TACHY and HCM classes were correctly classified. However, for the BRADY class, only 6 of the 10 instances were correctly classified. Three instances were misclassified as TACHY while one instance was misclassified as Normal. The overall classification accuracy of 90% was achieved for all the classes as shown in Figure 10. Furthermore, a Receiver Operating Characteristic (ROC) curve was plotted (as shown in Figure 11), to reveal the diagnostic ability of the developed model as its discrimination threshold is varied. The True Positive Rate (TPR) was plotted against the False Positive Rate (FPR) and the sensitivity and specificity of the TTLM generalization testing were found to be 91.96 and 97.06% respectively.
Although there have been earlier studies on classification of ECG signals, most especially the study reported in (Das & Ari, 2014) that utilized MLP-ANN on MIT-BIH data-set, the study at hand developed a biomedical device that extracted ECG data from subjects for the purpose of automated    detection of heart defects in athletes. The result we obtained compares well with (Das & Ari, 2014) even though we utilized data-set acquired from participants recruited for the study at hand using the ECG device we developed.
With the result in the current study, wearable systems that incorporate our best ANN model can be implemented for athletes. Once the model classifies an ECG signal as HCM (which represent a major heart defect among athletes), the affected athlete can be promptly rescued to pre-empt the incidence of SCD. The appropriate medical personnel should also promptly attend to cases of BRADY in athletes.

Conclusion
In this paper, we have presented an automated heart defect detection model in athletes using ECG signals. With the ECG acquisition system developed in this study, ECG data-set were curated from subjects for four different categories of heart conditions. The compact and low computational first order statistical features extracted from the data-set were utilized to experimentally determine appropriate ANN model with acceptable accuracy, specificity and sensitivity. The next phase of this work involves the prototyping of smart jersey for athletes based on the best ANN model developed in this study. We also hope to deploy the smart jerseys for use in real-time sporting activities and interconnect them with online Internet of Things (IoT) platforms. This will allow remote monitoring of athletes heart conditions and thereby curtailing the high spate of sudden cardiac deaths among them. Furthermore, the ECG data acquired in this study (which is already anonymized) will be added into a research corpus being developed by us, to be made available online as an open access data commons for researchers.