An ECG signal reconstruction method based on hybrid optimization and multimodal feature fusion
Through the hybrid optimization and multimodal features reconstruction method, dynamically optimized lead combination and combined with Transformer architecture, the separate design framework of lead selection and feature characterization in traditional methods is solved, and high-precision reconstruction of ECG signals in complex environments is realized.
Patent Information
- Application Number
- CN202510769820.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-10
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2045-06-10
AI Technical Summary
Traditional electrocardiogram reconstruction methods lack the ability to adaptive optimization of individualized physiological characteristics and dynamic noise environments, and it is difficult to effectively characterize the time-frequency joint characteristics and key physiological indicators of electrocardiogram signals. In addition, deep learning models have limitations in long-range timing-dependent modeling, resulting in insufficient reconstruction accuracy and pathological sensitivity.
The dynamic optimization lead combination is adopted using a hybrid optimization algorithm (genetic algorithm and simulated annealing algorithm), combining multimodal feature fusion (time domain, frequency domain and expert features) and Transformer architecture, and signal reconstruction is carried out through a multi-head self-attention mechanism.
It improves the adaptability and robustness of lead selection, enhances pathological sensitivity, reduces reconstruction errors under motion artifacts and noise interference, and improves signal fidelity and reconstruction effect of local waveform details.
Smart Images

Figure CN120316447B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of biomedical signal processing and artificial intelligence technology, and in particular to an electrocardiogram signal reconstruction method based on hybrid optimization and multimodal feature fusion. Background Art
[0002] Traditional ECG signal reconstruction methods face multiple technical bottlenecks in clinical application. First, existing technologies generally rely on fixed lead combinations (such as the standard 12-lead system), lacking the ability to adaptively optimize for individual physiological characteristics and dynamic noise environments. This rigid lead selection strategy can significantly reduce reconstruction accuracy when signal quality fluctuates or some leads are missing, particularly in scenarios with motion artifacts or poor device contact. Second, existing algorithms often model signals based on single modal features (such as using only the time-domain waveform or frequency-domain energy distribution), making it difficult to effectively characterize the joint time-frequency characteristics of ECG signals and key physiological parameters (such as QRS complex morphology and ST segment deviation). When processing complex pathological signals (such as atrial fibrillation and myocardial ischemia), such methods often cause waveform distortion or rhythm distortion due to incomplete feature representation. Furthermore, traditional deep learning models (such as convolutional neural networks or recurrent neural networks) have inherent limitations in modeling long-range temporal dependencies. The local receptive field of convolutional neural networks (CNNs) struggles to capture global cross-cycle correlations in ECG signals (such as RR interval variability), while recurrent neural networks (RNNs) are limited by the vanishing gradient problem and cannot stably model the spatiotemporal correlations of multi-lead signals in high-noise environments. These limitations make it difficult for existing technologies to meet the dual requirements of clinical diagnosis for signal fidelity and pathological sensitivity.
[0003] Despite recent attempts to improve reconstruction performance through multi-lead signal fusion or the introduction of attention mechanisms, these core algorithms have yet to break through the design framework of separating lead selection from feature representation. For example, while some methods employ genetic algorithms to optimize lead combinations, they fail to coordinate optimization with downstream feature extraction and reconstruction models, leading to a disconnect between lead selection and signal restoration goals. Other approaches, while extracting time-frequency features through wavelet transforms, neglect the explicit embedding of expert knowledge (such as QRS wave parameters), diluting key physiological information during the feature fusion process. Summary of the Invention
[0004] In view of the above situation, the main purpose of the present invention is to propose an ECG signal reconstruction method and system based on hybrid optimization and multimodal feature fusion to solve the above technical problems.
[0005] The present invention proposes an electrocardiogram signal reconstruction method based on hybrid optimization and multimodal feature fusion, the method comprising the following steps:
[0006] Step 1: Obtain 12-lead ECG signals, and process the 12-lead ECG signals sequentially through a linear regression model, a genetic algorithm, and a simulated annealing algorithm to obtain an optimal three-lead ECG signal;
[0007] Step 2: The optimal three-lead ECG signal is processed sequentially through a one-dimensional convolution layer and a maximum pooling layer to obtain time domain features;
[0008] Step 3: The optimal three-lead ECG signal is processed sequentially through continuous wavelet transform, two-dimensional convolution layer and maximum pooling to obtain frequency domain features;
[0009] Step 4: Filter and perform differential calculation on the optimal three-lead ECG signals to obtain filtered signals and differential signals respectively, and process the filtered signals and differential signals based on the Pan-Tompkins algorithm to obtain expert features;
[0010] Step 5: Perform multimodal feature fusion on the time domain features, frequency domain features and expert features to obtain fused features;
[0011] Step 6: Input the fused features into the Transformer mechanism for processing to obtain the reconstructed ECG signal.
[0012] Compared with the prior art, the present invention has the following beneficial effects:
[0013] 1. This invention adds adaptability to lead selection, significantly improving robustness. Traditional methods rely on fixed lead combinations, and performance degrades dramatically when leads are lost or subject to noise. This invention dynamically optimizes lead combinations based on a hybrid heuristic algorithm (genetic algorithm and simulated annealing algorithm), with the objective function integrating reconstruction error and inter-lead correlation. This effectively reduces reconstructed signal error and improves lead failure tolerance in complex scenarios such as motion artifacts and myoelectric noise.
[0014] 2. The multimodal feature fusion strategy of the present invention improves pathological sensitivity. Existing technologies often rely on single-modal features, resulting in loss of pathological details. The present invention uses a cross-modal attention mechanism to dynamically fuse time domain waveforms, frequency domain energy, and QRS expert features, resulting in smaller ST segment offset errors in myocardial ischemia signal reconstruction.
[0015] 3. This invention achieves significant results in long-range temporal modeling and local waveform detail optimization. Traditional CNN / RNN models are limited by local receptive fields or vanishing gradient problems, making it difficult to balance global rhythms and local morphology. This invention uses a QRS-aware Transformer architecture, combined with multi-head self-attention and a nonlinear feedforward network, to achieve smaller QRS complex width errors.
[0016] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through embodiments of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 This is a flowchart of the steps of an electrocardiogram signal reconstruction method based on hybrid optimization and multimodal feature fusion proposed by the present invention;
[0018] Figure 2 This is a framework diagram of the method for ECG signal reconstruction based on hybrid optimization and multimodal feature fusion proposed in the present invention. DETAILED DESCRIPTION
[0019] The following describes embodiments of the present invention in detail. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended only to explain the present invention and are not to be construed as limiting the present invention.
[0020] These and other aspects of the embodiments of the present invention will become clear with reference to the following description and accompanying drawings. In these descriptions and accompanying drawings, some specific implementations of the embodiments of the present invention are specifically disclosed to illustrate some ways of implementing the principles of the embodiments of the present invention, but it should be understood that the scope of the embodiments of the present invention is not limited thereto.
[0021] See also Figure 1 This embodiment provides an electrocardiogram signal reconstruction method based on hybrid optimization and multimodal feature fusion, the method comprising the following steps:
[0022] Step 1: Obtain 12-lead ECG signals, and process the 12-lead ECG signals sequentially through a linear regression model, a genetic algorithm, and a simulated annealing algorithm to obtain an optimal three-lead ECG signal.
[0023] See also Figure 2 In step 1, a 12-lead ECG signal is obtained, and the 12-lead ECG signal is processed sequentially through a linear regression model, a genetic algorithm, and a simulated annealing algorithm to obtain an optimal three-lead ECG signal, which specifically includes the following sub-steps:
[0024] Obtain 12-lead ECG signals, confirm one target lead ECG signal to be reconstructed, and select any 3 lead ECG signals from the remaining 11 lead ECG signals as a lead combination to obtain There are different three-lead combinations. The three-lead combinations are input into the linear regression model for processing to obtain the predicted value. The following relationship exists in the corresponding process:
[0025] ;
[0026] in, Represents the target lead ECG signal to be reconstructed, represents the independent variable matrix containing three-lead ECG signals and intercept terms, represents the regression coefficient matrix, represents the error matrix, represents the estimated value of the regression coefficient, represents transpose, represents the predicted value;
[0027] It should be noted that in Figure 2 In the matrix, LR represents the linear regression model, SA represents the simulated annealing algorithm, and GA represents the genetic algorithm; There are 4 columns, the matrix All elements in the first column are 1, which is mainly used for the intercept term to better fit the data. The matrix The second, third, and fourth columns correspond to the three lead ECG signals selected from the remaining 11 lead ECG signals. After feature extraction, these lead ECG signals form the matrix The data in the second, third and fourth columns of .
[0028] Based on 165 different three-lead combinations, the error calculation is performed for each three-lead combination to obtain the root mean square error. The following relationship exists in the corresponding process:
[0029] ;
[0030] in, represents the root mean square error, represents the number of samples, represents the sample index, Indicates the observations, Indicates the predicted values;
[0031] Furthermore, the coefficient of determination and Pearson correlation coefficient are added to provide a more comprehensive evaluation standard. The following relationship exists in the corresponding process:
[0032] ;
[0033] in, represents the coefficient of determination, express The average value of represents the Pearson correlation coefficient, express No. observations, express The average value of
[0034] The 165 three-lead combinations were sorted from smallest to largest by root mean square error, and the three-lead combinations with low root mean square errors in the top 20% were selected; when the root mean square errors were similar, the three-lead combinations with the coefficient of determination and Pearson correlation coefficient in the top several were preferentially selected to obtain the selected candidate three-lead combination set;
[0035] Based on the genetic algorithm, the screened candidate three-lead combination set is combined into the initial population. The fitness function is constructed based on the root mean square error, determination coefficient and Pearson correlation coefficient to obtain the fitness. The three-lead combination with the highest fitness is selected as the output of the genetic algorithm. The corresponding process has the following relationship:
[0036] ;
[0037] in, Indicates fitness;
[0038] The output of the genetic algorithm is locally adjusted based on the simulated annealing algorithm to obtain the optimal three-lead ECG signal. The following relationship exists in the corresponding process:
[0039] ;
[0040] in, represents the probability of accepting the new solution, represents the natural exponential function, Indicates the current temperature. Indicates a new solution, represents the current solution, represents the root mean square error of the new solution, Indicates the root mean square error of the current solution.
[0041] Step 2: The optimal three-lead ECG signal is processed sequentially through a one-dimensional convolution layer and a maximum pooling layer to obtain time domain features.
[0042] In step 2, the optimal three-lead ECG signal is processed sequentially through a one-dimensional convolution layer and a maximum pooling layer to obtain time domain features. The specific steps include the following:
[0043] Perform Z-Score normalization on the optimal three-lead ECG signal to obtain normalized ECG signal data. The following relationship exists in the corresponding process:
[0044] ;
[0045] in, represents the normalized ECG signal data, represents the optimal three-lead ECG signal, express The mean over the sample and time step dimensions, express Standard deviation in the sample and time step dimensions;
[0046] The normalized ECG data is input into the one-dimensional convolutional layer for feature extraction to obtain the output of the one-dimensional convolutional layer. The following relationship exists in the corresponding process:
[0047] ;
[0048] in, represents the output of the one-dimensional convolutional layer, Indicates that it has been processed by the activation function. Represents the input channel index of the convolution kernel, Indicates The set of input graphs connected to the output graphs, Represents the index of different objects related to the convolutional layer, Indicates the Layer Input graph, Represents the convolution kernel weight connecting the two layers of feature maps, Indicates the connection bias parameter, Represents a one-dimensional convolution operation;
[0049] It should be noted that in this step, the hyperbolic tangent function is used as the activation function to retain positive and negative fluctuation information; since the ECG signal contains negative values after centering, the traditional activation functions ReLU and Sigmoid have certain limitations in ECG signal processing. ReLU will discard negative value information, while Sigmoid will compress the output to (0,1), destroying the symmetry of the ECG signal.
[0050] Perform a one-dimensional maximum pooling operation on the output of the one-dimensional convolutional layer to obtain the time domain features. The following relationship exists in the corresponding process:
[0051] ;
[0052] in, Representing time domain features For each element in represents the time step index of the output, Indicates that after the maximum pooling operation, represents the local index within the pooling window, represents the number of time steps covered, Represents the output of a one-dimensional convolutional layer At time step The value at .
[0053] Step 3: The optimal three-lead ECG signal is processed sequentially through continuous wavelet transform, two-dimensional convolution layer and maximum pooling to obtain frequency domain features.
[0054] In step 3, the optimal three-lead ECG signal is processed sequentially through continuous wavelet transform, two-dimensional convolution layer and maximum pooling to obtain frequency domain features. The specific steps include the following:
[0055] The optimal three-lead ECG signal is subjected to wavelet denoising to obtain the optimal three-lead ECG signal after denoising. The following relationship exists in the corresponding process:
[0056] ;
[0057] in, represents the wavelet coefficient after soft threshold processing, represents the original wavelet coefficients, represents the symbolic function, represents the universal threshold;
[0058] The optimal three-lead ECG signal after noise reduction is processed by continuous wavelet transform to obtain three two-dimensional time-frequency images. The following relationship exists in the corresponding process:
[0059] ;
[0060] in, Represents the continuous wavelet transform at scale and time location The coefficient at Indicates scale, Indicates time position, represents the optimal three-lead ECG signal after noise reduction, represents consecutive time points, represents the conjugate function of the wavelet mother function, Indicates that the generated two-dimensional time-frequency image is at scale , time and location and channel The pixel value at represents the color channel, It means that it has been processed by normalization function. represents the time-frequency coefficient after continuous wavelet transform, represents the red channel, Indicates the green channel. represents the blue channel;
[0061] The three two-dimensional time-frequency images are fused and input into the two-dimensional convolution layer for feature extraction to obtain the output of the two-dimensional convolution layer. The following relationship exists in the corresponding process:
[0062] ;
[0063] in, Indicates the The feature map output by the convolution kernel, represents the height of the convolution kernel, represents the width of the convolution kernel, Indicates the The convolution kernel is The weight of each channel, Represents the first channels, represents the bias term, represents the channel index of the input tensor, Represents the index in the height direction of the convolution kernel, Represents the index in the width direction of the convolution kernel, represents the index of the convolution kernel, represents the output of the two-dimensional convolutional layer, Indicates that it has been processed by the ReLU activation function;
[0064] Perform a two-dimensional maximum pooling operation on the output of the two-dimensional convolutional layer to obtain frequency domain features. The following relationship exists in the corresponding process:
[0065] ;
[0066] in, represents the frequency domain characteristics, Indicates the height of the pooling window, represents the width of the pooling window, Indicates the sliding stride.
[0067] Step 4: Filter and perform differential calculation on the optimal three-lead ECG signals to obtain filtered signals and differential signals respectively. The filtered signals and differential signals are processed based on the Pan-Tompkins algorithm to obtain expert features.
[0068] In step 4, the optimal three-lead ECG signal is filtered and differentially calculated to obtain a filtered signal and a differential signal, respectively. The filtered signal and the differential signal are processed based on the Pan-Tompkins algorithm to obtain expert features, which specifically includes the following sub-steps:
[0069] The optimal three-lead ECG signal is filtered to obtain a filtered signal. The following relationship exists in the corresponding process:
[0070] ;
[0071] in, Indicates lead After low-pass filtering, at time The signal value of represents discrete time points, represents the window length of low-pass filtering, Indicates lead After high-pass filtering, at time The signal value of represents the window length of high-pass filtering, Indicates the sampling frequency;
[0072] Perform differential calculation on the optimal three-lead ECG signal to obtain the differential signal. The following relationship exists in the corresponding process:
[0073] ;
[0074] in, Indicates that the filtered signal is The difference between the first component and the second component at a time point, Indicates that the filtered signal is The difference between the second component and the third component at a time point, Indicates that the filtered signal is The difference between the third component and the first component at a time point, Indicates that lead 1 is at time point The filtered signal value, Indicates that lead 2 is at time point The filtered signal value, Indicates that lead 3 is at time point The filtered signal value, Indicates differential signal At the time point The signal value of
[0075] It should be noted that lead 1, lead 2, and lead 3 correspond to three lead ECG signals in the optimal three-lead ECG signal, respectively.
[0076] Based on the Pan-Tompkins algorithm, the filtered signal and the differential signal are sequentially subjected to R peak detection, QRS width calculation, and QRS amplitude calculation to obtain the R peak position feature, QRS width feature, and QRS amplitude feature, respectively. The following relationship exists in the corresponding process:
[0077] ;
[0078] in, Indicates that the lead Medium sample At the time point Whether it is an R peak indicator parameter, Indicates that the lead Medium sample At the time point The QRS complex width at Indicates the starting time point of the QRS wave, Indicates the end time point of the QRS wave. Indicates that the lead Medium sample At the time point The QRS complex amplitude at
[0079] The R peak position feature, QRS width feature, and QRS amplitude feature are fused to obtain the expert feature sequence. The following relationship exists in the corresponding process:
[0080] ;
[0081] in, represents the expert feature sequence, Represents expert feature sequence The element value in Represents the parameters used to distinguish different feature types;
[0082] The expert feature sequence is processed in sequence through time alignment, feature concatenation and dimensionality reduction mapping to obtain the expert feature. The following relationship exists in the corresponding process:
[0083] ;
[0084] in, represents the features obtained after the time alignment operation, represents the R peak time series based on the differential signal, After interpolation operation, Represents the comprehensive features obtained after feature combination operation, Indicates that after splicing operation, It represents the feature obtained after the time alignment operation of the first lead. It represents the feature obtained after the time alignment operation of the second lead. It represents the feature obtained after the time alignment operation of the third lead. represents expert characteristics, represents the weight matrix, Represents the bias vector.
[0085] Step 5: Perform multimodal feature fusion on the time domain features, frequency domain features and expert features to obtain fused features.
[0086] In step 5, the time domain features, frequency domain features and expert features are fused into a multimodal feature to obtain a fused feature, which specifically includes the following sub-steps:
[0087] The time domain features are sequentially processed by time alignment and feature mapping to obtain the time domain features after feature mapping. The following relationship exists in the corresponding process:
[0088] ;
[0089] in, represents the time domain features after time alignment operation, represents the target time step, represents the time domain features after feature mapping processing, represents the first weight matrix, represents the first bias vector;
[0090] The frequency domain features are processed in sequence through spatial flattening, dimension adjustment, time alignment and feature mapping to obtain the frequency domain features after feature mapping. The following relationship exists in the corresponding process:
[0091] ;
[0092] in, Represents the frequency domain characteristics The result after spatial dimension expansion is: Indicates that the shape of the input tensor is changed. Indicates the number of channels, Represents the spatial height after pooling, represents the spatial width after pooling, Express The result after dimension permutation, Indicates that after dimension adjustment operation, represents the frequency domain features after time alignment, Represents the frequency domain features after feature mapping processing, represents the second weight matrix, represents the second bias vector;
[0093] Perform feature mapping on the expert features to obtain the expert features after feature mapping. The following relationship exists in the corresponding process:
[0094] ;
[0095] in, represents the expert features after feature mapping processing, represents the third weight matrix, represents the third bias vector;
[0096] It should be noted that the feature dimensions of the time domain features, frequency domain features and expert features are unified by performing feature mapping on the time domain features, frequency domain features and expert features respectively.
[0097] The time domain features processed by feature mapping, the frequency domain features processed by feature mapping, and the expert features processed by feature mapping are fused to obtain fused features. The following relationship exists in the corresponding process:
[0098] ;
[0099] in, Indicates fusion features.
[0100] Step 6: Input the fused features into the Transformer mechanism for processing to obtain the reconstructed ECG signal.
[0101] In step 6, the fused features are input into the Transformer mechanism for processing to obtain the reconstructed ECG signal, which specifically includes the following sub-steps:
[0102] The fusion features are configured to positionally encode to construct a position encoding matrix, and the fusion features are embedded using the position encoding matrix to obtain fusion features of fusion position encoding. The following relationship exists in the corresponding process:
[0103] ;
[0104] in, represents the fusion feature of the fused position encoding, represents the time position code, Represents spatial position encoding, Indicates QRS perception coding;
[0105] The fusion features of the fusion position encoding are processed based on the multi-head self-attention mechanism to obtain the feature vector processed by the multi-head self-attention mechanism. The fusion features of the fusion position encoding and the feature vector processed by the multi-head self-attention mechanism are sequentially subjected to residual connection and layer normalization to obtain the intermediate feature vector. The following relationship exists in the corresponding process:
[0106] ;
[0107] in, represents the intermediate eigenvector, It means that after layer normalization, Represents the feature vector after processing by the multi-head self-attention mechanism;
[0108] The intermediate feature vector is input into the feedforward neural network for processing to obtain the output of the feedforward neural network. The output of the feedforward neural network is stacked in multiple layers to obtain the features processed by the Transformer mechanism. The following relationship exists in the corresponding process:
[0109] ;
[0110] in, represents the output of the feedforward neural network, represents the fifth weight matrix, represents the fifth bias vector, represents the fifth weight matrix, represents the fifth bias vector;
[0111] The output of the feedforward neural network is stacked in multiple layers to obtain features processed by the Transformer mechanism. The features processed by the Transformer mechanism are then subjected to linear projection, time truncation, and amplitude calibration in sequence to obtain the reconstructed ECG signal. The following relationship exists in the corresponding process:
[0112] ;
[0113] in, represents the output of the linear projection, Represents the features processed by the Transformer mechanism, represents the sixth weight matrix, represents the sixth bias vector, Represents the output after time truncation operation, represents the actual length of the original signal, represents the reconstructed ECG signal, represents the lead-by-lead scaling factor, represents element-wise multiplication, represents the lead-by-lead bias term;
[0114] Furthermore, to verify the reconstruction effect, the original ECG signal and the reconstructed ECG signal are subjected to mean square error calculation to obtain the mean square error. The following relationship exists in the corresponding process:
[0115] ;
[0116] in, represents the mean square error, represents the total time step, Indicates the original ECG signal at time The value of Represents the reconstructed ECG signal at time The value of .
[0117] It should be noted that by calculating the mean square error, we can intuitively understand the overall difference between the reconstructed ECG signal and the original ECG signal in the entire time range. By minimizing the mean square error, the reconstructed ECG signal can retain the characteristics and information of the original ECG signal to the greatest extent, thereby providing a reliable data basis for subsequent analysis, diagnosis and other applications.
[0118] It should be understood that, although the various steps in the flow chart of each embodiment of the present invention are shown in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence according to the order indicated by the arrows. Unless otherwise specified herein, the execution of these steps is not strictly limited in order, and these steps can be performed in other orders. Moreover, at least a portion of the steps in each embodiment may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.
[0119] It should be understood that various components of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used: a discrete logic circuit having logic gate circuits for implementing logic functions on data signals, an application-specific integrated circuit having suitable combinational logic gate circuits, a programmable gate array (PGA), a field-programmable gate array (FPGA), etc.
[0120] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that a specific feature, structure, material, or characteristic described in conjunction with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
[0121] The above-described embodiments merely illustrate several implementations of the present invention, and while their descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art would be able to make numerous variations and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.
Claims
1. A method for reconstructing electrocardiogram signals based on hybrid optimization and multimodal feature fusion, characterized in that: The method comprises the following steps: Step 1: Obtain 12-lead ECG signals, and process the 12-lead ECG signals sequentially through a linear regression model, a genetic algorithm, and a simulated annealing algorithm to obtain an optimal three-lead ECG signal; Step 2: The optimal three-lead ECG signal is processed sequentially through a one-dimensional convolution layer and a maximum pooling layer to obtain time domain features; Step 3: The optimal three-lead ECG signal is processed sequentially through continuous wavelet transform, two-dimensional convolution layer and maximum pooling to obtain frequency domain features; Step 4: Filter and perform differential calculation on the optimal three-lead ECG signals to obtain filtered signals and differential signals respectively, and process the filtered signals and differential signals based on the Pan-Tompkins algorithm to obtain expert features; Step 5: Perform multimodal feature fusion on the time domain features, frequency domain features and expert features to obtain fused features; Step 6: Input the fused features into the Transformer mechanism for processing to obtain the reconstructed ECG signal; The step of acquiring 12-lead ECG signals and sequentially processing the 12-lead ECG signals through a linear regression model, a genetic algorithm, and a simulated annealing algorithm to obtain an optimal three-lead ECG signal specifically includes the following sub-steps: Obtain 12-lead ECG signals, identify one target lead ECG signal to be reconstructed, and select any three lead ECG signals from the remaining 11 lead ECG signals as a lead combination to obtain 165 different three-lead combinations. Input the three-lead combinations into the linear regression model for processing to obtain the predicted value. The corresponding process has the following relationship: ; in, Represents the target lead ECG signal to be reconstructed, represents the independent variable matrix containing three-lead ECG signals and intercept terms, represents the regression coefficient matrix, represents the error matrix, represents the estimated value of the regression coefficient, represents transpose, represents the predicted value; Based on 165 different three-lead combinations, the error calculation is performed for each three-lead combination to obtain the root mean square error. The following relationship exists in the corresponding process: ; in, represents the root mean square error, represents the number of samples, represents the sample index, Indicates the observations, Indicates the predicted values; The 165 three-lead combinations were sorted from smallest to largest by root mean square error, and the three-lead combinations with low root mean square errors in the top 20% were selected; when the root mean square errors were similar, the three-lead combinations with the coefficient of determination and Pearson correlation coefficient in the top several were preferentially selected to obtain the selected candidate three-lead combination set; Based on the genetic algorithm, the screened candidate three-lead combination set is combined into the initial population. The fitness function is constructed based on the root mean square error, determination coefficient and Pearson correlation coefficient to obtain the fitness. The three-lead combination with the highest fitness is selected as the output of the genetic algorithm. The corresponding process has the following relationship: ; in, represents fitness, represents the coefficient of determination, represents the Pearson correlation coefficient; The output of the genetic algorithm is locally adjusted based on the simulated annealing algorithm to obtain the optimal three-lead ECG signal. The following relationship exists in the corresponding process: ; in, represents the probability of accepting the new solution, represents the natural exponential function, Indicates the current temperature. Indicates a new solution, represents the current solution, represents the root mean square error of the new solution, Indicates the root mean square error of the current solution.
2. The electrocardiogram signal reconstruction method based on hybrid optimization and multimodal feature fusion according to claim 1 is characterized in that: In step 2, the optimal three-lead ECG signal is sequentially processed through a one-dimensional convolution layer and a maximum pooling layer to obtain time domain features, which specifically includes the following sub-steps: Perform Z-Score normalization on the optimal three-lead ECG signal to obtain normalized ECG signal data. The following relationship exists in the corresponding process: ; in, represents the normalized ECG signal data, represents the optimal three-lead ECG signal, express The mean over the sample and time step dimensions, express Standard deviation in the sample and time step dimensions; The normalized ECG data is input into the one-dimensional convolutional layer for feature extraction to obtain the output of the one-dimensional convolutional layer. The following relationship exists in the corresponding process: ; in, represents the output of the one-dimensional convolutional layer, Indicates that it has been processed by the activation function. Represents the input channel index of the convolution kernel, Indicates The set of input graphs connected to the output graphs, Represents the index of different objects related to the convolutional layer, Indicates the Layer Input graph, Represents the convolution kernel weight connecting the two layers of feature maps, Indicates the connection bias parameter, Represents a one-dimensional convolution operation; Perform a one-dimensional maximum pooling operation on the output of the one-dimensional convolutional layer to obtain the time domain features. The following relationship exists in the corresponding process: ; in, Representing time domain features For each element in represents the time step index of the output, Indicates that after the maximum pooling operation, represents the local index within the pooling window, represents the number of time steps covered, Represents the output of a one-dimensional convolutional layer At time step The value at .
3. The electrocardiogram signal reconstruction method based on hybrid optimization and multimodal feature fusion according to claim 2 is characterized in that: In step 3, the optimal three-lead ECG signal is sequentially processed through continuous wavelet transform, two-dimensional convolution layer and maximum pooling to obtain frequency domain features, which specifically includes the following sub-steps: Perform wavelet denoising on the optimal three-lead ECG signal to obtain the optimal three-lead ECG signal after denoising; The optimal three-lead ECG signal after noise reduction is processed by continuous wavelet transform to obtain three two-dimensional time-frequency images; The three 2D time-frequency images are fused and input into the 2D convolution layer for feature extraction to obtain the output of the 2D convolution layer; The output of the two-dimensional convolutional layer is subjected to a two-dimensional maximum pooling operation to obtain frequency domain features.
4. The electrocardiogram signal reconstruction method based on hybrid optimization and multimodal feature fusion according to claim 3 is characterized in that: The optimal three-lead ECG signal is subjected to wavelet denoising to obtain the optimal three-lead ECG signal after denoising. The following relationship exists in the corresponding process: ; in, represents the wavelet coefficient after soft threshold processing, represents the original wavelet coefficients, represents the symbolic function, represents the universal threshold; In the step of performing continuous wavelet transform on the optimal three-lead ECG signal after noise reduction to obtain three two-dimensional time-frequency images, the following relationship exists in the corresponding process: ; in, Represents the continuous wavelet transform at scale and time location The coefficient at Indicates scale, Indicates time position, represents the optimal three-lead ECG signal after noise reduction, represents consecutive time points, represents the conjugate function of the wavelet mother function, Indicates that the generated two-dimensional time-frequency image is at scale , time and location and channel The pixel value at represents the color channel, It means that it has been processed by normalization function. represents the time-frequency coefficient after continuous wavelet transform, represents the red channel, Indicates the green channel. represents the blue channel; In the step of fusing the three two-dimensional time-frequency images and inputting them into the two-dimensional convolutional layer for feature extraction to obtain the output of the two-dimensional convolutional layer, the following relationship exists in the corresponding process: ; in, Indicates the The feature map output by the convolution kernel, represents the height of the convolution kernel, represents the width of the convolution kernel, Indicates the The convolution kernel is The weight of each channel, Represents the first channels, represents the bias term, represents the channel index of the input tensor, Represents the index in the height direction of the convolution kernel, Represents the index in the width direction of the convolution kernel, represents the index of the convolution kernel, represents the output of the two-dimensional convolutional layer, Indicates that it has been processed by the ReLU activation function; In the step of performing a two-dimensional maximum pooling operation on the output of the two-dimensional convolutional layer to obtain frequency domain features, the following relationship exists in the corresponding process: ; in, represents the frequency domain characteristics, Indicates the height of the pooling window, represents the width of the pooling window, Indicates the sliding stride.
5. The electrocardiogram signal reconstruction method based on hybrid optimization and multimodal feature fusion according to claim 4 is characterized in that: In step 4, the optimal three-lead ECG signal is filtered and differentially calculated to obtain a filtered signal and a differential signal, respectively. The filtered signal and the differential signal are processed based on the Pan-Tompkins algorithm to obtain expert features, which specifically includes the following sub-steps: Filtering the optimal three-lead ECG signal to obtain a filtered signal; Perform differential calculation on the optimal three-lead ECG signal to obtain a differential signal; Based on the Pan-Tompkins algorithm, the filtered signal and the differential signal are sequentially subjected to R peak detection, QRS width calculation, and QRS amplitude calculation to obtain R peak position features, QRS width features, and QRS amplitude features, respectively. The R peak position feature, QRS width feature and QRS amplitude feature are fused to obtain the expert feature sequence; The expert feature sequence is processed in sequence through time alignment, feature concatenation and dimensionality reduction mapping to obtain the expert feature.
6. The electrocardiogram signal reconstruction method based on hybrid optimization and multimodal feature fusion according to claim 5, characterized in that: The optimal three-lead ECG signal is filtered to obtain a filtered signal. The following relationship exists in the corresponding process: ; in, Indicates lead After low-pass filtering, at time The signal value of represents discrete time points, represents the window length of low-pass filtering, Indicates lead After high-pass filtering, at time The signal value of represents the window length of high-pass filtering, Indicates the sampling frequency; In the step of performing differential calculation on the optimal three-lead ECG signal to obtain the differential signal, the following relationship exists in the corresponding process: ; in, Indicates that the filtered signal is The difference between the first component and the second component at a time point, Indicates that the filtered signal is The difference between the second component and the third component at a time point, Indicates that the filtered signal is The difference between the third component and the first component at a time point, Indicates that lead 1 is at time point The filtered signal value, Indicates that lead 2 is at time point The filtered signal value, Indicates that lead 3 is at time point The filtered signal value, Indicates differential signal At the time point The signal value of In the steps of performing R peak detection, QRS width calculation, and QRS amplitude calculation on the filtered signal and the differential signal based on the Pan-Tompkins algorithm to obtain the R peak position feature, QRS width feature, and QRS amplitude feature, respectively, the following relationship exists in the corresponding process: ; in, Indicates that the lead Medium sample At the time point Whether it is an R peak indicator parameter, Indicates that the lead Medium sample At the time point The QRS complex width at Indicates the starting time point of the QRS wave, Indicates the end time point of the QRS wave. Indicates that the lead Medium sample At the time point The QRS complex amplitude at In the step of fusing the R peak position feature, QRS width feature, and QRS amplitude feature to obtain the expert feature sequence, the following relationship exists in the corresponding process: ; in, represents the expert feature sequence, Represents expert feature sequence The element value in Represents the parameters used to distinguish different feature types; In the steps of obtaining expert features by sequentially subjecting the expert feature sequence to time alignment, feature concatenation, and dimensionality reduction mapping, the following relationship exists in the corresponding process: ; in, represents the features obtained after the time alignment operation, represents the R peak time series based on the differential signal, After interpolation operation, Represents the comprehensive features obtained after feature combination operation, Indicates that after splicing operation, It represents the feature obtained after the time alignment operation of the first lead. It represents the feature obtained after the time alignment operation of the second lead. It represents the feature obtained after the time alignment operation of the third lead. represents expert characteristics, represents the weight matrix, Represents the bias vector.
7. The electrocardiogram signal reconstruction method based on hybrid optimization and multimodal feature fusion according to claim 6, characterized in that: In step 5, multimodal feature fusion is performed on the time domain features, frequency domain features and expert features to obtain fused features, which specifically includes the following sub-steps: The time domain features are sequentially processed by time alignment and feature mapping to obtain the processed time domain features. The following relationship exists in the corresponding process: ; in, represents the time domain features after time alignment operation, represents the target time step, represents the time domain features after feature mapping processing, represents the first weight matrix, represents the first bias vector; The frequency domain features are processed in sequence through spatial flattening, dimension adjustment, time alignment and feature mapping to obtain the frequency domain features after feature mapping. The following relationship exists in the corresponding process: ; in, Represents the frequency domain characteristics The result after spatial dimension expansion is: Indicates that the shape of the input tensor is changed. Indicates the number of channels, Represents the spatial height after pooling, represents the spatial width after pooling, Express The result after dimension permutation, Indicates that after dimension adjustment operation, represents the frequency domain features after time alignment, Represents the frequency domain features after feature mapping processing, represents the second weight matrix, represents the second bias vector; Perform feature mapping on the expert features to obtain the expert features after feature mapping. The following relationship exists in the corresponding process: ; in, represents the expert features after feature mapping processing, represents the third weight matrix, represents the third bias vector; The time domain features processed by feature mapping, the frequency domain features processed by feature mapping, and the expert features processed by feature mapping are fused to obtain fused features. The following relationship exists in the corresponding process: ; in, Indicates fusion features.
8. The electrocardiogram signal reconstruction method based on hybrid optimization and multimodal feature fusion according to claim 7, characterized in that: In step 6, the fused features are input into the Transformer mechanism for processing to obtain a reconstructed ECG signal, which specifically includes the following sub-steps: The fusion features are configured to positionally encode to construct a position encoding matrix, and the fusion features are embedded using the position encoding matrix to obtain fusion features of fusion position encoding. The following relationship exists in the corresponding process: ; in, represents the fusion feature of the fused position encoding, represents the time position code, Represents spatial position encoding, Indicates QRS perception coding; The fusion features of the fusion position encoding are processed based on the multi-head self-attention mechanism to obtain the feature vector processed by the multi-head self-attention mechanism. The fusion features of the fusion position encoding and the feature vector processed by the multi-head self-attention mechanism are sequentially subjected to residual connection and layer normalization to obtain the intermediate feature vector. The following relationship exists in the corresponding process: ; in, represents the intermediate eigenvector, It means that after layer normalization, Represents the feature vector after processing by the multi-head self-attention mechanism; The intermediate feature vector is input into the feedforward neural network for processing to obtain the output of the feedforward neural network. The following relationship exists in the corresponding process: ; in, represents the output of the feedforward neural network, represents the fifth weight matrix, represents the fifth bias vector, represents the fifth weight matrix, represents the fifth bias vector; The output of the feedforward neural network is stacked in multiple layers to obtain features processed by the Transformer mechanism. The features processed by the Transformer mechanism are then subjected to linear projection, time truncation, and amplitude calibration in sequence to obtain the reconstructed ECG signal. The following relationship exists in the corresponding process: ; in, represents the output of the linear projection, Represents the features processed by the Transformer mechanism, represents the sixth weight matrix, represents the sixth bias vector, Represents the output after time truncation operation, represents the actual length of the original signal, represents the reconstructed ECG signal, represents the lead-by-lead scaling factor, represents element-wise multiplication, Represents the lead-by-lead offset term.
Citation Information
Patent Citations
Multi-lead electrocardiogram classification and identification method based on convolution and self-attention mechanism
CN115470828A
Electrocardiosignal classification method based on time-frequency domain fusion and convolutional neural network
CN116746942A