Deep learning ECG beat classification for cardiac MRI reconstruction

Lightweight CNNs enhance ECG-gating in cardiac MRI by correcting cardiac phase alignment through R-wave detection and re-binning, addressing reliability issues at high field strengths and improving image clarity.

WO2026060050A1PCT designated stage Publication Date: 2026-03-19RGT UNIV OF CALIFORNIA
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-09-10
Publication Date
2026-03-19

AI Technical Summary

Technical Problem

Existing ECG-gating methods for cardiac MRI, especially at high field strengths, are prone to artifacts due to magnetohydrodynamic effects and patient-related factors, leading to unreliable detection of cardiac phases and compromised image quality.

Method used

Employing lightweight CNNs for R-wave detection and classification in ECG traces during MRI, enabling retrospective re-binning of k-space data to correct cardiac phase alignment and reduce artifacts.

Benefits of technology

Improves MR image quality by accurately detecting R-waves, reducing artifacts, and uncovering obscured cardiac anatomy, even in arrhythmia conditions, with potential for real-time or post-processing corrections.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure US2025045839_19032026_PF_FP_ABST
    Figure US2025045839_19032026_PF_FP_ABST
Patent Text Reader

Abstract

Deep learning algorithms are applied to electrocardiogram (ECG) traces to more accurately detect, locate, and / or predict true R-waves within the ECG traces. Accurate R-waves may be used to reduce image artifacts due to ECG gating or arrhythmia in real-time imaging. Corrected R-waves may be used for retrospective image reconstruction of cine cardiac MRI by re-binning spatial frequency maps to produce corrected cine MRI with reduced artifacts and uncovered cardiac anatomy.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] DEEP LEARNING ECG BEAT CLASSIFICATION FOR CARDIAC MRI RECONSTRUCTION RELATED APPLICATIONS This application claims the benefit of the priority of U.S. Provisional application No. 63 / 693,092, filed September 10, 2024, which is incorporated herein by reference in its entirety. FIELD OF THE INVENTION The present invention relates generally to techniques for deep learning algorithms for electrocardiogram (ECG) signal processing for reduction of ECG-gating artifacts that are encountered during cardiac magnetic resonance imaging (MRI) and for imaging of arrhythmia with cardiac MRI. BACKGROUND Cardiac MRI is an indispensable technique in the evaluation of cardiovascular diseases (CVDs), providing comprehensive information on morphology, function, flow, and tissue characteristics. Over the past two decades, innovations in cardiac MRI have led to several novel techniques getting incorporated into routine clinical practice. These techniques have significantly reduced the complexity of cardiac MRI and provided new insights into CVD. Most cardiac MRI examinations are performed with 1.5-T magnets, however, high- field-strength MRI at 3.0 T offers advantages of increased spatiotemporal resolution or decreased acquisition time, high T1 values, and improved spectral separation, which are beneficial for several sequences. However, 3.0-T field strength increases the complexity of cardiac MRI, with increased field inhomogeneities (B0, B1) and more artifacts, such as susceptibility, band, chemical shift, and dielectric shading. Balanced steady-state free precession (SSFP), the workhorse of cardiac MRI, is compromised by the higher T1 and off-resonance band / flow artifacts, which necessitate patient-specific shimming, frequency adjustment, or decreasing repetition time. Ferromagnetic attraction, radiofrequency deposition, and specific absorption rate are higher at 3.0 T than at 1.5 T, resulting in a different safety profile for devices. ECG signals are less reliable at 3.0 T due to magnetohydrodynamic (MHD) effects and may require peripheral pulse gating. ECG gating has long been essential for acquisition of most cardiac MRI pulse sequences. Cine SSFP requires ECG to be recorded over multiple heartbeats with breath- holds, with ECG-gating being used for concatenation. ECG-gated MRI techniques typically require reliable detection of a specific cardiac phase from ECG tracings to enable the merging of k-space data (spatial frequency content of the image) collected over several heartbeats. While this approach is generally effective, it can be impaired when the accuracy of ECG gating is limited by technical errors, arrhythmias, or other patient-related factors. Technical factors such as ECG lead placement, MHD effects, MR field strength, and patient-related factors, including heart rate, heartbeat regularity, body habitus, breathing, can cause ECG-gating artifacts and render cardiac MR images diagnostically unreadable. To take a clear MRI of the heart, an ECG is needed to monitor the electrical activity of the heart, which is used to synchronize the MRI to the patient’s heartbeat. A number of approaches have been implemented or explored to overcome technical errors and enhance the accuracy of ECG gating. Vectorcardiographic (VCG) gating has been incorporated into most MRI scanners but can be unreliable at higher field strengths due to MHD effects, which dampen R-waves, accentuate Q-waves and T-waves, and introduce noise spikes. The prevalence of VCG-gating errors at increasing field strength, however, is not well quantified. Alternatively, signal processing techniques such as the Hamilton method (Hamilton P., “Open Source ECG Analysis,” Computers in Cardiology 2002 Sep 22 (pp. 101-104), incorporated herein by reference) have been developed for ECG segmentation and hold potential for use in MRI. However, few, if any, of these have been specifically designed or evaluated in ECG tracings obtained during MRI, which poses its own unique challenges. Deep learning, in the form of convolutional neural networks (CNN), excels at a wide variety of tasks in image processing, and may similarly be tailored to address signal processing of ECG tracings from MRI. A few investigators have begun exploring feasibility of using CNNs for R- peak identification; CNNs have shown robustness to noise and artifacts and possess the speed necessary for timely R-wave detection, which is essential for ECG gating. These methods have not yet been applied to processing of ECG signals obtained during MRI. Given the need to improve weaknesses in current ECG gating methods for cardiac MRI, especially at high field strength, the need exists for deep learning algorithms tailored specifically for this purpose. SUMMARY According to the inventive scheme, deep learning is used to perform R-wave detection (or prediction) from ECG traces for cardiac cine MRI reconstruction. Retrospective image reconstruction of cine cardiac MRI is achieved through re-binning of k-space data after applying deep learning to ECG traces acquired during imaging to more accurately detect R-waves. Reconstruction of the re-binned spatial frequency maps using the true R-waves result in a corrected cine MRI with reduced artifacts, revealing cardiac anatomy that may have previously been obscured in the raw data. The effectiveness of this approach compares favorably against VCG gating and a state-of-the-art signal processing approach called the “Hamilton algorithm” for evaluation of ECG tracings obtained during cardiac MRI. The inventive approach employs lightweight CNNs to accurately detect R-waves of ECG waveforms from tracings obtained during MRI. By leveraging deep learning networks, further algorithms can be implemented to classify heartbeat-types in order to improve MR image quality retrospectively, even after patients have already been released from the hospital, or to improve imaging of arrhythmias by separating the constituent heartbeat-types. The inventive technique provides for retrospective image reconstruction through re- binning of k-space data (e.g., spatial frequency content) in a patient image. CNNs provide more accurate detection of R-waves, which can be used to unravel spatial frequency maps along the ECG trace to identify segments that do not match their assigned cardiac phase. The spatial frequency map segments are re-binned into the correct cardiac phases after detection of true R-waves. Reconstruction of the re-binned spatial frequency maps result in a corrected cine MRI with reduced artifacts and uncovered cardiac anatomy. The inventive approach could be more generally applied to correct arrhythmia or gating artifacts that are commonly encountered in cardiac MRI. Alternatively, if the arrhythmia is too severe, timely R-wave detection (or prediction) may guide sequence selection to change the MR acquisition strategy to a real-time mode that is insensitive to arrhythmia artifacts. The inventive approach employs a new algorithm that more accurately reads ECG scripts during MRI. The algorithm employs CNNs to identify the critical points in ECG waveforms recorded during MRI sessions. The novel algorithms not only recognize these points but also categorize different types of heartbeats so that patients with irregular heart rhythms can have a more personalized protocol that best synchronizes the MRI with their heartbeat. Overall, this new approach not only improves the clarity of MR images during the scan, but it can also be applied to already acquired MRI scans, so patients receive the best quality images without needing to return for additional imaging. The inventive CNN algorithms are effective for ECG R-wave detection and are robust to common artifacts encountered during MRI, especially at 3.0T. This highlights a new potential application of CNNs to enhance image acquisition and quality of cardiac MRI. The inventive approach for ECG waveform analysis can also be employed to correct ECG-triggering or arrhythmia artifacts through re-binning of k-space data and retrospective image reconstruction. This result can be accomplished when combined with heartbeat classification and other MR image reconstruction techniques. In one aspect, a method for detecting and locating R-wave peaks in ECG traces is provided, where the method includes: receiving ECG traces in a computer processor configured for executing a trained CNN; defining time windows within each ECG trace, each time window having a duration configured to include at least one heartbeat even at the lowest physiologic limit of 30 beats per minute; processing each time window with the trained CNN to determine whether an R-wave peak is present within the time window; and if an R-wave peak is determined to be present, generating at an output layer of the CNN identification of corrected R-wave peaks determined to be present in the time window. In some embodiments, each time window is approximately 2 seconds. The CNN may be a modified VGG-16 network, or other lightweight networks for fast inferencing. The output layer may be configured to apply a loss function to simultaneously optimize both R-wave detection and localization. The loss function for detection and localization of R-wave peaks may be of the form ^^^^^^^^ ^^^, ŷ, ^^, ^̂^^ = −^^^^^^^^^ŷ^ − ^1 − ^^^ log^1 − ŷ^ + ^^(^^ௌ^)(^^ − ^̂^)ଶ, where y is abinary [0, 1] ground truth label, with y=1 indicating an R-wave is present; ŷ is a predicted probability of an R-wave; x is a true location of the R-wave within a detection window, encoded as a decimal offset such that 0 represents a beginning of the detection window and 1 represents an end; x̂ is a predicted location of the R-wave; and λ_SA is an accuracy scaling factor to balance localization error relative to identification error. If an R-wave peak is determined to be present, the output layer may be used to regress the R-wave peak location within the time window to identify a corrected R-wave peak location. In some embodiments, regression of the R-wave location can be performed using a ReLU activation function. In some embodiments, the ECG traces may be collected during cardiac cine MRI imaging, wherein an MRI image includes binned spatial frequency data, and the method further includes retrospectively re-binning the binned spatial frequency data into corrected cardiac phases using the corrected R-wave peak location; and generating a corrected cardiac cine MRI image from the corrected cardiac phases. If the cardiac cine MRI image is generated by multiple receiver coils, the steps of retrospectively re-binning and generating a corrected cardiac cine MRI image may be performed separately for each receiver coil, after which the corrected cardiac cine MRI images for the multiple receiver coils may be combined. In some embodiments, if an R-wave peak is determined to be present, processing each time window may include applying a loss function to predict future R-wave peaks within a prediction window beyond the time window. The loss function for prediction of future R-wave peaks may be , where^^q is a predicted quantile, yp is an actual R-wave location encoded as milliseconds from astart of the prediction window, and ŷp is an estimated location encoded as milliseconds from the start of the prediction window. The prediction may include providing 5th, 50th, and 95th percentile probabilities of two upcoming R-waves in the output layer. In some embodiments, after defining time windows, the ECG traces are mean- normalized and standardized. In some embodiments, the method further includes imaging an arrhythmia using corrected R-wave peaks to reconstruct heartbeats of similar morphology and reject dissimilar heartbeats to separate constituent heartbeat types. The corrected R-wave peaks beats may be input a rule-based R-wave classifier employing a combination of the RR- intervals before and after a corrected R-wave peak to classify the R-wave into a arrhythmic category. The arrhythmic category is selected from the group consisting of sinus, interrupted sinus, PVC, PAC, post-pause sinus, bigeminy sinus, undetected R-wave, and misfire R-wave. BRIEF DESCRIPTION OF THE DRAWINGS FIGs.1A-1B diagrammatically illustrate arrhythmia and ECG-gating errors during cardiac MRI, where FIG. 1A plots prevalence of arrhythmia during MRI, and FIG. 1B shows prevalence of ECG gating errors during MRI; FIG. 1C provides MRI images corresponding to arrhythmias and ECG-gating errors and how they can result in similar appearing motion artifacts; and FIG. 1D provides the ECG trace, VCG detections (diamonds), and R-wave annotations (vertical dashed lines) shown alongside the corresponding MRI for three of the subjects from FIG. 1C; FIG. 1E is a plot of the distribution of mean heart rate from ECG traces versus heart rate coefficient of variation within the ECG trace, identifying patients with atrial fibrillation using coefficient of heart rate variation calculated from ECG traces. Patients with atrial fibrillation were identified by visual inspection of ECG traces with coefficient of variation (standard deviation of heart rate as a percent of mean heart rate) >5% (above dashed black line); FIG.1F shows R-wave classification in an example ECG obtained during MRI at 1.5T from a patient with bigeminy. R-waves were algorithmically classified into arrhythmic categories based on the relative RR-intervals, where an R-wave classified as a premature ventricular contraction (PVC) is highlighted (box) and the classifying algorithm is detailed; FIG.1G illustrates an example of robust identification (or prediction) of R-waves with CNN algorithms, enabling either real-time (in prospective imaging) or post-processing (in retrospective imaging) classification and organization of R-waves to reconstruct beats of specific morphology in a case of a patient with bigeminy, instead of merging sinus and PVC beats together (black arrow), the PVC morphology (light gray arrow) and the sinus morphology (dark gray arrows) is reconstructed separately. FIGs. 2A-2D diagrammatically illustrate CNNs for Retrospective ECG R-wave detection and prediction according to embodiments of the inventive scheme, where FIG. 2A illustrates a first method (referred to as “CNN Detector”) in which a ~2 second sliding context window that identifies R-waves and localizes the exact R-wave peak position within a 64 ms detection window; FIG. 2B diagrammatically illustrates a modified VGG-16 network used to execute a binary classification within each detection window. If an R-wave is detected, one additional output layer is used to regress to the R-wave peak location within the window; FIG.2C illustrates a second method (referred to as “CNN Predictor”) in which a ~2 second sliding context window is used to localize future positions of up to two upcoming R-waves in a ~4 second prediction window. Potential locations are recorded when the 90% confidence interval of an R-wave falls below 120 ms; and FIG. 2D diagrammatically illustrates a modified VGG-16 network used to provide 5th, 50th, and95th percentile probability of two upcoming R-waves in its output layer. In the loss function,^^q is the predicted quantile, yp is the actual R-wave peak location encoded as millisecondsfrom the start of the prediction window, and ŷp is the estimated location encoded as milliseconds from the start of the prediction window. FIG. 3A is a table listing imaging parameters of balanced steady-state free- precession cine exams performed at 1.5T and 3.0T MRI during which ECG traces were obtained to train the CNNs; FIGs.3B-3E illustrate retrospective gating and reconstruction in an example cine cardiac MRI using the image parameters of FIG.3A with ECG-gating artifact where, in FIG.3B significant ECG-gating artifacts in four successive cardiac phases are highlighted in a bSSFP cine cardiac MRI acquisition; FIG. 3C illustrates ECG-gating artifacts arising when the spatial frequency map of one cardiac phase contains segments that belong to other cardiac phases. Original scanner triggers (arrows T1–T4) are employed to unravel the spatial frequency maps along the ECG trace to identify segments that do not match their assigned cardiac phase (boxes a–h); FIG. 3D shows spatial frequency map segments re-binned into the correct cardiac phases after detection of true R-waves (arrows R1–R3); and FIG.3E shows reconstruction of the re-binned spatial frequency maps result in a corrected cine MRI with reduced artifacts and uncovered cardiac anatomy. FIGs. 4A-4B provide comparisons of accuracy, F1 score, false positive rate, and mean absolute error for signal processing methods and the inventive CNNs in ECG R-wave identification, where FIG. 4A shows that traditional signal processing methods exhibit decreased reliability for ECGs during MRI, especially at 3T, while CNNs exhibited higher accuracy for ECGs during MRI. FIG 4B shows that traditional signal processing methods exhibit increased false positives and mean absolute error during MRI, especially at 3T. CNNs were robust for R-wave identification and localization during MRI. CNNs perform similarly to traditional signal processing methods even when the CNN is predicting R-waves 4 seconds into the future while the traditional algorithm is detecting R-wave in the past. FIGs. 5A-5B illustrate example ECGs obtained during MRI and comparison of methods for R-wave identification during MRI at 1.5T (FIG.5A) and 3.0T (FIG.5B), both VCG (diamonds) and Hamilton detections (triangles) misidentify MHD effects and noise (gray arrows) for R-waves (vertical dashed lines). In FIG. 5B, in the upper panel, VCG double-detects before and after a single R-wave (black arrows). Hamilton detections inconsistently switch between Q-waves and R-waves (hashed arrows). CNN detections (dots) avoid these errors. CNN predictions (squares) avoid these errors at 1.5T but are similarly susceptible at 3.0T. FIGs 6A-6C show correction of ECG-gating artifact with retrospective CNN gating and reconstruction showing the original VCG-gating (diamonds) used in scan acquisition and CNN retrospective gating (dots). Images of the original reconstruction (left panel) and retrospective reconstruction (right panel) are shown below the corresponding ECG, where FIG.6A shows results for a 1.5T cardiac MRI in which the VCG had several false positive detections (arrows) that caused blurring and ringing artifacts, which resolve after retrospective reconstruction; FIG. 6B and 6C provide results for a 3.0T cardiac MRI, showing missed R-wave detection (6B) and error in R-wave localization (6C) in VCG- gating obscure the aortic valve leaflets, atrial septum, and left ventricular free wall, in addition to causing blurring and ringing artifacts, which improve after retrospective reconstruction. FIGs. 7A-7C illustrate correction of severe ECG-gating artifact with retrospective CNN gating and reconstruction with three examples of 3.0T cardiac MRIs where peripheral pulse-gating (diamonds) was used in scan acquisition as the ECG trace was too corrupted for reliable VCG triggering. Images of the original reconstruction (left panel) and retrospective reconstruction (right panel) are shown below the corresponding ECG, where FIG.7A provides the actual ECG-trace and an example systolic cardiac phase from the case detailed in FIGs.3B-3E; FIGs.7B and 7C show two slices of a multi-slice acquisition were corrupted by the scanner reconstructions. Retrospective reconstruction of raw data with CNN-gating fully recovers the anatomy in both slices. DETAILED DESCRIPTION OF EMBODIMENTS Disclosed herein are CNN strategies that each show improved accuracy and are more robust than standard-of-care signal processing methods for R-wave identification and localization from ECG traces. These algorithms were specifically developed to be applied to ECG-gating of cardiac MRI and are more resistant to noise or signal artifacts introduced to the ECG trace under MRI. Additionally, a rule-based heartbeat-type classification algorithm is provided for leveraging reliable R-wave detection (or prediction) from CNNs to classify arrhythmias and specific arrhythmic beats. Also described is a MRI reconstruction protocol which takes advantage of the inventive method for beat-type classifications to retrospectively correct ECG-gating or arrhythmic artifacts common to cardiac MR images. Referring to FIGs.1A-1F, arrhythmias introduce similar image artifacts to technical ECG-gating errors, thus the two are often conflated. The prevalence of each is independently plotted in FIGs.1A and 1B. FIG.1C provides MRI images corresponding to arrhythmias and ECG-gating errors and how they can result in similar-appearing motion artifacts. In 120 patients for whom ECG recordings were available, a similar frequency of arrhythmia and ECG-gating errors was observed. Images are labeled ECG: electrocardiogram, MRI: magnetic resonance imaging, NSR: normal sinus rhythm, PAC: premature atrial contraction, and PVC: premature ventricular contraction; FIG. 1D provides the ECG trace, VCG detections (diamonds), and R-wave annotations (vertical dashed lines) shown alongside the corresponding MRI for three of the subjects from FIG.1C. To allow streamline identification of arrhythmic ECG traces and specific arrhythmic beats, a rule-based R-wave classifier was developed employing a combination of the RR- intervals before and after an R-wave to classify the R-wave into arrhythmic categories. A normal sinus RR-interval was defined as within a small deviance (±10%) of the mean RR- interval between all detected R-waves of an ECG tracing. Additionally, the mean-RR- interval was used to define thresholds for both a short (≤75% of mean RR-interval) and a long (≥120% of mean RR-interval) RR-interval. Thresholds are defined from RR-interval before and after premature ventricular or atrial contraction (PVC or PAC). The following parameter definitions were used during classification:^^^^^^௧^^ is the RR-interval after the R-wave being classified;^^^^^^^^^^ is the RR-interval before the R-wave being classified;^^^^{^^} is a sinus R-wave, set as the mean RR-interval of the ECG trace ± 10% deviance;{< ^^} denotes ≤75% of the mean RR-interval of the ECG trace; and{> ^^} denotes ≥120% of the mean RR-interval of the ECG trace.R-waves were classified according to the following algorithms: 1. Sinus classified when: ^^^^^^^^^^{^^}^^^^^^ ^^^^^^௧^^{^^}2. Interrupted Sinus classified when: ^^^^^^^^^^{^^} ^^^^^^ ^^^^^^௧^^{< ^^}3. PVC classified when: 4. PAC classified when: ^^^^^^^^^^{< ^^} + ^^^^^^௧^^{^^ ^^^^ > ^^} < 2^^^^{^^}5. Post-Pause Sinus classified when: ^^^^^^^^^^{> ^^} ^^^^^^ ^^^^^^௧^^{^^}6. Bigeminy Sinus classified when: ^^^^^^^^^^{> ^^} ^^^^^^ ^^^^^^௧^^{< ^^}7. Undetected R-wave classified when: ^^^^^^^^^^{> ^^} ^^^^ ^^^^^^௧^^{> ^^} = 2^^^^{^^}8. Misfire R-wave classified when: ^^^^{^^}If the RR-intervals before and after an R-wave follow the trend for a particular beat- type but either one fails to meet the expected ≤75% of the mean RR-interval or ≥120% of the mean RR-interval threshold, then a “maybe” is prefixed to the beat-type classification to allow modification of the thresholds or deviances by a reviewer. To tabulate prevalence of arrhythmias, ECG tracings with a coefficient of heart rate variation >5% were visually inspected to identify patients with atrial fibrillation (FIG.1A, FIG. 1E). For the remaining patients, annotated R-wave labels were classified into arrhythmic categories and patients whose ECG tracings had ≥10% of R-waves classified as PVC or PAC were counted. FIG. 1F shows R-wave classification in an example ECG obtained during MRI at 1.5T from a patient with bigeminy. R-waves were algorithmically classified into arrhythmic categories based on the relative RR-intervals. For instance, an R- wave classified as a PVC is highlighted (box) and the classifying algorithm is detailed. Robust identification (or prediction) of R-waves with CNN algorithms may enable real-time classification and organization of R-waves to reconstruct beats of a specific morphology, allowing real-time selection of beats of similar morphology and rejection of dissimilar heartbeats. For example, referring to FIG.1G, in a patient with bigeminy, instead of merging sinus and PVC beats together, the PVC morphology and / or the sinus morphology can be separately reconstructed. This can be applied to other forms of arrhythmias as well. To tabulate prevalence of ECG gating error, VCG R-wave detections from the scanner with annotated R-waves labels were compared. ECG tracings were categorized as having <5%, 5-10%, 10-15%, 15-20%, 20-25%, and ≥25% R-wave detection error rate (1 – accuracy) (FIG. 1B). The number of patients who had an ECG trace within each R-wave detection error rate category were then counted at both 1.5T and 3.0T. Development of CNN R-Wave Detection Algorithm (“CNN Detector”) A CNN algorithm was implemented using Python (v3.9.18) and Tensorflow (v2.13.0) using a NVIDIA RTX A4500 GPU, and Weights & Biases (Weights & Biases, San Francisco, CA). Referring to Table 1, in-house data was split by patient randomly into three cohorts: 68 patients (56.6%) for training and 11 (9.2%) for validation, reserving 41 (34.2%) for testing. Table 1 In Table 1, Age is averaged at the patient-level. Heart Rate is averaged at the patient- level, and for each patient the entry is calculated as the average heart rate across all their ECG traces. (µ±σ: mean ± standard deviation, Afib: atrial fibrillation, bpm: beats per minute, ICM: ischemic cardiomyopathy, NICM: non-ischemic cardiomyopathy, NSR: normal sinus rhythm, PVC: premature ventricular contraction, PAC: premature atrial contraction). To avoid overrepresentation of any single patient in algorithm testing, only one ECG tracing was selected from each patient for the test-set. Six patients (12.8%) of the external ECG tracings were allocated for algorithm fine-tuning and 41 (87.2%) for algorithm testing. For preprocessing, ECG tracings were downsampled to 250 Hz and divided into a total of 4.5 million overlapping approximately 2-second context windows. Each context window was successively advanced from the prior window by one data point (approximately 4 ms) along the time axis. Referring to FIG.2A, an ECG context window size was chosen so that it included at least one full heartbeat of context. To ensure the presence of at least one full heartbeat within the context window, a 2.048-second window size was selected to cover a lower limit of 30 bpm. As will be apparent to those in the art, some variation in the window width may occur. To ensure a similar range of amplitudes, ECG segments were mean-normalized and standardized. At the end of each ECG context window, an R-wave detection window was defined as the final 64 ms of the ECG context window. Referring to FIG. 2B, a CNN was employed to process input of ECG context windows. In an exemplary implementation, a modified VGG-16 network is used to execute a binary classification within each detection window. (Briefly, a VGG Net classifier, developed by Simonyan and Zisserman at the University of Oxford Visual Geometry Group (see Simonyan and Zisserman, “Very Deep Convolutional Networks for Large-Scale Image Recognition”, Proc. Int’l Conf. on Learning Representations (ICLR 2015), May 7-9, 2015, arXiv:1409.1556v6) includes models with different depths (weight layers) ranging from 11 to 19 for large-scale image classification.) The 16-layer CNN included 5 convolution blocks (N=64, N=128, N=256, N=512, and N=512), each consisting of 1-D convolutions similar to signal processing filters of ECG algorithms, followed by max-pooling and dropout layers. The last convolution block was flattened before dropout and followed by two fully connected dense-layers that apply additional higher-level logic for detection of R-waves. A rectified linear activation function (ReLU) was employed for all layers except for the output layer, which was divided into two tasks: 1) binary classification of R-wave with sigmoid activation function (i.e., detection); and 2) a regression of R-wave location using a ReLU activation function (i.e., localization). A combined binary cross-entropy and conditional mean squared error loss function was created to simultaneously optimize both R-wave detection and localization. Hyperparameter tuning of the learning rate, dropout percentages, and dense layer dimensions were performed using Bayesian optimization with hyperband early stopping. Dropout layers of 20% were used in convolution blocks, and dropout layers of 50% before and after dens layers were used for regularization (FIG.2B). In the loss function of Equation 1,^^^^^^^^ (^^, ŷ, ^^, ^̂^) = −^^^^^^^^(ŷ) − (1 − ^^) logy is the binary [0, 1] ground truth label, with ^^ = 1 indicating an R-wave is present; ŷ isthe predicted probability of an R-wave; ^^ is the true location of the R-wave within the detection window, encoded as a decimal offset such that 0 represents the beginning of thedetection window and 1 represents the end; ^̂^ is the predicted location of the R-wave; and^^ௌ^ is an accuracy scaling factor to balance localization error relative to identification error.^^ௌ^ = 5 was experimentally determined to be the optimal value in this implementation.R-wave Predictor Model (CNN Predictor) A similar VGG-16 architecture was used for the second CNN algorithm, except that a linear activation function was applied on two separate output layers for two upcoming R- waves (FIGs. 2C-2D). The same preprocessing sequence described above was performed. From the 2.048-second ECG context windows, medians and associated 90% confidence intervals were estimated for two upcoming R-waves within a 4.096-second prediction window (1024 data points). For this task, a mean absolute error (MAE) loss function at lower, median, and upper quantile (e.g. 5%, 50%, and 95%) localization of the R-wave annotations (Equation 2) was used: , (2) This model was designed such that once the confidence interval of a predicted R- wave narrows to a calibrated identification threshold of ≤ 120 ms (30 data points), the R- wave is predicted and localized as the median point of the confidence interval. Additionally, an implicit rule was implemented that no two R-waves can be within 200 ms (50 data points) of one-another. In cases where the confidence interval fails to reach the identification threshold before acquiring the real signal, our CNN Predictor algorithm behaves similar to the CNN Detector algorithm as the prediction window overlaps with 256 ms (64 data points) of the context window. MRI Reconstruction using Retrospective R-Wave Detection ECG traces, scanner triggers, and MRI raw data were recorded during balanced steady-state free-precession (bSSFP) cine cardiac MRIs. Imaging parameters for these exams are stratified by field strength and cardiac view in the table provided in FIG. 3A, where abbreviations include CH: chamber, HLAX: horizontal long axis, R: acceleration factor, SAX: short axis, TR: repetition time, TE: echo time, VLAX: vertical long axis; values: mean (range). Referring to FIGs. 3B-3E, retrospective reconstruction of bSSFP cine images is outlined through re-binning of archived raw data (i.e., the spatial frequency map). This includes: 1) identifying ECG-gating artifacts (FIG.3B); 2) unraveling the associated spatial frequency maps along the ECG trace using the timing of scanner triggers (FIG. 3C); 3) detecting the true R-waves to enable re-binning of spatial frequency maps into correct cardiac phases (FIG. 3D); and 4) reconstructing new images from the corrected spatial frequency map by inverse Fourier transform (FIG. 3E). This process is performed separately for each receiver coil, then combined and the multi-coil images unaliased using the Array Spatial Sensitivity Encoding Technique (“ASSET”) (GE Healthcare). In accelerated images where homodyne detection is enabled, both low-pass and conjugate- symmetry coil images are generated before ASSET unaliasing. The unaliased low-pass images are used to scale and correct the final MR image. Within the re-binning algorithm, spatial frequency data are denoted as tensor entries ^^൫^^, ^^௫ , ^^, ^^,^^௬൯, where:^^ ^^ [1, ^^] is the slice index along the imaging axis of a multi-slice acquisition.^^^ is the number of cardiac slices imaged. For single-slice acquisitions ^^ =1;^^௫] is the spatial frequency index along the horizontal axis (frequency-encode); ^^^௫ is the frequency-encode value from the acquisition matrix (FIG. 3A).^^ ^^ [1,^^] is the receiver coil index;^^^ is the number of receiver coils used (FIG. 3A);^^ ^^ [1, ^^] is the cardiac phase index from the cardiac cycle;^ ^^ is the number of cardiac phases reconstructed. We set ^^ = 20 for ourreconstructions;^^௬ ^^ [1, ^^௬] is the spatial frequency index along the vertical axis (phase-encode); and^ ^^௬is the phase-encode value from the acquisition matrix (FIG.3A). An exponential-decay weight matrix was created with entries ^^( ^^, ^^)to store weight-factors ^^ ^^ (0, 1] that decay by the temporal distance of cardiac phases ^^and ^^ ^^ [1, ^^]. Specifically, the cardiac cycle’s periodic boundary condition was enforcedusing a circular distance matrix ^^ ^^ ℕ^ × ^ with entries ^^( ^^, ^^). This ensures that phases^^ = 2 and ^^ = ^^, for instance, are equidistant from phase ^^ = 1:^^ = ^^^^ such that ^^( ^^, ^^) = min (|^^ − ^^|, ^^ − |^^ − ^^|)A weight-factor of ^^ = 0.15 was experimentally determined as the optimal value in thereconstructions. For cardiac phases with missing data (^^), a weighted-sum tensor^^ ^^ ℂௌ × ^^ × ோ × ^ × ^^ with entries ^^൫^^, ^^௫, ^^, ^^, ^^௬൯ was calculated by dot-productmultiplication of weights ^^ and spatial frequencies ^^: ^^ = ^^ ∙ ^^ with contraction over cardiac phase dimension ^^The weighted-sum tensor ^^ was then normalized to eliminate contribution of other cardiac phases to spatial frequency sections that are not missing values. To do this, a non-zero maskof ^^, ^^ ^^ {0,1}ௌ × ^^ × ோ × ^ × ^^ with entries ^^൫^^,^^௫, ^^, ^^,^^௬൯ was first calculated, thenweights ^^ were multiplied with ^^ to define a total-weight tensor^^ ^^ ℝௌ × ^^ × ோ × ^ × ^^ with entries ^^൫^^, ^^௫, ^^, ^^, ^^௬൯ for the cardiac phases to be filled (^^): with contraction over cardiac phase dimension ^^. Finally, the average of the weighted-sum tensor ^^ was computed through Hadamard division by the total-weight tensor ^^. This method enforces a non-zero total-weight before allowing contribution to missing spatial frequencies, and avoids contribution into non-zero spatialfrequencies: As shown in FIG.3D, unraveling incorrectly gated spatial frequency maps and re- binning them results in new spatial frequency maps with under-sampled areas. These segments of missing spatial frequencies can be filled by symmetry using homodyne reconstruction, and by borrowing from temporally adjacent cardiac phases. Specifically, a periodic exponentially-decaying averaged-weighted-sum was applied across adjacent cardiac phases at the missing (zero value) spatial frequency positions. FIG. 3E illustrates how reconstruction of the re-binned spatial frequency maps results in a corrected cine MRI with reduced artifacts and uncovered cardiac anatomy. ECG-gating-related artifacts that are evident on the original reconstruction were each improved after retrospective binning and reconstruction as described above. FIG.6A shows results for a 1.5T cardiac MRI in which the VCG had several false positive detections (arrows) that caused blurring and ringing artifacts, each of which resolve after retrospective reconstruction; FIG.6B and 6C compare original reconstruction and retrospective reconstruction results for a 3.0T cardiac MRI, showing missed R-wave detection (FIG.6B) and error in R-wave localization (FIG.6C) in VCG-gating obscure the aortic valve leaflets, atrial septum, and left ventricular free wall, in addition to causing blurring and ringing artifacts, which improve after retrospective reconstruction. FIGs. 7A-7C illustrate correction of severe ECG-gating artifact with retrospective CNN gating and reconstruction with three examples of 3.0T cardiac MRIs where peripheral pulse-gating (diamonds) was used in scan acquisition as the ECG trace was too corrupted for reliable VCG triggering. Images of the original reconstruction (left panel) and retrospective reconstruction (right panel) are shown below the corresponding ECG, where FIG.7A provides the actual ECG-trace and an example systolic cardiac phase. FIGs.7B and 7C show two slices of a multi-slice acquisition that were corrupted by the scanner reconstructions. Retrospective reconstruction of raw data with CNN-gating fully recovers the anatomy in both slices, even when anatomic details were previously obscured. The following examples describe applications, procedures, and evaluation results of the inventive deep learning scheme for R-wave identification and retrospective MRI reconstruction. These examples are intended to illustrate, but not limit, the scope of the invention. Example 1: ECG Tracings and R-wave labeling With HIPAA compliance, IRB approval, and waiver of informed consent, all available ECG tracings were retrospectively collected, without exclusion. The tracings were recorded during breath-held and ECG-gated balanced steady-state free-precession (bSSFP) cine cardiac MRIs performed between August 2022 and April 2023 (120 patients, 388 tracings), details for which are listed in Table 1 above. ECG tracings and VCG triggers were recorded during MRIs performed at both 1.5T (74 patients, 304 tracings) and 3.0T (46 patients, 84 tracings). ECG tracings during MRI were recorded at 1000 Hz using MR-safe electrodes placed in a 2-channel reverse-J configuration. Ground truth labels for ECG R- waves were created by two readers trained by the senior investigator, a cardiovascular radiologist with over 10 years of experience in cardiac MRI. R-wave annotation of ECG tracings was performed using the Label Studio software (HumanSignal, Inc., San Francisco, California, United States). Using these labels, the prevalence of arrhythmia and ECG-gating errors during MRI was tabulated (see, e.g., FIG. 1A-1B). Details for tabulating error prevalence are described above. Imaging parameters for bSSFP exams are provided in the table in FIG.3A. Additionally, to ensure algorithm generalizability, external ECG tracings and R- wave labels were obtained from a publicly accessible database including 47 subjects seen at Boston's Beth Israel Hospital between 1975 and 1979 (the “MIT-BIH Arrhythmia Database"). Six percent (6%) of this data was allocated to supplement algorithm development, and 94% for algorithm testing. External ECG tracings were recorded at 360 Hz using standard electrodes placed in a 2-channel ambulatory configuration. Multiple forms of arrhythmia were observed in the ECG tracings recorded during MRI. Referring to FIG.1A, in 6.7% of patients, atrial fibrillation was observed. In 2.5% of patients, PACS in more than 10% of beats was observed. In 5% of patients, PVCs in over 10% of beats were observed. These were not the only sources of beat-to-beat inconsistency during MRI. As indicated in FIG.1B, frequent errors occurred in VCG R-wave detection, with 8.1% of patients scanned at 1.5T and 15.2% of patients scanned at 3.0T exhibiting errors involving over 5% of beats. Notably, the number of patients for whom VCG had errors involving over 25% of their beats increased from 1.4% at 1.5T to 6.5% at 3.0T. The higher frequency of errors at 3.0T was more frequent due to increased false positives than false negatives. The false negative rate was 2.1% at 3.0T and 1.9% at 1.5T. The FPR was 5-fold higher at 3.0T (3.0%) than at 1.5T (0.6%). Example 2: Comparison of Algorithms and Statistical Analysis As an external reference method for comparison in addition to on-scanner VCG triggers during MRI, the Hamilton algorithm was implemented using an open-source implementation via the BioSignal Processing Python library (v2.1.0). The accuracy and F1-score (F1) of each algorithm in R-wave detection on ECGs obtained during MRI, stratified by field strength, was first evaluated. R-wave detections were considered concordant if ground truth and algorithm detected R-waves fell within 40 ms. Next, the false positive rate (FPR) of R-wave detection was evaluated as false R-wave triggering can introduce motion artifacts in MRI. Furthermore, mean absolute error (MAE) in R-wave localization was evaluated relative to annotated R-wave labels so as to precisely localize time of R-wave for ECG-gating. Statistical analysis included Wilcoxon signed-rank test, with significance determined at p<0.05. All analyses were performed using the Numpy (v1.22.3), Scipy (v1.7.3), and Pandas (v2.0.3) Python libraries. Example 3: R-wave Identification The average execution time for the Hamilton algorithm was 0.2 ms, the CNN Detector was at 3.8 ms, and the CNN Predictor was 3.6 ms. The recorded delay between VCG triggers and each R-waves (obtained from the MR scanner) averaged 20 ms. Table 2 below provides a comparison of performance metrics in ECG R-wave identification across all cohorts. The CNN Detector (CNN-D) method exhibited higher accuracy, higher F1-score, and lower FPR than signal processing algorithms of R-wave detection. The CNN Predictor (CNN-P) method shows comparable accuracy, F1-score, and FPR to signal processing algorithms when predicting R-waves up to 4 seconds into the future. (Table key: CNN, FPR: false positive rate, MAE: mean absolute error, VCG: vectorcardiogram; values: mean [95% confidence interval], Wilcoxon signed rank p<0.05 between: *CNN-D and *VCG, †CNN-D and †Hamilton, CNN-D and CNN-P, §CNN-P and Hamilton or VCG). While both CNNs showed excellent performance on R-wave identification, the CNN Predictor did not perform as well as the CNN Detector, which may be due to the unpredictability of R-waves in cases of arrhythmia and MHD artifact. At 1.5T, the CNN-D achieved higher accuracy (99.5%) and F1 score (99.1%) for R- wave detection than VCG (98.9% and 98.1%, respectively; both P=.048; Table 2, FIG.4A). At 3.0T, the CNN-D achieved higher F1 score (99.1%) than the Hamilton algorithm (92.4%; P=.049). There was no difference in accuracy between the CNN (99.5%), Hamilton (94.5%; P=.06) , and VCG (95.9%; P=.46) at 3.0T. The CNN-D demonstrated a lower FPR during MRI (0.3% at 1.5T and 0.1% at 3.0T) compared with the Hamilton algorithm (1.0% at 1.5T [P=.01], and 7.4% at 3.0T [P=.02]; Table 2, FIG. 4B). Both signal processing algorithms (Hamilton and VCG) showed more than a six-fold increase in FPR at 3.0T compared with 1.5T. In contrast, the CNN algorithm maintained low FPR across both field strengths, demonstrating robust performance. In the publicly available external ECG dataset, the CNN-D and Hamilton methods achieved comparable accuracy (both 98.8%; P=.08) and F1 scores (98.3% and 98.2%, respectively; P=.07) for R-wave detection (Table 2, FIGs.4A and 4B). The CNN-D had a FPR of 0.1%, whereas Hamilton had a value of 0.0% (P=.11). Despite all 41 recordings containing arrhythmias, CNN-D performance in R-wave detection was comparable to that of a state-of-the-art signal processing algorithm. CNN-P however did not perform as well in predicting R-waves within the external dataset of arrhythmias. Additional evaluation of subpopulations stratified by age, sex, heart rate, indication, and arrhythmia are provided in Table 3, which provides a comparison of accuracy (%) in ECG R-wave identification categorized by age, sex, heart rate, MRI indication, and arrhythmia in the test set (Table 3). The CNN Detector method achieved higher accuracy than traditional methods of R-wave identification. Table 2

[0002] Table 3 Referring to FIGs. 5A and 5B, example ECG tracings from 1.5T and 3.0T, respectively, highlight common errors in R-wave detection. Errant detection of R-waves by signal processing algorithms were observed with MHD effects and noise spikes. Notably, with higher field strength, Q-waves and T-waves were detected as R-waves by VCG and Hamilton detectors. In both figures, VCG (diamonds) and Hamilton detections (triangles) misidentify MHD effects and noise (gray arrows) for R-waves (vertical dashed lines). In FIG.5B, in the upper panel, VCG double-detects before and after a single R-wave (black arrows). Hamilton detections inconsistently switch between Q-waves and R-waves (hashed arrows). CNN detections (dots) avoid these errors. CNN predictions (squares) avoid these errors at 1.5T but are similarly susceptible at 3.0T. Example 4: R-wave Localization It is important not only to accurately identify R-waves, but also to precisely localize their position in time. While evaluating localization performance, the CNNs maintained stability across field strengths relative to the reference standard R-wave annotations, whereas the performance of traditional signal processing algorithms declined at higher field strength (see Table 2, FIG.4B). At 3.0T, the error in R-wave temporal localization for the CNN-D was the lowest of the three methods (9.4 ms for CNN, 10.2 ms for VCG [P=.09], 26.9 ms for Hamilton [P=.86], and 30.1 ms for CNN-P [P<.05]). However, at 1.5T, VCG yielded the lowest error (5.4 ms; P < .01), followed by the CNN (7.9 ms) and Hamilton (13.7 ms; P=.79). Both signal processing algorithms (Hamilton and VCG) nearly doubled in localization error at 3.0T compared with 1.5T, whereas both of the CNN algorithms remained stable. In the publicly available external ECG dataset, Hamilton achieved lower localization error (5.6 ms) compared with the both of the CNNs (P < .001). As described herein, deep learning algorithms can be used to improve the reliability of ECG gating to, in turn, improve the real-time analysis of ECG signals during MRI. Current signal processing methods are unreliable during MRI, especially at high field strength. However, the inventive CNN-based approaches can be optimized specifically for ECG tracings obtained during MRI acquisition, enhancing accuracy of R-wave detection and robustness of localization. Use of the CNN algorithms to retrospectively re-bin and reconstruct scanner raw data can resolve artifacts related to errors in ECG-gating in MRI. The inventive CNN R-wave detector algorithm performs with high accuracy in R- wave detection, comparable to previous deep learning studies conducted on ECG tracings without MR interference. The CNN approaches showed higher R-wave detection accuracy, lower FPR and stable localization performance across field strengths, with the caveat that this may not be true of algorithms that are not specifically trained on ECGs obtained during MRI. For example, although the Hamilton algorithm exhibited lower FPR and localization error on the external dataset, its performance declined on ECG tracings obtained during MRI. Similarly, both VCG and Hamilton declined in FPR and localization error with increasing field strength. This may be a result of MHD effects during MRI which alter morphology of R-waves and introduce confounding artifacts. Additionally, the inventive CNN approaches accurately detected R-waves quickly, in under 4 ms, comparable to prior algorithms for prospective VCG-gating. Importantly, the inventive CNN algorithms are fast enough to allow systolic imaging, as the onset of systolic contraction occurs 30-70 ms after the actual R-wave. Beyond providing an optimized CNN approaches specifically for ECG-gating in MRI to enhance accuracy of R-wave detection and localization, the inventive CNN-based methods represent a valuable tools for retrospectively re-binning and reconstructing scanner raw data to resolve artifacts related to errors in ECG-gating.

Claims

WHAT IS CLAIMED IS:

1. A method for detecting and locating R-wave peaks in electrocardiogram (ECG) traces, comprising: receiving ECG traces in a computer processor configured for executing a trained convolutional neural network (CNN); defining time windows within each ECG trace, each time window having a duration configured to include at least one heartbeat; processing each time window with the trained CNN to determine whether an R-wave peak is present within the time window; and if an R-wave peak is determined to be present, generating at an output layer of the CNN identification of corrected R-wave peaks determined to be present in the time window.

2. The method of claim 1, wherein each time window is approximately 2 seconds.

3. The method of claim 1, wherein the CNN comprises a modified VGG-16 network.

4. The method of claim 1, wherein the output layer is configured to apply a loss function to simultaneously optimize both R-wave detection and localization.

5. The method of claim 4, wherein the loss function comprises ^^^^^^^^ (^^, ŷ, ^^, ^̂^) =−^^^^^^^^(ŷ) − (1 − ^^) log(1 − ŷ) + ^^(^^ௌ^)(^^ − ^̂^)ଶ, where y is a binary [0, 1] ground truthlabel, with ^^ = 1 indicating an R-wave is present; ŷ is a predicted probability of an R-wave;^^ is a true location of the R-wave within a detection window, encoded as a decimal offsetsuch that 0 represents a beginning of the detection window and 1 represents an end; ^̂^ is a predicted location of the R-wave; and ^^ௌ^is an accuracy scaling factor to balance localization error relative to identification error.

6. The method of claim 4, wherein, if an R-wave peak is determined to be present, using the output layer to regress the R-wave location within the time window to identify a corrected R-wave peak location.

7. The method of claim 6, wherein regression of R-wave location is performed using a ReLU activation function.

8. The method of claim 6, wherein the ECG traces are collected during cardiac cine MR imaging, wherein an MR image comprises binned spatial frequency data, and further comprising:retrospectively re-binning the binned spatial frequency data into corrected cardiac phases using the corrected R-wave peak location; and generating a corrected cardiac cine MR image from the corrected cardiac phases.

9. The method of claim 8, wherein the cardiac cine MR image is generated by multiple receiver coils, wherein the steps of retrospectively re-binning and generating a corrected cardiac cine MR image are performed separately for each receiver coil, and further comprising combining the corrected cardiac cine MR images for the multiple receiver coils.

10. The method of claim 1, wherein, if an R-wave peak is determined to be present, processing each time window further comprises applying a loss function to predict future R-wave peaks within a prediction window beyond the time window.

11. The method of claim 10, wherein the loss function comprises, where ^^q is a predicted quantile, yp is an actual R-wave location encoded as milliseconds from a start of the prediction window, and ŷpis an estimated location encoded as milliseconds from the start of the prediction window.

12. The method of claim 10, wherein processing further comprises providing 5th, 50th, and 95th percentile probabilities of two upcoming R-waves in the output layer.

13. The method of claim 1, wherein, after defining time windows, the ECG traces are mean-normalized and standardized.

14. The method of claim 4, further comprising imaging an arrhythmia using corrected R-wave peaks to reconstruct heartbeats of similar morphology and reject dissimilar heartbeats to separate constituent heartbeat types for imaging the arrhythmia.

15. The method of claim 14, wherein the corrected R-wave peaks beats are input a rule-based R-wave classifier employing a combination of the RR-intervals before and after a corrected R-wave peak to classify the R-wave into a arrhythmic category.

16. The method of claim 15, wherein the arrhythmic category is selected from the group consisting of sinus, interrupted sinus, PVC, PAC, post-pause sinus, bigeminy sinus, undetected R-wave, and misfire R-wave.

Citation Information

Patent Citations

  • Method and device for determining a cardiac phase in magnet resonance imaging

    US20210287364A1

  • Automatic quantification of cardiac MRI for hypertrophic cardiomyopathy

    US20210287367A1

  • Method and device for translating between stochastic signals

    US20220414181A1

  • Systems and methods for image data acquisition

    US20230355188A1

  • Apparatus and a method for predicting a physiological indicator

    US20240206821A1