X-RCRNet: an explainable deep learning network for COVID-19 detection using ECG beat signals

Wearable systems measuring human physiological indicators with integrated sensors and supervised learning-based medical image analysis (e.g. ECG, X-ray, CT or ultrasound images for lung or the chest) have been considered relevant tools for COVID-19 monitoring and diagnosis. However, these two technical roadmaps have their respective advantages and drawbacks. The current wearable systems enable to realize real-time monitoring of COVID-19 but are limited to its basic symptoms only, neither allowing to distinguish it from other diseases nor performing deep analysis. Current medical image analysis can provide accurate decision support for diagnosis but rarely deals with real-time data processing. In this context, we propose a new wearable system by combining the advantages of these two technical roadmaps. Considering that electrocardiogram (ECG) has been proved relevant to evolution of COVID-19 symptoms, the proposed wearable system will integrate an explainable Deep Neural Network to realize online monitoring of COVID-19 gravity by using ECG beat signal. This paper will focus on the Deep Neural Network model named X-RCRNet. The network is based on ResNet18 but with few enhancements: 1) LSTM Layers for regenerating the block memory and further extracting the involved time-varying features; 2) LeakyReLU for increasing the performances of the model. With an accuracy of 99.24 % after experiments, our model has not only outperformed the existing methods in terms of accuracy and robustness, but also originally identify the ST interval of the ECG pattern, as the most prominent key features affected by the virus.


Introduction
Three years after its emergence in late 2019, severe acute respiratory syndrome coronavirus 2 (Sars-CoV-2) or COVID-19 infected more than 630 million people, causing more than 6 million deaths [1].However, the symptoms of COVID-19 patients differ from one variant to another in this long duration.For all reported variants and all periods, the most serious symptoms are shortness of breath (blood oxygen level<92%) and heart failure (heart rate>90 bpm), [2][3][4][5][6].Although the intensity of infection and symptoms have attenuated thanks to the vaccination and follow-up of barrier gestures, we are still far from the termination of the pandemic.This is mainly due to the high infection rate, the proliferation of its variants that can escape from vaccination coverage, and the inability to detect the virus in real-time and thus, control its proliferation.This situation promotes the emergence of remote monitoring and diagnosis tools using the IoT (Internet of Things), including wearable systems, and supervised learning with medical images (ECG images, Xray, CT or ultrasound images for lung or the chest).Currently, these two categories of tools have effectively reduced the pressure of medical resources (e.g., medical doctors, healthcare staff, devices, materials, etc.).However, they are unable to perform reliable real-time monitoring and analysis for supporting quick decisions of medical professionals in complex diagnosis scenarios.The current wearable systems mainly realize real-time detection for the basic symptoms of COVID-19 from skin temperature, blood oxygen saturation (SPO2) level, and heart rate.Since these symptoms are common with other diseases (e.g.Flu), it is impossible to distinguish COVID-19 from others without further investigation [7].Medical image analysis with supervised learning is highly accurate and capable of providing reliable decision support to medical professionals.However, real-time processing with these images has rarely been involved in the existing research work due to its heavy computational load and complex conditions for supervised learning data acquisition (e.g.radiation exposure, requirement for qualified technicians and experts for image interpretation).Furthermore, the prediction results delivered by a supervised learning model are usually inexplainable from a medical viewpoint, which cannot provide relevant decision support for medical diagnosis.A new approach combining the advantages of real-time processing with wearable systems and accurate analysis of medical images with supervised learning models and high interpretation capacities will be significant for providing more efficient tools combatting COVID-19.Currently, we consider that heart failure is one of the most prominent symptoms of COVID-19 [5].Heart failure can be described using the Electrocardiogram (ECG) signal, especially beat signal (beat signal contains all information about cardiac condition).Different from ECG images, Xray or CT images requiring huge devices for data acquisition, ECG signals can be measured and processed in real-time by using portable tiny sensors.The analysis of ECG beat signals using an AI-based supervised learning model will be significant for COVID-19 monitoring.Our idea is to design and implement a wearable system coupling with an explainable supervised learning model named X-RCRNet (Explainable Residual Convolutional and Recurrent Network), to monitor the patient's symptoms from his/her ECG beat signals and make appropriate decision support in real-time.The main contributions of this paper are summarized below.
• At the supervised learning level, the performance of accuracy and robustness will be improved related to the existing work by introducing LeakyReLU (Leaky version of a Rectified Linear Unit) to avoid vanishing gradient and LSTM (Long-Short-Term Memory) units to extract temporal features.
• At the data acquisition level, a new open database of ECG beat signals for COVID-19 patients will be set up, enabling the collect more relevant data on infected patients.
• At the result interpretation level, the proposed super vised learning model will enable to accurately explain the results of classification for ECG beat signals.

The proposed model 2.1 Data-prepocessing
The original dataset used in this study is an ECG image dataset of cardiac and COVID-19 patients [8].It consists of 1937 distinct patient records, with five distinct classes: Normal, COVID-19, myocardial infarction (MI), abnormal heartbeat (HB) and history of myocardial infarction (PMI).The data were collected using the ECG device EDAN SE-RIES-3.The device collected 12 leads ECG trace images, sampling at 500 Hz.Each lead has a 2.5 second duration and the total duration length is 10 s on the 12 lead ECG images.The current dataset is not suitable for our wearable system due to data mismatch (Our single lead wearable ECG sensor measure 1d signal, X-RCRNet need to be train with 1d signal from a single lead instead of images).The first contribution of this paper will be a new single lead ECG beat signal dataset by converting single lead ECG trace images to 1d signals and extract heartbeat for each signal.Lead II ECG images was chosen for the image-signal conversion for two reasons: 1) The wearable ECG sensor of our system is a single lead ECG sensor; 2) Lead II is the lead that describes the best all ECG beat waves.The next lines describe the dataset creation process.The pre-processing was done by following three steps: • Image segmentation: Image cropping near the lead II area has been performed.is a black-and-white image with the ECG signal as the foreground has been obtained by using Otsu Method.
• Image to signal conversion: The signal was extracted by detecting the foreground pixel.The resulting signal has been down sampled to 125 Hz (Suitable for both time-domain analysis [34] and wearable systems [32]) .The signal is smoothed by convoluting the signal with a Hanning Windows [35].The Hanning window was chosen for two reasons :1) Good frequency resolution; 2) Spectral leakage reduction, especially for non-linear signals.

• Heartbeat Extraction and data augmentation:
The heartbeats were extracted using the Neurokit2 toolbox [9].The toolbox use Discrete Wavelength Transform (DWT) [10] to detect the P-waves, the R-peaks, and the T-waves Each heartbeat is centered around an R-peak.The interval from the P wave onset (The beginning of the P-wave) to the T-wave offset (The end of the T-wave) represents the beat duration.As show by Figure 1 the main features of an ECG beat are the PR interval, the QRS interval and the ST interval.The data augmentation has been done by applying different operations, like jittering, scaling, permutation, magnitude and time warping, resampling [11] We were able to generate up to 316 368 signals per class.To our best knowledge, this is the first public ECG beat signal dataset for COVID-19 patients.After the dataset creation, we proceed to the model training and evaluation.

Proposed framework
Illustrated by Figure 2,the model architecture can be divided into two parts: • Features extraction block: The purpose is to extract the signal spatial and temporal features using residual blocks.Inspired by ResNet, our model residual block possesses significant differences: 1) LeakyReLU is applied instead of ReLU.Indeed, negative values of the ECG beat signal will be replaced by zero.LeakyRELU the range of ReLU and allows negative values to be process; 2) LSTM Layer is applied before the pooling operation, to extract temporal features.Applying the LSTM Layer regenerate the residual block memory to retain the backpropagation error between the time step and the level.
The operation preserves the learning state in multiple time steps and improve the ability to extract temporal features.
• Classification block: After flattening the feature extraction block output, the fully connected layer transformed the data into a vector of numerical values corresponding to the outputs for each class.

Results
Figure 3 shows a convergence of the training and validation losses curves, with a final value of 0.0937 and confirms our model robustness.These results show the ability of our model to clearly identify COVID-19 patient heartbeat.
We compared our model with related studies with a five classes classification.Table 1 Show our model outperforms the existing ECG images classification tools for COVID-19.It also shows the possible use of ECG beat signal to monitor COVID-19 patients.At local level, the model explainability was performed using an approach called Gradient Weighted Class Activation Mapping ++ (Grad-CAM ++), is proposed in [15] .Grad-CAM visualize the gradients of the final layer of the Network in a heatmap.The heatmap can be used for analyzing factors that influence the classification result, and thus, help visualize where the network is looking.the main issue of Grad-CAM++ is the inability to give a dataset-level explanation.By using Grad-CAM++ we propose to compute, for each key feature, his frequency as the most prominent feature for each sample.Table 2 represents each key feature occurrence frequency,as the most important feature across the dataset.The results shows that X-RCRNet identifies the S-T interval as the most relevant feature for COVID-19 classification at the dataset level.Other researchers [2,4,5] confirm that the manifestation of a severe case of COVID-19 patients occurs in the ST interval.To our best knowledge, X-RCRNet is the first Deep Learning model to confirm ST interval of ECG pattern as the feature affected by the COVID-19 at a dataset-level.Despite its great performances, there are some limitations: 1) Since our experiments were conducted using synthetic data, another cross-validation with experts is recommended to further confirm of results; 2) While relevant, using the ECG beat signal alone is not sufficient to monitor the patient symptoms.The introduction of other relevant parameters (Body temperature, SPO2 level, cough, and human activity recognition) will be performed, to improve the monitoring ability of the overall proposed system, describes

Figure 1 -Figure 2 -
Figure 1 -A Normal Beat Signal (a disease-free regular ECG heartbeat signal and its decomposition); (b) beat signal samples per class

Table 1 :
Comparison with related studies

Table 2 :
Feature importance at dataset-level.The key feature with the highest occurrence is the most prominent key feature at the dataset level This paper presents X-RCRNet, a novel explainable deep neural network, based in ResNet18 for COVID-