1. Introduction
Atrial Fibrillation (AF) disease represents a major concern in cardiac arrhythmia in clinical practice since it affects around 2% of the community [
1]. This diseased, charactarised by asynchronized and irregular atria and ventricules contraction, attracts the focus of reserachers for early stage detection to avoid severe evolution and to reduce reduce of cardiovascular symptoms, morbidity and mortality. In depth most of AF episodes are asymptotics which does not play in favor of early stage diagnosis and awerness.
In ECG-based diagnosis, AF episodes often represented by the main features; RR irregularity and the absence of the P-wave, are not permanently detectable in the electrocardiogram. They might be manifested randomly in time making impredicatable the onset and the recurrence of the arithmya in the record. This adds a strong difficulty to the diagnosis [
2,
3].
The use of Artificial intelligence (AI) techniques is currently considred as the best approach for pattern recognition and classification. Indepth, the use of big relevant dataset and adequate classification model might contribute to build an accurate classification tool. Machine learning and deep learning models were, indeed, used for pattern detection and classification, in particular it was efficiently used for biosignal analysis and disease diagnosis [
4,
5,
6,
7]. The use of these detection methods for the diagnosis of AF detection based on ECG signals has been recently proposed in literature showing their adequacy and supremacy on classical feature- based engineering as detection methods [
5,
7].
From another side the use of IoT-based wearable device in e-health systems is gaining more importance and being advocated for large scale use [
3,
8]. In particular for AF detection, the use of wearable sensor tiny machine learning classifier is a very attractive method for accurate pe-diagnosis method that helps to avoid the burden of in-clinic lengthy recording sessions. Their deployement increases the probability of capturing non permanent episodes through multiple diagnosis sessions in the recorded ECG waveform.
Some solutions were reported in the literature for AF detection using wearable systems. M Lown et al. in [
9] proposed an algorithm based on the use of Lorenz plots of 60 consecutive RR mesures of intervals. These images were compressed using JPEG2000 and then introduced to an SVM classifier. The performance analysis was performed using MIT-BIH Atrial Fibrillation dataset. It has shown interesting accuracy of about 99.2 % of sensitivy and 99.7% of specificity. This solution was proposed for low-cost wearable device. Eventhough the measured sensitivity is very attractive, the use of images compressed with a high complexity algorithm for compression in addition to the SVM classifier significantly increase the processing resource requirements. We think that the energy consumption related to the use of this solution will not be optimized for long life time of the wearable devices. In addition the demand in terms of processing bandwidth and memory reduces its adequacy for IoT based werable sensor implementation.
In [
10], the authros proposed a hardware architecture for the implementation of Deep Neural Network (DNN) classifier for the detection of AF in low-frequency band of the ECG signal. The circuit was synthetized for VLSI implementation using the CMOS technology 180 nm. It was intebded to be used as a wearable device for AF detection ensuring a low-power consumption of 11.08 µW with a frequency of 25 kHz. The accuracy of AF detection was around 92% for class-oriented AF detection and around 81 % for subject oriented classification. We think that CMOS implementation is very suitable for low-power consumption which is an attractive characteristic for werable device. But the classification accuracy obtained is relatively low compared to other methods presented in literature. In Addition CMOS design is very costly compared to software implementation and less-adequate to evolution and scalability of the design.
Lee et al. in [
11] proposed a compressed deep learning model for wearable systems to detect AF episodes. They used Resnets and MobileNets with model compression based on TensorFlow lite. The authors reported in this paper that the accuracy of detection and other performances metrics such sensitivity, Specificity and F1 score are highly scored with both of Resnets and MobileNets but they demonstrated that the MobileNets model is more adequate for memory occupancy of Embedded devices. The paper has shown that the current consumed to process MobileNet model is about 7.4 mA and that the inference time is about 0.2 sec. So if we consider that the embedded device is powerd by 6v battery and that it processes segment of 10 sec ECG records than the expected energy consumption will be around 440 mJ. This energy consumption is highier than the energy consumption presented with other approaches such as the model based on time-domain ECG processing for AF detection in wearable device [
12] where we have measured an energy consumption of around 100 mJ for the same segment length. Eventhough the presented solution is attractive interms of accuracy and design methodlogy, it is still higly demanding in energy consumption and does not play in favor of extended life time of the wearable device for multiple diagnosis sessions. The detection accuracy of 97% was reported with the use of less complexity ML algorithms that are more adequate to low-memory occupancy and low-power consumption.
The solution that we have proposed for Embedded atrial fibrillation detection [
12] was based on extraction RR-feature in the time domain andand detection the absence of P-wave to calssify processed ECG segment. Decision of AF detection is made upon a block of processed consecutive segments allowing to reach a sensitivity of 99 % and specificity of 96 % while ensuring a low-energy consumption. We think that the main issue in this proposed solution is its high sensitivity to noise since the signal is processed in the time domain. The QRS detection and measurments of RR intervals and P-wave detection can be significantly affected by motion artifacts and other sources of noise. Furthermore we think also that classification over groups of ECG segments might reduces accuracy since some AF episodes might go undetected. From another side, it was reported in the literature that the mean features of for efficient AF detection can be detected in the frequency domain or in the time frequency domain. That’s why we believe that an extension of the proposed scheme to process the ECG signal in time-frequency domain with the extraction of relevant features might provide more scalability and resistance to noises. The use of ML algorithm will significantly reduce the sensitivity of this solution to noise and will reduce the dependency of the of the results to the dataset.
Saadatnejad et al. in [
13] presented a wearable solution for arrithmya classification using ECG signals. They used wavelet transform of the the ECG followed by LSTM Recurrent Neural Network architecture for classification. They have used MIT-BIH ECG arrhythmia database for training and for testing, showing that for 7 classes of arrithmya, the accuracy was above 95% for most of the signals. The algorithm was proposed for embedded implementation and it was prototyped for 3 types platforms. They have used in depth Moto 360 which is an adroid wearable device based on CPU ARM Cortex A7. They have measured an execution time of 31 ms. When implemented on NanoPi Neo Plus2 using CPU ARM Cortex A53 the execution time was 39 ms. Using Raspberry Pi Zero the measured time was around 58 ms. The classification approach was performed for ECG data window of 300 ms. Eventhough the classification was not oriented for the detection of AF episodes, this approach demonstrated the feasibility of analyzing ECG signal for arrithmya disagnosis in wearable device. In this study the authors did not proved the energy efficiency of the proposed approach.
Based on the previous discussion we can state the the design of low-complexity scheme based on AI techniques for ECG processing and AF detection is well feasbale using wearable system. However a carefull attention should be yet for the selection of low-complexity tasks while ensuring efficient accuracy for AF detection.
We propose in this paper, a new study addressing the design of a low-complexity scheme for AF detection based on machine learning algorithms using wearable wireless sensor. The main novelty is to assess the capability of some machine learning algorithms for wearable AF detection and their adequacy for embedded system implementation. The new proposed scheme will be using per segment of 10 sec for the detection of QRS complex using dual-slope algorithm[
12] followed by Discrete Wavlet Transform for the extraction of usful features ( RR intervals and P-wave absence ) that will be used to train and to classify input signals. We assess in this paper the execution time and the energy consumption related to processing of the proposed scheme to check its adequacy for embedded AF detection.
The main research question to which this paper is trying to provide an answer is ; is it possible to deploy ML algorithms for low-energy wearable solution for AF detection using IoMT devices?
The remain part of the paper is organized as follow. We first present the general approach and the methodlogy for the design of the proposed AF detection scheme. Next, we present the experimentation and the obtained results. These result will be discussed and analyzed in the discussion section. We present in the last section the conclusion of this research and the feature works.
3. Methodolgy
The adopted methodology to design the proposed low-complexity scheme for wearable AF detection is summarized in
Figure 1. The different tasks of the scheme are implemented using python and matlab languages. The proposed scheme based on machine learning algorithm for classification is trained and tested using MIT-BIH dataset. It is assessed in terms of accuracy of AF detection at the application level. The retained solution showing the highest accuracy is then implemented using python language to be simulated on different wearable IoMT solutions such as (Waspmote and Zolertia Z1 platforms). These implementations on IoMT devices are used to evaluate the energy consumption, the memory occupancy and the execution time.
- 1.
General approach
Figure 1.
Adopted methodology for the design of the embedded AF detection scheme.
Figure 1.
Adopted methodology for the design of the embedded AF detection scheme.
- 2.
Structure of the proposed scheme
Relevant features for AF detection in ECG signals were discussuded in [
12]. We have shown that the combination of RR interval’s measurments combined with the absence of P-wave detection in an ECG segment can be efficiently used for high accuracy [
14,
15]. The difficulty that was faced in [
12] is that the definition of model for p-wave reference in the time domain doesn’t provide and a stable biomarker for the detection of this wave in the test ECG segement. In depth the p-wave has a low amplitude and can be easily missed in detection because of noise. Furthermore, p-wave shapes in ECG signals are subject dependent which does not play in favor of automated detection. Therefore, in the new scheme the detection of the p-wave will be performed in the time-frequency domain using Discrete wavelet transform
Figure 2.
The proposed scheme that is illustrated in
Figure 2 uses Dual-Slope (DS) algorithm for the detection of QRS complex in the ECG segment. The detection accuracy of the R-peaks was evaluated in [
12] using different AF ECG segements from MIT BIH arrhythmia dataset. We have demonstrated that the DS algorithm was capable to perform as good as the Pan Tompkins algorithm (PT) [
14] while showing lower processing complexity. The detection accuracy of the DS algorithm for R peacks is around 97%. The PT algorithm is processed in the frequency domain after the fourrier transform of the ECG signal. To evalauate the processing complexity of these two algorithms, we implemented them in Waspmote sensors to compare the Flash memory requirement and the execution time.
Table 1 shows these results. As illustrated in this table the DS algorithm is requiring around 50% less than the flash memory required by TP and around 57% of less execution time. This attests about the adequacy of DS algorithm for low-ressources execution wearable devices.
The adoption of the DS algorithm in this scheme was encouraged by its capability to provide efficient solution to mesure RR intervals that is used for simple statsical measure to capture the RR- irregularity interval. This measurement defines the estimate standard deviation of the series of RR intervals in the ECG segment. It represents the first used feature as input for the classifier of the signal.
Figure 2.
General structure of the proposed scheme for embedded machine learning based AF detection. (a) ECG wave form; (b) deplyement of the scheme as wearable IoMT. (c) proposed scheme.
Figure 2.
General structure of the proposed scheme for embedded machine learning based AF detection. (a) ECG wave form; (b) deplyement of the scheme as wearable IoMT. (c) proposed scheme.
The use of 1-D DWT to transform the input non-stationary ECG signal is suitable to extract relevant feature in the tim-frequency domain. In our approach, we used Haar for its low computational requirements. Each level of the Haar DWT is implemented as a cascade of low-pass filter and high pass filter. The output of the low-pass filter that represents the approximation coefficient is then decomposed again to generate the next level. We adopted a decomposition at the 2nd level that provides good a good reduction of noises.
The Haar DWT is charactirised by a reduced number of computational operations. For a a length N samples, it needs
additions and
multiplications to process the first level of the decomposition. For the second level, it needs
additions and multiplications. Since we are using the second level of decomposition, Haar wavlet requires
additions and multiplications. This number of arithmetic operation is much less than other proposed implementation for IoT devices [
17].
The P-wave detection is always expected in the second half of the RR intervals. In depth, we estimated the pR distance (
) from QT dataset [
17] to prove that the useful interval for p wave searching is the second half (
Table 2). We used 21766 pR pairs in this analysis that has shown the rsults illustrated in
Figure 3.
Based on
Figure 3 we can attest that around 98% of the studied P waves have a distance
in the interval [0.12, 0.22]. Only 2% have
outside of this interval. This results attests about the search interval of the p-wave should be in the second half of the interval RRs of the acquired ECG segment. The processing of short window length of the EEG segment is expected to reduce the processing load and therefore it reduces the energy consumption in the wearable IoMT device.
In a segment of 10-sec the number of absent P waves in the N serach interval is denoted by
. These parameters were used to define the second used feature in this study defined by (2) that represent the fraction of the absent p wave in the ECG segment.
In our proposed method the P wave is detected using the discrete wavelet transform applied to the the second half of the RR interval in the segment. This transform is used to provide an approximate morphology of the second half of the RR intervals.
To determine the number of absent p waves we developed a model that is used to calculate the feature expressed in (2). This model was developed based on the signals mentioned in Table3 usingmQT dataset [
18].
Table 3.
NSR signals used to create the p wave template.
Table 3.
NSR signals used to create the p wave template.
Sel16265 |
Sel16272 |
Sel16273 |
Sel16420 |
Sel16773 |
Sel16939 |
sel117 |
sel123 |
Sel213 |
Sel16786 |
Sel17152 |
Sel17453 |
The model is obtained by normalization of the approximation coefficients at the second level of the Haar DWT transform. The template of the built P wave is presented in
Figure 4.
The model of the P wave denoted by (
is then used to detect its presence in each second half of the RR interval and to extract the fraction of p wave absent in the ECG segment. However the main difficulty to do that is that extracted P waves don’t have the same length as the built model. In depth the length of the P waves varies according to the duration of the RR intervals. To solve this issue we have used Dynamic Time Warping (DTW) method that allowas to estimate the distance between two time series of differents lengths and not aligned [
19]. This method is applied as follow. For two series X and Y ;
and
. The DWT constructs m x n matric (
) where each cell represents the alignment between
and
. the main objective of DWT is to find out the optimal alignment between the sequences with the minimum distance. The distance in each cell is calculated recursively by (4).
The implementation of DWT results on a quadratic space complexity
that represents a high complexity and is not adequate for wearable devices. Therefore we used a linear space- complexity implementation of the DTW (
Figure 5). In this approach, we keep only the current and the previous columns as the distance maticx is evaluated. This method to evaluate the minimum distance does not keep track of the warping pat, but for our purpose of getting similariy between the detected p wave and the P wave model (
Then with the estimated value of the minimum distance, we compare it with the pre-determined threshold value to decide if we have a valid P wave or it is absent. For the evaluation of this threshold we have used a set of AF signal as well as NSR signals from MIT Atrial Fibrillation Dataset and also from MIT BIH Normal sinus Rhythm dataset as illustrated in
Table 4.
The frequency of distribution of distances DTW for P waves is illustrated in
Figure 6. We can see from this figure that for AF signals, the distances DTW is for 92% higher than 3.2 (
Figure 6.a). For NSR the value of the DTW distance is for 86 % less than 3.2. So we think that this feature gives a clear clustering and can be well used train the classifier for efficient discrimination between AF episodes and non AF signals which help the classifier to correctly assess the acquired signal.
- 3.
AF detection using machine learning classifiers
In biomedical engineering, using machine learning (ML) for classification and disease’s diagnosis has shown interesting performances [
20,
21,
22]. In this paper we study the perfrmances of three ML classifiers; Support Vector Machine (SVM), Logistic Regression, and Decision Tree algorithms for AF detection. We will also assess the adequacy of these algorithm for embedded implementation in werable devices.