An electrocardiogram synthesis method and system based on adaptive dual encoder and wavelet fusion
By using an adaptive dual encoder and wavelet fusion method, the individual differences and physiological delays in the conversion of BCG signals to ECG signals are resolved, achieving high-fidelity ECG signal reconstruction, which is suitable for real-time diagnostic monitoring in edge health monitoring platforms.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN TECH UNIV
- Filing Date
- 2026-02-05
- Publication Date
- 2026-05-26
AI Technical Summary
Existing technologies struggle to achieve high-fidelity ECG signal reconstruction under individual differences and physiological delays, especially in the mapping of BCG signals to ECG signals, where there are issues with signal morphology adaptation, temporal phase alignment, and high-frequency detail reconstruction.
An adaptive dual encoder and wavelet fusion method is adopted, and high-fidelity reconstruction of BCG signal to ECG signal is achieved through cross-correlation alignment, adaptive orthogonal wavelet decomposition, gated cross-attention fusion and bidirectional temporal convolutional network.
It significantly improves the quantization accuracy and phase synchronization of ECG signal reconstruction, ensuring the fidelity of the morphological characteristics of P waves, QRS complexes and T waves, and is suitable for real-time diagnostic monitoring in edge health monitoring platforms.
Smart Images

Figure CN122075007A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and biomedical signal processing, and in particular to an electrocardiogram synthesis method and system based on adaptive dual encoder and wavelet fusion. Background Technology
[0002] Electrocardiography (ECG) is the "gold standard" for clinically assessing heart health and screening for diseases such as arrhythmias. However, traditional acquisition methods require attaching electrodes to the skin, which can easily cause skin allergies and discomfort with long-term monitoring. Furthermore, the limitations of lead wires make it difficult for users to achieve continuous, non-contact monitoring at home. In contrast, cardiac impulse signal (BCG) reflects heart activity by capturing the mechanical vibrations caused by the heartbeat. It can be integrated into mattresses, chairs, and other carriers, offering the inherent advantages of non-contact and non-contact monitoring. However, due to the lack of a unified clinical interpretation standard for BCG signals, synthesizing high-fidelity diagnostic-grade ECG signals from readily available BCG signals has become an urgent need in the field of biomedical signal processing.
[0003] Currently, researchers are attempting to establish a mapping from BCG to ECG using convolutional neural networks or recurrent neural networks. Although this can reconstruct the QRS complex wave, the following bottlenecks still urgently need to be addressed in practical applications:
[0004] First, the signal morphology is significantly affected by individual physiological differences, making it difficult for fixed algorithms to adapt. BCG signals are mechanical waves transmitted through human tissue and mattresses, and are influenced by the weight, body shape, and viscoelastic damping effect of the human-sensor system of different users, resulting in highly nonlinear and individual-specific waveform characteristics. Existing processing methods often use fixed wavelet bases such as Haar or Daubechies for decomposition. Because the form of these basis functions is fixed, they cannot adaptively simulate complex physical transfer functions, leading to inherent biases in separating cardiac impact components from respiratory and body movement interferences.
[0005] Secondly, the alignment mechanism between time-domain phase and frequency-domain energy is imperfect. BCG, as a mechanical signal, naturally exhibits a phase shift on the time axis compared to the electrophysiological signal ECG. Mainstream deep learning models, when fusing time-domain and frequency-domain features, often employ feature concatenation or simple addition, lacking an effective gating mechanism. This "equal weighting" approach easily leads to frequency-domain noise interfering with the time-series phase information, manifesting in the synthesized waveform as inaccurate R-peak localization, QRS group blunting, and poor phase consistency.
[0006] Finally, the reconstruction quality of weak high-frequency signals is difficult to achieve clinical diagnostic standards. Although the P and T waves in ECG signals are weak in amplitude, they contain crucial pathological information. Current technologies often rely on transposed convolution or interpolation operations for upsampling during the decoding stage. While these operations improve resolution, they often produce a "smoothing effect," causing high-frequency details to be filtered out. This results in blurred or even absent synthesized P and T waves, severely weakening the clinical reference value of the synthesized signal. Even with the introduction of skip connections, without targeted modeling of the span of typical ECG waveform components, high-fidelity morphological reconstruction remains difficult to achieve.
[0007] Therefore, how to construct a synthesis architecture that can both adaptively fit individualized spectral characteristics and explicitly recover high-frequency details of waveforms while ensuring precise time and phase synchronization is a key challenge currently faced by those skilled in the art. Summary of the Invention
[0008] To achieve the above-mentioned objectives, this invention proposes an electrocardiogram synthesis method based on adaptive dual encoder and wavelet fusion, comprising the following steps: S1. Acquire the raw cardiac impact signal and perform preprocessing, the preprocessing including calibrating the time offset between the raw cardiac impact signal and the reference electrocardiogram through a cross-correlation alignment algorithm to achieve phase alignment; S2. The original cardiac impact signal is processed by an adaptive orthogonal wavelet decomposition module. The signal is decomposed using end-to-end learnable low-pass and high-pass filters to obtain multi-scale wavelet coefficients. S3. Construct a dual encoder structure, including a time-domain encoder and a wavelet-domain encoder; input the original cardiac impact signal into the time-domain encoder to extract multi-scale time-domain features, and input the multi-scale wavelet coefficients into the wavelet-domain encoder to extract multi-scale wavelet-domain features; S4. At the corresponding scales of the time-domain encoder and the wavelet-domain encoder, the time-domain features and wavelet-domain features are dynamically fused through a gated cross-attention fusion module to generate multi-scale fused features. S5. Input the features of the deepest layer of the encoder into a bidirectional temporal convolutional network bottleneck module, and capture long-range temporal dependencies through forward and backward temporal convolution processing to obtain bottleneck features; S6. The bottleneck features are input to a wavelet information decoder. The decoder receives the multi-scale fusion features through a skip connection and uses multi-scale wavelet heuristic decomposition to guide the upsampling process to reconstruct the target electrocardiogram signal.
[0009] Preferably, in step S2, the learnable low-pass filter and high-pass filter It is obtained by introducing trainable perturbation parameters to continuously deform the initial basis filter. The specific construction formula is as follows:
[0010]
[0011] in, and For initialization of orthogonal wavelet basis filters; and These are learnable perturbation parameters; This is the scaling factor.
[0012] Preferably, the method introduces an orthogonality loss during training. To constrain the learnable filter to maintain near orthogonality, prevent mode collapse, and ensure non-overlapping frequency domain information, the calculation formula is as follows:
[0013]
[0014] in, and These represent the first and second passes of the low-pass and high-pass filters, respectively. One coefficient, For filter length, These are the weighting coefficients for the orthogonality loss.
[0015] Preferably, in step S4, the gated cross-attention fusion module uses time-domain features as the query vector. Using wavelet domain features as key vectors Sum value vector Interacting with the system and employing an adaptive gating mechanism to control the injection intensity of frequency details: fused features The calculation formula is:
[0016]
[0017] in, For time domain features, For attention output, This is the residual scaling factor. For adaptive gating weights, This is an element-wise multiplication of the Hadamard product, used to dynamically adjust detail injection based on different frequency band components of the signal.
[0018] Preferably, in step S5, the bidirectional temporal convolutional network bottleneck module comprises stacked residual TCN blocks with exponentially increasing dilation rates. Precise phase synchronization is achieved by concatenating the outputs of the forward and reverse processing streams, thus addressing the bottleneck feature. The calculation formula is:
[0019]
[0020] in, For input features, This indicates a flip operation along the time dimension. and These represent the forward and backward temporal convolutional networks, respectively.
[0021] Preferably, in step S6, the wavelet heuristic decomposition uses parallel multi-scale convolution kernels, with the kernels being parallel convolution kernels of different sizes, respectively simulating the typical morphological spans corresponding to the P wave, QRS complex, and T wave in the electrocardiogram.
[0022] Preferably, the wavelet information decoder utilizes a frequency-aware attention mechanism to upsample the features. Multiscale decomposition components of jump connection features Weighted fusion is performed to highlight the frequency band components that are most discriminative for the reconstruction task.
[0023] Preferably, the model training uses a hybrid loss function, including a Smooth L1 loss between the predicted ECG and the actual ECG, and a Smooth L1 loss between the predicted wavelet coefficients and the target wavelet coefficients, in order to improve the detail restoration capability of the synthesized waveform.
[0024] An electrocardiogram synthesis system based on adaptive dual encoder and wavelet fusion includes:
[0025] Sensor module: used to acquire raw cardiac impact signals in real time; Storage module: used to store computer programs and trained electrocardiogram synthesis network models;
[0026] Processor module: Used to execute the method steps and synthesize high-fidelity, diagnostic-grade electrocardiogram signals in real time using the model.
[0027] Preferably, the system is deployed on an edge health monitoring platform; the processor module adopts a stacked residual block and dilated convolution structure from the bidirectional temporal convolution bottleneck module, so that the computational load increases linearly with the input length, thereby realizing real-time monitoring on the edge platform.
[0028] The beneficial effects of this invention are as follows: This invention proposes an electrocardiogram (ECG) synthesis system based on adaptive dual encoders and wavelet fusion. Through the synergistic optimization of adaptive orthogonal wavelet decomposition and dual-domain feature extraction architecture, the quantization accuracy of ECG signal reconstruction is significantly improved. Experimental data shows that it outperforms existing technologies in terms of root mean square error (RMSE) and Pearson correlation coefficient (PLCC). Compared with traditional methods, this invention utilizes a gated cross-attention mechanism and a wavelet heuristic decoder to effectively solve the persistent problems of excessive smoothing and loss of high-frequency details in the synthesized waveform. It can faithfully reproduce the morphological characteristics of the P wave, QRS complex, and T wave, ensuring that the synthesized signal has extremely high morphological fidelity and clinical reference value. In addition, the Bi-TCN module successfully overcomes the physiological delay problem between mechanical waves and electrical signals by explicitly modeling long-range nonlinear dependencies, achieving precise synchronization of the synthesized waveform at the phase level. Thanks to its linear computational complexity design, this invention achieves extremely high inference speed while ensuring diagnostic-level accuracy. Its processing efficiency far exceeds the requirements of real-time monitoring, making it particularly suitable for edge inference scenarios with limited computing resources, such as smart mattresses and vehicle seats. It provides a reliable industrial-grade solution for long-term, non-contact cardiac health monitoring. Attached Figure Description
[0029] To more clearly illustrate the technical solutions in this 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 for this invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0030] Figure 1 This is a schematic flowchart of the electrocardiogram synthesis method based on adaptive dual encoder and wavelet fusion as described in an embodiment of the present invention;
[0031] Figure 2 This is a schematic diagram illustrating the waveform correspondence between ECG and BCG signals during the cardiac cycle in an embodiment of the present invention.
[0032] Figure 3 This is a schematic diagram of the overall architecture of AdaptiveDWAVE-Net as described in an embodiment of the present invention;
[0033] Figure 4 This is a schematic diagram of the adaptive orthogonal wavelet decomposition (AOWD) module described in an embodiment of the present invention;
[0034] Figure 5 This is a schematic diagram of the structure of the inverse discrete wavelet transform (IDWT) unit according to an embodiment of the present invention;
[0035] Figure 6This is a schematic diagram of the basic structure of the convolutional block (ConvBlock) according to an embodiment of the present invention;
[0036] Figure 7 This is a schematic diagram of the structure of the gated cross-attention fusion (CAGF) module described in an embodiment of the present invention;
[0037] Figure 8 This is a schematic diagram of the structure of the Bidirectional Temporal Convolutional Network (Bi-TCN) module according to an embodiment of the present invention;
[0038] Figure 9 This is a schematic diagram of the structure of the wavelet information decoder (WID) module according to an embodiment of the present invention;
[0039] Figure 10 This is a bar chart comparing the performance of the embodiments of the present invention with various baseline models in terms of normalization error index and inference time;
[0040] Figure 11 This is a bar chart comparing the performance of the embodiments of the present invention with various baseline models on the normalized quality assessment index;
[0041] Figure 12 This is a qualitative comparison chart of the ECG synthesis results of embodiments of the present invention and various baseline models;
[0042] Figure 13 This is a scatter plot illustrating the performance and complexity trade-offs between embodiments of the present invention and various baseline models. Detailed Implementation
[0043] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments.
[0044] The present invention provides an electrocardiogram synthesis method and system based on adaptive dual encoder and wavelet fusion. Its core lies in realizing high-fidelity reconstruction from the original cardiac impact signal (BCG) to the diagnostic electrocardiogram (ECG) signal through "constructive" adaptive wavelet transform and "gated" cross-domain fusion mechanism.
[0045] The preferred method for implementing this invention is to acquire raw cardiac impact signals (BCG). In practical applications, these signals are acquired in real time using sensor modules such as flexible piezoelectric sensors and microelectromechanical systems accelerometers integrated into smart mattresses, car seats, or home scales.
[0046] Figure 2This demonstrates the correspondence between ECG and BCG signal waveforms within a cardiac cycle. ECG reflects the electrophysiological activity of the heart, exhibiting clear P waves, QRS complexes, and T waves; while BCG reflects the mechanical vibrations caused by the heart pumping blood, with its main characteristic wave being the J wave. Because there is a physiological delay in the generation mechanism of BCG (mechanical signal) and ECG (electrical signal), and the physical characteristics of different sensors can lead to time asynchrony during acquisition, precise phase correction is essential.
[0047] In this embodiment, the core of the preprocessing in step S1 is the cross-correlation alignment algorithm. The system uses the JJ interval in the cardiac impulse signal and the RR interval in the electrocardiogram as a reference (reference). Figure 2 (Note), within the preset maximum lag window (For example Calculate the reference ECG signal within ms) Compared with the original BCG signal The cross-correlation function between them. Derived by the formula:
[0048] according to The BCG signal is cyclically shifted and aligned. Subsequently, the signal is standardized using the mean and standard deviation of the training set, and then divided into time windows of fixed length (preferred length). As the model input, to verify the model's flexibility under different task granularities, Table 3 compares the computational efficiency for lengths of 4096 and 1024. This phase correction mechanism is fundamental to the subsequent point-to-point waveform synthesis task; without this step, the R-peak of the synthesized signal will exhibit severe phase shift. Ablation experiments (as shown in Table 2) demonstrate that removing this alignment step leads to a significant decrease in PLCC performance, fully illustrating its necessity.
[0049] After signal alignment is completed, proceed to step S2. One of the inventive features of this invention is the use of a "constructive" rather than a "dictionary-selective" wavelet processing method. Traditional techniques typically select fixed wavelets from a predefined basis function library, but BCG signals are affected by human viscoelastic damping and medium coupling, resulting in highly nonlinear waveform characteristics, making it difficult for fixed basis functions to perfectly fit.
[0050] refer to Figure 4 This invention constructs an adaptive orthogonal wavelet decomposition (AOWD) module. Traditional techniques typically select a fixed wavelet from a predefined basis function library (such as Haar and Daubechies). However, BCG signals are affected by human viscoelastic damping and mattress coupling effects, resulting in highly nonlinear waveform characteristics and individual differences. Fixed basis functions are difficult to perfectly adapt to the minute deformations of physical signals.
[0051] In this embodiment, the AOWD module introduces learnable perturbation parameters. and scaling factor (Preferred) Construct continuously differentiable optimized manifolds based on the standard Haar basis:
[0052]
[0053] in It is a low-pass filter. For high-pass filters, and For initialization of orthogonal wavelet basis filters; and These are learnable perturbation parameters; This is the scaling factor.
[0054] like Figure 4 As shown, the filter executes after each gradient update. Normalization treatment ( To maintain energy conservation and system stability, and to ensure the mathematical integrity of the wavelet transform and prevent filter degradation during training that could lead to loss of high-frequency details or spectral aliasing, this invention introduces an orthogonality loss function. This loss function forces and The inner product in the time domain approaches zero, ensuring that the two capture non-overlapping information in the frequency domain. This "constructive" wavelet enables the model to adaptively simulate the inverse transfer function of the human-sensor system for different individuals. To constrain the learnable filters to maintain near-orthogonality, prevent mode collapse, and ensure the mathematical integrity of spectral capture, this invention introduces an orthogonality loss during training. The calculation formula is:
[0055]
[0056] in, and These represent the first and second passes of the low-pass and high-pass filters, respectively. One coefficient, For filter length, is the weighting coefficient. This loss term forces the high-pass and low-pass filters to have an in-time product close to zero, effectively separating cardiac impulse components from low-frequency interference such as breathing, and preventing the two from degrading and converging.
[0057] like Figure 3 As shown, this invention employs a dual-encoder structure that operates in both the time and wavelet domains. This design aims to simultaneously capture the macroscopic temporal characteristics and microscopic multi-scale spectral distribution of the BCG signal.
[0058] Time-domain encoder: Receives the raw BCG signal or a downsampled signal. For example... Figure 3 As shown on the left, this path consists of a series of convolutional blocks. (Reference) Figure 5 Each convolutional block contains two layers of one-dimensional convolutions, batch normalization (BN), and a ReLU activation function. This path focuses on extracting local morphological features, such as the sharpness of the J-wave peak.
[0059] Wavelet domain encoder: Receives multi-scale wavelet coefficients generated by the AOWD module. For example... Figure 3 and Figure 4 As shown at the bottom, the original signal is decomposed to obtain approximate coefficients. (Low frequency) and detail coefficient (High frequency). This embodiment employs a two-level decomposition strategy, where the original BCG signal is decomposed into two levels: The second level is to approximate the coefficients of the first level. and detail coefficient All were further decomposed to obtain and Then, all four components of the second stage are concatenated together to form the final wavelet domain input. If the original input length is After secondary decomposition, The dimension is This decomposition method can simultaneously reflect the low-frequency trend and high-frequency pulse characteristics of the signal.
[0060] To address the “semantic gap” between time-domain features (phase-sensitive) and wavelet domain features (frequency-sensitive), step S4 introduces a gated cross-attention fusion (CAGF) module.
[0061] refer to Figure 7 This module differs in structure from standard multi-head attention mechanisms. It employs a Query-Key-Value design with specific physical meaning: based on time-domain features. as query vector With wavelet domain features as a key vector Sum value vector Its physical essence is "to use the time-domain phase as an anchor point to directionally retrieve the required frequency-domain details".
[0062] Innovatively, the CAGF module introduces an adaptive gating mechanism. Features after fusion The calculation formula is:
[0063]
[0064] in, For time domain features, For attention output, This is the residual scaling factor. For adaptive gating weights, The Hadamard product is element-wise multiplied to dynamically adjust the injection of details based on different frequency band components of the signal. In high-frequency regions such as QRS groups, gating is enabled to inject rich wavelet details to sharpen peaks; in low-frequency regions such as equipotential lines, gating is automatically adjusted to suppress noise. This dynamic determination mechanism avoids the time-domain phase information being overwhelmed by noise during the fusion process, solving the problem of P / T wave blurring in the synthesized waveform.
[0065] At the deepest layer of the encoder path, i.e., after the fifth layer fusion, the features are fed into the bottleneck layer of the Bi-Temporal Convolutional Network (Bi-TCN) (step S5).
[0066] like Figure 8 As shown, the Bi-TCN module achieves a large receptive field without increasing the number of parameters by utilizing stacked residual blocks and an exponentially increasing expansion rate. This module processes the forward flow in parallel ( ) and reverse flow ( This method utilizes non-causal contextual information (past and future information) to explicitly model the complex nonlinear delay between BCG and ECG. (Reference formula:)
[0067]
[0068] in, For input features, This indicates a flip operation along the time dimension. and These represent the forward and backward temporal convolutional networks, respectively. This non-causal modeling ensures that the synthesized waveform is precisely synchronized with the real ECG at the phase level.
[0069] In the decoding stage, this invention abandons the traditional simple upsampling and adopts wavelet information decoder (WID).
[0070] like Figure 9 As shown, the WID module receives the upsampled features of the previous layer at each decoding layer. and features from skip connections The core of WID lies in "multi-scale wavelet heuristic decomposition": using three parallel one-dimensional convolutional kernel pairs. The convolution kernels are decomposed into parallel convolution kernels of different sizes, preferably 17, 19, and 21. This specific parameter design is based on prior knowledge of physical morphology, namely, 17, 19, and 21 correspond to the typical morphological spans of the P wave, QRS complex, and T wave in normal human electrocardiogram signals, respectively.
[0071] Subsequently, the module utilizes the normalized weights generated by the frequency-aware attention mechanism. Features at different scales are weighted and fused. Finally, the predicted wavelet coefficients are obtained through... Figure 4 The Inverse Discrete Wavelet Transform (IDWT) module shown utilizes the learned AOWD... and The filter reconstructs the high-resolution ECG signal back to the time domain.
[0072] The model training employs a hybrid loss function strategy, aiming to balance macroscopic morphology with detailed waveform reconstruction. Specifically, the total loss function includes a Smooth L1 loss between the predicted ECG and the actual ECG, and a Smooth L1 loss between the predicted wavelet coefficients and the target wavelet coefficients. The Smooth L1 loss provides gradient smoothness when the error is small and avoids gradient explosion when the error is large, thus helping to improve the robustness of waveform reconstruction.
[0073] Experimental verification of the embodiments
[0074] To verify the effectiveness and superiority of the ECG synthesis method based on adaptive dual encoder and wavelet fusion proposed in this invention, this embodiment uses the publicly available Kansas dataset to conduct a series of comparative experiments and ablation experiments.
[0075] To comprehensively and quantitatively evaluate the quality of the synthesized electrocardiogram, this embodiment uses three types of evaluation indicators:
[0076] 1) Error metrics, including mean square error (MSE), root mean square error (RMSE), and mean absolute error (MAE), are used to measure the numerical deviation between the synthesized signal and the real signal (lower values are better); 2) Signal-to-noise ratio metrics, including peak signal-to-noise ratio (PSNR) and signal-to-noise ratio (SNR), are used to evaluate the noise resistance and reconstruction quality of the signal (higher values are better); 3) Correlation metrics, including Spearman rank correlation coefficient (SRCC), Kendall rank correlation coefficient (KRCC), and Pearson linear correlation coefficient (PLCC), focus on evaluating the consistency of the synthesized waveform in terms of morphological trends and linear relationships (values closer to 1 indicate better fit).
[0077] To verify the performance of this invention, 14 mainstream baseline models were selected for comparative experiments in this embodiment. These models cover convolutional neural networks (such as U-Net, MultiResUnet, SCINet), recurrent neural networks (such as GRU, BiLSTM), Transformers (such as Transformer, iTransformer, PatchTST, Medformer), and hybrid architectures (such as UNet-BiLSTM, TimeMixer, WPMixer, etc.). The specific comparison results are shown in Table 1. This invention significantly outperforms all existing methods in nine key evaluation metrics. For example, the MSE (0.0055) of this method is reduced by approximately 23.6% compared to the second-best method, UNet-BiLSTM (0.0072), and the PLCC (0.9340) also reaches the highest level.
[0078] Table 1. Quantitative comparison results between BCG to ECG reconstruction and state-of-the-art methods based on multiple evaluation metrics. For each metric, the optimal value is represented by data in bold. Suboptimal value Underlined text indicates
[0079]
[0080] like Figure 10 As shown in the bar chart, the invention (Ours) has the lowest error metrics across all metrics and outperforms complex models such as SCINet in terms of inference time. Figure 11 As shown, in terms of quality assessment metrics (PSNR, PLCC, etc.), the height of the bars in this invention is significantly higher than the baseline, and the PLCC reaches 0.9340, demonstrating extremely high fidelity.
[0081] Meanwhile, the present invention also conducted comprehensive ablation experiments. As shown in Table 2, removing any module will lead to a decrease in the accuracy of the present invention, which fully proves that each module proposed in the present invention is effective and necessary.
[0082] Table 2. Comprehensive ablation study of the proposed framework. Each variant highlights its contribution by removing or modifying specific components.
[0083] The best result is the data displayed in bold.
[0084]
[0085] like Figure 12A qualitative comparison of waveform synthesis is shown. Observing the sub-figure (p), it can be found that the waveform synthesized by the present invention (dashed line) almost overlaps with the real ECG (solid line), and the R peak corresponding to the J wave is accurately located, and the details of the P wave and T wave are clear, which is significantly better than the smooth or distorted waveforms generated by Transformer (h,i) or UNet (b).
[0086] As shown in Table 3, the present invention achieves high-efficiency signal generation while maintaining moderate computational overhead.
[0087] This system includes sensor, storage, and processor modules. Because Bi-TCN has linear computational complexity (e.g., Figure 8 As shown in the figure, it can effectively meet the real-time inference requirements under resource constraints. Figure 13 The performance-complexity tradeoff scatter plot shown indicates that our invention (Ours) is located in... Figure 13 The top left corner signifies that while achieving high-quality signal generation (lowest RMSE and highest PLCC), a moderate number of model parameters are maintained. This efficient design allows the system to be deployed on edge monitoring platforms such as smart mattresses or in-vehicle seats, supporting arrhythmia screening or driver fatigue assessment.
[0088] Table 3. Complexity analysis of each model on NVIDIA GeForce RTX 4080
[0089]
[0090] In summary, this invention proposes:
[0091] An electrocardiogram synthesis system based on adaptive dual encoder and wavelet fusion, the system is deployed on an edge health monitoring platform and includes a sensor module, a storage module and a processor module;
[0092] The sensor module is used to acquire raw cardiac impact signals in real time; the storage module is used to store the computer program and the trained electrocardiogram synthesis network model.
[0093] The processor module is used to synthesize high-fidelity, diagnostic-grade electrocardiogram signals in real time through the model. The processor module adopts a stacked residual block and dilated convolution structure from the bidirectional temporal convolution bottleneck module, so that the computational load increases linearly with the input length, thereby realizing real-time monitoring on the edge platform.
[0094] This invention, through a series of innovations from the construction of the underlying filter to the cross-domain attention mechanism, successfully solves the core problems of phase shift, detail smoothing and individual mismatch in BCG to ECG reconstruction, and achieves a clinical diagnostic-grade non-invasive monitoring effect.
[0095] The embodiments described above are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for synthesizing electrocardiograms based on adaptive dual encoders and wavelet fusion, characterized in that, Includes the following steps: S1. Acquire the raw cardiac impact signal and perform preprocessing, the preprocessing including calibrating the time offset between the raw cardiac impact signal and the reference electrocardiogram through a cross-correlation alignment algorithm to achieve phase alignment; S2. The original cardiac impact signal is processed by an adaptive orthogonal wavelet decomposition module. The signal is decomposed using end-to-end learnable low-pass and high-pass filters to obtain multi-scale wavelet coefficients. S3. Construct a dual encoder structure, including a time-domain encoder and a wavelet-domain encoder; input the original cardiac impact signal into the time-domain encoder to extract multi-scale time-domain features, and input the multi-scale wavelet coefficients into the wavelet-domain encoder to extract multi-scale wavelet-domain features; S4. At the corresponding scales of the time-domain encoder and the wavelet-domain encoder, the time-domain features and wavelet-domain features are dynamically fused through a gated cross-attention fusion module to generate multi-scale fused features. S5. Input the features of the deepest layer of the encoder into a bidirectional temporal convolutional network bottleneck module, and capture long-range temporal dependencies through forward and backward temporal convolution processing to obtain bottleneck features; S6. The bottleneck features are input to a wavelet information decoder. The decoder receives the multi-scale fusion features through a skip connection and uses multi-scale wavelet heuristic decomposition to guide the upsampling process to reconstruct the target electrocardiogram signal.
2. The method according to claim 1, characterized in that, In step S2, the learnable low-pass filter and high-pass filter It is obtained by introducing trainable perturbation parameters to continuously deform the initial basis filter. The specific construction formula is as follows: ; in, and For initialization of orthogonal wavelet basis filters; and These are learnable perturbation parameters; This is the scaling factor.
3. The method according to claim 2, characterized in that, The method introduces an orthogonal loss during training. To constrain the learnable filter to maintain near orthogonality, prevent mode collapse, and ensure non-overlapping frequency domain information, the calculation formula is as follows: ; in, and These represent the first and second passes of the low-pass and high-pass filters, respectively. One coefficient, For filter length, These are the weighting coefficients for the orthogonality loss.
4. The method according to claim 1, characterized in that, In step S4, the gated cross-attention fusion module uses time-domain features as the query vector. Using wavelet domain features as key vectors Sum value vector Interacting with the system and employing an adaptive gating mechanism to control the injection intensity of frequency details: fused features The calculation formula is: ; in, For time domain features, For attention output, This is the residual scaling factor. For adaptive gating weights, This is an element-wise multiplication of the Hadamard product, used to dynamically adjust detail injection based on different frequency band components of the signal.
5. The method according to claim 1, characterized in that, In step S5, the bidirectional temporal convolutional network bottleneck module comprises stacked residual TCN blocks with exponentially increasing dilation rates. Precise phase synchronization is achieved by concatenating the outputs of the forward and reverse processing streams. (Bottleneck features) The calculation formula is: ; in, For input features, This indicates a flip operation along the time dimension. and These represent the forward and backward temporal convolutional networks, respectively.
6. The method according to claim 1, characterized in that, In step S6, the wavelet heuristic decomposition uses parallel multi-scale convolution kernels, with the kernels being parallel convolution kernels of different sizes, respectively simulating the typical morphological spans of the P wave, QRS complex, and T wave in the electrocardiogram.
7. The method according to claim 6, characterized in that, The wavelet information decoder utilizes a frequency-aware attention mechanism to upsample features. Multiscale decomposition components of jump connection features Weighted fusion is performed to highlight the frequency band components that are most discriminative for the reconstruction task.
8. The method according to claim 1, characterized in that, The model training employs a hybrid loss function, including a Smooth L1 loss between the predicted ECG and the actual ECG, and a Smooth L1 loss between the predicted wavelet coefficients and the target wavelet coefficients, in order to improve the detail reproduction capability of the synthesized waveform.
9. An electrocardiogram synthesis system based on adaptive dual encoder and wavelet fusion, characterized in that, include: Sensor module: used to acquire raw cardiac impact signals in real time; Storage module: used to store computer programs and trained electrocardiogram synthesis network models; Processor module: used to execute the steps of the method as described in any one of claims 1-8, and to synthesize high-fidelity, diagnostic-grade electrocardiogram signals in real time through the model.
10. The electrocardiogram synthesis system according to claim 9, characterized in that, The system is deployed on an edge health monitoring platform; the processor module adopts a stacked residual block and dilated convolution structure from the bidirectional temporal convolution bottleneck module, so that the computational load increases linearly with the input length, thereby realizing real-time monitoring on the edge platform.