Fetal electrocardiogram display and QRS detection system based on time domain inversion and maternal interference suppression, and electronic device

CN122581783APending Publication Date: 2026-08-18HANGZHOU DIANZI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610826814.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-09
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0008]本发明的目的在于提供一种基于时域反转与母体干扰抑制的胎儿心电显现及QRS检测技术方案,以解决现有技术在强母体干扰和低信噪比条件下,未能充分利用时间方向性差异来区分母体心电与胎儿心电,而导致的胎儿心电波形显现不充分、QRS检测稳定性不足的技术问题

Benefits of technology

[0120]本发明通过时间反转判别使共享编码器显式学习信号的时间方向性,利用母体与胎儿QRS在正向-反向特征分布上的天然差异为后续分离提供依据;通过母体干扰掩膜在特征层面对母体干扰进行任务驱动的自适应抑制;通过波形重构与QRS检测的多任务联合学习,兼顾整体形态和关键峰值;通过低信噪比自适应权重,使模型在弱信号条件下依然保持稳定的显现和检测能力;通过波形能量与QRS概率的融合检测,显著降低了误检和漏检率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122581783A_ABST
    Figure CN122581783A_ABST
Patent Text Reader

Abstract

The application discloses a fetal electrocardiogram display and QRS detection system and electronic equipment based on time domain reversal and maternal interference suppression, and the system comprises a signal preprocessing module, a time reversal self-supervised learning module, a weak enhancement contrast learning module, a shared feature coding module, a maternal interference guiding module, a fetal electrocardiogram reconstruction and QRS auxiliary detection module and a continuous reconstruction and fusion detection module.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of biomedical signal processing and deep learning technology, specifically involving a technique for extracting fetal electrocardiogram from mixed abdominal electrocardiogram signals and performing QRS (QRS is the letter designation for the three waveforms Q wave, R wave and S wave on an electrocardiogram) wave group detection. Background Technology

[0002] Accurate extraction of fetal cardiac components and QRS complex detection from the pregnant woman's abdominal electrocardiogram signal are core components of perinatal fetal health monitoring. Based on this, the calculated fetal heart rate and heart rate variability can provide objective evidence for early warning of fetal distress, screening for congenital heart disease, and management of high-risk pregnancies.

[0003] Currently, non-invasive fetal electrocardiogram (ECG) acquisition via abdominal electrodes is commonly used in clinical practice. This method is safe and convenient for long-term continuous monitoring. However, the signals recorded by abdominal leads, in addition to fetal ECG, are also mixed with maternal ECG, electromyographic noise, baseline drift, and power line interference. Among these, maternal ECG has a stronger amplitude (usually 5 to 20 times that of fetal ECG) and a relatively regular morphology, dominating the mixed signal; fetal ECG, on the other hand, has a weaker amplitude, narrower peaks, and its morphology is easily affected by fetal position and fetal movement. Furthermore, the timing of their occurrence on the time axis is not completely synchronized. These factors combined often result in fetal ECG being overwhelmed by strong maternal interference and complex noise, making waveform visualization and QRS localization very difficult.

[0004] Existing extraction methods mostly rely on adaptive filtering, blind source separation, wavelet transform, or template cancellation, combined with rule-based peak detection. When the maternal interference pattern is relatively fixed and the signal-to-noise ratio is high, these methods can provide acceptable results. However, when the maternal QRS and fetal QRS overlap in time or the noise environment changes drastically, the waveform reconstruction distortion, missed detection, and false detection rates will increase significantly due to over-reliance on manually set parameters and the assumption of statistical independence of the signal.

[0005] In recent years, deep learning models have been introduced into electrocardiogram (ECG) signal processing. Convolutional networks, recurrent networks, and multi-task learning frameworks enable models to automatically learn features from data, improving the performance of fetal ECG extraction and detection in complex scenarios. However, most current methods are still designed around the amplitude distribution, spectral characteristics, or statistical independence between different channels, neglecting a fundamental physical characteristic of mixed abdominal ECG signals—temporal directionality.

[0006] Temporal directionality refers to the degree to which the statistical characteristics and internal structure of a time series are distinguishable when observed forward and backward along the time axis. The morphology of maternal QRS complexes is relatively regular, with little difference in characteristic distributions between forward and backward propagation; however, fetal QRS peaks are narrower and more irregular, and coupled with random disturbances from fetal movement and acquisition noise, there are significant differences between their forward and backward characteristics. Furthermore, the relative positions of maternal and fetal QRS complexes on the time axis—which appears first and whether they partially overlap—also imply rich directional clues. If the model cannot explicitly capture these directional differences, it is easy to produce false positives at moments when strong maternal QRS complexes appear, or to miss detections at times when fetal ECGs are weaker.

[0007] Based on the above observations, this invention proposes a system that explicitly learns the temporal directionality characteristics of signals through time reversal operations. On this basis, it achieves adaptive suppression of maternal interference and multi-task joint learning, ultimately achieving clear visualization of fetal electrocardiogram and accurate detection of QRS complexes. Summary of the Invention

[0008] The purpose of this invention is to provide a fetal electrocardiogram (ECG) display and QRS detection technology based on time-domain reversal and maternal interference suppression, in order to solve the technical problems of insufficient fetal ECG waveform display and insufficient QRS detection stability caused by the failure of existing technologies to fully utilize the temporal directionality difference to distinguish between maternal ECG and fetal ECG under conditions of strong maternal interference and low signal-to-noise ratio.

[0009] This invention revolves around the following key steps: preprocessing and sliding window segmentation of multi-channel abdominal electrocardiogram (ECG) signals; using a time-reversal discrimination task to guide the shared encoder in learning the temporal direction characteristics of the signals; improving the robustness of features to noise and morphological perturbations through weak enhancement contrastive learning; adding a maternal interference mask branch to the shared features to automatically suppress maternal ECG-dominant regions in a task-driven manner, resulting in purified fetal ECG features; fusing the original and purified features to simultaneously achieve fetal ECG waveform reconstruction and QRS probability estimation; and finally fusing the continuously predicted waveform with the QRS probability sequence to achieve high-precision QRS detection. Furthermore, a low signal-to-noise ratio adaptive mechanism is introduced during training, enabling the model to automatically enhance the guidance effect of auxiliary loss when the fetal signal is extremely weak.

[0010] The specific technical solution of this invention is as follows:

[0011] The fetal electrocardiogram display and QRS detection system based on time-domain inversion and maternal interference suppression includes the following modules:

[0012] Signal preprocessing module: used for preprocessing abdominal electrocardiogram signals and constructing sliding window samples;

[0013] Time-reversal self-supervised learning module: Based on time-reversal discrimination, a time-domain directional self-supervised learning task is constructed, and time-reversal samples are used to guide the shared encoder to learn the temporal directional features in abdominal electrocardiogram signals;

[0014] Weak-enhanced contrastive learning module: Enhances the temporal robust features of the shared encoder based on weak-enhanced contrastive learning;

[0015] Shared feature encoding module: Extracts time-domain inversion features from abdominal electrocardiogram signals using a shared encoder;

[0016] Maternal interference guidance module: Based on the maternal interference mask, the time-domain inversion features are purified to obtain fetal electrocardiogram display features;

[0017] Fetal ECG Reconstruction and QRS Assisted Detection Module: This module fuses time-domain inversion features with fetal ECG display features, and performs fetal ECG waveform reconstruction and QRS assisted detection separately, outputting fetal ECG predicted waveforms and fetal QRS probability sequences.

[0018] Joint training module: Joint training is performed based on multi-task loss and low signal-to-noise ratio adaptive weights;

[0019] Continuous reconstruction and fusion detection module: stitches the sliding window prediction results into a continuous fetal electrocardiogram sequence, and performs fusion detection based on the continuous fetal electrocardiogram prediction sequence and QRS probability sequence, outputting the fetal QRS detection location.

[0020] The following is a detailed explanation of each module.

[0021] Preferably, the signal preprocessing module performs the following specific processing:

[0022] Read multi-channel abdominal electrocardiogram signals and fetal electrocardiogram reference signals;

[0023] Bandpass filtering, resampling, and normalization were performed on the abdominal ECG signal and the fetal ECG reference signal.

[0024] According to the set window length and sliding window step size, the abdominal ECG signal and the fetal ECG reference signal are synchronously segmented by sliding window to obtain the abdominal ECG input sample and the fetal ECG monitoring sample.

[0025] Further optimized, the signal preprocessing module performs preprocessing and sliding window sample construction.

[0026] Multi-channel abdominal electrocardiogram (ECG) signals and corresponding fetal ECG reference signals are read. In a preferred embodiment, four abdominal channels are used (corresponding to the first to fourth abdominal leads in the original recording), and the fetal ECG reference signal is taken from the scalp electrode channel (index 0). Both types of signals are first bandpass filtered, with the passband set from 1 Hz to 100 Hz, using a third-order Butterworth filter to achieve zero-phase filtering. After filtering, the signal is resampled from the original sampling rate of 1000 Hz to a uniform sampling rate of 200 Hz, and then each channel of each record is normalized separately.

[0027]

[0028] Where x represents the original electrocardiogram signal sequence to be normalized or a single sampling point therein. The mean of the signal. The maximum absolute amplitude of the signal. Pick To prevent division by zero.

[0029] After completing the above processing, based on the window length (i.e., 10 seconds) and sliding step size (5 seconds) Simultaneously segment the abdominal ECG and fetal ECG reference signals to generate training samples and corresponding supervision labels. During the testing phase, a step size of 1000 is also used for sliding window prediction to ensure 50% overlap between adjacent windows, facilitating subsequent reconstruction of continuous signals.

[0030] The time-reversed self-supervised learning module processes the data as follows:

[0031] Perform a time reversal operation on the abdominal ECG input samples to construct forward and reverse samples;

[0032] The forward and reverse samples are input into the shared encoder to obtain the corresponding temporal features;

[0033] The temporal features are input into the time reversal discriminator to determine the temporal direction of the input sample;

[0034] By using a time-reversal discriminative loss-constrained shared encoder to learn the difference in the characteristic distribution of abdominal electrocardiogram signals under forward and reverse observations, the temporal directionality of the signal can be captured.

[0035] Further optimized, the time reversal self-supervised learning module is a time-domain directional self-supervised learning based on time reversal discrimination.

[0036] Before formally entering labeled training, a time-reversal self-supervised task is first constructed using unlabeled abdominal electrocardiogram signals, with the aim of enabling the shared encoder to learn to capture the temporal directional features of the signal.

[0037] Abdominal ECG input sample Perform a time reversal operation to obtain a reversed time series sample. The forward and reverse samples are fed into the shared encoder respectively. Feature extraction and (The main difference between these two features lies in the input temporal direction, while the encoder parameters are the same. The former refers to the feature obtained after inputting the original forward abdominal ECG sample X into the shared encoder, called the forward temporal feature, which preserves the temporal order of the original ECG signal. The latter refers to the feature obtained after first reversing the sample X in the time dimension to obtain X_rev, and then inputting it into the same shared encoder E(·), called the reverse temporal feature, which corresponds to the signal feature after the time order has been reversed.) The feature map output by the shared encoder is averaged and pooled in the time dimension to obtain a 64-dimensional global description vector, which is then input into a time-reversal discriminator. The discriminator consists of two fully connected network layers: the first layer maps the dimension from 64 to 64 and then performs ReLU activation; the second layer maps to 1 and outputs a logit value to determine whether the input feature comes from a positive or negative signal.

[0038] The discriminant loss uses binary cross-entropy, with positive samples labeled 1 and negative samples labeled 0.

[0039]

[0040] Through this task, the encoder is forced to learn the signal patterns most easily distinguishable before and after time reversal. Experimental observations show that after sufficient inverse discrimination training, the forward-reverse feature similarity of the maternal QRS region is usually higher than 0.85, while the similarity of the fetal QRS region is generally lower than 0.65. This difference provides a natural basis for subsequent maternal interference masking.

[0041] Preferably, the self-supervised pre-training in this stage uses the Adam optimizer with a learning rate of [missing information]. Weight decay The batch size was 16, and the training lasted for 20 epochs.

[0042] The preferred processing of the weakly enhanced contrastive learning module is as follows:

[0043] Two weak enhancements were performed on the same abdominal ECG input sample to obtain the first enhanced sample and the second enhanced sample.

[0044] The first and second augmented samples are input into the shared encoder and the projection head, respectively, to obtain the normalized projection vector.

[0045] Contrastive learning loss is used to constrain different augmented views of the same sample to be close to each other in the feature space, and to constrain the feature representations of different samples to be far apart.

[0046] The weak enhancements include one or more of Gaussian noise perturbation, amplitude scaling, low-frequency baseline drift, short-range time shift, and short-segment random occlusion.

[0047] Further optimized, the weakly enhanced contrastive learning module: temporal robust feature enhancement based on weakly enhanced contrastive learning.

[0048] During self-supervised pre-training, a contrastive learning task is introduced simultaneously to enhance the robustness of features to common perturbations. This is applied to the same abdominal ECG sample. Apply two random weak enhancements to obtain an enhanced view. and .

[0049] The specific operations of weak enhancement include five categories, with two to three combinations randomly selected each time: ① Gaussian noise perturbation, with a standard deviation of 0.01 times the signal standard deviation; ② Amplitude scaling, with a scaling factor uniformly sampled between 0.92 and 1.08; ③ Low-frequency baseline drift, superimposed with low-frequency random perturbation with a standard deviation of 0.03 times the signal standard deviation; ④ Short-distance time shift, with a random displacement not exceeding 8 sampling points (±40 milliseconds); ⑤ Short-segment random occlusion, with a 15% probability of zeroing out segments of the input, and each occlusion segment accounting for 3% of the total window length. These parameters have all been validated to ensure that reasonable variations are introduced without disrupting the local structure of the QRS group.

[0050] The enhanced views are input into the shared encoder, and then into the projection head. The normalized projection vector is obtained. The projection head structure is similar to the inverted discriminator head, consisting of two fully connected layers (64→64→64), outputting a 64-dimensional vector and performing L2 normalization. The input to the projection head also comes from the temporal mean pooling of the encoder features.

[0051] The contrastive learning loss is expressed in the form of InfoNCE, with a temperature coefficient. :

[0052]

[0053] in, This represents the anchor (anchor sample representation) of the current augmented view. This is a positive sample representation obtained by enhancing the same original ECG (electrocardiogram) segment in a different way. In the same mini-batch, except All other candidate representations, including both positive and negative samples.

[0054] The total loss during the self-supervised pre-training phase is Among them, the preferred ones , Time reversal discrimination is the primary task, providing the most direct directional learning signal; contrastive learning serves as an auxiliary method, enhancing feature consistency and robustness without requiring additional manual annotation. Preferably, the shared feature encoding module extracts abdominal ECG time-domain reversal features based on a shared encoder.

[0055] The shared encoder consists of three stacked one-dimensional convolutional layers, with the following structure:

[0056] First layer: kernel size 7, stride 1, padding=3, input channels 4, output channels 32, followed by batch normalization (BN) and ReLU;

[0057] Second layer: kernel size 5, stride 1, padding=2, input channels 32, output channels 64, BN+ReLU;

[0058] Third layer: kernel size 5, stride 1, padding=2, input channels 64, output channels 64, BN+ReLU.

[0059] The entire encoder does not use pooling layers, therefore the output feature map maintains the same temporal resolution as the input window. The input tensor shape is... Output features The shape of the tensor is This feature integrates multi-channel local temporal information and has been pre-trained through time reversal discrimination and contrastive learning, making it sensitive to temporal directional differences in signals.

[0060] Preferably, the processing of the parent interference guidance module is as follows:

[0061] The time-domain inversion feature is input into the parent interference mask branch to obtain the parent interference mask;

[0062] The time-domain inversion features are weighted by subtracting maternal interference masking to obtain fetal electrocardiogram display features.

[0063] A further preferred option is the maternal interference guidance module: fetal electrocardiogram feature purification and display based on maternal interference mask.

[0064] Shared encoder output features Above this, connect a lightweight parent interference mask branch. This branch consists of two one-dimensional convolutional layers without batch normalization: the first layer has a kernel size of 5, a stride of 1, 64 input channels, 32 output channels, and ReLU activation; the second layer has a kernel size of 3, padding=1, 32 input channels, and 1 output channel, directly outputting logits. The logits are mapped to a parent interference mask using the Sigmoid function. .

[0065] The learning of the mask is entirely driven by the loss from subsequent tasks. In the early stages of training, the mask values ​​are random; as the model gradually converges, the network discovers that "increasing the mask value at a certain time step and suppressing the features of the corresponding region can reduce the final fetal ECG reconstruction error," thus spontaneously forming a strategy of generating high mask values ​​during periods when the maternal QRS is dominant and low mask values ​​during periods when the fetal QRS appears independently.

[0066] After obtaining the mask, the purified fetal electrocardiogram features were obtained using a reverse weighting method:

[0067]

[0068] in, The original temporal feature map extracted by the encoder. For the soft-temporal mask of the mask branch prediction, This represents element-wise multiplication. Broadcast along the channel dimension. In the process, areas severely affected by maternal interference are attenuated, while fetal electrocardiogram and noise background areas are preserved or relatively enhanced.

[0069] Preferably, the processing of the fetal electrocardiogram remodeling and QRS-assisted detection module is as follows:

[0070] The time-domain inversion feature and the fetal electrocardiogram display feature are spliced ​​together to obtain the fused feature;

[0071] The fusion features are input into the fetal ECG waveform reconstruction branch and the QRS auxiliary detection branch respectively to obtain the fetal ECG prediction waveform and the QRS probability sequence.

[0072] Further preferred, the fetal electrocardiogram reconstruction and QRS-assisted detection module: fetal electrocardiogram waveform reconstruction and QRS-assisted detection based on the fusion of original features and manifest features.

[0073] Original features Manifestation characteristics after maternal inhibition By concatenating along the channel dimension, the fused features are obtained:

[0074]

[0075] in, This indicates the length of the feature map in the time dimension.

[0076] This feature preserves both the original mixed signal information and the purified fetal electrocardiogram information. Subsequently, The data is fed into two downstream branches that are structurally similar but have independent parameters.

[0077] Fetal ECG waveform reconstruction branch ( The system consists of three convolutional layers: the first layer has 128 input channels, 64 output channels, a 5-kernel convolution, and BN+ReLU; the second layer has 64 input channels, 32 output channels, a 5-kernel convolution, and BN+ReLU; the third layer has 32 input channels, 1 output channel, a 3-kernel convolution, linear activation, and outputs the predicted fetal electrocardiogram waveform. .

[0078] QRS-assisted detection branch ( The structure is slightly different: the first layer has an input of 128 and an output of 64, with a convolution kernel of 5 and BN+ReLU; the second layer has an input of 64 and an output of 32, with a convolution kernel of 3 and BN+ReLU; the third layer has an input of 32 and an output of 1, with a convolution kernel of 1, and outputs QRS logits. After passing through the Sigmoid function, the QRS probability sequence is obtained. .

[0079] The two branches share the same fusion feature but have independent parameters. Preliminary experiments show that if intermediate layer parameters are further shared, the waveform reconstruction task tends to preserve continuous smooth information, while the QRS detection task emphasizes the discontinuity of local peaks, resulting in a conflict between the two in terms of deep features. After decoupling the branches, each can learn a feature utilization method more suitable for its own objective, leading to better overall performance.

[0080] Preferably, the joint training module processes the data as follows:

[0081] We constructed the fetal electrocardiogram waveform reconstruction loss, differential morphology loss, peak weighting loss, QRS-assisted detection loss, and maternal interference masking regularization loss.

[0082] The signal-to-noise ratio weakness of the current sample is assessed based on the ratio of the root mean square amplitude of the abdominal ECG input signal to the fetal ECG reference signal.

[0083] When the amplitude ratio of the fetal ECG reference signal to the abdominal ECG input signal is lower than the set reference ratio, the weights of time reversal auxiliary loss, contrast learning auxiliary loss, and enhanced consistency loss in the total loss are increased.

[0084] Joint training is performed based on losses.

[0085] Further preferred, the joint training module: joint training based on multi-task loss and low signal-to-noise ratio adaptive weights.

[0086] The total loss during the labeled training phase consists of the main supervisory loss and multiple auxiliary losses.

[0087] The main supervisor's losses consist of three parts:

[0088] (1) Waveform reconstruction loss: Composed of basic L1 loss, differential shape loss, and peak-weighted L1 loss. The differential loss constrains the consistency between the predicted waveform and the true waveform at the differences between adjacent sampling points to maintain the sharpness of the QRS wave. The peak-weighted loss utilizes QRS location labels. The reconstruction error in the QRS region is amplified, and the peak enhancement factor is increased. That is, the error contribution within the QRS interval is 4 times that of other regions.

[0089] The final waveform loss is ,in, This represents the mean absolute error loss between the predicted fetal ECG waveform and the reference fetal ECG waveform. , .

[0090] (2) QRS detection loss: A binary cross-entropy with positive class weights is used. Considering that QRS events are extremely sparse on the time axis (the positive class usually accounts for less than 2%), a weight of 20.0 is assigned to the positive class to alleviate class imbalance. The loss is denoted as... .

[0091] (3) Parent Interference Mask Regularization Loss: Composed of two terms—total temporal variation loss to ensure smooth temporal changes in the mask and avoid abrupt changes at single sampling points; and mean penalty term to limit the average activation value of the mask, preventing large-area activation and loss of suppression capability. The weight combination of the two terms is as follows: . Indicates mask Total variation over time, This represents the average activation value of the mask across all time locations.

[0092] The main supervisor's loss is:

[0093]

[0094] in, , .

[0095] Auxiliary loss and low signal-to-noise ratio adaptive mechanism:

[0096] Time reversal is used to determine loss during joint training. and contrastive learning loss Continue to participate in optimization to prevent the encoder from forgetting the directional features learned in the self-supervised phase during supervised training. Furthermore, an enhanced consistency loss is introduced. Two weak enhancements are applied to the same abdominal ECG sample, and the QRS probability output of the two enhanced samples is required to be consistent with the QRS probability output of the original sample. The loss form is L1 distance.

[0097] To further enhance the model's ability to process weak fetal ECGs, this invention uses the root mean square amplitude ratio of fetal ECGs to abdominal ECGs in each batch of samples. To estimate the signal-to-noise ratio. When When the signal strength is low, it is judged as a low signal-to-noise ratio scene, and a signal weakness sensing coefficient is used. The weight of the aforementioned auxiliary loss is amplified. This coefficient is calculated as follows:

[0098]

[0099] Among them, reference ratio Maximum enhancement factor .when hour ;when Approaching 0 It approaches 1.8. This mechanism enables the model to automatically increase its reliance on directional learning, contrastive learning, and consistency learning when the fetal electrocardiogram is weak, thereby preventing performance degradation caused by weak gradient signals.

[0100] The final contribution of the auxiliary loss is:

[0101]

[0102] in, , , .

[0103] In addition, to improve the overall consistency of the waveform shape, the predicted waveform and the reference waveform are subjected to mean pooling with a window size of 25, and the L1 loss is calculated to obtain the shape constraint loss. Weight Taking all the above factors into account, the final joint training loss is:

[0104]

[0105] Training was performed using the Adam optimizer with an initial learning rate of [missing information]. Weight decay The batch size was 8, and the training lasted for 80 epochs. The first 10 epochs used only the main loss for warm-up, and then the contrastive learning loss was gradually introduced; the inversion loss and consistency loss were used in the training from the first epoch.

[0106] Preferably, the processing of the continuous reconstruction and fusion detection module is as follows:

[0107] The abdominal electrocardiogram record to be tested is used for sliding window prediction according to the set window length and sliding window step size;

[0108] Based on the starting position of each window in the original record, the fetal ECG prediction waveforms and QRS probability sequences of multiple windows are spliced ​​together to obtain continuous fetal ECG prediction sequences and continuous QRS probability sequences.

[0109] Bandpass filtering, differential processing, sum of squares and moving integral processing are performed on continuous fetal electrocardiogram prediction sequences to obtain waveform-based QRS candidate peaks;

[0110] The continuous QRS probability sequence is smoothed and normalized, and then weighted and fused with the energy envelope of the continuous fetal electrocardiogram prediction sequence to obtain the fusion detection score;

[0111] Based on the fusion detection score, peak search, candidate peak merging, local peak refinement, and RR interval constraint are performed to obtain the final fetal QRS detection location.

[0112] Further preferred, the continuous reconstruction and fusion detection module: fetal QRS detection based on continuous fetal electrocardiogram reconstruction and QRS probability sequence fusion.

[0113] After model training, sliding window prediction is performed on the test records with a window length of 2000 and a step size of 1000. Each window outputs the predicted fetal ECG waveform, QRS probability sequence, and maternal interference mask. Based on the starting position of each window in the original record, the prediction results are concatenated into a continuous signal in chronological order. During concatenation, for overlapping portions of adjacent windows, the non-overlapping segments of the previous window are retained, and new non-overlapping segments are extracted from the subsequent window, thus obtaining a complete continuous prediction sequence. and continuous QRS probability sequences .

[0114] Next, for Bandpass filtering (8 Hz to 35 Hz) was performed, and the absolute value was then averaged using a 40 ms moving average window to obtain the waveform energy envelope, which was then normalized to [0,1]. The results were also smoothed and normalized using a 40-millisecond window width. A weighted fusion was then performed to obtain the fused detection score:

[0115]

[0116] in, This represents the energy envelope score obtained from the reconstructed fetal ECG waveform. This represents the score obtained from the QRS probability map output by the auxiliary QRS branch.

[0117] That is, the QRS probability sequence is given a slightly higher weight (0.55) in the fusion to make full use of the peak position information directly output by the model.

[0118] Peaks are initially screened on the fused scores, with the threshold set to the greater of 1.5 times the standard deviation of the score mean and 0.6 times the 75th percentile of the score. The minimum peak interval is set to 280 milliseconds (corresponding to an upper limit heart rate of approximately 214 bpm). Simultaneously, an improved Pan-Tompkins detector (120 millisecond integration window, 220 millisecond refractory period, adaptive threshold percentile of 75, threshold scaling of 0.18) is run on the predicted waveform to obtain candidate peaks based on the waveform. The two sets of candidate peaks are merged and returned to the predicted waveform for local extremum refinement with a radius of ±8 sampling points. Finally, a minimum RR interval of 280 milliseconds is set according to the typical range of fetal heart rate, and falsely detected peaks that are too close together are eliminated to obtain the final fetal QRS detection location sequence. This invention also provides an electronic device including a processor and a memory; the memory stores a program, which, when executed by the processor, causes the electronic device to perform the above system.

[0119] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0120] This invention enables the shared encoder to explicitly learn the temporal directionality of the signal through time reversal discrimination, utilizing the natural differences in the forward and reverse feature distributions of maternal and fetal QRS to provide a basis for subsequent separation; it employs a maternal interference mask to perform task-driven adaptive suppression of maternal interference at the feature level; it combines waveform reconstruction and QRS detection through multi-task joint learning, taking into account both the overall morphology and key peaks; it uses low signal-to-noise ratio adaptive weights to ensure the model maintains stable display and detection capabilities even under weak signal conditions; and it significantly reduces false detection and false negative rates through the fusion detection of waveform energy and QRS probability. Attached Figure Description

[0121] Figure 1 The flowchart below shows a preferred embodiment of the present invention of a fetal electrocardiogram display and QRS detection system based on time-domain inversion and maternal interference suppression.

[0122] Figure 2 The flowchart illustrates the abdominal electrocardiogram signal preprocessing and sliding window sample construction in a preferred embodiment of the present invention.

[0123] Figure 3 The flowchart illustrates a preferred embodiment of the self-supervised learning process based on time reversal discrimination and weakly enhanced contrastive learning.

[0124] Figure 4 This is a structural diagram of fetal electrocardiogram feature purification and visualization guided by maternal interference masking, according to a preferred embodiment of the present invention.

[0125] Figure 5 The flowchart of QRS detection based on the fusion of fetal electrocardiogram waveform and QRS probability sequence is a preferred embodiment of the present invention.

[0126] Figure 6 This is a block diagram of a fetal electrocardiogram display and QRS detection system based on time-domain inversion and maternal interference suppression, which is a preferred embodiment of the present invention. Detailed Implementation

[0127] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. The network structure, hyperparameters, and training strategies in this embodiment are preferred solutions adopted in actual implementation.

[0128] like Figure 1 , 6 As shown in the figure, this embodiment of a fetal electrocardiogram display and QRS detection system based on time domain reversal and maternal interference suppression includes the following modules: signal preprocessing module: used for preprocessing abdominal electrocardiogram signals and constructing sliding window samples;

[0129] Time Reversal Self-Supervised Learning Module: Temporal Directional Self-Supervised Learning Based on Time Reversal Detection;

[0130] Weak Enhancement Contrast Learning Module: Temporal Robust Feature Enhancement Based on Weak Enhancement Contrast Learning;

[0131] Shared feature encoding module: Abdominal ECG time-domain inversion feature extraction based on a lightweight shared feature encoder (“shared” means that the output of the encoder is used simultaneously by the maternal interference masking branch, the fetal ECG reconstruction branch, and the QRS auxiliary branch);

[0132] Maternal interference guidance module: fetal electrocardiogram feature purification and display based on maternal interference mask;

[0133] Fetal ECG Reconstruction and QRS-Assisted Detection Module: Fetal ECG waveform reconstruction and QRS-assisted detection based on the fusion of original and manifest features;

[0134] Joint training module: joint training based on multi-task loss and low signal-to-noise ratio adaptive weights;

[0135] Continuous reconstruction and fusion detection module: Fetal QRS detection based on continuous fetal electrocardiogram reconstruction and QRS probability sequence fusion.

[0136] In the signal preprocessing module, abdominal ECG recordings in EDF format are read, and the input signal is constructed from abdominal leads 1 to 4. The fetal scalp electrode channel with index 0 is selected as the supervision label. Both the abdominal ECG signal and the fetal ECG reference signal are uniformly bandpass filtered from 1 to 100 Hz using a third-order Butterworth filter. The filter employs a zero-phase design to avoid phase distortion. After filtering, the signal is resampled from the original sampling rate of 1000 Hz to 200 Hz. During normalization, each channel of each recording is processed independently as follows: first, the mean of that channel is subtracted, then divided by the maximum absolute amplitude of that channel. A very small constant is added to prevent division by zero. Then, based on the window length sampling points, sliding step size Each sampling point synchronously segments the two signals, thereby constructing input-label sample pairs for training and testing. The 50% overlap between adjacent windows facilitates the reconstruction of subsequent continuous signals.

[0137] The self-supervised pre-training of the time-reversal self-supervised learning module and the weak-enhancement contrastive learning module was conducted for a total of 20 rounds. In each training round, for each unlabeled abdominal ECG sample, its reversed version was first generated through a time-reversal operation. The forward and reversed samples were then fed into a shared encoder, and after feature extraction, mean pooling was performed along the time axis. The reverse discriminant head output the binary classification result and calculated the binary cross-entropy loss—the label of the forward sample was 1, and the label of the reverse sample was 0. Simultaneously, the same sample was subjected to two augmented views generated by randomly selecting two to three combinations from five augmentation strategies. The normalized projection vectors were obtained by the shared encoder and the projection head, respectively, and the InfoNCE contrastive loss was calculated, with a temperature coefficient set to 0.2. The weights of the two losses were 1.0 and 0.5, respectively, and the Adam optimizer was used with a learning rate of 0.5. Weight decay The batch size is 16.

[0138] In the shared feature encoding module, the preprocessed abdominal ECG sliding window samples are input into the shared encoder. The shared encoder consists of three stacked one-dimensional convolutional layers: the first layer uses a kernel of size 7 to map the 4-channel input to 32 channels, with a stride of 1 and padding of 3 to maintain the time length, followed by batch normalization and ReLU activation; the second layer uses a kernel of size 5, a stride of 1, and padding of 2, expanding the 32 channels to 64 channels, also followed by batch normalization and ReLU; the third layer still uses a kernel of size 5, a stride of 1, and padding of 2, maintaining the 64-channel output, followed by batch normalization and ReLU activation. The entire encoder does not perform any downsampling and outputs features. The dimension is 64× That is, a time series with 64 feature channels and the same length as the input window.

[0139] The parent interference guidance module shares features The parent interference mask branch is deployed above this. This branch consists of two one-dimensional convolutional layers, neither of which uses batch normalization: the first convolutional layer has a kernel size of 5 and a stride of 1, mapping 64 channels to 32 channels, followed by ReLU activation; the second convolutional layer has a kernel size of 3, a stride of 1, and padding of 1, outputting single-channel mask logits. The logits are then mapped using the Sigmoid function to obtain the parent interference mask. The value ranges from 0 to 1. Then, the purified fetal electrocardiogram characteristics are obtained through reverse masking weighting: .

[0140] The fetal electrocardiogram reconstruction and QRS-assisted detection module will share the original output characteristics of the encoder. Manifestation characteristics after suppression of maternal interference By stitching along the channel dimension, a 128-channel fusion feature is formed. The fused feature is then fed into two structurally similar but parameter-independent branches. The waveform reconstruction branch consists of three convolutional layers: the first layer compresses 128 channels to 64 channels with a kernel size of 5, followed by batch normalization and ReLU; the second layer further compresses to 32 channels with a kernel size of 5, followed by batch normalization and ReLU; the third layer outputs a single-channel predicted waveform. The convolutional kernel has a size of 3, and linear activation is used. The QRS auxiliary detection branch also has three layers: the first layer maps from 128 channels to 64 channels, with a convolutional kernel of size 5, batch normalization + ReLU; the second layer reduces from 64 channels to 32 channels, with a convolutional kernel of size 3, batch normalization + ReLU; the third layer outputs single-channel logits, with a convolutional kernel size of size 1, which, after passing through the Sigmoid function, yields the QRS probability sequence. .

[0141] The joint training module uses the Adam optimizer with an initial learning rate of [missing information]. Weight decay The batch size is 8, and the training run is 80 epochs. The weights for each loss term are as follows: Differential morphology loss weight 0.5, Peak weighted loss weight 0.5 (with a peak enhancement coefficient of 3.0), QRS-assisted detection loss weight 0.8 (using binary cross-entropy with positive class weights, where the positive class weight is set to 20.0), Parent interference mask regularization loss weight 0.05 (with a mean penalty term coefficient of 0.03), Morphological constraint loss weight 0.05, Time reversal-assisted loss weight 0.12, Contrast learning-assisted loss weight 0.08, and Consistency enhancement loss weight 0.05. In the low SNR adaptive coefficients, the reference ratio... The maximum enhancement factor was set to 1.8, and the amplification of the auxiliary loss was dynamically adjusted based on the root mean square amplitude ratio of fetal ECG and abdominal ECG in each batch of samples.

[0142] During the testing phase, the continuous reconstruction and fusion detection module performs sliding window prediction with a step size of 1000. The predicted waveforms, QRS probability sequences, and maternal interference masks output from each window are spliced ​​together into a continuous sequence based on their starting positions. The continuous predicted waveforms are bandpass filtered from 8 to 35 Hz to highlight the fetal QRS frequency band. The absolute value is then used for a moving average with a 40-millisecond window width to obtain the normalized waveform energy envelope. The continuous QRS probability sequence was also smoothed and normalized using a 40-millisecond window, resulting in... The two results are then fused with weights of 0.45 and 0.55 respectively to generate a fused detection score. For the fusion score, the larger of the mean plus 0.3 times the standard deviation and 0.6 times the 75th percentile was used as the threshold, with a minimum peak interval of 280 milliseconds for initial peak screening. Simultaneously, a waveform candidate peak detection strategy based on the Pan-Tompkins approach was employed, with parameters set to an integration window of 120 milliseconds, a refractory period of 220 milliseconds, and an adaptive threshold percentile of 75, to obtain waveform-based candidate peaks. After merging the two sets of candidate peaks, the system returned to the predicted waveform and searched for local extrema with a radius of ±8 sampling points for fine-tuning and alignment. Finally, a minimum RR interval of 280 milliseconds was applied to eliminate falsely detected peaks that were too close together, outputting the final fetal QRS detection position sequence.

[0143] Figure 2 A flowchart illustrating the preprocessing and sliding window sample construction process is provided. Figure 3 This demonstrates the data flow during the time-reversal discrimination and contrastive learning phases of the self-supervised learning process. Figure 4 This describes the process by which the parent interference mask branch generates a mask from shared features and obtains cleaned features. Figure 5 The paper describes the weighted combination of waveform energy envelope and QRS probability sequence in QRS fusion detection and the subsequent peak search process.

[0144] To verify the technical effectiveness of this invention, an experiment was conducted using the leave-one-out method on an abdominal electrocardiogram database containing 5 records. Evaluation metrics included: precision, recall, and F1 score of QRS detection, as well as mean squared error (MSE) and mean absolute error (MAE) of waveform reconstruction. The experimental results are shown in Table 1.

[0145]

[0146] Table 1. Leave-one-out validation results of this invention on an abdominal electrocardiogram dataset.

[0147] As shown in Table 1, accuracy and recall remained at high levels for most records. The F1 score for record r10 was relatively low; post-analysis revealed that the mother in this record had a high body mass index, resulting in significant signal attenuation due to abdominal fat, and frequent fetal movements during the recording period, causing multiple significant changes in the fetal QRS morphology. The slightly lower recall for record r08 was due to several instances where the maternal and fetal QRSs completely overlapped, almost completely obscuring the fetal waveform, leaving ambiguous areas even with manual labeling. These results indirectly demonstrate that the invention performs stably in conventional scenarios and maintains a certain level of detection capability even in extremely challenging conditions.

[0148] The results obtained through experiments using the leave-one-out method on five records (listed in Table 1) show that this invention exhibits stable and excellent performance in terms of both QRS detection accuracy and waveform reconstruction quality. The system integrates modules for signal preprocessing, self-supervised learning, feature encoding, mask generation, waveform reconstruction, QRS detection, joint training, continuous reconstruction, and fusion detection, enabling them to operate collaboratively and demonstrating good engineering feasibility.

[0149] A preferred embodiment of the present invention also discloses an electronic device, which includes a processor and a memory; the memory stores a program, and when the program is executed by the processor, the electronic device performs the above-described system.

[0150] In summary, this invention discloses a fetal electrocardiogram (ECG) display and QRS detection system and electronic device based on time-domain reversal and maternal interference suppression, belonging to the fields of biomedical signal processing and deep learning technology. This invention guides a shared encoder to learn the temporal directionality features of abdominal ECG signals through a time-reversal discrimination task, utilizing the difference in forward-reverse feature distributions between maternal and fetal QRS signals to provide a basis for subsequent separation; it introduces weak-enhancement contrastive learning to improve the robustness of features to noise and morphological perturbations; it sets a maternal interference mask branch on the shared features to adaptively suppress the maternal ECG-dominant region in a task-driven manner, obtaining purified fetal ECG features; after fusing the original and purified features, it simultaneously outputs the predicted fetal ECG waveform and QRS probability sequence through a waveform reconstruction branch and a QRS-assisted detection branch; during training, it uses low signal-to-noise ratio adaptive weights to enhance the contribution of weak signals; in the detection stage, it fuses the continuous predicted waveform energy with the QRS probability sequence, and obtains the final fetal QRS position through peak search and RR interval constraints. This invention can effectively display fetal electrocardiograms and accurately detect QRS complexes under conditions of strong maternal interference and low signal-to-noise ratio, and can be used for perinatal fetal health monitoring.

[0151] The above description is merely a preferred embodiment of the present invention and does not constitute a limitation on the scope of protection of the present invention. Any equivalent modifications or substitutions made based on the technical concept of the present invention should be included within the scope of protection of the present invention.

Claims

1. A fetal electrocardiogram display and QRS detection system based on time-domain inversion and maternal interference suppression, characterized in that, Includes the following modules: Signal preprocessing module: used for preprocessing abdominal electrocardiogram signals and constructing sliding window samples; Time-reversal self-supervised learning module: Based on time-reversal discrimination, a time-domain directional self-supervised learning task is constructed, and time-reversal samples are used to guide the shared encoder to learn the temporal directional features in abdominal electrocardiogram signals; Weak-enhanced contrastive learning module: Enhances the temporal robust features of the shared encoder based on weak-enhanced contrastive learning; Shared feature encoding module: Extracts time-domain inversion features from abdominal electrocardiogram signals using a shared encoder; Maternal interference guidance module: Based on the maternal interference mask, the time-domain inversion features are purified to obtain fetal electrocardiogram display features; Fetal ECG Reconstruction and QRS Assisted Detection Module: This module fuses time-domain inversion features with fetal ECG display features, and performs fetal ECG waveform reconstruction and QRS assisted detection separately, outputting fetal ECG predicted waveforms and fetal QRS probability sequences. Joint training module: Joint training is performed based on multi-task loss and low signal-to-noise ratio adaptive weights; Continuous reconstruction and fusion detection module: stitches the sliding window prediction results into a continuous fetal electrocardiogram sequence, and performs fusion detection based on the continuous fetal electrocardiogram prediction sequence and QRS probability sequence, outputting the fetal QRS detection location.

2. The system according to claim 1, characterized in that, The signal preprocessing module performs the following steps: Read multi-channel abdominal electrocardiogram signals and fetal electrocardiogram reference signals; Bandpass filtering, resampling, and normalization were performed on the abdominal ECG signal and the fetal ECG reference signal. According to the set window length and sliding window step size, the abdominal ECG signal and the fetal ECG reference signal are synchronously segmented by sliding window to obtain the abdominal ECG input sample and the fetal ECG monitoring sample.

3. The system according to claim 1, characterized in that, The time-reversed self-supervised learning module processes the data as follows: Perform a time reversal operation on the abdominal ECG input samples to construct forward and reverse samples; The forward and reverse samples are input into the shared encoder to obtain the corresponding temporal features; The temporal features are input into the time reversal discriminator to determine the temporal direction of the input sample; By using a time-reversal discriminative loss-constrained shared encoder to learn the difference in the characteristic distribution of abdominal electrocardiogram signals under forward and reverse observations, the temporal directionality of the signal can be captured.

4. The system according to any one of claims 1-3, characterized in that, The processing of the weak enhancement contrastive learning module is as follows: Two weak enhancements were performed on the same abdominal ECG input sample to obtain the first enhanced sample and the second enhanced sample. The first and second augmented samples are input into the shared encoder and the projection head, respectively, to obtain the normalized projection vector. Contrastive learning loss is used to constrain different augmented views of the same sample to be close to each other in the feature space, and to constrain the feature representations of different samples to be far apart.

5. The system according to claim 4, characterized in that, The weak enhancements include one or more of Gaussian noise perturbation, amplitude scaling, low-frequency baseline drift, short-range time shift, and short-segment random occlusion.

6. The system according to claim 5, characterized in that, The specific processing of the mother interference guidance module is as follows: The time-domain inversion feature is input into the parent interference mask branch to obtain the parent interference mask; The time-domain inversion features are weighted by subtracting maternal interference masking to obtain fetal electrocardiogram display features.

7. The system according to claim 6, characterized in that, The specific processing of the fetal electrocardiogram remodeling and QRS-assisted detection module is as follows: The time-domain inversion feature and the fetal electrocardiogram display feature are spliced ​​together to obtain the fused feature; The fusion features are input into the fetal ECG waveform reconstruction branch and the QRS auxiliary detection branch respectively to obtain the fetal ECG prediction waveform and the QRS probability sequence.

8. The system according to claim 7, characterized in that, The joint training module is processed as follows: We constructed the fetal electrocardiogram waveform reconstruction loss, differential morphology loss, peak weighting loss, QRS-assisted detection loss, and maternal interference masking regularization loss. The signal-to-noise ratio weakness of the current sample is assessed based on the ratio of the root mean square amplitude of the abdominal ECG input signal to the fetal ECG reference signal. When the amplitude ratio of the fetal ECG reference signal to the abdominal ECG input signal is lower than the set reference ratio, the weights of time reversal auxiliary loss, contrast learning auxiliary loss, and enhanced consistency loss in the total loss are increased. Joint training is performed based on losses.

9. The system according to claim 8, characterized in that, The specific processing steps of the continuous reconstruction and fusion detection module are as follows: The abdominal electrocardiogram record to be tested is used for sliding window prediction according to the set window length and sliding window step size; Based on the starting position of each window in the original record, the fetal ECG prediction waveforms and QRS probability sequences of multiple windows are spliced ​​together to obtain continuous fetal ECG prediction sequences and continuous QRS probability sequences. Bandpass filtering, differential processing, sum of squares and moving integral processing are performed on continuous fetal electrocardiogram prediction sequences to obtain waveform-based QRS candidate peaks; The continuous QRS probability sequence is smoothed and normalized, and then weighted and fused with the energy envelope of the continuous fetal electrocardiogram prediction sequence to obtain the fusion detection score; Based on the fusion detection score, peak search, candidate peak merging, local peak refinement, and RR interval constraint are performed to obtain the final fetal QRS detection location.

10. An electronic device, characterized in that, It includes a processor and a memory; the memory stores a program that, when executed by the processor, causes the electronic device to perform the system according to any one of claims 1-9.