Electrocardiogram lead reconstruction method based on multi-domain feature interaction and clinical semantic regulation

The ECG lead reconstruction method using multi-domain feature interaction and clinical semantic modulation solves the problem of neglecting clinical background information in existing technologies, and achieves efficient reconstruction of ECG signals and enhanced diagnostic value.

CN122320566BActive Publication Date: 2026-08-25EAST CHINA JIAOTONG UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610804093.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-06-05
Publication Date
2026-08-25
Estimated Expiration
2046-06-05

AI Technical Summary

Technical Problem

Existing ECG lead reconstruction methods ignore clinical background information such as the patient's disease diagnosis, medication status, and biochemical indicators, resulting in insufficient feature fusion, underutilization of frequency domain information, and redundant information and learning burden between modes.

Method used

A multi-domain feature interaction and clinical semantic modulation method for ECG lead reconstruction is adopted. By encoding the patient's structured numerical and category information, a clinical semantic vector is generated. Combining semantic gating and path allocation mechanisms, features are selectively suppressed or enhanced. Frequency domain inverse enhancement and cross-attention fusion are performed to generate waveforms of missing ECG signals.

Benefits of technology

It significantly improves the clinical readability and diagnostic value of the reconstructed signal, reduces the computational burden on the network, and enhances the utilization efficiency of frequency domain features and signal quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122320566B_ABST
    Figure CN122320566B_ABST
Patent Text Reader

Abstract

The present application provides an electrocardiogram lead reconstruction method based on multi-domain feature interaction and clinical semantic regulation, which comprises: standardizing and coding the structured information of the patient, obtaining the clinical semantic vector through the clinical semantic encoder; filtering, Hilbert transform, envelope extraction, threshold determination and refractory period verification are performed on the existing electrocardiogram signal to obtain the R wave position, and the global rhythm and local morphology are divided; the encoder is used to extract the lead, rhythm, morphology and frequency domain features; the multi-domain features are selectively inhibited or enhanced through the semantic gating mechanism; the features after gating are sequentially subjected to frequency domain reverse enhancement, cross attention enhancement and interaction fusion to obtain the lead reconstruction vector; the path allocation mechanism is executed based on the clinical semantic vector to generate the optimal fusion vector; the decoder is used to obtain the missing electrocardiogram waveform as the reconstruction result. The present application significantly improves the clinical interpretability and diagnostic value of the reconstructed signal through clinical semantic regulation and multi-domain feature interaction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method for reconstructing electrocardiogram leads based on multi-domain feature interaction and clinical semantic modulation. Background Technology

[0002] ECG lead reconstruction refers to the process of recovering the complete waveform of a missing lead from existing ECG leads. It has significant clinical application value in scenarios such as wearable device monitoring and telemedicine. However, existing lead reconstruction methods are limited to inputting waveform data from existing leads. They infer missing leads by learning the mapping between electrophysiological mathematical characteristics of leads. Essentially, they treat lead reconstruction as a closed signal processing problem, ignoring clinical background information such as the patient's disease diagnosis, medication status, and biochemical indicators.

[0003] On the other hand, existing ECG lead reconstruction techniques face the following problems in feature fusion: First, the fusion strategy is mainly based on simple splicing, lacking a deep interaction mechanism between different features. The late fusion method of features means that time-domain features and frequency-domain features have no interaction at all during the entire encoding process. Second, many methods use continuous wavelet transform to extract frequency-domain features, directly normalizing the CWT coefficients to RGB images, compressing continuous time-frequency resolution information into a single image representation. Frequency-domain information is not fully explored and utilized, or its representation method suffers from information loss. Third, although some techniques have achieved interaction between frequency-domain and time-domain features, redundant information between modes is generated as a result. Redundancy control is not performed, which increases the learning burden of subsequent networks. Summary of the Invention

[0004] In view of the above situation, the main objective of this invention is to propose an ECG lead reconstruction method based on multi-domain feature interaction and clinical semantic modulation to solve the above-mentioned technical problems.

[0005] This invention proposes a method for ECG lead reconstruction based on multi-domain feature interaction and clinical semantic modulation, the method comprising the following steps: Step 1: Standardize the patient's structured numerical information to obtain a structured numerical information vector; encode the medication and comorbidities in the structured category information to obtain a medication vector and a comorbidity vector; concatenate the structured numerical information vector, medication vector, and comorbidity vector, and input them into the clinical semantic encoder to obtain a clinical semantic vector. Step 2: Perform bandpass filtering, Hilbert transform, and envelope extraction on the existing ECG signal in sequence to obtain the instantaneous envelope; perform threshold determination and refractory period verification on the sampling points corresponding to the instantaneous envelope in sequence to obtain the R wave position; divide the existing ECG signal according to the R wave position to obtain the global rhythm and local morphology. Step 3: Use the corresponding encoder to extract the features of the existing ECG signal, global rhythm and local morphology respectively, so as to obtain the lead feature vector, rhythm feature vector, morphological feature vector and frequency domain feature vector; Step 4: Selectively suppress or enhance the lead feature vector, rhythm feature vector, morphological feature vector, and frequency domain feature vector through a semantic gating mechanism to obtain the semantically gating feature vector. Step 5: Perform frequency-domain-based reverse enhancement, cross-attention enhancement, and interactive fusion processing on the semantically gated feature vectors to obtain the lead reconstruction vectors. Step 6: Based on the clinical semantic vector and lead reconstruction vector, the optimal lead reconstruction path fusion vector is generated through the execution path allocation mechanism; Step 7: Input the optimal lead reconstruction path fusion vector into the preset decoder for decoding to obtain the waveform of the missing ECG signal; use the waveform of the missing ECG signal as the ECG lead reconstruction result.

[0006] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. This invention introduces a clinical semantic vector jointly constructed from patient demographic characteristics, physical examination indicators, blood tests, medication records, and disease diagnoses. A semantic gating mechanism is then used to selectively suppress or enhance multi-domain features, enabling the reconstructed network to employ differentiated feature regulation strategies based on individual patient pathological information. This significantly improves the clinical readability and diagnostic value of the reconstructed signal.

[0007] 2. This invention proposes a two-stage fusion architecture of "frequency domain reverse enhancement first, and time domain three-branch cross-attention alignment later". First, it uses three types of micro time domain features, namely morphology, lead and rhythm, to refine macro frequency domain features in reverse, so that the frequency domain representation is refined from "average spectrum of the whole signal" to "conditional spectrum for the current heartbeat". Then, the frequency domain features anchored in the time domain are used as a unified key value benchmark to perform cross-attention enhancement on the three time domain features. In this way, a shared reference coordinate system is explicitly established among the four heterogeneous channels, so that each channel is in the same semantic space before entering the fusion layer, providing a well-aligned input representation for the linear mapping of the fusion layer.

[0008] 3. The clinical semantic path allocation mechanism proposed in this invention uses the patient's clinical semantic vector, rather than signal features, as the decisive input for path allocation. It then uses Top-k sparse weighted fusion to select the few key paths that best match the patient's pathological characteristics from multiple candidate paths. Simultaneously, the secondary paths, which are zeroed out by the sparse mechanism, avoid diluting the semantic contribution of the main path and significantly reduce the computational burden on the subsequent parallel decoder. Attached Figure Description

[0009] Figure 1The flowchart shows the ECG lead reconstruction method based on multi-domain feature interaction and clinical semantic modulation proposed in this invention. Figure 2 The flowchart shows the Hilbert detection algorithm for dividing global rhythm and local morphology in the ECG lead reconstruction method based on multi-domain feature interaction and clinical semantic modulation proposed in this invention. Figure 3 This is a schematic diagram illustrating the division of global rhythm and local morphology in the ECG lead reconstruction method based on multi-domain feature interaction and clinical semantic modulation proposed in this invention. Figure 4 This is a schematic diagram of the semantic gating mechanism of the ECG lead reconstruction method based on multi-domain feature interaction and clinical semantic modulation proposed in this invention; Figure 5 This is a schematic diagram of the reconstruction vector construction of existing leads in the ECG lead reconstruction method based on multi-domain feature interaction and clinical semantic modulation proposed in this invention. Figure 6 This is a schematic diagram illustrating the clinical semantic path allocation mechanism of the ECG lead reconstruction method based on multi-domain feature interaction and clinical semantic modulation proposed in this invention. Figure 7 This is a comparison diagram of the V5 lead waveform reconstruction without clinical semantic modulation and the actual waveform of the ECG lead reconstruction method based on multi-domain feature interaction and clinical semantic modulation proposed in this invention. Figure 8 This is a comparison diagram of the V5 lead waveform reconstruction and the actual waveform based on the ECG lead reconstruction method of multi-domain feature interaction and clinical semantic modulation proposed in this invention. Figure 9 This is a comparison diagram of the V6 lead waveform reconstruction without clinical semantic modulation and the actual waveform of the ECG lead reconstruction method based on multi-domain feature interaction and clinical semantic modulation proposed in this invention. Figure 10 This is a comparison diagram of the V6 lead waveform reconstruction and the actual waveform based on the ECG lead reconstruction method of multi-domain feature interaction and clinical semantic modulation proposed in this invention. Figure 11 This is a comparison of the local morphology of the V5 lead waveform reconstructed with and without clinical semantic modulation based on the ECG lead reconstruction method based on multi-domain feature interaction and clinical semantic modulation proposed in this invention. Figure 12 This is a comparison of the local morphology of the V6 lead waveform reconstructed with and without clinical semantic modulation, based on the ECG lead reconstruction method proposed in this invention, which is based on multi-domain feature interaction and clinical semantic modulation. Detailed Implementation

[0010] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0011] These and other aspects of the embodiments of the present invention will become clear from the following description and accompanying drawings. In these descriptions and drawings, some specific embodiments of the present invention are specifically disclosed to illustrate some ways of implementing the principles of the embodiments of the present invention; however, it should be understood that the scope of the embodiments of the present invention is not limited thereto.

[0012] Please see Figure 1 This invention proposes a method for reconstructing electrocardiogram (ECG) leads based on multi-domain feature interaction and clinical semantic modulation. The method includes the following steps: Step 1: Standardize the patient's structured numerical information to obtain a structured numerical information vector; encode the medication and comorbidities in the structured category information to obtain a medication vector and a comorbidity vector; concatenate the structured numerical information vector, medication vector, and comorbidity vector, and input them into the clinical semantic encoder to obtain a clinical semantic vector. In step 1, the patient's structured numerical information is standardized to obtain a structured numerical information vector; the medication and comorbidities in the structured category information are encoded separately to obtain a medication vector and a comorbidity vector; the structured numerical information vector, medication vector, and comorbidity vector are concatenated and input into the clinical semantic encoder to obtain a clinical semantic vector. The specific steps are as follows: The age in the patient's structured numerical information is processed by min-max normalization to obtain the normalized age; Z-Score standardization was applied to the BMI in the patient's structured numerical information to obtain a standardized BMI value; Z-score standardization was performed on the systolic and diastolic blood pressure in the patient's structured numerical information to obtain standardized systolic and diastolic blood pressure values, respectively. The standardized pulse pressure difference was then calculated using the systolic and diastolic blood pressure values. Z-Score standardization was performed on the blood potassium concentration in the structured numerical information to obtain the standardized blood potassium value; Z-Score normalization was performed on the blood calcium concentration in the structured numerical information to obtain the normalized blood calcium value; Z-Score normalization was performed on the blood magnesium concentration in the structured numerical information to obtain the normalized blood magnesium value; The binary discrete variables representing gender are encoded one-hot to obtain a two-dimensional gender vector. The normalized age, standardized BMI, standardized systolic blood pressure, standardized diastolic blood pressure, standardized pulse pressure, standardized serum potassium, standardized serum calcium, standardized serum magnesium, and the two-dimensional gender vector are concatenated to obtain a structured numerical information vector. Based on structured category information, a drug administration vector is constructed using predefined Boolean values; Comorbidity vectors are constructed based on structured category information and predefined multi-hot encoding. The clinical semantic encoder is used to concatenate the structured numerical information vector, the medication vector, and the comorbidity vector to obtain the clinical semantic vector.

[0013] In this step, the structured numerical information includes the patient's age, gender, BMI (height, weight), blood pressure, blood potassium, blood calcium, and blood magnesium levels. Age: Age is a crucial baseline factor influencing the morphology of electrocardiogram (ECG) waveforms. With increasing age, the function of the cardiac conduction system gradually declines, leading to prolonged PR intervals, widened QRS complexes, decreased sinoatrial node function, and lower baseline heart rate in elderly patients. Age is a continuous numerical variable, ranging from 0 to 120 years. In this invention, Min-Max normalization is used to scale it to the [0,1] interval. Specifically, in the process of applying Min-Max normalization to the patient's structured numerical age information to obtain the normalized age, the following relationship exists: ; in, This represents the normalized age value. This indicates the current age of the patient. This represents the maximum age of all patients in the dataset. This represents the minimum age of all patients in the dataset.

[0014] The gender is a binary discrete variable (male / female). In this invention, males are encoded as [1,0] and females are encoded as [0,1], and recorded using a gender vector.

[0015] The BMI reflects the patient's body shape characteristics. In obese patients, an elevated BMI is due to thickened chest wall adipose tissue, leading to attenuation of ECG signals, decreased voltage in limb leads, and potentially left axis deviation. BMI is a continuous numerical variable, and the value range in this invention is 15-50 kg / m². Specifically, in the process of Z-Score standardization of the BMI in the patient's structured numerical information to obtain the standardized BMI value, the following relationship exists: ; in, This represents the standardized BMI value. This represents the patient's original BMI value. This represents the average BMI in the dataset. This represents the standard deviation of BMI for all patients in the dataset.

[0016] Hypertension leads to ventricular hypertrophy, which manifests on electrocardiograms as high voltage QRS complexes, ST segment depression, and characteristic T wave inversion. The blood pressure includes two continuous numerical variables: systolic blood pressure (SBP) and diastolic blood pressure (DBP). Additionally, pulse pressure (PP, the difference between systolic and diastolic blood pressure) is calculated as a third derived feature. Specifically, Z-score standardization is performed on the systolic and diastolic blood pressures in the patient's structured numerical information to obtain standardized systolic and diastolic blood pressure values, respectively. The following relationship exists in the calculation of the standardized pulse pressure using systolic and diastolic blood pressures: ; in, This represents the standardized systolic blood pressure value. This indicates the patient's original systolic blood pressure value. This represents the mean systolic blood pressure of all patients in the dataset. This represents the standard deviation of systolic blood pressure for all patients in the dataset. This represents the standardized diastolic blood pressure value. This indicates the patient's original diastolic blood pressure value. This represents the mean diastolic blood pressure of all patients in the dataset. This represents the standard deviation of diastolic blood pressure for all patients in the dataset. This represents the standardized pulse pressure difference value. This represents the mean pulse pressure of all patients in the dataset. This represents the standard deviation of pulse pressure across all patients in the dataset.

[0017] Serum potassium concentration has a significant impact on the repolarization process of myocardial cells; hyperkalemia can cause peaked T waves, widened QRS complexes, and even sinusoidal waveforms; hypokalemia manifests as flattened T waves, the appearance of U waves, and prolonged QT intervals. In this invention, serum potassium levels are set as continuous numerical variables, with a normal reference range of 3.5–5.5 mmol / L. Specifically, in the process of Z-score standardization of serum potassium concentration in structured numerical information to obtain standardized serum potassium values, the following relationship exists: ; in, This represents the standardized serum potassium level. This indicates the patient's blood potassium concentration. This represents the mean serum potassium level of all patients in the dataset. This represents the standard deviation of serum potassium levels across all patients in the dataset.

[0018] Serum calcium levels primarily affect the QT interval on an electrocardiogram (ECG). Hypercalcemia leads to a shortened QT interval, with significant ST segment shortening, while hypocalcemia prolongs the QT interval. In this invention, serum calcium levels are set as a continuous numerical variable, with a normal reference range of 2.1–2.7 mmol / L. Specifically, in the process of Z-score standardization of the serum calcium concentration in the structured numerical information to obtain the standardized serum calcium value, the following relationship exists: ; in, This represents the standardized blood calcium level. This indicates the patient's original blood calcium concentration. This represents the mean blood calcium level of all patients in the dataset. This represents the standard deviation of blood calcium levels across all patients in the dataset.

[0019] Serum magnesium levels: Abnormal serum magnesium concentrations coexist with abnormal serum potassium levels, and together they have a synergistic effect on electrocardiogram waveforms. Hypomagnesemia can lead to QT interval prolongation, T wave morphology changes, and an increased risk of arrhythmias. In this invention, serum magnesium levels are set as a continuous numerical variable, with a normal reference range of 0.7–1.1 mmol / L. Specifically, in the process of Z-score standardization of serum magnesium concentration in structured numerical information to obtain standardized serum magnesium values, the following relationship exists: ; in, This represents the standardized blood magnesium level. This indicates the patient's original blood magnesium concentration. This represents the mean serum magnesium level of all patients in the dataset. This represents the standard deviation of blood magnesium levels across all patients in the dataset.

[0020] The normalized age, standardized BMI, standardized systolic blood pressure, standardized diastolic blood pressure, standardized pulse pressure, standardized serum potassium, standardized serum calcium, standardized serum magnesium, and gender two-dimensional vectors are concatenated to obtain a structured numerical information vector. The corresponding process includes the following relationship: ; in, Represents a structured numerical information vector. This indicates a splicing operation. Represents the gender vector.

[0021] It should be noted that in real-world scenarios, due to various limitations, it is sometimes impossible to comprehensively obtain a patient's age, gender, BMI (height and weight), blood pressure, serum potassium, serum calcium, and serum magnesium levels. For different types of numerical features, this invention employs the following missing value imputation strategy: For basic demographic information such as age and sex, since these are almost never missing in clinical records, any missing data will result in the sample being removed. For BMI, if height or weight data is missing, the median BMI in the dataset will be used to fill the gap. For blood pressure values, if missing, the median of the corresponding indicator in the dataset will also be used to fill the gap; pulse pressure (PP) will be calculated from the filled SBP and DBP. For blood electrolyte indicators (serum potassium, serum calcium, serum magnesium), if missing, the median of their normal reference range will be used to fill the gap. , , The reference range median was chosen instead of the dataset mean because electrolyte deficiency often means that the clinical suspicion of abnormality of the indicator is not present, and filling with the normal median is more in line with clinical prior.

[0022] The structured category information includes two categories: medication and comorbidities. Medication information uses multi-hot encoding, recording each patient's current medication using a binary vector. To reduce the overall complexity of this method, this invention excludes rarely used medications and medications that do not affect ECG waveforms, selecting the following eight commonly used medications in clinical practice. Specifically, in the process of constructing the medication vector based on structured category information using predefined Boolean values, the following relationship exists: ; in, This represents the vector indicating drug administration. This represents a predefined Boolean value corresponding to the first drug category information. This represents a predefined Boolean value corresponding to the second drug category information. This represents a predefined Boolean value corresponding to the information of the eighth drug category; Furthermore, The corresponding drugs and their effects on electrocardiogram waveforms are shown in Table 1.

[0023] Table 1. Correspondence between drug categories and coding dimensions

[0024] Information on comorbidities is encoded using multi-hot encoding. Similarly, to reduce the overall model size, this invention selects eight common comorbidities that affect ECG waveforms in clinical practice. A binary vector is used to record the current comorbidities for each patient. To reduce the overall complexity of this method, after reviewing the literature, rare diseases and comorbidities that do not affect ECG waveforms were excluded, and the following eight common comorbidities widely used in clinical practice were selected. Specifically, in the process of constructing the comorbidity vector based on structured category information and predefined multi-hot encoding, the following relationship exists: ; in, Represents the comorbidity vector. This represents a predefined Boolean value corresponding to the first comorbidity. This represents a predefined Boolean value corresponding to the second comorbidity. This represents a predefined Boolean value corresponding to the eighth comorbidity. Furthermore, The corresponding complications and their effects on electrocardiogram waveforms are shown in Table 2.

[0025] Table 2. Correspondence between comorbidities and coding dimensions

[0026] Structured numerical vectors With structured category vectors ( , The data is directly concatenated and then input into the clinical semantic encoder. To obtain the clinical semantic vector , It is a three-dimensional vector, a clinical semantic encoder. Its function is to map the concatenated 26-dimensional vector into a 3-dimensional clinical semantic vector. This compresses redundant information in structured numerical vectors and structured category vectors, while enhancing differentiated features.

[0027] It should be further explained that in this invention, the clinical semantic encoder is implemented using a fully connected multilayer perceptron (MLP). Since its input is a concatenated 26-dimensional vector and its output is a 3-dimensional clinical semantic vector, the encoder consists of three fully connected layers connected sequentially: the first fully connected layer maps the 26-dimensional input to 16 dimensions, the second fully connected layer maps the 16-dimensional input to 8 dimensions, and the output fully connected layer maps the 8-dimensional input to 3 dimensions. Regarding the activation function, ReLU activation is applied after both hidden fully connected layers to introduce non-linearity, and a Sigmoid activation function is applied after the output fully connected layer, constraining each dimension of the 3D clinical semantic vector to the interval between 0 and 1, making it interpretable as the normalized activation intensity corresponding to the latent clinical semantic axis. In terms of regularization strategy, this invention inserts a one-dimensional batch normalization layer between each hidden fully connected layer and its ReLU activation to stabilize training and accelerate convergence, and applies a dropout with a dropout rate of 0.2 after each hidden layer activation to suppress overfitting. The clinical semantic encoder is jointly trained end-to-end with the entire network using the missing lead reconstruction loss as a unified supervision signal, without the need for separate labeling.

[0028] It should be further noted that the relatively high compression ratio of compressing the concatenated 26-dimensional vector into a 3-dimensional clinical semantic vector has a clear theoretical basis, as follows: From the perspective of feature redundancy, the 26-dimensional original vector obtained by splicing contains a large amount of correlation and redundancy, and its intrinsic dimension is much lower than 26. In the structured numerical information, pulse pressure is linearly derived from systolic and diastolic blood pressure, and there is a linear correlation among the three. Blood potassium, blood calcium, and blood magnesium are all blood electrolyte indicators and often change synergistically in clinical practice. In the structured category information, the 8-dimensional drug administration vector and the 8-dimensional comorbidity vector are both sparse multi-heat encodings, and there are strong pathological associations between the two and between them and numerical indicators. For example, the use of diuretics, hypokalemia, and heart failure are highly correlated. Therefore, the encoder compresses the 26-dimensional redundant representation into a low-dimensional representation, which is essentially to remove the redundant information brought about by the above linear correlation and pathological co-occurrence, consistent with the design goal of "compressing redundant information and enhancing differentiated features" stated in the manual. From the perspective of information bottleneck, the clinical semantic encoder acts as an information bottleneck layer in the network. Its role is to extract the minimum sufficient representation that affects the ECG waveform from all structured clinical information, and to filter out patient individual variations and acquisition noise that are not related to ECG lead reconstruction during the compression process. A higher compression ratio forces the encoder to retain only the semantic information that is truly discriminative for downstream gating and path allocation, thereby improving the compactness and generalization ability of the learned semantic representation.

[0029] Furthermore, The term "clinical semantic vector" has two layers of meaning. "Clinical" refers to the fact that all this information originates from patient data available in clinical practice—demographic characteristics, physical examination indicators, blood tests, medication records, and disease diagnoses—rather than the electrocardiogram (ECG) signal itself. This constitutes the indispensable clinical context for interpreting ECGs. "Semantic" emphasizes that this vector is not a simple stacking of raw data, but a semantic-level representation after standardization, encoding, and encoder compression. Each dimension carries information with clear pathological significance for the ECG waveform.

[0030] Step 2: Perform bandpass filtering, Hilbert transform, and envelope extraction on the existing ECG signal in sequence to obtain the instantaneous envelope; perform threshold determination and refractory period verification on the sampling points corresponding to the instantaneous envelope in sequence to obtain the R wave position; divide the existing ECG signal according to the R wave position to obtain the global rhythm and local morphology. In step 2, the existing ECG signal is sequentially subjected to bandpass filtering, Hilbert transform, and envelope extraction to obtain the instantaneous envelope; the sampling points corresponding to the instantaneous envelope are sequentially subjected to threshold determination and refractory period verification to obtain the R-wave position; the existing ECG signal is divided according to the R-wave position to obtain the global rhythm and local morphology. The specific steps are as follows: The existing electrocardiogram signal is filtered using a bandpass filter to obtain the filtered signal; The filtered signal is subjected to Hilbert transform to obtain the assembled complex signal; Calculate the modulus of the assembled complex signal to obtain the instantaneous envelope; By comparing the instantaneous envelope point by point using a preset envelope signal threshold, sampling points corresponding to instantaneous envelopes that are not lower than the preset envelope signal threshold are selected to obtain the R-wave candidate point set. The time interval between adjacent candidate points in the R-wave candidate point set is verified in chronological order, and candidate points with time intervals less than the judgment threshold are removed to obtain the R-wave candidate point set that passes the verification. The R-wave position is determined by verifying the set of candidate R-wave points; the R-wave position is used to extract a waveform segment of a preset time window size from the original ECG signal to obtain the local morphology; at the same time, all R-wave positions are marked as time scales to obtain the global rhythm.

[0031] Please see Figure 2 and Figure 3 In this step, bandpass filtering is performed: the raw ECG signal is filtered using a bandpass filter with a passband of 5-20Hz to remove electromyographic noise, power line interference, and baseline drift, highlighting the QRS band. The resulting filtered signal is... ,in Represents a time variable. It itself represents the filtered signal.

[0032] The filtered signal is subjected to Hilbert transform to obtain the assembled complex signal. The corresponding process has the following relationship: ; in, This represents the complex signal assembled at time t. Indicates the imaginary part. This represents the filtered signal at time t. This represents the operator processing that applies the Hilbert transform to the signal. express The filtered signal at each moment; This represents the internal integration variable, i.e., the index of the time step. The constant representing normalization, This indicates taking the infinitesimal with respect to the integral variable. The index represents the time point; it should be noted that this formula treats singularities as principal values ​​when performing integration.

[0033] Envelope extraction: The assembled complex signal is compressed into a real-valued curve that only reflects the instantaneous amplitude, making the QRS peak appear as a prominent spike on this curve, while low-amplitude components such as P-waves, T-waves, and noise are relatively suppressed. Specifically, the modulus of the assembled complex signal is calculated to obtain the instantaneous envelope, and the corresponding process has the following relationship: ; in, This represents the instantaneous envelope.

[0034] Threshold determination: in the envelope Candidate QRS wave positions are detected. For each sampling point in the sample, compare them point by point. Marked as candidate points for R-wave; if If any of these are identified as noise, they will be discarded; It is an envelope signal The threshold. A fixed threshold is used in this invention. This setup can filter out residual noise and significantly reduce the number of candidate points, thus easing the burden on subsequent processes. Refractory period verification; for the R-wave candidate points obtained from the threshold determination, check the time interval between adjacent candidate points one by one in chronological order. ,if If the current candidate point is determined to be a "false candidate", candidate suppression is performed, i.e., the point is discarded, and the feedback loop is used to return to the previous level for processing; if Then proceed to step six to confirm the true R-wave location; Confirming R-wave location: In the raw ECG signal, a time window is extracted before and after each R-wave location. In this invention, the window is taken from 250ms before the R-wave to 400ms after the R-wave, resulting in a complete P-QRS-T waveform segment, which is the local morphology. All R-wave locations are marked as a series of time scales. Figure 3 The upward arrows form a "pulse sequence" that retains only the information of "when a heartbeat occurred", with a uniform amplitude of 1, which is the global rhythm.

[0035] Step 3: Use the corresponding encoder to extract the features of the existing ECG signal, global rhythm and local morphology respectively, so as to obtain the lead feature vector, rhythm feature vector, morphological feature vector and frequency domain feature vector; In step 3, the corresponding encoders are used to extract features from the existing ECG signal, global rhythm, and local morphology to obtain lead feature vectors, rhythm feature vectors, morphological feature vectors, and frequency domain feature vectors. The specific steps are as follows: The existing ECG signal is input into the lead encoder to obtain the lead feature vector; The global rhythm is input into the global rhythm encoder to obtain the rhythm feature vector; The local morphology is input into the local morphology encoder to obtain the morphological feature vector.

[0036] The existing electrocardiogram signal is input into the frequency domain encoder to obtain the frequency domain feature vector.

[0037] It should be noted that the frequency domain encoder The frequency domain encoder consists of five sequentially connected convolutional layers, one global pooling layer, and one fully connected output layer, with all structural parameters set to fixed values ​​beforehand. The frequency domain encoder takes the one-dimensional time-domain ECG waveform of the i-th existing lead within an analysis window as input. This input is a single-channel one-dimensional sequence, with a length of 1024 sampling points in this invention; that is, the input tensor has a shape of one channel and 1024 sampling points. No explicit spectral transformations such as Fourier transform or short-time Fourier transform are performed before the input. All transformations from the time-domain waveform to the frequency-domain feature vector are completed within the network via forward convolution. The first layer of the frequency domain encoder is an initial filtering layer, which is a one-dimensional convolutional layer with one input channel, 64 output channels, a kernel length of 15, and a stride of 1. During convolution, 7 zeros are padded at both ends to maintain the sequence length. The 64 convolutional kernels in this layer are equivalent to 64 filters of fixed length. The convolution output of each kernel on the input waveform reflects the frequency component in the waveform corresponding to that kernel. In order to make the output reflect the energy of each frequency component without being affected by the phase, the absolute value of the output is taken point by point after the convolution, and then it is subjected to a batch normalization with 64 channels. Finally, it is subjected to a max pooling with a window length of 2 and a stride of 2 to compress the sequence length from 1024 to 512. Thus, a set of initial frequency domain features reflecting the energy of different frequency components can be obtained directly from the time domain waveform inside the network. This is the basis for the frequency domain representation extracted from inside the encoder in this invention. Following the initial filtering layer, the frequency domain encoder stacks four identical convolutional layers in sequence. Each layer consists of one-dimensional convolution, batch normalization, modified linear unit activation function (MRU), and max pooling, with all parameters pre-fixed. The second convolutional layer has 64 input channels, 128 output channels, a kernel length of 9, a stride of 1, and is padded with 4 zeros at both ends. After batch normalization, MRU activation, and max pooling with a window length of 2 and a stride of 2 for 128 channels, the sequence length is compressed from 512 to 256. The third convolutional layer has 128 input and output channels, a kernel length of 9, a stride of 1, and is padded with 4 zeros at both ends. After the same batch normalization, activation, and max pooling, the sequence length is compressed from... The sequence length is compressed from 128 to 128. The fourth convolutional layer has 128 input channels, 256 output channels, a kernel length of 7, a stride of 1, and is padded with 3 zeros at both ends. After batch normalization, activation, and max pooling with 256 channels, the sequence length is compressed from 128 to 64. The fifth convolutional layer has 256 input and output channels, a kernel length of 7, a stride of 1, and is padded with 3 zeros at both ends. After the same batch normalization, activation, and max pooling, the sequence length is compressed from 64 to 32. In this process of stacking layers, each max pooling not only halves the time dimension length but also expands the equivalent coverage of the next layer's convolutional kernel on the original waveform layer by layer. This allows the output of deeper convolutional layers to reflect features over a longer time span, i.e., lower frequency components. After the five convolutional layers described above, the output of the last convolutional layer is a feature sequence with 256 channels and a length of 32. The frequency domain encoder performs a global average pooling along the time dimension, compressing the 32-length sequence in each channel into a single value, resulting in a vector of length 256. This vector is then linearly projected through a fully connected layer that maps from 256 dimensions to 128 dimensions, and the projection result is normalized once to obtain the frequency domain feature vector of the i-th existing lead. In this invention, the length of this frequency domain feature vector is set to 128 dimensions, the same as the length of the lead feature vector, rhythm feature vector, and morphological feature vector. In terms of training, the frequency domain encoder is not pre-trained separately. Instead, it is integrated as a sub-module within the ECG lead reconstruction network, and is jointly trained end-to-end with the lead encoder, global rhythm encoder, local morphological encoder, clinical semantic encoder, semantic gating module, multi-domain interaction fusion module, and decoder. During training, only the weights of the convolutional kernels in the five convolutional layers and the weights of the fully connected output layer are updated. The structural parameters, such as the number of convolutional layers, the length and number of convolutional kernels in each layer, the pooling window and stride, and the dimension of the output vector, are all determined and remain unchanged before training. During training, the error between the reconstructed missing lead waveform and the actual waveform is used as the loss function. Minimizing this loss optimizes the entire network, including the frequency domain encoder. Similarly, the present invention relates to lead encoders. E Global rhythm encoder E rhythm and local shape encoder E morphology All three encoders employ a fixed structure and preset parameters, sharing the same set of hyperparameters: the number of convolutional layers, the number of output channels in each convolutional block, the kernel size, the pooling window, and the stride. These parameters are all preset and remain unchanged before end-to-end training. The differences between the three lie in the different physical meanings of the input objects they process and the different durations of the input sequences. The three encoders share the same main structure: each encoder consists of four cascaded one-dimensional convolutional blocks, a global average pooling layer, and a fully connected layer. Each convolutional block is composed of one-dimensional convolution, one-dimensional normalization, and modified linear unit activation, followed by a max pooling layer with a window length of 2 and a stride of 2. The output channels of the four convolutional blocks are 64, 128, 128, and 256, respectively, and the kernel lengths are 7, 5, 3, and 3, respectively, with a stride of 1 for each. Zeros are padded at both ends to maintain the sequence length before pooling. The final global average pooling compresses each channel into a single value along the time dimension, resulting in a vector of length 256. This vector is then linearly projected onto a fully connected layer that maps from 256 dimensions to 128 dimensions and applies a layer normalization, ultimately outputting a 128-dimensional feature vector. The lead encoder takes the one-dimensional time-domain waveform of the i-th existing lead within the analysis window as input. Its input is the same as the frequency-domain encoder input: one channel and 1024 sampling points. It outputs the lead feature vector of that lead. The global rhythm encoder takes the global rhythm segmented in step 2 based on the Hilbert detection algorithm as input, taking only unit amplitude at each R-wave position and zero at all other points, outputting the rhythm feature vector of that lead. The local morphology encoder takes the local morphology segmented in step 2 based on the Hilbert detection algorithm as input, specifically the single-channel local morphology truncated from 250 ms before the R-wave to 400 ms after the R-wave, centered at each R-wave position. This encoder encodes each beat segment within the window into a 128-dimensional beat-by-beat vector, obtaining the morphological feature vector of that lead. The lead feature vector, rhythm feature vector, and morphological feature vector are all 128-dimensional. These three encoders are consistent with the frequency domain feature vector, thereby ensuring that the four features can complete element-wise operations and attention operations in the same dimension in subsequent semantic gating, cross-domain interaction and sparse path allocation; Similarly, the three encoders mentioned above are not pre-trained separately, but are jointly trained end-to-end with the frequency domain encoder, clinical semantic encoder, semantic gating module, multi-domain feature interaction module, path subnet and parallel decoder group, using the missing lead reconstruction loss as a unified supervision signal.

[0038] Step 4: Selectively suppress or enhance the lead feature vector, rhythm feature vector, morphological feature vector, and frequency domain feature vector through a semantic gating mechanism to obtain the semantically gating feature vector. In step 4, the lead feature vector, rhythm feature vector, morphological feature vector, and frequency domain feature vector are selectively suppressed or enhanced through a semantic gating mechanism to obtain the semantically gating feature vector. The specific steps are as follows: The clinical semantic vectors were subjected to four independent single-layer linear transformations to obtain the gating vectors of morphological feature vectors, frequency domain feature vectors, lead feature vectors, and rhythm feature vectors, respectively. Hadamard products are applied to the morphological feature vector, frequency domain feature vector, lead feature vector, and rhythm feature vector using gating vectors of morphological feature vector, frequency domain feature vector, lead feature vector, and rhythm feature vector, respectively, to obtain semantically gated morphological feature vector, semantically gated frequency domain feature vector, semantically gated lead feature vector, and semantically gated rhythm feature vector, respectively.

[0039] Please see Figure 4 This step involves analyzing the lead feature vectors. Rhythmic feature vector morphological feature vectors Frequency domain eigenvectors Compared with the clinical semantic vector output in step one The purpose of semantic gating is to selectively suppress or enhance each dimension to achieve clinically driven feature purification. Specifically, the clinical semantic vector is subjected to four independent single-layer linear transformations to obtain gating vectors for morphological feature vectors, frequency domain feature vectors, lead feature vectors, and rhythm feature vectors, respectively. The corresponding process includes the following relationships: ; in, The weights of the morphological feature vectors are represented. The weights represent the eigenvectors in the frequency domain. The weights of the lead eigenvectors are represented. The weights represent the rhythmic feature vectors. Represents a clinical semantic vector (3-dimensional). The basic offset representing the morphological feature vector is independent of clinical semantics. The basic offset representing the frequency domain feature vector is independent of clinical semantics. This represents the basic offset of the lead feature vector that is independent of clinical semantics. The underlying offset that represents the rhythmic feature vector is independent of clinical semantics; This indicates activation function processing, which ensures that the output strictly falls between 0 and 1; A gate vector representing a morphological feature vector. The gate vector represents the frequency domain eigenvector. The gate vector representing the characteristic vector of the lead. A gate vector representing the rhythmic feature vector; , , , They have the same structure but independent parameters and are responsible for mapping the 3D clinical semantic vector to the gating dimensions of the four feature channels. , , , Used to adjust the numerical center before the function is activated; By utilizing the gating vectors of morphological feature vectors, frequency domain feature vectors, lead feature vectors, and rhythm feature vectors respectively, Hadamard products are applied to the morphological feature vectors, frequency domain feature vectors, lead feature vectors, and rhythm feature vectors to obtain semantically gated morphological feature vectors, semantically gated frequency domain feature vectors, semantically gated lead feature vectors, and semantically gated rhythm feature vectors. The corresponding process includes the following relationships: ; in, This represents the morphological feature vector after semantic gating of the i-th existing lead. Let represent the frequency domain feature vector of the i-th existing lead after semantic gating. Let represent the semantically gated feature vector of the i-th existing lead. Let represent the rhythm feature vector after semantic gating of the i-th existing lead. This represents the morphological feature vector of the i-th existing lead. This represents the frequency domain eigenvector of the i-th existing lead. Let represent the feature vector of the i-th existing lead. This represents the rhythm feature vector of the i-th existing lead; It represents the Hadamah accumulation. This indicates that there is already a lead number, and represents a binary operation of element-wise multiplication between two vectors, matrices, or tensors of the same shape.

[0040] Furthermore, to clearly demonstrate the selective suppression or enhancement effect of the semantic gating mechanism on various dimensions, an example is provided here: Patient information: 55-year-old female, normal BMI, normal blood pressure, serum potassium level 2.8 mmol / L (below the lower limit of 3.5 mmol / L to 5.5 mmol / L), normal serum calcium and magnesium levels; medication: diuretic. The rest were 0; comorbidities: heart failure, i.e. The rest are 0; Based on the above information, this patient's electrocardiogram should show T-wave flattening, U-wave appearance, and QT interval prolongation. The clinical semantic encoder outputs the semantic vector as follows: In this embodiment, each feature channel is set to have a dimension of 8, and after passing through four independent linear layers and sigmoid activation, the following is obtained: ; ; ; ; The gating vectors corresponding to the morphological features can be observed. The mean value is approximately 0.93, because low potassium primarily affects the morphology of waveforms such as the T wave, U wave, and QT interval; while the rhythm corresponds to the gating vector of the characteristic vector. The mean value is approximately 0.19, because the patient had no arrhythmia, and the rhythm information had low reference value for this reconstruction. After the Hadamard product, 93% of the energy through the morphological feature channel will be retained, the energy through the rhythm feature channel will be suppressed to 19% of the initial value, and the energy through the frequency domain feature channel and the energy through the lead feature channel will be moderately retained, approximately 80% and 60% of the initial value, respectively. Using the same set of network parameters, but employing completely different clinical semantic feature modulation strategies based on the pathological information of different patients, is the essence of clinical semantic modulation and the core innovation of this invention that distinguishes it from traditional ECG lead reconstruction methods.

[0041] Step 5: Perform frequency-domain-based reverse enhancement, cross-attention enhancement, and interactive fusion processing on the semantically gated feature vectors to obtain the lead reconstruction vectors. In step 5, the semantically gated feature vectors are sequentially subjected to frequency-domain-based reverse enhancement, cross-attention enhancement, and interactive fusion processing to obtain the lead reconstruction vectors. The specific steps are as follows: The semantically gated morphological feature vector, semantically gated lead feature vector, and semantically gated rhythm feature vector are concatenated along the feature dimension, and then a trainable linear transformation is used to generate key vectors and value vectors; at the same time, the semantically gated frequency domain feature vector is used as the query subject to generate query vectors. Using key vectors, value vectors, and query vectors, the semantically gated frequency domain feature vectors are inversely enhanced to obtain enhanced frequency domain feature vectors. The enhanced frequency domain eigenvectors are used as the basis for key values ​​to generate shared key matrices and shared value matrices; Based on the semantically gated morphological feature vector, the semantically gated lead feature vector, and the semantically gated rhythm feature vector, query matrices for morphological branches, lead branches, and rhythm branches are generated, respectively. Using the query matrix of morphological branch, query matrix of lead branch, query matrix of rhythm branch, shared key matrix and shared value matrix, cross-attention enhancement is performed on the semantically gated morphological feature vector, semantically gated lead feature vector and semantically gated rhythm feature vector in residual form to obtain the enhanced morphological feature vector, enhanced lead feature vector and enhanced rhythm feature vector respectively. The enhanced frequency domain feature vector, enhanced morphological feature vector, enhanced lead feature vector, and enhanced rhythm feature vector are interactively fused to obtain the lead reconstruction vector.

[0042] Please see Figure 5The semantically gated morphological feature vector, semantically gated lead feature vector, and semantically gated rhythmic feature vector are concatenated along the feature dimension, and then a trainable linear transformation is applied to generate key and value vectors. Simultaneously, a query vector is generated using the semantically gated frequency domain feature vector as the query subject. The corresponding process includes the following relationship: ; in, This represents the linearly transformable weight matrix corresponding to the generated key vector. This represents the linearly transformable weight matrix corresponding to the generated query vector. This represents the linearly transformable weight matrix corresponding to the generated value vector. Represents the key vector. Represents the query vector. Represents a value vector; n The first letter of the key indicates that the corresponding target is a key vector; q The first letter of the query indicates that the corresponding target is the query vector; f The first letter indicates the frequency domain, signifying that the corresponding variable originates from the enhanced frequency domain characteristics; l It is an abbreviation for "lead," referring to the link itself. r The first letter of "rhythm" indicates the branch of rhythmic characteristics; x The first letter of the value matrix indicates that the corresponding weight matrix applies to the value matrix. This indicates that the corresponding variables originate from the time-domain aggregation of the signal; In the process of using key vectors, value vectors, and query vectors to perform reverse enhancement on the semantically gated frequency domain feature vector to obtain the enhanced frequency domain feature vector, the following relationship exists: ; in, This represents the enhanced frequency domain eigenvector of the i-th existing lead. Indicates the transpose symbol. This represents the transpose of the key vector. The feature dimension scalar representing single-head attention; In the process of using the enhanced frequency domain eigenvectors as the basis for key values ​​to generate shared key matrices and shared value matrices, the following relationship exists: ; in, Represents the shared key matrix. Represents a shared-value matrix. This represents the trainable linear transformation weight matrix used to generate the shared key matrix. This represents the trainable linear transformation weight matrix used to generate the shared value matrix; Based on the semantically gated morphological feature vector, semantically gated lead feature vector, and semantically gated rhythm feature vector, query matrices for morphological branches, lead branches, and rhythm branches are generated, respectively. The corresponding process includes the following relationships: ; in, The query matrix represents the morphological branching. The query matrix represents the lead branches. The query matrix representing the rhythm branches. This represents the trainable linear transformation weight matrix used in the query matrix that generates morphological branches. This represents the trainable linear transformation weight matrix used in the query matrix that generates lead branches. This represents the trainable linear transformation weight matrix used in the query matrix that generates the rhythmic branches. express The abbreviation refers to a branch of morphological features; Using the query matrices of the morphological branch, lead branch, and rhythm branch, as well as the shared key and shared value matrices, cross-attention enhancement is performed on the semantically gated morphological feature vector, semantically gated lead feature vector, and semantically gated rhythm feature vector in residual form, respectively, to obtain the enhanced morphological feature vector, enhanced lead feature vector, and enhanced rhythm feature vector. The corresponding process includes the following relationship: ; in, This represents the enhanced morphological feature vector of the i-th existing lead. This represents the enhanced feature vector of the i-th existing lead. This represents the enhanced rhythm feature vector of the i-th existing lead. Represents the transpose of the shared key matrix; In the process of interactively fusing the enhanced frequency domain feature vector, the enhanced morphological feature vector, the enhanced lead feature vector, and the enhanced rhythm feature vector to obtain the lead reconstruction vector, the following relationship exists: ; in, Let represent the lead reconstruction vector of the i-th existing lead. This represents the trainable linear transformation weight matrix of the fusion layer. This represents the trainable bias vector of the fusion layer.

[0043] It is important to note that traditional ECG lead reconstruction methods typically perform feature fusion only in a single time domain or frequency domain, or fuse multi-domain features using simple feature stitching combined with a single linear projection layer. Their shortcomings are mainly twofold: First, the complementary relationships between features from different domains are not explicitly modeled, and the inherent coupling between the overall spectral energy distribution carried by the frequency domain features and the peak and band time-series information carried by the time domain features is directly discarded. Second, no cross-domain alignment mechanism is introduced during the fusion stage, resulting in the directly stitched features being heterogeneous in physical meaning across all dimensions, making it difficult for subsequent linear layers to learn stable mapping relationships in this heterogeneous space.

[0044] The two-stage design proposed in step five of this invention, which involves "frequency domain reverse enhancement first, and time domain three-branch cross-attention alignment later," has clear physical and engineering significance: frequency domain characteristics The description depicts the energy distribution of an ECG signal across the overall spectrum, independent of the location of specific peaks and troughs, representing a "macro" characterization of the signal. In contrast, morphology, rhythm, and lead characteristics are essentially "micro" descriptions indexed by time. First, the macroscopic frequency domain characteristics are refined using these three micro-time domain characteristics, equivalent to injecting a time-domain context corresponding to the specific state of the current heartbeat into the frequency domain vector, refining it from the "average spectrum of the entire signal" to the "conditional spectrum specific to the current heartbeat." Then, this time-anchored spectral characteristic... Using a unified key value benchmark to enhance the three types of temporal features—morphology, lead, and rhythm—is equivalent to explicitly establishing a shared reference coordinate system among the four heterogeneous channels. This ensures that each channel is already in the same semantic space before entering the fusion layer, thus providing a well-aligned input representation for the linear mapping of the fusion layer.

[0045] It should be noted that, in Figure 5 middle, Indicates a lead encoder. This represents a global rhythm encoder. This represents a local morphological encoder. This indicates a frequency domain encoder.

[0046] Step 6: Based on the clinical semantic vector and lead reconstruction vector, the optimal lead reconstruction path fusion vector is generated through the execution path allocation mechanism; In step 6, based on the clinical semantic vector and the lead reconstruction vector, an optimal lead reconstruction path fusion vector is generated through an execution path allocation mechanism. The specific steps are as follows: Input clinical semantic vectors into the path subnet L To obtain the path score vector ; Path scoring vector Perform Softmax normalization to obtain the original weight distribution; The components in the original weight distribution are sorted from largest to smallest, and the lead indices corresponding to the first predetermined number of components are extracted to obtain an index set. ; The lead weights in the index set are normalized to obtain a normalized index set. The lead reconstruction vectors are sparsely weighted and fused using the weight vectors of the normalized index set to obtain the optimal lead reconstruction path fusion vector.

[0047] It should be further explained that in this invention, the path subnetwork is implemented using a three-layer fully connected multilayer perceptron (MLP). Its input dimension is consistent with the dimension of the clinical semantic vector, and its output dimension is consistent with the total number of existing leads. Specifically, the input layer of the path subnetwork receives a 3D clinical semantic vector. The first hidden layer contains 32 neurons, and the second hidden layer contains 64 neurons. Both hidden layers use the ReLU activation function, and a dropout rate of 0.2 is applied between the hidden layers to suppress overfitting. The output layer contains i neurons, where i is the total number of existing leads. No activation function is applied to the output layer; it directly outputs an i-dimensional path score vector, which serves as the input logarithm for subsequent Softmax normalization. In other words, the path subnetwork maps the 3D clinical semantic vector layer by layer into a path score vector with a length equal to the number of existing leads. The k-th component of the vector represents the degree of matching between the reconstructed path corresponding to the k-th existing lead and the current patient's clinical semantics.

[0048] by Figure 6 Taking the illustrated embodiment as an example, the existing number of ECG leads is 5, corresponding to leads I, II, III, V1, and V5 respectively. Therefore, the output layer dimension of the path subnet is set to 5. When the input clinical semantic vector is (0.34, 0.78, 0.29), after mapping by the above path subnet, a 5-dimensional path scoring vector [1.20, 3.50, 0.80, 0.50, 3.20] is output. Subsequently, this scoring vector undergoes Softmax normalization, sparse selection, and sparse renormalization to complete the path allocation. It should be noted that the number of layers and neurons in the above hidden layer is a relatively optimal value. Those skilled in the art can adjust it within a similar range according to the existing number of leads i and the data scale. Alternatively, the above MLP can be replaced with an MLP structure with residual connections, etc., to achieve the function of obtaining the path scoring vector while ensuring that the input dimension is consistent with the clinical semantic vector and the output dimension is consistent with the total number of existing leads.

[0049] Further explanation is needed regarding the training method of the path subnet: the path subnet is not trained independently, nor does it require additional supervisory labels. Instead, it is integrated with the clinical semantic encoder, the four-way parallel feature encoder, the semantic gating module, the multi-domain feature interaction module, and the parallel decoder group to form an end-to-end jointly optimizable network. The loss between the reconstructed waveform of the missing lead and the real waveform is used as a unified supervisory signal for backpropagation. Due to the non-differentiability of the sorting and truncation operations involved in sparse selection in step 6, sparse path allocation is performed by Top-k hard selection during forward propagation in the training phase. During backpropagation, the selected Top-k index set is treated as a constant, so that the gradient is continuously backpropagated to the parameters of each layer of the path subnet through the Softmax weights after sparse renormalization. Thus, the path subnet can be learned and trained under the indirect supervision of the reconstruction loss.

[0050] Specifically, the path score vector is subjected to Softmax normalization to obtain the original weight distribution. The corresponding process has the following relationship: ; in, Original weight distribution, This represents the path weight vector of the first existing lead. Indicates the first i The path weight vector of an existing lead.

[0051] The index set: for weight vectors Sort the results and take the largest one. The indices corresponding to each component form the Top-k index set; where Represents the set of indices The selected lead number is not specified in this invention. The value is limited, and when there are few existing leads, it can be set to... This represents the current number of leads; when there are many existing leads, adjustments can be made as needed. Perform the assignment.

[0052] Specifically, for the index set The lead weights are normalized to obtain a normalized set of indices. The corresponding process has the following relationship: ; in, This represents the new weight value after sparse renormalization of the path weight vector of the k-th existing lead in the index set. This represents the path weight vector of the k-th existing lead in the index set. This indicates that there are already lead numbers. Indicates the first index in the set The components corresponding to the original weight distribution obtained after Softmax normalization of existing leads. Represents an index set; The lead reconstruction vectors are sparsely weighted and fused using the weight vectors of the normalized index set to obtain the optimal lead reconstruction path fusion vector. The corresponding process has the following relationship: ; in, This represents the optimal lead reconstruction path fusion vector. This represents the weight vector of the normalized index set. This represents the lead reconstruction vector of the first existing lead. This represents the lead reconstruction vector of the second existing lead. Indicates the first i Lead reconstruction vectors of existing leads.

[0053] For further details, please refer to Figure 6 To clearly demonstrate the effect of the clinical semantic path allocation mechanism proposed in this invention on real individual patients, and to highlight the "differential driving role of clinical semantic modulation in lead reconstruction path selection," a specific embodiment is provided here for illustration: The patient's information is as follows: age 65, male, BMI = 23.8 kg / m², blood pressure 128 / 82 mmHg, serum potassium 4.2 mmol / L, serum calcium 2.4 mmol / L, serum magnesium 0.9 mmol / L. All of these parameters—age, BMI, blood pressure, serum potassium, serum calcium, and serum magnesium—are within the normal reference range. Medication: Concomitantly taking digoxin and amiodarone. , All others are set to 0; Comorbidities: There are currently no active comorbidities, i.e. to All are set to 0; Suppose there are 5 existing ECG leads, which correspond in order to leads I, II, III, V1 and V5 in a standard 12-lead ECG, i.e., subscripts k=1 to 5 refer to the above 5 leads in sequence; the sparse hyperparameter is taken as 2; After mapping by the clinical semantic encoder, the clinical semantic vector output of this patient is: = (0.34, 0.78, 0.29) Will Input path subnet This yields a 5-dimensional path score vector. : = [1.20, 3.50, 0.80, 0.50, 3.20] It can be seen that 3.50 (corresponding to lead II) and 3.20 (corresponding to lead V5) are significantly higher than the other three components, which initially reflects that the pathway scoring mechanism has correctly mapped the clinical semantic signals to the two leads that are most sensitive to the above-mentioned drug responses; right Performing Softmax normalization yields the original weight distribution: =(0.0512, 0.5107, 0.0343, 0.0254, 0.3783) The sum of the original weights of leads II and V5 is approximately 0.8890, accounting for nearly 89% of the weighted quality, while the sum of the weights of leads I, III, and V1 is only about 11%.

[0054] Take k=2, and follow Sort the indices from largest to smallest and select the indices corresponding to the two largest components to obtain the Top-k index set: {2,5} That is, only the two candidate reconstruction paths, lead II and lead V5, are retained to proceed to the next sub-step.

[0055] Perform sparse renormalization on the weights of the two paths within {2, 5}: = 0.5107 / (0.5107 + 0.3783) ≈ 0.5744 = 0.3783 / (0.5107 + 0.3783) ≈ 0.4256 = = = 0 Perform sparse weighted fusion to obtain the final fused reconstructed vector: = 0.5744 · + 0.4256 ·

[0056] In this embodiment, the sparse selection results can be interpreted from a clinical interpretability perspective as follows: both lead II and lead V5 are the optimal observation windows for digoxin "fishhook-like" ST-segment depression and amiodarone QT interval prolongation. Lead II is the preferred choice for the former, representing the result observed from the inferior wall perspective, while lead V5 is the preferred choice for the latter, representing the result observed from the left anterior chest perspective. These two leads are complementary rather than redundant in an electrophysiological sense, jointly covering the main impacts of the medications taken by this patient on myocardial repolarization. Meanwhile, Slightly higher This relative preference aligns closely with the clinical practice's conventional reading order: "first interpreting heart rate, rhythm, and baseline ST-T using lead II, then verifying lateral ST segment morphology using lead V5." This further confirms the natural consistency between the preferences learned by the pathway scoring mechanism and the clinical logic of ECG interpretation. The reconstructed pathways corresponding to leads I, III, and V1, which were zeroed out by the sparse mechanism, do not bear the primary differential diagnostic function in this patient's medication context. Zeroing their weights avoids diluting the semantic contribution of secondary pathways to the primary pathway and significantly reduces the computational burden on the decoder in the subsequent step seven.

[0057] It should be noted that the clinical semantic path allocation mechanism in this step is based on the patient's clinical semantic vector. Instead of using ECG signals or their features as the decisive input, this invention selects from multiple candidate reconstruction branches based on the patient's pathological background outside the signal. This is fundamentally different from existing self-attention reconstruction methods based on signal features in terms of driving signals, processing paradigms, and architectural positions: existing methods establish correlations within the signal feature sequence, while this invention selects from multiple candidate reconstruction branches based on the patient's pathological background outside the signal.

[0058] Furthermore, due to the design of the acquisition circuit and the position of the acquisition electrodes, there is a linear relationship between the six limb leads (I, II, III, aVR, aVL, aVF). If any two of the six can be obtained, the other four can be directly derived through linear operations without any model; this is Einthofen's law.

[0059] Step 7: Input the optimal lead reconstruction path fusion vector into the preset decoder for decoding to obtain the waveform of the missing ECG signal; use the waveform of the missing ECG signal as the ECG lead reconstruction result.

[0060] It should be further explained that this invention sets up a decoder for each missing lead to be reconstructed, and all decoders are arranged in parallel to form a parallel decoder group. Each decoder has the same network structure and its trainable parameters are independent. The input to each decoder is the optimal lead reconstruction path fusion vector, and the output is the reconstructed waveform of the corresponding missing lead. To eliminate the differences in reconstruction results that may be caused by uncertain decoder structures, this invention limits each decoder to an upsampling network based on one-dimensional transposed convolution, with the following specific structure: Each decoder consists of an input mapping layer, several cascaded one-dimensional transposed convolutional upsampling blocks, and an output mapping layer. The input mapping layer is a fully connected layer that maps the optimal lead reconstruction path fusion vector to a vector of length 1024, and then rearranges it into a low-resolution one-dimensional feature map with 128 channels and a length of 8, serving as the starting point for subsequent upsampling. The dimension of the optimal lead reconstruction path fusion vector is consistent with the dimension of the lead reconstruction vector in step 5. After the input mapping layer, seven one-dimensional transposed convolutional upsampling blocks are cascaded. Each upsampling block consists of a one-dimensional transposed convolutional layer, a one-dimensional batch normalization layer, and a ReLU activation layer, in sequence. Each one-dimensional transposed convolutional layer has a kernel size of 4, a stride of 2, and padding of 1, thus doubling the temporal length of the feature map after each upsampling block. The number of output channels for the seven upsampling blocks are 64, 32, 16, 8, 8, 8, and 8, respectively, and the feature map length is upsampled from 8 to 1024 via upsampling from 16, 32, 64, 128, 256, and 512. The output mapping layer is a one-dimensional convolutional layer with a kernel size of 3 and padding of 1, which compresses the number of channels from 8 to 1. No activation function is applied after the output mapping layer, and it directly outputs a single-channel one-dimensional waveform with 1024 sampling points as the reconstructed waveform of the corresponding missing lead. The length of this waveform is consistent with the length of the target waveform of the missing lead to be reconstructed, which corresponds to an ECG waveform of about 2.05s at a sampling rate of 500Hz. As shown above, each decoder upsamples and decodes an optimal lead reconstruction path fusion vector step by step into a single-channel ECG waveform. Its output has the same number of channels and time length as the reconstructed missing lead structure. When the target waveform length of the missing lead to be reconstructed is not 1024 sampling points, those skilled in the art can correspondingly increase or decrease the number of levels of the one-dimensional transposed convolution upsampling block or adjust the stride of each block to make the final output length consistent with the target waveform length. Apart from the aforementioned adjustments for adapting the output length, the decoder structure is based on the "fully connected input mapping layer matching the one-dimensional transposed convolution upsampling block and the one-dimensional convolution output mapping layer" defined in this section. The kernel size, stride, batch normalization, and ReLU activation settings of each upsampling block are as described above, thereby ensuring the determinism and reproducibility of the decoding process. The parallel decoder group undergoes end-to-end joint training with the entire network using the missing lead reconstruction loss as a unified supervision signal. Each decoder learns the mapping from the fusion vector to its corresponding missing lead waveform.

[0061] It should be further explained that the trainable parameters involved in this invention mainly include: a clinical semantic encoder, a four-way parallel feature encoder (lead encoder, global rhythm encoder, local morphological encoder, and frequency domain encoder), linear transformation weights and biases of each channel in the semantic gating module, linear transformation weight matrices of each attention submodule in the multi-domain feature interaction module and weights and biases of the cross-channel fusion layer, path subnetworks, and all trainable parameters of the parallel decoder group. These parameters together constitute the complete end-to-end jointly optimizable parameter set of this invention. The above complete parameter set is jointly trained end-to-end as follows: Regarding the loss function, this invention employs a composite loss obtained by weighted summation of a time-domain main loss term and a frequency-domain auxiliary loss term. The time-domain main loss term is the mean square error between the reconstructed missing lead waveform and the corresponding true waveform at each sampling point. Specifically, it is calculated by first averaging the squared difference between the reconstructed waveform and the true waveform at each sampling point along the time axis, then averaging over all reconstructed missing leads for the current sample, and finally averaging over all samples within a batch to obtain the time-domain main loss term for that batch. To avoid high-voltage leads dominating the loss, both the reconstructed and true waveforms involved in the loss calculation are processed using the same amplitude normalization method as the training data. The frequency-domain auxiliary loss term is used to constrain the overall spectral energy distribution of the reconstructed waveform: a short-time Fourier transform is applied to both the reconstructed waveform and the corresponding true waveform. This invention uses a window length of 256 sampling points, a frame shift of 128 sampling points, and 256 transform points. After obtaining the amplitude spectrum of each frame, the mean square error between the amplitude spectrum of the reconstructed waveform and the amplitude spectrum of the true waveform at each time-frequency point is calculated and used as the frequency-domain auxiliary loss term. The total loss is a weighted sum of the temporal main loss term and the frequency-domain auxiliary loss term, where the weighting coefficient of the frequency-domain auxiliary loss term is 0.15, ensuring that pointwise fidelity in the temporal domain dominates during training, while simultaneously suppressing excessive smoothing and high-frequency artifacts in the reconstructed waveform. Since all missing leads are reconstructed simultaneously by the parallel decoder group, the total loss is summed across the reconstruction errors of each decoder and backpropagated, serving as a unified monitoring signal to update the aforementioned complete parameter set via backpropagation. For the Top-k sparse selection stage in step 6, which includes non-differentiable sorting operations, a pass-through approach is used during backpropagation, treating the selected index set as a constant. This allows the gradient weights, after sparse renormalization, to be continuously backpropagated to the path subnet, eliminating the need for separate monitoring labels for the path subnet. Model training can also be completed using only the temporal main loss term as the total loss; the frequency-domain auxiliary loss term is used to further improve the fidelity of the reconstructed waveform in the spectrum. Regarding the optimizer and learning rate strategy, this invention employs the Adam adaptive moment estimation optimizer to optimize the aforementioned parameter set. The decay coefficient for the first-order moment estimation is set to 0.9, the decay coefficient for the second-order moment estimation is set to 0.999, and the numerical stability term is set to 0.00000008. The initial learning rate is set to 0.001, the weight decay coefficient is set to 0.0001, the batch size is set to 32, and the number of training epochs is set to 300. The learning rate smoothly decays from the initial learning rate of 0.001 to 0.000001 with the number of training epochs. An early stopping strategy is adopted during training: after each training epoch, the root mean square error of reconstruction is evaluated on the validation set. When this error no longer decreases for 20 consecutive epochs, training is terminated early, and the set of parameters with the best performance on the validation set is retained as the final model. Regarding the path allocation mechanism, the method for determining the value of k used in the Top-k sparse selection in step 6 is as follows: when the total number of existing leads is not greater than 3, let k be equal to the total number of existing leads, that is, do not perform sparse truncation and retain all candidate reconstruction paths; when the total number of existing leads is greater than 3, the value of k is set to half of the number of leads and rounded down. Regarding training techniques such as batch normalization and Dropout, batch normalization layers are set after linear transformations or convolution operations in the hidden layers and before nonlinear activation in each feature encoder, clinical semantic encoder, path subnetwork, attention submodule, and decoder to stabilize the input distribution of each layer and accelerate training convergence. After activation of the fully connected hidden layers in the clinical semantic encoder, path subnetwork, and attention submodule, Dropout with a dropout rate of 0.2 is set to suppress overfitting. For the judgment threshold In this invention, a fixed This setup can filter out residual noise and significantly reduce the number of candidate points, thus alleviating the burden on subsequent processes.

[0062] It should be noted that the application of this lead reconstruction method should be limited to situations where no three linearly independent leads can be found in the existing leads. When there are three known leads in linearly independent directions in the existing leads, a closed-loop reconstruction using a purely linear transformation should be performed with the aid of the cardiac electrical dipole model.

[0063] To verify the effectiveness of the morpho-rhythm frequency domain interaction mechanism and the clinical semantic modulation mechanism, as well as their synergistic effect, this invention compares four models: Baseline (no morpho-rhythm segmentation, no interaction with frequency domain features, only encoding, fusion, and decoding, with an average allocation fusion path allocation mechanism), Baseline+Interact (segmentation of the morpho-rhythm frequency domain and interaction, but no clinical semantic modulation, with an average allocation fusion path allocation mechanism), and Baseline+Semantic (clinical semantic modulation, but no morpho-rhythm frequency domain segmentation and interaction, only semantic gating of lead feature vectors, with the path allocation mechanism unaffected by the absence of morpho-rhythm frequency domain segmentation and interaction). Using six limb leads (I, II, III, aVR, aVL, aVF) as input, six precordial leads (V1–V6) were reconstructed. Data was taken from the PhysioNetPTB Diagnostic ECG Database, with signals uniformly resampled to 500 Hz and bandpass filtered from 0.5–40 Hz. The original database contained 549 ECG records from 290 subjects. The 549 records were divided into training, validation, and testing sets according to the subjects, with a ratio of 7:1:2. All records of the same subject were ensured to appear only in the same subset to avoid cross-patient data leakage caused by the same patient's data being included in both training and testing at the same time.

[0064] All models use the same encoder and decoder skeleton to ensure fair comparison. The only difference is whether the corresponding mechanism module is enabled. The root mean square error (RMSE) decrease rate relative to the baseline model is used as the evaluation index. The arithmetic mean of the values ​​is taken over the six reconstruction leads V1–V6. The results are shown in Table 3. Table 3. Ablation experiment results of the four models on the PTB dataset V1–V6 reconstruction task.

[0065] As shown in Table 3, the RMSE reduction of the model of this invention is 32.7%, and the combined reduction rate generated by the segmentation of the morphological rhythm frequency domain and interaction and the clinical semantic regulation mechanism is 1-(1-9.6%)×(1-18.3%)=26.1%, which reflects the synergistic effect between the segmentation of the morphological rhythm frequency domain and interaction and the clinical semantic regulation mechanism, rather than a mechanical superposition.

[0066] On the other hand, the synergistic effect between dividing the frequency domain of morphological rhythms and interacting with clinical semantic modulation mechanisms can also be understood from the perspective of deep learning: First, from the perspective of feature space structure, semantic gating mechanisms are essentially a type of dimensional feature modulation based on patient-specific conditions, and their effectiveness depends on the semantic homogeneity of the space in which the modulated features reside. If different feature channels are in heterogeneous spaces, the gating vector... During backpropagation, the direction of the gradient received will deviate due to the difference in the physical meaning between channels, causing the gating weights to oscillate in the later stages of training and making it difficult to converge to a stable state. However, the two-stage architecture proposed by the multi-domain interaction mechanism, which prioritizes frequency domain backpropagation enhancement and follows time domain three-branch cross-attention alignment, has already established a shared reference for the four heterogeneous features before the fusion layer. Multi-domain feature interaction transforms the objects operated on by semantic gating from the original features mixed with alignment noise to pure features in the same semantic subspace. The optimization objective of the gating parameters is thus optimized from simultaneously undertaking the dual tasks of alignment and regulation between different features to focusing on differential inhibition or enhancement driven by clinical priors. This fundamentally reduces the optimization difficulty and parameter coupling.

[0067] Secondly, from the perspective of conditional computation, the Top-k sparse selection in the clinical semantic path allocation mechanism implicitly assumes a key assumption: that the reconstruction vectors of each candidate lead... In a scoring space, comparable, normalized path weights must be based on homogeneous features to have discriminative significance; if multi-domain features are directly concatenated without explicit alignment, each... The differences between them include both the real differences in the clinical observation value of different leads and the spurious differences introduced by the misalignment of heterogeneous channels. The latter can contaminate the path scoring vector and cause non-clinically driven randomness in sparse selection among different patients. The multi-domain interaction mechanism eliminates the latter type of spurious differences, so that the path scoring vector can purely reflect the real matching relationship between the clinical semantic vector and each lead.

[0068] To further verify the performance advantages of this invention compared to existing ECG lead reconstruction methods, under the same settings as the above experiments, six limb leads (I, II, III, aVR, aVL, aVF) were used as inputs to reconstruct six precordial leads (V1–V6). The data were taken from the PhysioNet PTB Diagnostic ECG Database, and the signals were uniformly resampled to 500 Hz and bandpass filtered from 0.5 to 40 Hz. Several other representative ECG lead reconstruction methods were selected for comparison with this invention.

[0069] The database originally contained 549 electrocardiogram (ECG) records from 290 subjects. These 549 records were divided into a training set, a validation set, and a test set according to the subjects, with a ratio of 7:1:2. It was ensured that all records from the same subject appeared only in the same subset to avoid cross-patient data leakage caused by data from the same patient being included in both training and testing simultaneously.

[0070] To ensure fairness in the comparison, all methods were trained and tested under the same data partitioning and preprocessing procedures. The root mean square error (RMSE) between the reconstructed waveform and the true waveform, expressed in mV, was calculated as the arithmetic mean across the six reconstruction leads V1-V6; a lower RMSE indicates higher reconstruction accuracy. The results are shown in Table 4.

[0071] Table 4. Experimental results of other models and the model of this invention on the PTB dataset V1-V6 reconstruction task.

[0072] As shown in Table 4, the model of this invention achieved the lowest root mean square error on the V1-V6 reconstruction task, which is about 16.74%, 10.76% and 28.14% lower than that based on DiffECG, ECGrecover and U²-Net, respectively, showing a significant advantage in reconstruction accuracy.

[0073] Table 4 shows that the DiffECG, ECGrecover, and U²-Net models all employ methods that achieve lead reconstruction through internal signal driving. The ECGrecover model uses UNet as its core network structure and combines amplitude error and waveform change trend loss strategies to ensure the fidelity of the reconstructed lead signal in terms of amplitude and morphology. The U²-Net model uses a nested U-shaped network structure combined with an attention mechanism, attempting to achieve time-domain reconstruction of ECG leads with slightly lower computational and parameter requirements. The DiffECG model is a diffusion generation model for ECG signals, whose strategy is to gradually denoise the ECG waveform and ultimately generate the missing lead waveform in the time domain from the existing lead conditions. In summary, all three models operate only in the time domain, failing to incorporate frequency domain information or effectively interact with multi-domain features such as morphology, rhythm, and frequency. Most importantly, all three models treat lead reconstruction as a closed signal mapping problem, using only existing lead waveforms as input without exploring clinical background information such as patient medication, comorbidities, and biochemical indicators, thus lacking personalized considerations in the ECG lead reconstruction problem. In comparison, this invention creatively establishes a shared reference system for frequency domain features and multiple features in the time domain through multi-domain feature interaction, achieves feature-level information filtering through semantic gating mechanism, and simultaneously drives the reconstruction path with differentiated clinical semantic modulation, achieving a consistent and significant improvement in reconstruction accuracy. Its interpretability far exceeds that of traditional ECG lead reconstruction methods, verifying the effectiveness and superiority of the proposed method.

[0074] Furthermore, to more vividly illustrate the clinical semantic modulation effect and excellent clinical interpretability of this method, a specific example is presented below: The patient001 / s0010_re record from the PhysioNet PTB Diagnostic ECG Database dataset was selected as an example: The subject was an 81-year-old female admitted to the hospital for acute inferior wall myocardial infarction on September 29, 1990, with type 2 diabetes mellitus. Coronary angiography showed a single-vessel lesion with 70% stenosis in the proximal left anterior descending artery and adjacent to the second diagonal branch. Ventriculography showed loss of inferior wall motion. Prior to admission, she had been taking isosorbide mononitrate, digoxin, and glibenclamide for a long time; she received thrombolytic therapy during the acute phase; and in-hospital treatment included aspirin, isosorbide mononitrate, calcium channel blockers, amiloride + chlorothiazide diuretics, glibenclamide, and insulin. The ECG signal sampling rate was 1000Hz, the duration was 38.4 seconds, and it included 12 leads and Frank orthogonal three-lead ECG, for a total of 15 channels.

[0075] In the 15-lead ECG, the orthogonal three-lead ECG was discarded, leaving 12 leads. Among them, I, II, III, aVR, aVL, and aVF were retained as existing leads, and the remaining leads were considered missing and needed to be reconstructed. Since there are no three linearly independent leads among the existing leads, closed-loop reconstruction by pure linear transformation is not possible. Therefore, this method is used for reconstruction, and the waveforms of the most representative leads V5 and V6 are selected for display.

[0076] Please see Figures 7 to 10 The gray waveform represents the patient's actual lead waveform; the red waveform represents the waveform reconstructed using a method that removes semantic gating and clinical semantic modulation path allocation mechanisms, retaining only multi-domain feature interactions, with the path allocation mechanism employing average allocation fusion; the green waveform represents the waveform reconstructed using the complete method described in this study. Observations show that, without clinical semantic modulation, the R-wave amplitude of the reconstructed waveform is significantly higher than the actual waveform in each cardiac cycle, with the reconstructed R-wave in V5 being approximately 1.6 mV and in V6 approximately 1.35 mV, while the corresponding actual signal R-wave amplitude is only about 0.2 mV, and the T-wave direction is incorrectly reconstructed as positive. These results indicate that, in the absence of prior clinical information, the reconstruction model can only output precordial lead waveforms approximating healthy individuals based on a "population average," failing to reflect the pathological characteristics caused by lateral myocardial ischemia in this patient, and posing a serious risk of clinical misjudgment. After applying clinical semantic modulation, the reconstructed waveform closely matches the real signal in key diagnostic features such as R-wave amplitude, T-wave polarity, and ST-segment morphology. It accurately reproduces the low-voltage morphology and T-wave inversion characteristics of leads V5 and V6, maintaining good consistency with the overall trend and local details of the real waveform. The above comparison fully demonstrates that the clinical semantic modulation mechanism proposed in this invention can guide the reconstruction network to generate precordial lead waveforms that conform to the individual pathological characteristics of patients, even when the number of existing leads is limited and the three-dimensional linear independence condition is not met, significantly improving the clinical readability and diagnostic value of the reconstructed signal.

[0077] Please see Figure 11 and Figure 12 To further reveal the influence of clinical semantic modulation mechanisms on the characteristic bands within a single heartbeat, this embodiment performs a magnified comparison of the V5 and V6 lateral wall leads in a single heartbeat. Figure 11 and Figure 12 The horizontal axis is set with the R-wave peak value as the zero point, covering the range from 350 ms before the R-wave peak value to 450 ms after the R-wave peak value, fully presenting the five characteristic wave bands of P-wave, Q-wave, R-wave, S-wave and T-wave; the vertical axis is the signal amplitude. Figure 11 and Figure 12The four sub-figures are: the single-heart reconstruction result of lead V5 without clinical semantic modulation, the single-heart reconstruction result of lead V5 with clinical semantic modulation, the single-heart reconstruction result of lead V6 without clinical semantic modulation, and the single-heart reconstruction result of lead V6 with clinical semantic modulation. Each sub-figure is superimposed with the single-heart waveform of the real signal of that lead as a reference, and the center positions of the five characteristic bands P, Q, R, S and T are marked at the corresponding positions on the horizontal axis.

[0078] Depend on Figure 11 and Figure 12 The waveforms show that the amplitude of the true signals V5 and V6 at the R wave position is only about 0.2 mV, the Q wave is slightly deepened, and the T wave is significantly negatively inverted about 220 ms after the R wave peak. This is consistent with the typical pathological features of "low voltage combined with T wave inversion" in the lateral leads of patients with acute inferior wall myocardial infarction. The reconstructed waveform without clinical semantic modulation shows towering positive spikes of about 1.6 mV and 1.35 mV at the R wave position, and the T wave is positively convex with a peak value of about 0.5 mV. It deviates significantly from the true signal in both the R wave amplitude and T wave polarity, two key diagnostic features. It only shows a limited degree of agreement at the P wave position due to the low amplitude. After applying clinical semantic modulation, the reconstructed waveform achieved a high degree of point-to-point alignment with the real signal in each characteristic band of the P wave, Q wave, R wave, S wave, and T wave: the R wave amplitude was reasonably reduced to a level close to the real signal, the deepening feature of the Q wave was preserved, the T wave direction was correctly reconstructed as negative inversion, and the ST segment transition was smooth and basically coincided with the real signal.

[0079] The detailed comparison at the single-heart beat level above demonstrates that the clinical semantic modulation mechanism proposed in this invention can not only correct amplitude deviations at the entire signal level, but also perform refined morphological reconstruction of each characteristic band within a single heart beat. This mechanism enables the reconstruction network to accurately reconstruct diagnostically significant low voltage and T-wave inversion morphology in leads V5 and V6 based on the patient's prior clinical information, even when relying solely on input from six limb leads and without satisfying the three-dimensional linear independence premise. This verifies the interpretability and reliability of this invention in clinical scenarios.

[0080] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0081] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions 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 one or more embodiments or examples.

[0082] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of this patent should be determined by the appended claims.

Claims

1. A method for reconstructing electrocardiogram leads based on multi-domain feature interaction and clinical semantic modulation, characterized in that, The method includes the following steps: Step 1: Standardize the patient's structured numerical information to obtain a structured numerical information vector; encode the medication and comorbidities in the structured category information separately to obtain a medication vector and a comorbidity vector; concatenate the structured numerical information vector, medication vector, and comorbidity vector, and input them into the clinical semantic encoder to obtain a clinical semantic vector. The specific steps are as follows: The age in the patient's structured numerical information is processed by min-max normalization to obtain the normalized age; Z-Score standardization was applied to the BMI in the patient's structured numerical information to obtain a standardized BMI value; Z-score standardization was performed on the systolic and diastolic blood pressure in the patient's structured numerical information to obtain standardized systolic and diastolic blood pressure values, respectively; the standardized pulse pressure difference was then calculated using the systolic and diastolic blood pressure values. Z-Score standardization was performed on the blood potassium concentration in the structured numerical information to obtain the standardized blood potassium value; Z-Score normalization was performed on the blood calcium concentration in the structured numerical information to obtain the normalized blood calcium value; Z-Score normalization was performed on the blood magnesium concentration in the structured numerical information to obtain the normalized blood magnesium value; The binary discrete variables representing gender are encoded one-hot to obtain a two-dimensional gender vector. The normalized age, standardized BMI, standardized systolic blood pressure, standardized diastolic blood pressure, standardized pulse pressure, standardized serum potassium, standardized serum calcium, standardized serum magnesium, and the two-dimensional gender vector are concatenated to obtain a structured numerical information vector. Based on structured category information, a drug administration vector is constructed using predefined Boolean values; Comorbidity vectors are constructed based on structured category information and predefined multi-hot encoding. The clinical semantic encoder is used to concatenate the structured numerical information vector, the medication vector, and the comorbidity vector to obtain the clinical semantic vector. Step 2: Perform bandpass filtering, Hilbert transform, and envelope extraction on the existing ECG signal in sequence to obtain the instantaneous envelope; perform threshold determination and refractory period verification on the sampling points corresponding to the instantaneous envelope in sequence to obtain the R wave position; divide the existing ECG signal according to the R wave position to obtain the global rhythm and local morphology. Step 3: Use the corresponding encoder to extract the features of the existing ECG signal, global rhythm and local morphology respectively, so as to obtain the lead feature vector, rhythm feature vector, morphological feature vector and frequency domain feature vector; Step 4: Selectively suppress or enhance the lead feature vector, rhythm feature vector, morphological feature vector, and frequency domain feature vector through a semantic gating mechanism to obtain the semantically gating feature vector. Step 5: Perform frequency-domain-based reverse enhancement, cross-attention enhancement, and interactive fusion processing on the semantically gated feature vectors to obtain the lead reconstruction vectors. Step 6: Based on the clinical semantic vector and lead reconstruction vector, the optimal lead reconstruction path fusion vector is generated through the execution path allocation mechanism; Step 7: Input the optimal lead reconstruction path fusion vector into the preset decoder for decoding to obtain the waveform of the missing ECG signal; use the waveform of the missing ECG signal as the ECG lead reconstruction result.

2. The ECG lead reconstruction method based on multi-domain feature interaction and clinical semantic modulation according to claim 1, characterized in that, In the process of applying min-max normalization to the age in the patient's structured numerical information to obtain the normalized age, the following relationship exists: ; in, This represents the normalized age value. This indicates the current age of the patient. This represents the maximum age of all patients in the dataset. This represents the minimum age of all patients in the dataset; In the process of applying Z-Score standardization to the BMI in the patient's structured numerical information to obtain the standardized BMI value, the following relationship exists: ; in, This represents the standardized BMI value. This represents the patient's original BMI value. This represents the average BMI in the dataset. This represents the standard deviation of BMI for all patients in the dataset; Z-score standardization was performed on the systolic and diastolic blood pressures in the patient's structured numerical information to obtain standardized systolic and diastolic blood pressure values, respectively. The standardized pulse pressure difference was then calculated using these systolic and diastolic blood pressures, and the following relationship exists: ; in, This represents the standardized systolic blood pressure value. This indicates the patient's original systolic blood pressure value. This represents the mean systolic blood pressure of all patients in the dataset. This represents the standard deviation of systolic blood pressure for all patients in the dataset. This represents the standardized diastolic blood pressure value. This indicates the patient's original diastolic blood pressure value. This represents the mean diastolic blood pressure of all patients in the dataset. This represents the standard deviation of diastolic blood pressure for all patients in the dataset. This represents the standardized pulse pressure difference value. This represents the mean pulse pressure of all patients in the dataset. This represents the standard deviation of pulse pressure across all patients in the dataset. In the process of Z-score normalization of blood potassium concentration in structured numerical information to obtain normalized blood potassium values, the following relationship exists: ; in, This represents the standardized serum potassium level. This indicates the patient's blood potassium concentration. This represents the mean serum potassium level of all patients in the dataset. This represents the standard deviation of serum potassium levels across all patients in the dataset. In the process of Z-score normalization of blood calcium concentration in structured numerical information to obtain normalized blood calcium values, the following relationship exists: ; in, This represents the standardized blood calcium level. This indicates the patient's original blood calcium concentration. This represents the mean blood calcium level of all patients in the dataset. This represents the standard deviation of blood calcium levels across all patients in the dataset. In the process of Z-score normalization of blood magnesium concentration in structured numerical information to obtain normalized blood magnesium values, the following relationship exists: ; in, This represents the standardized blood magnesium level. This indicates the patient's original blood magnesium concentration. This represents the mean serum magnesium level of all patients in the dataset. This represents the standard deviation of serum magnesium across all patients in the dataset. The normalized age, standardized BMI, standardized systolic blood pressure, standardized diastolic blood pressure, standardized pulse pressure, standardized serum potassium, standardized serum calcium, standardized serum magnesium, and gender two-dimensional vectors are concatenated to obtain a structured numerical information vector. The corresponding process includes the following relationship: ; in, Represents a structured numerical information vector. This indicates a splicing operation. Represents the gender vector.

3. The ECG lead reconstruction method based on multi-domain feature interaction and clinical semantic modulation according to claim 2, characterized in that, In step 2, the existing ECG signal is sequentially subjected to bandpass filtering, Hilbert transform, and envelope extraction to obtain the instantaneous envelope; the sampling points corresponding to the instantaneous envelope are sequentially subjected to threshold determination and refractory period verification to obtain the R-wave position; the existing ECG signal is divided according to the R-wave position to obtain the global rhythm and local morphology. The specific steps are as follows: The existing electrocardiogram signal is filtered using a bandpass filter to obtain the filtered signal; The Hilbert transform is applied to the filtered signal to obtain the assembled complex signal. The corresponding process has the following relationship: ; in, This represents the complex signal assembled at time t. Indicates the imaginary part. This represents the filtered signal at time t. This represents the operator processing that applies the Hilbert transform to the signal. express The filtered signal at each moment Index representing time, The constant representing normalization, This indicates taking the infinitesimal with respect to the integral variable. An index representing a time point; Calculate the modulus of the assembled complex signal to obtain the instantaneous envelope. The corresponding process has the following relationship: ; in, Indicates the instantaneous envelope; By comparing the instantaneous envelope point by point using a preset envelope signal threshold, sampling points corresponding to instantaneous envelopes that are not lower than the preset envelope signal threshold are selected to obtain the R-wave candidate point set. The time interval between adjacent candidate points in the R-wave candidate point set is verified in chronological order, and candidate points with time intervals less than the judgment threshold are removed to obtain the R-wave candidate point set that passes the verification. The R-wave position is determined by verifying the set of candidate R-wave points; the R-wave position is used to extract a waveform segment of a preset time window size from the original ECG signal to obtain the local morphology; at the same time, all R-wave positions are marked as time scales to obtain the global rhythm.

4. The ECG lead reconstruction method based on multi-domain feature interaction and clinical semantic modulation according to claim 3, characterized in that, In step 3, the corresponding encoders are used to extract features from the existing ECG signal, global rhythm, and local morphology to obtain lead feature vectors, rhythm feature vectors, morphological feature vectors, and frequency domain feature vectors. The specific steps are as follows: The existing ECG signal is input into the lead encoder to obtain the lead feature vector; The global rhythm is input into the global rhythm encoder to obtain the rhythm feature vector; The local morphology is input into the local morphology encoder to obtain the morphological feature vector; The existing electrocardiogram signal is input into the frequency domain encoder to obtain the frequency domain feature vector.

5. The ECG lead reconstruction method based on multi-domain feature interaction and clinical semantic modulation according to claim 4, characterized in that, In step 4, a semantic gating mechanism is used to selectively suppress or enhance the lead feature vector, rhythm feature vector, morphological feature vector, and frequency domain feature vector to obtain the semantically gated feature vector. The specific steps are as follows: The clinical semantic vectors were subjected to four independent single-layer linear transformations to obtain the gating vectors of morphological feature vectors, frequency domain feature vectors, lead feature vectors, and rhythm feature vectors, respectively. Hadamard products are applied to the morphological feature vector, frequency domain feature vector, lead feature vector, and rhythm feature vector using gating vectors of morphological feature vector, frequency domain feature vector, lead feature vector, and rhythm feature vector, respectively, to obtain semantically gated morphological feature vector, semantically gated frequency domain feature vector, semantically gated lead feature vector, and semantically gated rhythm feature vector, respectively.

6. The ECG lead reconstruction method based on multi-domain feature interaction and clinical semantic modulation according to claim 5, characterized in that, The clinical semantic vectors are subjected to four independent single-level linear transformations to obtain gating vectors for morphological feature vectors, frequency domain feature vectors, lead feature vectors, and rhythm feature vectors, respectively. The corresponding process includes the following relationship: ; in, The weights of the morphological feature vectors are represented. The weights represent the eigenvectors in the frequency domain. The weights of the lead eigenvectors are represented. The weights represent the rhythmic feature vectors. Represents a clinical semantic vector. The basic offset representing the morphological feature vector is independent of clinical semantics. The basic offset representing the frequency domain feature vector is independent of clinical semantics. This represents the basic offset of the lead feature vector that is independent of clinical semantics. The underlying offset representing the rhythm feature vector is independent of clinical semantics. This indicates activation function processing. A gate vector representing a morphological feature vector. The gate vector represents the frequency domain eigenvector. The gate vector representing the characteristic vector of the lead. A gate vector representing the rhythmic feature vector; By utilizing the gating vectors of morphological feature vectors, frequency domain feature vectors, lead feature vectors, and rhythm feature vectors respectively, Hadamard products are applied to the morphological feature vectors, frequency domain feature vectors, lead feature vectors, and rhythm feature vectors to obtain semantically gated morphological feature vectors, semantically gated frequency domain feature vectors, semantically gated lead feature vectors, and semantically gated rhythm feature vectors. The corresponding process includes the following relationships: ; in, Indicates the first i A semantically gated morphological feature vector of an existing lead. Indicates the first i A frequency domain feature vector after semantic gating of existing leads. Indicates the first i The semantically gated feature vector of an existing lead. Indicates the first i A rhythm feature vector after semantic gating of existing leads. Indicates the first i The morphological feature vector of an existing lead, Indicates the first i The frequency domain eigenvectors of existing leads, Indicates the first i The characteristic vectors of existing leads, Indicates the first i The rhythmic feature vector of an existing lead, It represents the Hadamah accumulation. This indicates that a lead number already exists.

7. The ECG lead reconstruction method based on multi-domain feature interaction and clinical semantic modulation according to claim 6, characterized in that, In step 5, the semantically gated feature vector is sequentially subjected to frequency-domain-based reverse enhancement, cross-attention enhancement, and interactive fusion processing to obtain the lead reconstruction vector. The specific steps are as follows: The semantically gated morphological feature vector, semantically gated lead feature vector, and semantically gated rhythm feature vector are concatenated along the feature dimension, and then a trainable linear transformation is used to generate key vectors and value vectors; at the same time, the semantically gated frequency domain feature vector is used as the query subject to generate query vectors. Using key vectors, value vectors, and query vectors, the semantically gated frequency domain feature vectors are inversely enhanced to obtain enhanced frequency domain feature vectors. The enhanced frequency domain eigenvectors are used as the basis for key values ​​to generate shared key matrices and shared value matrices; Based on the semantically gated morphological feature vector, the semantically gated lead feature vector, and the semantically gated rhythm feature vector, query matrices for morphological branches, lead branches, and rhythm branches are generated, respectively. Using the query matrix of morphological branch, query matrix of lead branch, query matrix of rhythm branch, shared key matrix and shared value matrix, cross-attention enhancement is performed on the semantically gated morphological feature vector, semantically gated lead feature vector and semantically gated rhythm feature vector in residual form to obtain the enhanced morphological feature vector, enhanced lead feature vector and enhanced rhythm feature vector respectively. The enhanced frequency domain feature vector, enhanced morphological feature vector, enhanced lead feature vector, and enhanced rhythm feature vector are interactively fused to obtain the lead reconstruction vector.

8. The ECG lead reconstruction method based on multi-domain feature interaction and clinical semantic modulation according to claim 7, characterized in that, The semantically gated morphological feature vector, semantically gated lead feature vector, and semantically gated rhythmic feature vector are concatenated along the feature dimension, and then a trainable linear transformation is applied to generate key and value vectors. Simultaneously, a query vector is generated using the semantically gated frequency domain feature vector as the query subject. The corresponding process includes the following relationship: ; in, This represents the linearly transformable weight matrix corresponding to the generated key vector. This represents the linearly transformable weight matrix corresponding to the generated query vector. This represents the linearly transformable weight matrix corresponding to the generated value vector. Represents the key vector. Represents the query vector. Represents a value vector; In the process of using key vectors, value vectors, and query vectors to perform reverse enhancement on the semantically gated frequency domain feature vector to obtain the enhanced frequency domain feature vector, the following relationship exists: ; in, This represents the enhanced frequency domain eigenvector of the i-th existing lead. Indicates the transpose symbol. This represents the transpose of the key vector. The feature dimension scalar representing single-head attention; In the process of using the enhanced frequency domain eigenvectors as the basis for key values ​​to generate shared key matrices and shared value matrices, the following relationship exists: ; in, Represents the shared key matrix. Represents a shared-value matrix. This represents the trainable linear transformation weight matrix used to generate the shared key matrix. This represents the trainable linear transformation weight matrix used to generate the shared value matrix; Based on the semantically gated morphological feature vector, semantically gated lead feature vector, and semantically gated rhythm feature vector, query matrices for morphological branches, lead branches, and rhythm branches are generated, respectively. The corresponding process includes the following relationships: ; in, The query matrix represents the morphological branch. The query matrix represents the lead branches. The query matrix representing the rhythm branches. This represents the trainable linear transformation weight matrix used in the query matrix that generates morphological branches. This represents the trainable linear transformation weight matrix used in the query matrix that generates lead branches. The trainable linear transformation weight matrix used in the query matrix that generates the rhythmic branches; Using the query matrices of the morphological branch, lead branch, and rhythm branch, as well as the shared key and shared value matrices, cross-attention enhancement is performed on the semantically gated morphological feature vector, semantically gated lead feature vector, and semantically gated rhythm feature vector in residual form, respectively, to obtain the enhanced morphological feature vector, enhanced lead feature vector, and enhanced rhythm feature vector. The corresponding process includes the following relationship: ; in, Indicates the first i An enhanced morphological feature vector of an existing lead. Indicates the first i Enhanced lead feature vectors of existing leads, Indicates the first i An enhanced rhythm feature vector from existing leads. Represents the transpose of the shared key matrix; In the process of interactively fusing the enhanced frequency domain feature vector, the enhanced morphological feature vector, the enhanced lead feature vector, and the enhanced rhythm feature vector to obtain the lead reconstruction vector, the following relationship exists: ; in, Indicates the first i Lead reconstruction vectors of existing leads, This represents the trainable linear transformation weight matrix of the fusion layer. This represents the trainable bias vector of the fusion layer.

9. The ECG lead reconstruction method based on multi-domain feature interaction and clinical semantic modulation according to claim 8, characterized in that, In step 6, based on the clinical semantic vector and the lead reconstruction vector, an optimal lead reconstruction path fusion vector is generated through a path allocation mechanism. The specific steps are as follows: The clinical semantic vector is input into the path subnet to obtain the path score vector; The path score vector is subjected to Softmax normalization to obtain the original weight distribution. The corresponding process has the following relationship: ; in, Original weight distribution, This represents the path weight vector of the first existing lead. Indicates the first i The path weight vector of an existing lead; The components in the original weight distribution are sorted from largest to smallest, and the lead indices corresponding to the first predetermined number of components are extracted to obtain an index set. ; The lead weights in the index set are normalized to obtain a normalized index set. The corresponding process has the following relationship: ; in, This represents the new weight value after sparse renormalization of the path weight vector of the k-th existing lead in the index set. This represents the path weight vector of the k-th existing lead in the index set. This indicates that there are already lead numbers. Indicates the first index in the set The components corresponding to the original weight distribution obtained after Softmax normalization of existing leads. Represents an index set; The lead reconstruction vectors are sparsely weighted and fused using the weight vectors of the normalized index set to obtain the optimal lead reconstruction path fusion vector. The corresponding process has the following relationship: ; in, This represents the optimal lead reconstruction path fusion vector. This represents the weight vector of the normalized index set. This represents the lead reconstruction vector of the first existing lead. This represents the lead reconstruction vector of the second existing lead. Indicates the first i Lead reconstruction vectors of existing leads.

Citation Information

Patent Citations

  • 12-lead electrocardiosignal generation method based on medical text and related equipment

    CN120656697A

  • Artificial intelligence enabled disease profiling

    US20250311956A1