An automated method and system for detecting cardiac cycle based on cardiac MRI data
By constructing a k-space ECG dataset and using singular value decomposition and digital filtering, combined with an FCNN+bidirectional LSTM network model, cardiac cycle signals are directly extracted from cardiac MRI data. This solves the problems of long scan time and poor real-time performance in cardiac MRI technology, and enables real-time acquisition of cardiac cycle signals.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-26
- Publication Date
- 2026-04-03
AI Technical Summary
Existing cardiac magnetic resonance imaging technology is affected by heartbeat and respiration during the scanning process, resulting in long scanning time and complex operation. Furthermore, new technologies have long signal processing times and cannot achieve real-time acquisition of cardiac cycle signals.
By constructing a k-space ECG dataset, using singular value decomposition and digital filtering to process cardiac MRI data, and combining an FCNN+bidirectional LSTM network model, cardiac cycle signals can be directly extracted from the k-space data, replacing the need for additional ECG signal acquisition.
It enables real-time feedback of cardiac cycle signals, simplifies the scanning process, reduces reliance on ECG signals, and improves data processing efficiency.
Smart Images

Figure CN116687347B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of nuclear magnetic resonance technology, and more specifically to an automatic cardiac cycle detection method and system based on cardiac nuclear magnetic resonance data. Background Technology
[0002] Cardiac magnetic resonance (CMR) imaging is a crucial method for diagnosing and treating cardiovascular diseases. This imaging technique offers numerous advantages, such as being non-invasive, radiation-free, high-resolution, multi-sequence, multi-parameter, and capable of imaging in any plane. However, due to the influence of the heart's own rhythm and respiration, as well as the fundamental principles of CMR imaging, cardiac CMR scans are lengthy and complex. To overcome these challenges, the patient wears an electrocardiogram (ECG) acquisition and transmission device during the scan to track the heart's rhythm in real time, obtaining data from different cardiac cycles and avoiding artifacts.
[0003] With continuous technological advancements, cardiac magnetic resonance imaging (MRI) technology is constantly improving. In recent years, researchers have sought new techniques and methods to enhance cardiac MRI, attempting to extract cardiac motion data from imaging data to achieve cardiac MRI scans without external equipment. These techniques aim to extract anatomical motion information from imaging data, eliminating reliance on electrocardiograms (ECGs). These methods derive MR signals that display periodic variations associated with the cardiac cycle through frequent sampling of the k-space center. Using these signals, a cinematic image of the cardiac cycle can be retrospectively reconstructed. While this technique eliminates the need for external physiological signal detection, its efficiency is slightly lower compared to traditional ECG gating. Furthermore, these new techniques have longer signal processing times and require more data acquisition and analysis, making it difficult for physicians to obtain real-time feedback, which is a key factor limiting their widespread clinical application.
[0004] Therefore, how to directly and quickly obtain cardiac cycle signals using k-space data is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] In view of this, the present invention provides an automatic cardiac cycle detection method and system based on cardiac MRI data.
[0006] To achieve the above objectives, the present invention adopts the following technical solution:
[0007] This invention discloses an automatic cardiac cycle detection method based on cardiac MRI data, characterized by comprising the following steps:
[0008] S1, collect historical data in k-space and corresponding electrocardiogram signals to construct a k-space-ECG dataset;
[0009] S2, preprocess the constructed k-space-ECG dataset, and use the preprocessed k-space-ECG dataset as the training set;
[0010] S3, The k-space cardiac cycle label classification network is trained using the training set;
[0011] S4. Collect continuous real-time k-space data, input the real-time k-space data into the trained k-space cardiac cycle label classification network, and obtain the cardiac cycle label corresponding to the real-time k-space data.
[0012] Preferably, in step S2, the constructed k-space-ECG dataset is preprocessed, specifically including the following steps:
[0013] S21. Divide the historical data of k-space according to the acquisition window. If the inverted pulse is used during the acquisition and scanning process, the acquired k-space data is filtered and compared to ensure that the brightness change of the k-space data in each acquisition window is consistent.
[0014] S22. Use the singular value decomposition algorithm to compress the signals of different coil channels in the k-space data;
[0015] S23. Based on the cardiac cycle frequency range, the influence of data brightness changes caused by inverted pulses is eliminated through digital filtering and undersampling.
[0016] S24. Perform tag cleaning on the collected electrocardiogram signals to remove misaligned tags.
[0017] Preferably, in step S21, the range of each acquisition window is 3-5 seconds.
[0018] Preferably, step S24 is followed by the following step:
[0019] Feature extraction was performed on the preprocessed electrocardiogram signal, and QRS peak detection was performed based on threshold and feature determination methods;
[0020] Based on the QRS peak detection results, the ECG signal is converted into two categories: R wave and non-R wave.
[0021] Preferably, in step S3, the k-space cardiac cycle label classification network includes an FCNN+bidirectional LSTM network model, in which the output of the FCNN network is used as the input of the bidirectional LSTM network.
[0022] Preferably, in step S3, the cost function of the k-space cardiac cycle label classification network includes the following binary cross-entropy loss function:
[0023]
[0024] Where x is the actual k-space cardiac cycle label probability, y is the predicted probability, and W is the loss weighting.
[0025] Preferably, in step S3, the k-space cardiac cycle label classification network is trained using the training set, specifically including the following steps:
[0026] The k-space image dataset was randomly divided into 5 equal parts, each part was used as a test set, and the remaining 4 parts were used as training sets. The k-space cardiac cycle label classification network was trained 5 times to obtain the trained k-space cardiac cycle label classification network and its parameters.
[0027] Preferably, before inputting the real-time k-space data into the trained k-space cardiac cycle label classification network, the method further includes:
[0028] Preprocess the real-time data in k-space.
[0029] Preferably, the real-time data in the k-space is preprocessed, specifically including:
[0030] Historical k-space data is divided according to acquisition windows. If a reverse pulse is used during the acquisition and scanning process, the acquired k-space data is filtered and compared to ensure that the brightness changes of the data in each acquisition window are consistent.
[0031] The singular value decomposition algorithm is used to compress signals from different coil channels in k-space data;
[0032] Based on the cardiac cycle frequency range, the influence of K-space data brightness changes caused by inverted pulses is eliminated through digital filtering and undersampling;
[0033] The time steps of k-space data and electrocardiogram data are unified.
[0034] The present invention also discloses an automatic cardiac cycle detection system based on cardiac MRI data, the system comprising a computer program, the computer program being used in any of the automatic cardiac cycle detection methods based on cardiac MRI data described in the present invention.
[0035] As can be seen from the above technical solution, compared with the prior art, the present invention discloses an automatic cardiac cycle detection method and system based on cardiac MRI data, which has the following beneficial effects:
[0036] During MRI scans, it is often necessary to acquire additional electrocardiogram (ECG) signals to track the cardiac cycle. With this invention, cardiac cycle signals can be directly extracted from continuously acquired cardiac MRI k-space data, enabling real-time feedback of cardiac cycle signals. This can replace the need for additional ECG signal acquisition for subsequent image reconstruction. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0038] Figure 1 The attached figure is a schematic diagram of the method flow provided by the present invention;
[0039] Figure 2 The attached figure shows waveforms of electrocardiogram signals at different stages provided in an embodiment of the present invention, wherein... Figure 2 'a' represents the original electrocardiogram waveform. Figure 2 b represents the waveform after the original electrocardiogram signal has been deconstructed and reconstructed. Figure 2 c represents the ECG signal waveform after differential operation. Figure 2 d represents the ECG waveform after squaring. Figure 2 e represents the electrocardiogram waveform after the sliding window;
[0040] Figure 3 The attached figure is a waveform diagram of the ECG signal R-wave localization result provided in an embodiment of the present invention. Detailed Implementation
[0041] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0042] Example 1
[0043] Example 1 discloses an automated cardiac cycle detection method based on cardiac MRI data, comprising the following steps:
[0044] S1. Construct a k-space-ECG dataset. First, select n consecutively acquired k-space data points and their corresponding ECG signals to construct a k-space-ECG dataset D, where the optimal value of n is 100, but it is not limited to this value.
[0045] S2, the k-space-ECG dataset is preprocessed, and the preprocessed k-space-ECG dataset is used as the training set.
[0046] First, the k-space data is divided according to the acquisition window (AW). If an inverted pulse is used during the scanning process, the acquired k-space data needs to be filtered and compared. When dividing the acquisition window, ensure that the brightness change of the data in each acquisition window is consistent. That is, ensure that the data of the input model is consistent not only in length in the time dimension, but also in brightness change in the time dimension. The optimal range for each acquisition window is 3-5 seconds (it is best to ensure that each acquisition window contains at least one cardiac cycle), but it is not limited to this value.
[0047] Then, methods such as Singular Value Decomposition (SVD) are used to compress the signals of different coil channels in the NMR k-space data;
[0048] Next, based on the patient's cardiac cycle frequency range, digital filtering and undersampling were used to eliminate the influence of data brightness changes caused by inverted pulses in the presence of inverted pulses, thereby further optimizing the k-space data;
[0049] Finally, the collected electrocardiogram signals affected by the magnetic field need to be cleaned by removing misaligned tags.
[0050] In this embodiment, singular value decomposition is used to compress different coil signals. While preserving the data content as much as possible, data from multiple coil channels is compressed into fewer virtual coils, reducing the amount of data. This facilitates faster subsequent processing and saves computing power.
[0051] Digital filtering, after determining the range of the cardiac cycle, filters the data to eliminate frequency information other than the cardiac cycle frequency, such as noise and brightness changes caused by inversion pulses.
[0052] Undersampling involves undersampling data in the time dimension to unify the temporal resolution of k-space data and ECG signals, thereby reducing the amount of data and improving computational efficiency.
[0053] The processing of ECG signals also includes,
[0054] QRS peak detection:
[0055] First, a moving average filter and a differential filter are used to extract features from the preprocessed ECG signal. Then, peak detection is performed based on a threshold and feature-based method. The specific steps are as follows:
[0056] First, wavelet transform is performed on the original ECG signal, decomposing it into sub-signals of different scales. Each scale corresponds to a frequency band of the wavelet basis function. These sub-signals are then reconstructed to enhance the characteristics of the QRS complex and reduce noise interference. Since the QRS complex is a special waveform structure in the ECG signal, composed of Q, R, and S waves, representing the ventricular contraction process, it has specific slope characteristics and a relatively steep waveform with a large slope. Therefore, a differential filter is used to calculate the slope of the QRS complex, i.e., the rate of signal change, to capture its characteristics.
[0057] The differential signal is then squared to make the QRS peak more prominent and easier to locate.
[0058] Next, to more accurately locate the QRS peak, a sliding window method is used to further process the obtained signal. This method smooths and processes the integrated signal to determine the location of the QRS peak. In this method, a fixed window size of 20 is selected, the window is shifted, and the average value within the window is calculated; this average value is considered the location of the QRS peak. This method can effectively reduce the influence of noise. The waveforms of the original ECG signal, the decomposed and reconstructed signal, the signal after differential operation, the signal after squaring operation, and the signal after sliding window operation are shown in the figure. Figure 2 As shown, where, Figure 2 The following are waveform diagrams of electrocardiogram signals at different stages provided in embodiments of the present invention, wherein... Figure 2 'a' represents the original electrocardiogram waveform. Figure 2 b represents the waveform after the original electrocardiogram signal has been deconstructed and reconstructed. Figure 2 c represents the ECG signal waveform after differential operation. Figure 2 d represents the ECG waveform after squaring. Figure 2 e represents the electrocardiogram waveform after the sliding window.
[0059] Finally, candidate points are filtered by setting a threshold to remove smaller peaks and noise peaks. Then, heart rate intervals are set to further filter the candidate points and eliminate false positives, resulting in the final R-wave peak. The waveform of the R-wave localization result is shown below. Figure 3 As shown:
[0060] Classification markers:
[0061] The above steps can accurately detect the QRS wave peak in the ECG signal and extract the R wave peak, converting the continuous ECG signal into two categories: R wave and non-R wave.
[0062] S3, train the k-space cardiac cycle label classification network using the training set.
[0063] First, a k-space cardiac cycle label classification network is constructed.
[0064] This invention constructs an FCNN+bidirectional LSTM network model as a k-space cardiac cycle label classification network N. In the FCNN+bidirectional LSTM network model, the output of the FCNN network serves as the input of the bidirectional LSTM network.
[0065] Specifically, in the FCNN+Bidirectional LSTM network model, the goal of the FCNN network is to reduce the spatial dimension of the input data at each step while preserving the temporal dimension, thereby achieving efficient feature extraction. Simultaneously, by processing each batch size, the training and optimization process of the model can be accelerated, improving the model's accuracy and robustness.
[0066] The specific implementation steps are as follows: First, divide each set of data into nb batches (nb = 4, 8, 16, etc. are recommended), each batch size containing coil dimension, time dimension, and spatial dimension; next, perform batch normalization on the input data; then, process the data sequentially through convolutional layers, linear activation layers, and max pooling layers applied only in the spatial dimension. In each convolutional layer, the number of feature maps is doubled, while using a 3×3 kernel size. For each pooling layer, a 1×2 kernel size is used. These steps are repeated 7 times until the spatial dimension is reduced to 1 dimension.
[0067] In the FCNN+Bidirectional LSTM network model, the input to the Bidirectional LSTM module comes from the output of the FCNN module. The FCNN and Bidirectional LSTM network models have the same batch size. The tensor size of the input data is the same as the number of feature maps output by the FCNN module. The temporal length of the input data remains unchanged, maintaining the same time dimension. This design helps to better capture the features and changes of the signal in the time dimension.
[0068] The bidirectional LSTM module contains nl layers (nl=4 is recommended, but not limited to) of LSTM layers, each with several hidden nodes. The design of these layers allows the model to better understand the evolution and characteristics of the signal over time. At the model output level, this invention uses a fully connected layer and a linear activation layer to generate the final probability prediction. The spatial dimension of the predicted output is 1 because the model design has already extracted and compressed useful features from the spatial dimension of the input signal using the FCNN module. The number of output channels is 1. The predicted data represents the probability of the R-wave, ranging from 0 (0%) to 1 (100%).
[0069] At the model output level, a fully connected layer and a linear activation layer are used to generate the final probability predictions. Specifically, the fully connected layer is designed to map the hidden state vector output by the LSTM module to a 1-dimensional output space, and then the linear activation layer constrains the output to the range of 0 to 1. This method can generate an R-wave probability prediction sequence with the same length as the input signal in the time dimension, where each value in the sequence represents the probability of detecting an R-wave at the corresponding time point. Data in this output format can be directly compared with labeled data, facilitating the evaluation of model performance using common evaluation metrics.
[0070] The process of constructing a k-space cardiac cycle label classification network also includes constructing the cost function for the k-space cardiac cycle label classification network. In this embodiment, the cost function F of the k-space cardiac cycle label classification network N is defined as the following binary cross-entropy loss function:
[0071]
[0072] Where x is the actual probability of the label (0 or 1), and y is the predicted probability (ranging from 0 to 1). Since the amount of positive and negative label data differs significantly, the weighted loss W is:
[0073] W = (t in -p v ) / p v =Non-R wavenumber / R wavenumber
[0074] After constructing the k-space cardiac cycle label classification network, the preprocessed k-space ECG dataset is input into the classification network to train the k-space cardiac cycle label classification network, and the parameters of the k-space cardiac cycle label classification network are obtained.
[0075] The specific training process is as follows:
[0076] The obtained k-space image dataset D is randomly divided into 5 equal parts, with each part used as a test set and the remaining 4 parts used as training sets. This modeling process is repeated 5 times to obtain the trained k-space cardiac cycle label classification network N. t and k-space cardiac cycle label classification network parameters γ t .
[0077] S5, collect continuous k-space real-time data, input the k-space real-time data into the trained k-space cardiac cycle label classification network, and obtain the cardiac cycle label corresponding to the k-space real-time data.
[0078] Specifically, continuous k-space data is collected. First, k-space data is continuously collected. Then, the k-space data is preprocessed according to the k-space data preprocessing process in step S2. During the preprocessing, the time step of the k-space data and the ECG data is unified, because the time resolution of the k-space data and the ECG data may be different in practice. The processed k-space data T is obtained.
[0079] Cardiac cycle labels are extracted from k-space data. First, the k-space data T is input into the trained k-space cardiac cycle label classification network N. t Then, import the trained k-space cardiac cycle label classification network parameters γ. t Finally, the cardiac cycle signal label corresponding to the k-space data is obtained.
[0080] Example 2
[0081] Example 2 discloses an automatic cardiac cycle detection system based on cardiac MRI data. The system includes a computer program, which is used in any of the automatic cardiac cycle detection methods based on cardiac MRI data of the present invention.
[0082] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0083] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An automated cardiac cycle detection method based on cardiac MRI data, characterized in that, Includes the following steps: S1, collect historical data in k-space and corresponding electrocardiogram signals to construct a k-space-ECG dataset; S2, preprocess the k-space-ECG dataset and use the preprocessed k-space-ECG dataset as the training set; specifically including: S21, divide the k-space historical data according to the acquisition window, apply the inverted pulse during the acquisition and scanning process, and filter and compare the acquired k-space data to ensure that the brightness change of the data in each acquisition window is consistent. S22. Use the singular value decomposition algorithm to compress the signals of different coil channels in the k-space data; S23. Based on the cardiac cycle frequency range, the influence of K-space data brightness changes caused by the inversion pulse is eliminated by digital filtering and undersampling; S24. Perform tag cleaning on the collected electrocardiogram signals to remove misaligned tags; S3, The k-space cardiac cycle label classification network is trained using the training set; S4. Collect continuous real-time k-space data, input the real-time k-space data into the trained k-space cardiac cycle label classification network, and obtain the cardiac cycle label corresponding to the real-time k-space data.
2. The automatic cardiac cycle detection method based on cardiac MRI data according to claim 1, characterized in that, In step S21, the range of each acquisition window is 3-5 seconds.
3. The automatic cardiac cycle detection method based on cardiac MRI data according to claim 1, characterized in that, Step S24 is followed by the following steps: Feature extraction was performed on the preprocessed electrocardiogram signal, and QRS peak detection was performed based on threshold and feature determination methods; Based on the QRS peak detection results, the ECG signal is converted into two categories: R wave and non-R wave.
4. The automatic cardiac cycle detection method based on cardiac MRI data according to claim 1, characterized in that, In step S3, the k-space cardiac cycle label classification network includes an FCNN+bidirectional LSTM network model, in which the output of the FCNN network is used as the input of the bidirectional LSTM network.
5. The automatic cardiac cycle detection method based on cardiac MRI data according to claim 1, characterized in that, In step S3, the cost function of the k-space cardiac cycle label classification network includes the following binary cross-entropy loss function: ; Where x is the actual k-space cardiac cycle label probability, y is the predicted probability, and W is the loss weighting.
6. The automatic cardiac cycle detection method based on cardiac MRI data according to claim 1, characterized in that, In step S3, the k-space cardiac cycle label classification network is trained using the training set, specifically including the following steps: The k-space image dataset was randomly divided into 5 equal parts. One part was selected as the test set and the other 4 parts were used as the training set. The k-space cardiac cycle label classification network was trained 5 times to obtain the trained k-space cardiac cycle label classification network and its parameters.
7. The automatic cardiac cycle detection method based on cardiac MRI data according to claim 1, characterized in that, Before the real-time k-space data is input into the trained k-space cardiac cycle label classification network, the following steps are also included: Preprocess the real-time data in k-space.
8. The automatic cardiac cycle detection method based on cardiac MRI data according to claim 7, characterized in that, Preprocessing of real-time data in k-space includes: Historical k-space data is divided into acquisition windows. Inverted pulses are used during the acquisition and scanning process to filter and compare the acquired k-space data to ensure that the brightness changes of the data in each acquisition window are consistent. The singular value decomposition algorithm is used to compress signals from different coil channels in k-space data; Based on the cardiac cycle frequency range, the influence of K-space data brightness changes caused by inverted pulses is eliminated through digital filtering and undersampling; The time steps of k-space data and electrocardiogram data are unified.
9. An automated cardiac cycle detection system based on cardiac MRI data, characterized in that, The system includes a computer program for executing the automatic cardiac cycle detection method based on cardiac MRI data as described in any one of claims 1-8.
Citation Information
Patent Citations
Heart signal prediction method and system
CN113303783A