Next Article in Journal
Pre-Planning the Surgical Target for Optimal Implant Positioning in Robotic-Assisted Total Knee Arthroplasty
Next Article in Special Issue
EnsemDeepCADx: Empowering Colorectal Cancer Diagnosis with Mixed-Dataset Features and Ensemble Fusion CNNs on Evidence-Based CKHK-22 Dataset
Previous Article in Journal
Organotypic 3D Co-Culture of Human Pleura as a Novel In Vitro Model of Staphylococcus aureus Infection and Biofilm Development
Previous Article in Special Issue
Histopathological Analysis for Detecting Lung and Colon Cancer Malignancies Using Hybrid Systems with Fused Features
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Self-Attention MHDNet: A Novel Deep Learning Model for the Detection of R-Peaks in the Electrocardiogram Signals Corrupted with Magnetohydrodynamic Effect

1
Department of Electrical, Electronic and System Engineering, Universiti Kebangsaan Malaysia, Bangi 43600, Malaysia
2
Department of Electrical Engineering, Qatar University, Doha 2713, Qatar
3
Department of Mechanical and Industrial Engineering, Qatar University, Doha 2713, Qatar
4
Department of Biomedical Engineering, Military Institute of Science and Technology, Mirpur Cantonment, Dhaka 1216, Bangladesh
*
Author to whom correspondence should be addressed.
Bioengineering 2023, 10(5), 542; https://doi.org/10.3390/bioengineering10050542
Submission received: 31 March 2023 / Revised: 19 April 2023 / Accepted: 21 April 2023 / Published: 28 April 2023

Abstract

:
Magnetic resonance imaging (MRI) is commonly used in medical diagnosis and minimally invasive image-guided operations. During an MRI scan, the patient’s electrocardiogram (ECG) may be required for either gating or patient monitoring. However, the challenging environment of an MRI scanner, with its several types of magnetic fields, creates significant distortions of the collected ECG data due to the Magnetohydrodynamic (MHD) effect. These changes can be seen as irregular heartbeats. These distortions and abnormalities hamper the detection of QRS complexes, and a more in-depth diagnosis based on the ECG. This study aims to reliably detect R-peaks in the ECG waveforms in 3 Tesla (T) and 7T magnetic fields. A novel model, Self-Attention MHDNet, is proposed to detect R peaks from the MHD corrupted ECG signal through 1D-segmentation. The proposed model achieves a recall and precision of 99.83% and 99.68%, respectively, for the ECG data acquired in a 3T setting, while 99.87% and 99.78%, respectively, in a 7T setting. This model can thus be used in accurately gating the trigger pulse for the cardiovascular functional MRI.

Graphical Abstract

1. Introduction

The use of functional magnetic resonance imaging (fMRI) has been proven to be an excellent method for evaluating the functional condition of the heart [1]. Other imaging methods, such as echocardiography, cardiac computed tomography (CT), and nuclear medicine, are complemented by cardiovascular fMRI, which plays an important role in the diagnosis and treatment of cardiovascular diseases, as well as in research [2]. It is also standard for assessing cardiac structure and function [3]. fMRI can also be used to obtain functional information regarding vascular blood flow. Along with being a valuable tool for diagnosis, fMRI is also used in surgical planning of complex congenital heart diseases [4]. Procedures such as taking biopsies, tumor therapies, and electrophysiological studies benefit from fMRI.
A prerequisite for cardiovascular fMRI is the adequate synchronization of image acquisition with the cardiac cycle [5]. For that, the use of an accurate triggering pulse is required to permit the successive acquisition of imaging sequences in line with the phase of the heart. It is possible to generate the triggering pulse using a variety of methods, including photoplethysmography signals [6], a Doppler ultrasound [5]-based method, and an optical-based sensor [7]. However, the most common and straightforward way to accomplish this goal is to record an electrocardiogram (ECG) in parallel with MRI and use the location of the R-peak on the ECG to trigger the acquisition [8,9]. Therefore, good synchronization is necessary for collecting precise data in fMRI, which is highly dependent on the precise detection of R-peaks from the ECG signal. Additionally, concurrently recording an ECG with an MRI scan can also be used for diagnostic purposes. ECG is an essential tool for evaluating cardiovascular function and frequently appears in clinical practice. Because it might be challenging to visually monitor or converse with the patient while inside the MRI scanner, the attending physician or clinical staff must rely on the patient’s vital data to make a diagnosis. MRI patients, especially those in critical or unstable condition, need to be adequately monitored during the procedure [10]. For example, patients coming from an intensive care unit (ICU) or patients under anesthesia need proper monitoring. A diagnostically useful surface ECG is unavoidable for MRI-guided electrophysiological (EP) operations, which are sparingly carried out in modern day practice, but have the potential to become more significant in the foreseeable future [11,12].
However, the imaging setup (high static magnetic field, gradient switching, radio frequency (RF) pulse) of MRI greatly undermines the synchronization process by heavily distorting the recorded ECG signal. A high magnetic field mainly distorts the ECG signal, known as the Magnetohydrodynamic (MHD) effect [13,14]. Blood, consisting of charged ions, is subjected to a continuous flow due to the pumping activity of the heart. When a subject is placed under a magnetic field, the magnetic field exerts a force on the dynamic ions of the blood [14]. This force is known as Lorentz force, and it acts perpendicular to the direction of the applied magnetic field and the direction of the blood flow. Due to this, ions distribute themselves in the periphery of blood vessels and produce an electric voltage. The induced potential due to the MHD effect superimposes the recorded ECG signal and alters the waveform of the recorded signal. Many other parameters influence the MHD effect, as summarized in Figure 1. In the distorted ECG signals, the amplitude of the T wave eclipses that of the R-peak and makes it difficult to detect the location of R peaks [15]. Similarly, in most cases, due to the superposition of the ECG and MHD signals, a detailed and reliable morphological analysis of the ECG (e.g., the P wave, ST segment, or the T wave) during MRI exams is not possible [16,17,18,19,20]. Another challenge is the detection of the QRS complex. Depending on the characteristics of the MHD signal, QRS detection might be hampered [21].
Numerous studies have examined the effects of various noise sources, including the MHD effect and artifacts, on ECG signals. In addition, abnormal ECG signals, such as arrhythmia and premature ventricular contraction [22], have been investigated. There have also been studies conducted that deal with separating fetal ECG from mother ECG [23]. These studies were conducted in various experimental settings, and multiple algorithms have been proposed for detecting R-peaks, generating trigger signals, and classifying normal and abnormal ECG signals. During the earlier stages of working with MHD-affected ECG signals, extraction of referenced ECG signals from the distorted signal was predominant. In the extraction of referenced ECG signals, various filtering techniques were incorporated, such as Independent Component Analysis (ICA) [9], Wilcoxon filter [24], Least mean squares (LMS) adaptive filtering [25], as well as other adaptive filtering methods.
Numerous studies have been conducted on the detection of R-peaks in non-MHD corrupted ECG signals. One of the most popular methods is the Pan-Tomkins algorithm [26]. The algorithm uses filtering, differentiation, squaring, and thresholding to detect the R-peaks. Adaptive filtering and template matching have been used to further improve the detection performance. Continuous wavelet transform with selective scale [27] and Shannon’s energy [28] have also been used to detect R-peak locations, while discrete wavelet transform was used in [29]. In [30], the authors used sorting and thresholding squared double difference signals from ECG data to estimate R-peak locations. Another study conducted by Mabrouki et al. [30] consisted of cleverly combining Hilbert transform and empirical mode decomposition. While, in [31], a novel empirical mode decomposition algorithm was used, called ensemble empirical mode decomposition with the adaptive noise (CEEMDAN). The algorithm addresses the issue of ‘mode-mixing’ and different realizations of signal with Gaussian white noise. The method uses modes 2–5 from CEEMDAN to detect the R-peak locations.
In terms of R-peak detection in MHD corrupted signals, Vectorcardiogram (VCG) [32,33,34,35] had been extensively used along with the signal processing techniques before the adoption of decomposition techniques. The extraction of the R-peaks reference vector from the ECG signal recorded outside of an MRI scanner was a prerequisite for this method. The location of R-peaks in MHD affected the ECG signal and was determined using projections of the VCG signal across the reference R-peak’s directions [32], where the reference R-peak is the extracted R-peak vector from the ECG signal taken outside of the MRI scanner. Euclidean, as well as cosine [32], directions were incorporated with the projection for better accuracy. Derivative-based methods [33] have also been studied in various experiments. Krug et al. [9] used Independent Component Analysis (ICA) to diminish the effects of MHD in ECG waveform, and R-peaks were then detected. Twelve-lead ECG data were processed using ICA after being captured in a 7T MR scanner. To locate the dominant independent component (IC) in the ECG signal, an automated source identification approach was presented. Once the IC was selected, it could be utilized for R-peak detection. The decomposition-based technique supplanted other signal processing-based techniques with the emergence of wavelet decomposition and wavelet transform to detect R-peaks [36], or for signal processing to extract the reference ECG signal [36,37] with greater accuracy. With the improvements in computation power, both machine learning associated with signal processing [38,39,40] and deep-learning-based approaches [41,42,43] have become ubiquitous and have been intensively used in the detection of R-peaks/beat detection in noisy and abnormal ECG signals.
The motivation of this study is to devise a robust R-peak detection system for MHD corrupted ECG signals using a deep learning technique that seemed promising for highly corrupted Holter ECG datasets [44]. The authors believe that the inherent adaptability of deep learning models will help handle the noisy nature of the data. To this end, this work aims to contribute to the field by:
  • Proposing a novel deep learning model, Self-Attention MHDNet, which can accurately detect R-peaks by approaching the problem as a segmentation problem.
  • Assessing the performance of the model on ECG data collected from both 3T and 7T MRI machines.
  • Pioneering the use of deep learning models for R-peak detection in MHD corrupted ECG signals.
  • Demonstrating that three-channel ECG signals are sufficient for detecting R-peaks in multi-channel ECG signals.
The manuscript is organized as follows: In Section 2, the methodology employed in this study is expounded, encompassing a concise depiction of the dataset, the problem formulation, the network architecture, the training methodology, and the evaluation metrics. The outcomes of the ablation study, the evaluation of the model, and a comparison with the current literature are presented in Section 3. Finally, the manuscript is concluded with Section 4.

2. Materials and Methods

In this section, the experimental setup, problem formulation, dataset description, pre-processing steps, and the proposed deep neural network architecture along with training methodology for detecting R-peaks in MHD-corrupted ECG signals are discussed. Finally, the various metrics used for evaluating the model are described.
The process of detecting R-peaks from patients inside MRI has been summarized in Figure 2. Patients were scanned using an MRI scanner while their ECG signals were recorded. Due to the presence of MRI magnetic fields, the ECG signals were corrupted by the MHD effect. The corrupted ECG signals were first preprocessed, then they were split into training, validation, and test sets. The training set was used for training the proposed model, while the validation set was used to choose the best model. The resulting best-trained model was then used on test data to detect R-peaks.

2.1. R-peak Detection as av Segmentation Problem

Segmentation is a popular method in the biomedical image and signals domain for its ability to isolate the regions of interest (ROIs) [45]. Most segmentation models are variants of the UNet model [46], which consist of an encoder and a decoder. The 2D segmentation models take an image as input and produce a mask where the region of interest is depicted as 1, while the background is depicted as 0. This methodology can be adopted for detecting R-peaks in ECG signals, based on our previous work [44]. In this case, the region of interest is the R-peak location. The R-peak locations are manually annotated by expert physicians. The R-peaks are modeled as a rectangular pulse with a height of 1.0 and a length of 13 samples (roughly 12.7 ms) [44]. A corrupted ECG and its corresponding R-peaks as pulses are shown in Figure 3. The signals are ‘widely’ plotted so that the width of the pulse train can be easily seen. In this work, the proposed model will map a corrupted three-channel ECG signal to a pulse train, where the pulses refer to the R-peak locations.

2.2. Dataset Description

The dataset used here is taken from Krug et al. [47], as they made the dataset public in “PhysioNet” [48,49]. The motivation behind the collection of this dataset was to carry out further research on analyzing the ECG signals corrupted by the strong static magnetic fields generated by MRI machines. The dataset contained 53 records from 29 subjects. The data is annotated by either Physicians or ECG experts. In this work, ECG data corrupted by 3T (23 subjects) and 7T (5 subjects) magnetic fields are used, as the number of subjects for 1T (only 1 subject) is insufficient for training deep learning models. Moreover, in this dataset, the number of ECG channels is not uniform for all subjects. Some subjects have twelve channels, while the others have only three channels (Lead I, II, and III). Therefore, for both 3T and 7T machines, three channel ECG signals have been used. The dataset was sampled at 1024 Hz and segments of 4 s duration were applied as input to the deep learning models.

2.3. Preprocessing

The MHD corrupted ECG signals were filtered with a bandpass filter of 0.05 Hz to 100 Hz bandwidth. After the bandpass filtering, a notch filter or narrowband band stop filter with a central rejection frequency of 50 Hz was applied to clean power line distortions. Figure 4 depicts the effect of preprocessing steps on raw ECG signals. The waveforms in Figure 4a,c show ECG signals corrupted by magnetic fields of 3T and 7T, respectively. The aforementioned preprocessing steps were applied to both signals. The result of the preprocessing steps on signals in Figure 4a,c are shown in Figure 4b,d, respectively.

2.4. Model Architecture

In this work, a novel architecture is proposed for detecting R-peaks via a segmentation model, named Self-Attention MHDNet. The network utilizes the concepts of Self-Organizing Operational Neural Networks (Self-ONN) [50,51,52,53,54], Feature Pyramid Networks (FPN) [55], and Attention mechanism. This subsection explains the Self-ONN layers, the actual network, and how the Attention mechanism works.

2.4.1. Self-ONN

This work proposes a new architecture using Self-ONN [50,51,52,53,54] for R-peak detection. Operational Neural Networks (ONNs) employ generative neurons rather than homogeneous linear approximations used by Convolutional Neural Networks (CNNs) [50,51,54]. ONNs are conceptual expansions of the neural network class, Generative Operational Perceptrons (GoPs) [51]. Self-ONNs are an efficient version of ONN, where the operators are no longer selected from a library of operators. Because genuine neurons execute a wide range of neurochemical processes, these ONNs and Self-ONNs emulate them by simulating numerous synaptic connections and operations in the deep learning layer. For an input feature x n 1 , of n t h neuron, the approximation function f x can be formulated by using Equations (1)–(3).
f x = f x 0 +   f x 0 1 ! x x 0 +   f x 0 2 ! x x 0 2 + + f q x 0 q ! x x 0 q
f x = f 0 +   f x 0 1 ! x +   f x 0 2 ! x 2 + + f q x 0 q ! x q
f x = b + ω 1 x + ω 2 x 2 + + ω q x q
This approximation is derived with the help of the Taylor Series approximation. As shown in Equation (3), b is the bias that is formulated from the Taylor series approximation on x→0. For Self-ONN layers, tan h activation, instead of ReLU, is used so that the approximation is bound between −1 and 1. Several studies have shown that Self-ONN-based model designs outperform CNN-based architecture [53,54,56]. Previous work has also studied how Self-ONN compares in R-peak detection for Holter ECG signals [44]. Hence, it is important to examine the effectiveness of a deep Self-ONN model for R-peak detection in MHD-affected ECG.

2.4.2. Self-Attention MHDNet

The model, as shown in Figure 5, contains four layers in the encoder section and four layers in the decoder section with a bottleneck in between. Each Self-ONN layer (q = 3) is followed by an instance norm and tanh activation. The architecture requires the signal length to decrease as we go deeper and for it to increase as we go ‘upwards’ from the deeper layers. For decreasing the signal lengths, we use a max pooling layer, which decreases the length by a factor of 2. For increasing the signal lengths, we use an upsampling layer, which increases the length by a factor of 2. As a result, the signal length is halved as we go deeper. The first layer of the encoder contains only 16 filters. The number of filters doubles as we go deeper into the network, with the bottleneck having 256 filters. The kernel size is kept the same throughout the model with a size of 11.
In place of a normal skip connection between the encoder layer and the decoder layer, an attention block is placed in between to focus on the relevant parts of the signal. The attention block takes in the encoder signal from the i t h layer and the decoder signal from the i + 1 t h layer. The attention-guided signal is then concatenated with the decoder signal from the i t h layer.
In a normal encoder-decoder architecture, the feature map of the final layer is passed through an ONN layer to obtain the final segmentation mask. However, taking inspiration from FPN, a feature concatenation approach is taken. Feature maps from the first, second, and third decoder layers are concatenated together. Deeper layer feature maps are interpolated to match the shape of the feature maps in the output layer (layer 1). The resulting feature map is then passed through an ONN layer of kernel size 1 that produces the final output.

2.4.3. Attention Mechanism

The attention mechanism helps in focusing the features of the model into maximum relevancy. Figure 6 demonstrates the attention mechanism in detail. The attention block takes in two signals viz. the encoder signal (from i t h layer) and the decoder signal (from i + 1 t h layer). Both the encoder and decoder go through an ONN layer of kernel size 1 followed by instance normalization. The ONN layer has the same number of filters as the number of channels in the signal. The decoder signal is then upsampled by a factor of 2, and then added to the encoder signal in a summation operation. The resulting signal is introduced to some non-linearity in the form of tanh activation.
The signal is then passed through an ONN layer of 1 filter with kernel size 1, which is later normalized via instance normalization. We now have a vector that is the same length as the encoder signal. Another non-linearity is introduced in the form of sigmoid activation so that the vector is between 0 and 1. The vector is then multiplied elementwise with the encoder signal. The product is then given as the output of the attention block.

2.5. Training Methodology

The dataset is split into five folds, where three folds are used for training, one fold for validation, and one fold for testing. The split is carried out in such a way that there is no leaking of the same subject’s data between the folds. The results reported in this study were calculated by averaging over all five folds. The training data is split into segments of 4-s duration with a 75% overlap. The process is the same for both 3T and 7T. This ensures that there is enough data for the training phase. This resulted in 2809 segments for 7T data and 9171 segments for 3T data. A batch size of 128 is used to train the model for 100 epochs. The Adam optimizer is used to optimize the cross-entropy loss with a learning rate of 1 × 10−3.

2.6. Evaluation Criteria

The trained models were quantitatively evaluated in two categories: segmentation and R-peak detection. Intersection over Union (IoU) and Dice Similarity Coefficient (DSC) are computed to robustly quantify the performance of the network in 1D segmentation mask generation. IoU and DSC are calculated using Equations (4) and (5), respectively. Here, TP, FN, and FP refer to true positive, false negative, and false positive, respectively, in terms of the segmented 1D waveform data points.
IOU = TP TP + FN + FP × 100 %
DSC = 2 × TP 2 × TP + FN + FP × 100 %
For R-peak detection, three metrics are employed viz. recall, precision, and F1-score, as shown in Equations (6)–(8), respectively. It is also essential to note that the number of true positives, false positives, and false negatives was obtained within 70 milliseconds of the true peak location [44]. For R-peak detection, TP, FP, and FN refer to instances where the R-peak is properly detected, falsely detected, or not detected, respectively.
Recall = TP TP + FN × 100 %
Precision = TP TP + FP × 100 %
F 1 score = TP TP + 1 2 FP + FN × 100 %
For easy readability, the five metrics were converted from ratios to percentages.

3. Results and Discussion

In this section, we present the experimental outcomes of the study with brief discussions on each. Firstly, the authors conduct an ablation study regarding the importance of various blocks that make up the proposed network. The authors then analyze the R-peak detection capability of the model in 3T and 7T data. Finally, the performance of the proposed network is compared to the current literature in R-peak detection of MHD corrupted signals. The models were newly trained for both 3T and 7T data.

3.1. Ablation Study

To verify the effect of the various modules on the proposed model, an ablation study is conducted where the effect of Self-ONN layers and attention mechanism is studied. In each experiment, the model is newly trained following the structure discussed in Section 2.5. The results of the ablation study are shown in Table 1 and Figure 7. An FPN architecture (using CNN instead of Self-ONN) is used as the baseline model, while all other parameters are kept the same. The baseline model performs well with IoU and DSC of 96.35% and 96.33% for 3T, and 93.85% and 95.55% for 7T. Changing CNN layers to Self-ONN layers results in IoU and DSC increasing to 97.88% and 98.36% for 3T, and 95.01% and 97.31% for 7T. For 3T, it shows an improvement of 1.53% and 2.53% in terms of IoU and DSC. On the other hand, 7T shows an improvement of 1.16% and 1.76% in terms of IoU and DSC.
Adding an attention mechanism pushed the model’s performance to an even higher level. The IoU increased from 97.88% to 98.97% (3T) and from 95.01% to 97.01% (7T) when compared to the Self-FPN model. The DSC increased from 98.86% to 99.01% (3T) and from 97.31% to 98.36% (7T) for the same situation. This addition caused the most improvement in IoU for 7T, as it increased by 2.00%. Thus, replacing CNN with Self-ONN layers and then adding an attention mechanism appears to be a promising method for detecting R-peaks in MHD-affected ECG.

3.2. R-peak Detection Analysis

The ablation study proved that Self-Attention MHDNet outperforms all other variations of FPN in segmenting the R-peak pulse train by a significant margin. Hence, the performances of R-peak detection are computed on the results of that model where the Self-Attention MHDNet model has been separately trained for both 3T and 7T data. The previously discussed evaluation metrics are shown in Table 2. It can be observed that recall, precision, and F1-score for both settings are above 99%. Furthermore, the F1-score is used as the main metric as it is a harmonic sum of recall and precision. Considering that, even though both models performed very well, the performance in the 7T setting marginally outperformed the model in the 3T setting.
For qualitative evaluation, Figure 8 depicts the prediction of R-peaks from three-channel ECG waveforms under the 3T setting. Only channel 1 or lead I of the ECG is visualized. The green shaded area shows the location of the actual R-peak. In the 3T setting, the R-peaks correspond to the highest peaks in the signal. This is because the signal is not distorted to a high degree due to the MHD effect. As a result, the model can easily learn the patterns for R-peak locations compared to the 7T setting, which will be described later.
Similar to the 3T setting, Figure 9 depicts the predicted R-peaks from three-channel ECG waveforms under a 7T magnetic field. The first observation from the figure is that the ECG waveforms are distorted to a very high degree. While in some cases, the R-peaks are in a trough before the largest peak (as in Figure 9f), in other cases, the R-peaks are in a smaller peak before the largest peak (as in Figure 9d). Despite that, the model was able to reliably predict the R-peaks in the corrupted ECG signals.
As shown in Table 1 and Table 2, the model is not 100% accurate. There are some missing cases. Figure 10 depicts some signals where the model failed to detect some R-peaks in the signal. It is important to note that the model correctly identified most of the R-peaks in the waveform. In Figure 10, two types of errors are noticed. In Figure 10a,b,d, the model missed the R-peaks when it was almost out of bounds. That was the most common error in this work. The other error can be seen in Figure 10c, where the model missed the R-peak by roughly 0.2 s. It is important to notice that the second type of error only occurred for ECG under 7T settings.

3.3. Heart Rate Analysis

The proposed system is very accurate in predicting R-peaks in ECG waveforms. While R-peaks can be used for gating under an MRI machine, they can also be used to monitor the heart rate (HR). Abnormal heart rates often signify that the patient is under duress. To demonstrate the performance of the proposed system in heart rate estimation, the R-peaks were used to calculate the R-R intervals and, consequently, the heart rate. The actual heart rate and predicted heart rate were calculated from actual and predicted R-peaks, respectively. The heart rates were analyzed with the help of a regression plot, as shown in Figure 11. In a regression plot, the estimated heart rate is plotted against the actual heart rate. Then, a trendline is fitted through the data points. An ideal model will have a trendline with a gradient, i.e., a Pearson’s Correlation Coefficient (PCC) of 1. As seen in Figure 11, the trendline almost perfectly fits the data points for both 3T and 7T, and shows a very high correlation. Moreover, the heart rate estimation for the 3T setting has a PCC of 0.998 compared to the PCC of 0.987 for the 7T setting; which makes sense, as the 3T magnetic field distorts the signal less than the 7T magnetic field. Nevertheless, our proposed approach showed excellent performance in estimating heart rate.
Further analysis of the estimated and actual heart rate was carried out using the Bland-Altman plot in Figure 12. In a Bland-Altman plot, the difference in estimated and actual heart rate is plotted against the average of the estimated and actual heart rate. The black dotted line represents the average of all the differences, while the red dotted lines represent the 95% confidence interval. Hence, in ideal conditions, the plot will contain all the data points that have a y-coordinate of 0. It will essentially be a horizontal line along the x-axis. In this case, Figure 12 shows that the spread of error in the prediction of heart rate is quite small. The 95% confidence intervals for 3T and 7T settings range from 0.23 beats per minute (bpm) to −0.23 bpm, and from 2.54 bpm to −2.37 bpm, respectively.

3.4. Comparison with Current Work

The results obtained from an experiment must be compared with the literature. However, it is very difficult to do so in tasks where the main resource, the dataset, is scarce. Hence, to ensure a fairer comparison, the performance of various methods that used a version of the dataset used in this work is reported in Table 3. Unfortunately, no literature could be found that used the exact data and no work was found that used 3T data of this dataset. The methods that have been reported were all implemented by Krug et al. [9]. Krug et al. first showed the performance of the methods M1, M2, M3, and M5 on the 7T data. M1 used an ECG lead and showed a respectable precision and recall of 89.40% and 87.10%.
However, in M2, when VCG was used, the performance jumped to 91.20% and 88.90% in precision and recall, respectively. When 3D VCG was used in M3, the results drastically dropped. The precision was less than 60% and the recall was 72%. M5 used an ICA-based method that had a precision of 87.50% and recall of 84.30%. Krug et al. chose to improve this ICA-based method and were able to obtain very good precision and recall of 99.10% and 99.20%, respectively. Our method, however, outperformed [9] this with a precision of 99.87% and a recall of 99.78%.
Despite accurately predicting the R-peaks in the ECG waveforms, which are corrupted under 3T and 7T magnetic fields, the model still needs to be tested for robustness in external datasets, which are not currently available. Another limitation is that the proposed model needs a separate model for 3T and 7T. It might not properly work in cases where the field strength will be different. In the future, the authors aim to create a model that will be able to robustly detect the R-peaks regardless of the degree of MHD effect on ECG. To ensure robustness, the model could be evaluated with external data. These studies would, however, require extensive data collection. This study is a step towards building a universal R-peak detector in MHD-corrupted ECG signals.

4. Conclusions

In the field of medical diagnosis and image-guided interventions, Magnetic Resonance Imaging (MRI) is a commonly used technique. An electrocardiogram (ECG) may be used to monitor the patient’s heart during an MRI scan to ensure cardiac gating, capture information at end diastole or end systole, or acquire partial images throughout the cardiac cycle and average these signals out over several heartbeats. However, the strong magnetic fields present in an MRI scanner can lead to significant distortions of the ECG data due to the Magnetohydrodynamic (MHD) effect. These distortions, which can cause abnormalities in the heartbeat pattern, make it challenging to detect QRS complexes and limit the diagnostic potential of ECG readings. Hence, in this work, a novel network, Self-Attention MHDNet, was proposed to detect R-peaks in the ECG waveforms collected inside an MRI scanner. This model formulates the detection process as a 1D-segmentation problem. In a 3 Tesla (T) environment, the proposed model attained precision and recall percentages of 99.83% and 99.68%, respectively. On the other hand, in a 7T environment, the model could obtain precision and recall rates of 99.87% and 99.78%, respectively. It was also shown that only three channels of ECG (Lead I, II, and III) are enough to accurately detect R-peaks in ECG signals distorted by the MHD effect. Furthermore, an ablation study was conducted, where it was found that the addition of Self-ONN layers and the attention mechanism improved the segmentation capabilities of the model. Therefore, the proposed approach could be used to robustly detect the locations of the R-peaks in the MHD corrupted ECG signals by 3T or 7T MRI machines for accurate gating of the cardiovascular functional MRI.

Author Contributions

Conceptualization, M.H.C., M.E.H.C. and A.H. (Anwarul Hasan); Formal analysis, M.H.C., M.A.U., A.K. and A.H. (Alvee Hassan); Funding acquisition, M.E.H.C., M.S.K. and A.H. (Anwarul Hasan); Investigation, M.H.C., M.A.U., S.M., A.K. and A.H. (Alvee Hassan); Methodology, M.H.C., M.A.U., S.M., A.K. and A.M.T.; Project administration, M.E.H.C., M.S.K. and A.H. (Anwarul Hasan); Resources, M.S.K. and A.M.T.; Software, M.A.U., S.M., A.H. (Alvee Hassan) and A.M.T.; Supervision, M.E.H.C., M.S.K. and A.H. (Anwarul Hasan); Validation, M.A.U., S.M. and A.H. (Alvee Hassan); Visualization, M.E.H.C. and A.M.T.; Writing—original draft, M.H.C., M.E.H.C., M.S.K., M.A.U., S.M., A.K., A.H. (Alvee Hassan), A.M.T. and A.H. (Anwarul Hasan); Writing—review and editing, M.E.H.C., M.S.K., S.M., A.K., A.H. (Alvee Hassan), A.M.T. and A.H. (Anwarul Hasan). All authors have read and agreed to the published version of the manuscript.

Funding

This work was made possible by the Qatar University student grant: QUST-1-CENG-2023-941. The statements made herein are solely the responsibility of the authors.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The dataset is available in PhysioNet [48] as mentioned by the original authors in [49].

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Amano, Y.; Yanagisawa, F.; Tachi, M.; Asai, K.; Suzuki, Y.; Hashimoto, H.; Ishihara, K.; Kumita, S. Three-dimensional cardiac MR imaging: Related techniques and clinical applications. Magn. Reson. Med. Sci. 2017, 16, 183. [Google Scholar] [CrossRef]
  2. Von Knobelsdorff-Brenkenhoff, F.; Pilz, G.; Schulz-Menger, J. Representation of cardiovascular magnetic resonance in the AHA/ACC guidelines. J. Cardiovasc. Magn. Reson. 2017, 19, 70. [Google Scholar] [CrossRef] [PubMed]
  3. Petersen, S.E.; Aung, N.; Sanghvi, M.M.; Zemrak, F.; Fung, K.; Paiva, J.M.; Francis, J.M.; Khanji, M.Y.; Lukaschuk, E.; Lee, A.M.; et al. Reference ranges for cardiac structure and function using cardiovascular magnetic resonance (CMR) in Caucasians from the UK Biobank population cohort. J. Cardiovasc. Magn. Resonance 2017, 19, 18. [Google Scholar] [CrossRef]
  4. Babu-Narayan, S.V.; Giannakoulas, G.; Valente, A.M.; Li, W.; Gatzoulis, M.A. Imaging of congenital heart disease in adults. Eur. Heart J. 2016, 37, 1182–1195. [Google Scholar] [CrossRef] [PubMed]
  5. Kording, F.; Ruprecht, C.; Schoennagel, B.; Fehrs, K.; Yamamura, J.; Adam, G.; Goebel, J.; Nassenstein, K.; Maderwald, S.; Quick, H.; et al. Doppler ultrasound triggering for cardiac MRI at 7T. Magn. Reson. Med. 2017, 80, 239–247. [Google Scholar] [CrossRef]
  6. Spicher, N.; Kukuk, M.; Maderwald, S.; Ladd, M.E. Initial evaluation of prospective cardiac triggering using photoplethysmography signals recorded with a video camera compared to pulse oximetry and electrocardiography at 7T MRI. Biomed. Eng. Online 2016, 15, 126. [Google Scholar] [CrossRef]
  7. Sablong, R.; Rengle, A.; Ramgolam, A.; Saint-Jalmes, H.; Beuf, O. An optical fiber-based gating device for prospective mouse cardiac MRI. IEEE Trans. Biomed. Eng. 2013, 61, 162–170. [Google Scholar] [CrossRef]
  8. Abi-Abdallah, D.; Drochon, A.; Robin, V.; Fokapu, O. Cardiac and respiratory MRI gating using combined wavelet sub-band decomposition and adaptive filtering. Ann. Biomed. Eng. 2007, 35, 733–743. [Google Scholar] [CrossRef]
  9. Krug, J.W.; Rose, G.; Clifford, G.; Oster, J. ECG-based gating in ultra high field cardiovascular magnetic resonance using an independent component analysis approach. J. Cardiovasc. Magn. Reson. 2013, 15, 104. [Google Scholar] [CrossRef] [PubMed]
  10. Committee of Standards and Practice Parameters; American Society of Anesthesiologists. Standards for Basic Anesthetic Monitoring. 2012. Available online: https://www.asahq.org/standards-and-guidelines/standards-for-basic-anesthetic-monitoring (accessed on 28 February 2023).
  11. Bogaert, J.; Dymarkowski, S.; Taylor, A.M.; Muthurangu, V. Clinical Cardiac MRI; Springer Science and Business Media: Berlin/Heidelberg, Germany, 2012. [Google Scholar]
  12. Sommer, P.; Grothoff, M.; Eitel, C.; Gaspar, T.; Piorkowski, C.; Gutberlet, M.; Hindricks, G. Feasibility of real-time magnetic resonance imaging-guided electrophysiology studies in humans. Europace 2013, 15, 101–108. [Google Scholar] [CrossRef]
  13. Gregory, T.S.; Cheng, R.; Tang, G.; Mao, L.; Tse, Z.T.H. The magnetohydrodynamic effect and its associated material designs for biomedical applications: A state-of-the-art review. Adv. Funct. Mater. 2016, 26, 3942–3952. [Google Scholar] [CrossRef]
  14. Mader, W.; Hoppe, G.; Timmer, J.; Lorenz, R.; Buchenberg, W.B.; Büchert, M.; Menza, M.; Jung, B. In vitro study to simulate the intracardiac magnetohydrodynamic effect. Magn. Reson. Med. 2015, 74, 850–857. [Google Scholar]
  15. Abi-Abdallah, D.; Robin, V.; Drochon, A.; Fokapu, O. Alterations in human ECG due to the MagnetoHydroDynamic effect: A method for accurate R peak detection in the presence of high MHD artifacts. In Proceedings of the 29th Annual International Conference of the IEEE Engineering in Medicine and Biology Society, Lyon, France, 22–26 August 2007; pp. 1842–1845. [Google Scholar]
  16. Krug, J.W.; Rose, G. Magnetohydrodynamic distortions of the ECG in different MR scanner configurations. In Proceedings of the Computing in Cardiology, Hangzhou, China, 18–21 September 2011; pp. 769–772. [Google Scholar]
  17. Krug, J.W.; Rose, G.H.; Stucht, D.; Clifford, G.D.; Oster, J. Filtering the magnetohydrodynamic effect from 12-lead ECG signals using independent component analysis. In Proceedings of the Computing in Cardiology, Krakow, Poland, 9–12 September 2012; pp. 589–592. [Google Scholar]
  18. Krug, J.W. Improved Cardiac Gating and Patient Monitoring in High Field Magnetic Resonance Imaging by Means of Electrocardiogram Signal Processing. Ph.D. Dissertation, Magdeburg University, Magdeburg, Germany, 2015. [Google Scholar]
  19. Passand, J.K.; Rose, G. Progress of MRI-guided EP Interventions is Hampered by a Lack of ECG-based Patient Monitoring-An Engineering Perspective. In Proceedings of the 12th International Conference on Bio-Inspired Systems and Signal Processing, Prague, Czech Republic, 22–24 February 2019; pp. 201–208. [Google Scholar]
  20. Kinouchi, Y.; Yamaguchi, H.; Tenforde, T. Theoretical analysis of magnetic field interactions with aortic blood flow. Bioelectromagnetics 1996, 17, 21–32. [Google Scholar] [CrossRef]
  21. Krug, J.; Rose, G.; Stucht, D.; Clifford, G.; Oster, J. Limitations of VCG based gating methods in ultra high field cardiac MRI. J. Cardiovasc. Magn. Reson. 2013, 15, W19. [Google Scholar] [CrossRef]
  22. Ullah, H.; Bin Heyat, B.; Akhtar, F.; Muaad, A.Y.; Ukwuoma, C.C.; Bilal, M.; Miraz, M.H.; Bhuiyan, M.A.S.; Wu, K.; Damaševičius, R.; et al. An Automatic Premature Ventricular Contraction Recognition System Based on Imbalanced Dataset and Pre-Trained Residual Network Using Transfer Learning on ECG Signal. Diagnostics 2022, 13, 87. [Google Scholar] [CrossRef]
  23. Awan, M.T.; Amir, M.; Maqsood, S.; Yousufi, M.; Abdullah, S.; Irfan, M. Modified block compressed sensing for extraction of fetal electrocardiogram from mother electrocardiogram using block compressed sensing based guided focuss and fast-independent component. Inf. Technol. Control. 2021, 50, 123–137. [Google Scholar] [CrossRef]
  24. Schmidt, M.; Krug, J.W.; Rose, G. Reducing of gradient induced artifacts on the ECG signal during MRI examinations using Wilcoxon filter. Curr. Dir. Biomed. Eng. 2016, 2, 175–178. [Google Scholar] [CrossRef]
  25. Gupta, A. Signal Processing of an ECG signal in the Presence of a Strong Static Magnetic Field. Ph.D. Dissertation, University of Central Florida, Orlando, FL, USA, 2007. [Google Scholar]
  26. Pan, J.; Tompkins, W. A real-time QRS detection algorithm. IEEE Trans. Biomed. Eng. 1985, BME-32, 230–236. [Google Scholar] [CrossRef] [PubMed]
  27. Aqil, M.; Jbari, A.; Bourouhou, A. Adaptive ECG Wavelet analysis for R-peaks detection. In Proceedings of the 2016 International Conference on Electrical and Information Technologies (ICEIT), Tangiers, Morocco, 4–7 May 2016; pp. 164–167. [Google Scholar]
  28. Thiamchoo, N.; Phukpattaranont, P. Application of wavelet transform and Shannon energy on R peak detection algorithm. In Proceedings of the 13th International Conference on Electrical Engineering/Electronics, Computer, Telecommunications and Information Technology (ECTI-CON), Chiang Mai, Thailand, 28 June–1 July 2016; pp. 1–5. [Google Scholar]
  29. Goodfellow, J.; Escalona, O.J.; Kodoth, V.; Manoharan, G.; Bosnjak, A. Denoising and automated R-peak detection in the ECG using Discrete Wavelet Transform. In Proceedings of the Computing in Cardiology Conference (CinC), Vancouver, BC, Canada, 11–14 September 2016; pp. 1045–1048. [Google Scholar]
  30. Sadhukhan, D.; Mitra, M. R-peak detection algorithm for ECG using double difference and RR interval processing. Procedia Technol. 2012, 4, 873–877. [Google Scholar] [CrossRef]
  31. Hossain, M.B.; Bashar, S.K.; Walkey, A.J.; McManus, D.D.; Chon, K.H. An accurate QRS complex and P wave detection in ECG signals using complete ensemble empirical mode decomposition with adaptive noise approach. IEEE Access 2019, 7, 128869–128880. [Google Scholar] [CrossRef] [PubMed]
  32. Fischer, S.E.; Wickline, S.A.; Lorenz, C.H. Novel real-time R-wave detection algorithm based on the vectorcardiogram for accurate gated magnetic resonance acquisitions. Magn. Reson. Med. 1999, 42, 361–370. [Google Scholar] [CrossRef]
  33. Chia, J.M.; Fischer, S.E.; Wickline, S.A.; Lorenz, C.H. Performance of QRS detection for cardiac magnetic resonance imaging with a novel vectorcardiographic triggering method. J. Magn. Reson. Imaging 2000, 12, 678–688. [Google Scholar] [CrossRef]
  34. van Deursen, C.J.; Vernooy, K.; Dudink, E.; Bergfeldt, L.; Crijns, H.J.G.M.; Prinzen, F.W.; Wecke, L. Vectorcardiographic QRS area as a novel predictor of response to cardiac resynchronization therapy. J. Electrocardiol. 2015, 48, 45–52. [Google Scholar] [CrossRef]
  35. Hamilton-Craig, C.; Stäeb, D.; Al Najjar, A.; O’brien, K.; Crawford, W.; Fletcher, S.; Barth, M.; Galloway, G. 7-Tesla Functional Cardiovascular MR Using Vectorcardiographic Triggering—Overcoming the Magnetohydrodynamic Effect. Tomography 2021, 7, 323–332. [Google Scholar] [CrossRef]
  36. Abi-Abdallah, D.; Chauvet, E.; Bouchet-Fakri, L.; Bataillard, A.; Briguet, A.; Fokapu, O. Reference signal extraction from corrupted ECG using wavelet decomposition for MRI sequence triggering: Application to small animals. Biomed. Eng. Online 2006, 5, 1–12. [Google Scholar]
  37. El B’charri, O.; Latif, R.; Elmansouri, K.; Abenaou, A.; Jenkal, W. ECG signal performance de-noising assessment based on threshold tuning of dual-tree wavelet transform. Biomed. Eng. Online 2017, 16, 11. [Google Scholar]
  38. Al, Z.M.A.; Thapa, K.; Yang, S.-H. Improving R Peak Detection in ECG Signal Using Dynamic Mode Selected Energy and Adaptive Window Sizing Algorithm with Decision Tree Algorithm. Sensors 2021, 21, 6682. [Google Scholar]
  39. Asgari, S.; Mehrnia, A.; Moussavi, M. Automatic detection of atrial fibrillation using stationary wavelet transform and support vector machine. Comput. Biol. Med. 2015, 60, 132–142. [Google Scholar] [CrossRef]
  40. Raj, S.; Ray, K.C.; Shankar, O. Cardiac arrhythmia beat classification using DOST and PSO tuned SVM. Comput. Methods Programs Biomed. 2016, 136, 163–177. [Google Scholar] [CrossRef] [PubMed]
  41. Vijayarangan, S.; Vignesh, R.; Murugesan, B.; Preejith, S.; Joseph, J.; Sivaprakasam, M. RPnet: A Deep Learning approach for robust R Peak detection in noisy ECG. In Proceeding of the 42nd Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), Montreal, QC, Canada, 20–24 July 2020; pp. 345–348. [Google Scholar]
  42. Romdhane, T.F.; Alhichri, H.; Ouni, R.; Atri, M. Electrocardiogram heartbeat classification based on a deep convolutional neural network and focal loss. Comput. Biol. Med. 2020, 123, 103866. [Google Scholar] [CrossRef]
  43. Oh, S.L.; Ng, E.Y.; Tan, R.S.; Acharya, U.R. Automated beat-wise arrhythmia diagnosis using modified U-net on extended electrocardiographic recordings with heterogeneous arrhythmia types. Comput. Biol. Med. 2019, 105, 92–101. [Google Scholar] [CrossRef]
  44. Gabbouj, M.; Kiranyaz, S.; Malik, J.; Zahid, M.U.; Ince, T.; Chowdhury, M.E.H.; Khandakar, A.; Tahir, A. Robust Peak Detection for Holter ECGs by Self-Organized Operational Neural Networks. In IEEE Transactions on Neural Networks Learning Systems; IEEE: Piscataway, NJ, USA, 2022. [Google Scholar]
  45. Rahman, T.; Khandakar, A.; Kadir, M.A.; Islam, K.R.; Islam, K.F.; Mazhar, R.; Hamid, T.; Islam, M.T.; Kashem, S.; Mahbub, Z.B.; et al. Reliable tuberculosis detection using chest X-ray with deep learning, segmentation and visualization. IEEE Access 2020, 8, 191586–191601. [Google Scholar] [CrossRef]
  46. Ronneberger, O.; Fischer, P.; Brox, T. U-net: Convolutional networks for biomedical image segmentation. In Proceedings of the International Conference on Medical Image Computing and Computer-Assisted Intervention, Munich, Germany, 5–9 October 2015; Springer: Berlin/Heidelberg, Germany, 2015; pp. 234–241. [Google Scholar]
  47. Passand, J.W.K. Influence of the MHD Effect on 12-lead and 3-lead ECGs Recorded in 1T to 7T MRI Scanners. Available online: https://physionet.org/content/mhd-effect-ecg-mri/1.0.0/ (accessed on 28 February 2023).
  48. Goldberger, A.L.; Amaral, L.A.; Glass, L.; Hausdorff, J.M.; Ivanov, P.C.; Mark, R.G.; Mietus, J.E.; Moody, G.B.; Peng, C.K.; Stanley, H.E. PhysioBank, PhysioToolkit, and PhysioNet: Components of a new research resource for complex physiologic signals. Circulation 2000, 101, e215–e220. [Google Scholar] [CrossRef] [PubMed]
  49. Krug, J.W.; Schmidt, M.; Rose, G.; Friebe, M. A database of electrocardiogram signals acquired in different magnetic resonance imaging scanners. In Proceedings of the Computing in Cardiology (CinC), Rennes, France, 24–27 September 2017; pp. 1–4. [Google Scholar]
  50. Keleş, O.; Tekalp, A.M.; Malik, J.; Kιranyaz, S. Self-Organized Residual Blocks For Image Super-Resolution. In Proceedings of the IEEE International Conference on Image Processing (ICIP), Anchorage, AK, USA, 19–22 September 2021; pp. 589–593. [Google Scholar]
  51. Kiranyaz, S.; Ince, T.; Iosifidis, A.; Gabbouj, M. Operational neural networks. Neural Comput. Appl. 2020, 32, 6645–6668. [Google Scholar] [CrossRef]
  52. Kiranyaz, S.; Malik, J.; Abdallah, H.B.; Ince, T.; Iosifidis, A.; Gabbouj, M. Self-organized operational neural networks with generative neurons. Neural Netw. 2021, 140, 294–308. [Google Scholar] [CrossRef]
  53. Malik, J.; Kiranyaz, S.; Yamac, M.; Guldogan, E.; Gabbouj, M. Convolutional versus Self-Organized Operational Neural Networks for Real-World Blind Image Denoising. arXiv 2021, arXiv:2103.03070. [Google Scholar]
  54. Yílmaz, M.A.; Kelesş, O.; Güven, H.; Tekalp, A.M.; Malik, J.; Kíranyaz, S. Self-Organized Variational Autoencoders (Self-Vae) For Learned Image Compression. In Proceedings of the IEEE International Conference on Image Processing (ICIP), Anchorage, AK, USA, 19–22 September 2021; pp. 3732–3736. [Google Scholar]
  55. Lin, T.-Y.; Dollár, P.; Girshick, R.; He, K.; Hariharan, B.; Belongie, S. Feature pyramid networks for object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017; pp. 2117–2125. [Google Scholar]
  56. Malik, J.; Kiranyaz, S.; Gabbouj, M. Self-organized operational neural networks for severe image restoration problems. Neural Netw. 2021, 135, 201–211. [Google Scholar] [CrossRef] [PubMed]
  57. Clifford, G.D. Signal Processing Methods for Heart Rate Variability. PhD Thesis, Oxford University, Oxford, UK, 2002. [Google Scholar]
Figure 1. Physiological and technical parameters that influence the MHD effect.
Figure 1. Physiological and technical parameters that influence the MHD effect.
Bioengineering 10 00542 g001
Figure 2. Detection of R peaks in three-channel ECG waveforms collected from patients under MRI.
Figure 2. Detection of R peaks in three-channel ECG waveforms collected from patients under MRI.
Bioengineering 10 00542 g002
Figure 3. R-peak detection as a segmentation problem. Here, (a) depicts Channel 1 or Lead I of corrupted ECG, and (b) depicts the R-peaks as a pulse train.
Figure 3. R-peak detection as a segmentation problem. Here, (a) depicts Channel 1 or Lead I of corrupted ECG, and (b) depicts the R-peaks as a pulse train.
Bioengineering 10 00542 g003
Figure 4. Result of preprocessing on MHD corrupted ECG signals. The preprocessing steps convert the raw ECG signal corrupted by a 3T magnetic field in (a) to obtain the clean signal in (b). The same steps were also taken to filter raw ECG signal corrupted by 7T magnetic field in (c) to obtain the clean signal in (d).
Figure 4. Result of preprocessing on MHD corrupted ECG signals. The preprocessing steps convert the raw ECG signal corrupted by a 3T magnetic field in (a) to obtain the clean signal in (b). The same steps were also taken to filter raw ECG signal corrupted by 7T magnetic field in (c) to obtain the clean signal in (d).
Bioengineering 10 00542 g004
Figure 5. Network architecture of the proposed Self-Attention MHDNet.
Figure 5. Network architecture of the proposed Self-Attention MHDNet.
Bioengineering 10 00542 g005
Figure 6. Attention block. The Decoder signal from the (i + 1)th layer and encoder signal from the ith layer are taken as inputs into the attention block.
Figure 6. Attention block. The Decoder signal from the (i + 1)th layer and encoder signal from the ith layer are taken as inputs into the attention block.
Bioengineering 10 00542 g006
Figure 7. Outcomes of the ablation study for the effect of Self-ONN layers and attention mechanism on the FPN model. Note that in this stacked bar plot, IoU and DSC for FPN are shown as the base performance, while the Self-FPN and Self-Attention MHDNet outcomes are shown as improvements.
Figure 7. Outcomes of the ablation study for the effect of Self-ONN layers and attention mechanism on the FPN model. Note that in this stacked bar plot, IoU and DSC for FPN are shown as the base performance, while the Self-FPN and Self-Attention MHDNet outcomes are shown as improvements.
Bioengineering 10 00542 g007
Figure 8. R-peak detection for ECG Lead I in the 3T setting where (af) refer to various samples from the test set. Green spikes denote the ground truth R peaks annotated by clinical experts, while the red crosses denote the predicted R-peaks.
Figure 8. R-peak detection for ECG Lead I in the 3T setting where (af) refer to various samples from the test set. Green spikes denote the ground truth R peaks annotated by clinical experts, while the red crosses denote the predicted R-peaks.
Bioengineering 10 00542 g008
Figure 9. R-peak detection for ECG Lead I data in 7T setting where (a–f) refer to various samples from the test set. Green spikes denote the ground truth R peaks as annotated by clinical experts. On the other hand, the red cross denotes the predicted R-peaks.
Figure 9. R-peak detection for ECG Lead I data in 7T setting where (a–f) refer to various samples from the test set. Green spikes denote the ground truth R peaks as annotated by clinical experts. On the other hand, the red cross denotes the predicted R-peaks.
Bioengineering 10 00542 g009
Figure 10. Analysis of missed R-peaks in 3T setting (a,b) and 7T setting (c,d).
Figure 10. Analysis of missed R-peaks in 3T setting (a,b) and 7T setting (c,d).
Bioengineering 10 00542 g010
Figure 11. Analysis of heart rate prediction using a regression plot for ECG under a (a) 3T and a (b) 7T setting.
Figure 11. Analysis of heart rate prediction using a regression plot for ECG under a (a) 3T and a (b) 7T setting.
Bioengineering 10 00542 g011
Figure 12. Heart rate estimation analysis using Bland-Altman plot for ECG under a (a) 3T and a (b) 7T setting. The black dotted line corresponds to the average value of the variances, whereas the red dotted lines depict the range within which 95% of the variances are expected to fall.
Figure 12. Heart rate estimation analysis using Bland-Altman plot for ECG under a (a) 3T and a (b) 7T setting. The black dotted line corresponds to the average value of the variances, whereas the red dotted lines depict the range within which 95% of the variances are expected to fall.
Bioengineering 10 00542 g012
Table 1. Effect of various mechanisms on the performance of the proposed model.
Table 1. Effect of various mechanisms on the performance of the proposed model.
3T7T
NetworkIoU (%)DSC (%)IoU (%)DSC (%)
FPN96.3596.3393.8595.55
Self-FPN97.8898.8695.0197.31
Self-Attention MHDNet98.9799.0197.0198.36
Table 2. Performance evaluation of Self Attention MHDNet in R-peak detection for 3T and 7T settings.
Table 2. Performance evaluation of Self Attention MHDNet in R-peak detection for 3T and 7T settings.
NetworkMagnetic Field StrengthRecall (%)Precision (%)F1-Score (%)
Self-Attention MHDNet3T99.8399.6899.76
7T99.8799.7899.82
Table 3. Comparison of this work with the current literature in R-peak detection of MHD-corrupted ECG.
Table 3. Comparison of this work with the current literature in R-peak detection of MHD-corrupted ECG.
MethodMagnetic FieldPrecision (%)Recall (%)F1-Score (%)
ICA of ECG for R-peak detection [9]7T99.1099.20-
M1: R-peak detection in a single ECG lead [57]7T89.4087.10-
M2: R-peak detection in a single VCG lead [57]7T91.2088.90-
M3: 3D VCG-based R-peak detection [32]7T57.5072.10-
M5: ICA of the VCG for R-peak detection [57]7T87.5084.30-
Self-Attention MHDNet7T99.8799.7899.82
3T99.8399.6899.76
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Chowdhury, M.H.; Chowdhury, M.E.H.; Khan, M.S.; Ullah, M.A.; Mahmud, S.; Khandakar, A.; Hassan, A.; Tahir, A.M.; Hasan, A. Self-Attention MHDNet: A Novel Deep Learning Model for the Detection of R-Peaks in the Electrocardiogram Signals Corrupted with Magnetohydrodynamic Effect. Bioengineering 2023, 10, 542. https://doi.org/10.3390/bioengineering10050542

AMA Style

Chowdhury MH, Chowdhury MEH, Khan MS, Ullah MA, Mahmud S, Khandakar A, Hassan A, Tahir AM, Hasan A. Self-Attention MHDNet: A Novel Deep Learning Model for the Detection of R-Peaks in the Electrocardiogram Signals Corrupted with Magnetohydrodynamic Effect. Bioengineering. 2023; 10(5):542. https://doi.org/10.3390/bioengineering10050542

Chicago/Turabian Style

Chowdhury, Moajjem Hossain, Muhammad E. H. Chowdhury, Muhammad Salman Khan, Md Asad Ullah, Sakib Mahmud, Amith Khandakar, Alvee Hassan, Anas M. Tahir, and Anwarul Hasan. 2023. "Self-Attention MHDNet: A Novel Deep Learning Model for the Detection of R-Peaks in the Electrocardiogram Signals Corrupted with Magnetohydrodynamic Effect" Bioengineering 10, no. 5: 542. https://doi.org/10.3390/bioengineering10050542

APA Style

Chowdhury, M. H., Chowdhury, M. E. H., Khan, M. S., Ullah, M. A., Mahmud, S., Khandakar, A., Hassan, A., Tahir, A. M., & Hasan, A. (2023). Self-Attention MHDNet: A Novel Deep Learning Model for the Detection of R-Peaks in the Electrocardiogram Signals Corrupted with Magnetohydrodynamic Effect. Bioengineering, 10(5), 542. https://doi.org/10.3390/bioengineering10050542

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop