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

Through a 12-lead ECG signal generation method based on medical text, the TTE model is used to embed text semantic constraints in the latent diffusion model to generate simulated ECG signals that conform to specific pathological characteristics. This solves the privacy protection and data scarcity issues in ECG signal acquisition and sharing, and supports the development and optimization of automatic ECG analysis models.

CN120656697APending Publication Date: 2025-09-16SOUTH CHINA UNIV OF TECH
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202510842083.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-23
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

The acquisition and sharing of ECG signals in existing technologies face challenges in protecting patient privacy, and the lack of high-quality annotated data makes it difficult to effectively conduct automatic ECG analysis and diagnosis.

Method used

A 12-lead ECG signal generation method based on medical text is adopted. The text information is converted into ECG signals through a pre-trained TTE model. The encoder, noise predictor and decoder are used to embed text semantic constraints in the latent diffusion model to generate simulated ECG signals that conform to specific pathological characteristics.

Benefits of technology

The generated simulated ECG signals can be analyzed by clinical medical personnel and used as training data to support the development and optimization of automatic ECG analysis models, solving the problem of data scarcity and meeting data sharing requirements for privacy protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120656697A_ABST
    Figure CN120656697A_ABST
Patent Text Reader

Abstract

The invention discloses a 12-lead electrocardiosignal generation method based on a medical text and related equipment. The method comprises the steps that text information is acquired; inputting the text information into a pre-trained TTE model to generate a 12-lead electrocardiogram signal; wherein the TTE model comprises an encoder, a noise predictor and a decoder; in an electrocardiogram generation stage, a noise predictor takes a text semantic condition as input, starts from initial random Gaussian noise zT, gradually recovers a potential feature vector # imgabs0 # pretrained decoder meeting conditional constraints through iterative denoising, reflects a potential feature vector # imgabs1 # to a high-dimensional original signal space, and outputs the potential feature vector # imgabs1 # pretrained decoder to a high-dimensional original signal space. According to the method, medical text description is used as condition input, text semantic constraints are embedded in a potential diffusion model framework, 12-lead simulated electrocardiosignals conforming to specific pathological features are generated, and a feasible alternative scheme is provided for shortage of current labeled ECG data sets.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electrocardiogram signal generation, and in particular to a 12-lead electrocardiogram signal generation method based on medical text and related equipment. Background Art

[0002] Cardiovascular disease is one of the leading causes of death worldwide. Electrocardiography (ECG), as an important tool for early diagnosis of cardiovascular disease, plays a crucial role in reducing patient mortality. Medical professionals diagnose cardiovascular disease by analyzing abnormal changes in characteristic ECG waves, such as the P wave, QRS complex, and ST segment.

[0003] Currently, research on classifiers for automated electrocardiogram (ECG) analysis and diagnosis is gaining significant attention. However, due to patient privacy requirements, the acquisition and sharing of real ECG signals face significant challenges. Furthermore, high-quality annotated ECG data is particularly scarce and expensive to obtain. Summary of the Invention

[0004] In order to at least solve one of the technical problems existing in the prior art to a certain extent, the present invention aims to provide a 12-lead electrocardiogram signal generation method based on medical text and related equipment.

[0005] The first technical solution adopted by the present invention is:

[0006] A method for generating 12-lead electrocardiogram signals based on medical text comprises the following steps:

[0007] Get text information;

[0008] Input text information into the pre-trained TTE model to generate a 12-lead electrocardiogram signal;

[0009] Wherein, the TTE model includes an encoder, a noise predictor and a decoder;

[0010] In the model training phase, the original 12-lead ECG signal x is subjected to feature extraction and dimensionality reduction processing through the pre-trained encoder, and the high-dimensional time domain signal is mapped to the low-dimensional latent feature space to obtain the latent feature vector z0; the noise predictor takes the text semantic constraint as the conditional input and constructs the noise sequence z by gradually adding Gaussian noise to the latent feature vector z0. t , to drive the model to learn the mapping relationship between noisy feature distribution and text semantic conditions;

[0011] In the ECG generation stage, the noise predictor takes the text semantic condition as input and generates the initial random Gaussian noise z T Starting from this, the latent feature vector that meets the conditional constraints is gradually restored through iterative denoising The pre-trained decoder transforms the latent feature vector Back-mapping to the high-dimensional original signal space to generate a 12-lead ECG signal corresponding to the semantics of the input text

[0012] Furthermore, the TTE model uses an autoencoder architecture to achieve feature compression and reconstruction of ECG signals;

[0013] The autoencoder is composed of multiple residual blocks, a self-attention mechanism layer, a downsampling module and an upsampling module;

[0014] Among them, the residual block effectively alleviates the gradient degradation problem in deep network training through skip connections, while enhancing the model's ability to learn the multi-level features of ECG signals;

[0015] The self-attention mechanism layer captures the long-range dependencies in the ECG signal to extract more pathologically discriminative global feature representations;

[0016] The downsampling module and upsampling module use one-dimensional convolution layer and one-dimensional deconvolution layer respectively to achieve layer-by-layer dimensionality reduction and dimensionality increase of the signal dimension.

[0017] Furthermore, the noise predictor consists of multiple cascaded residual blocks; in each residual block, two cascaded S4-AdaLNZ modules are used to sequentially process the diffusion step embedding and the text conditional information embedding, thereby introducing conditional constraints in the feature space.

[0018] Furthermore, in terms of the processing of diffusion step t, a 128-dimensional embedding vector t is generated for each diffusion step t emb , vector t emb After the nonlinear transformation of the multi-layer perceptron MLP, it is input into the residual block;

[0019] Inside the residual block, the S4-AdaLNZ module performs the vector t emb Processing:

[0020] γ t ,β t ,α t =MLP t (t emb )

[0021] z S4T =z S4in +α t ⊙S4((1+γ t )⊙LN(z conv )+β t )

[0022] Where z S4in and zS4T They represent the input and output of the first S4-AdaLNZ module, LN represents layer normalization, γ t ,β t ,α t Represented by vector t emb The scale and shift parameters are trained by the multi-layer perceptron (MLP); t Represents the vector used to process the diffusion step (i.e., t emb ) of the multilayer perceptron; ⊙ represents the element-wise dot product operation.

[0023] Furthermore, for text conditional information, the Bio_ClinicalBERT model is used to encode and extract features from the text to obtain the embedding vector c emb :

[0024] c emb =Bio_ClinicalBERT(c)

[0025] Where c is the input medical text condition information;

[0026] The vector c emb Input to the residual block, S4-AdaLNZ module is used to calculate c emb Processing:

[0027] γ c ,β c ,α c =MLP c (c emb )

[0028]

[0029] Where z S4T and z S4C They represent the input and output of the second S4-AdaLNZ module, LN represents layer normalization, and γ c ,β c ,α c Represented by vector c emb The scale and shift parameters are trained by the multi-layer perceptron; c Indicates the information used to process the condition (i.e., vector c emb ) of the multi-layer perceptron.

[0030] Furthermore, for the encoder and decoder, the training objective is to minimize the mean square error between the reconstructed signal and the original input signal. The loss function is defined as follows:

[0031]

[0032] Where x i Represents the original 12-lead ECG signal, x i is the reconstructed 12-lead ECG signal, and N is the number of samples.

[0033] Furthermore, for the noise predictor, the loss function during its training process is:

[0034]

[0035] Where, represents the noise ε predicted by the noise predictor θ Mean square error loss with the true noise ε; represents the frequency loss between the reconstructed ECG latent vector z0 after denoising by the noise predictor and the original ECG latent vector z0; F(·) represents the short-time Fourier transform, which is used to obtain the joint time-frequency distribution of the ECG latent vector; λ represents the weight coefficient.

[0036] The second technical solution adopted by the present invention is:

[0037] An electronic device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set, or an instruction set, and the at least one instruction, at least one program, the code set, or the instruction set is loaded and executed by the processor to implement a 12-lead electrocardiogram signal generation method based on medical text as described above.

[0038] The third technical solution adopted by the present invention is:

[0039] A computer-readable storage medium stores at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, at least one program, code set, or instruction set is loaded and executed by a processor to implement a 12-lead electrocardiogram signal generation method based on medical text as described above.

[0040] The fourth technical solution adopted by the present invention is:

[0041] A computer program product or computer program includes computer instructions stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium and execute the computer instructions, causing the computer device to perform the aforementioned method for generating a 12-lead electrocardiogram signal based on medical text.

[0042] The beneficial effects of the present invention are as follows: the present invention uses medical text descriptions as conditional input, and by embedding text semantic constraints in the latent diffusion model architecture, generates a 12-lead simulated ECG signal that conforms to specific pathological characteristics. The generated simulated signal can be used by clinical medical personnel for waveform analysis, and can also be used as training data to support the development and optimization of automatic ECG analysis models, providing a feasible alternative to the current shortage of labeled ECG datasets. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following introduction is made to the drawings of the embodiments of the present invention or the related technical solutions in the prior art. It should be understood that the drawings introduced below are only for the convenience of clearly describing some embodiments of the technical solutions of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative work.

[0044] Figure 1 Schematic diagram of the structure of the TTE model in an embodiment of the present invention;

[0045] Figure 2 is a schematic structural diagram of a noise predictor in an embodiment of the present invention;

[0046] Figure 3 Schematic diagram of the structure of the S4-AdaLNZ module in an embodiment of the present invention;

[0047] Figure 4 is an example diagram of a first simulated ECG signal in an embodiment of the present invention;

[0048] Figure 5 This is an example diagram of the second simulated ECG signal in an embodiment of the present invention. DETAILED DESCRIPTION

[0049] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application and are not to be construed as limiting the present application. For the step numbers in the following embodiments, they are provided only for the convenience of explanation and are not intended to limit the order of the steps. The order of execution of the steps in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.

[0050] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments and are not intended to limit the embodiments of the present application. The singular forms of "a", "said", and "the" used in the embodiments of the present application and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise. In addition, unless otherwise clearly defined, words such as setting, installing, and connecting should be understood in a broad sense, and those skilled in the art can reasonably determine the specific meanings of the above words in the present invention in combination with the specific content of the technical solution.

[0051] In the description of this application, it should be understood that descriptions involving orientations, such as up, down, front, back, left, right, etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings. They are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, they cannot be understood as limitations on this application.

[0052] In the description of this application, "several" means one or more, "many" means more than two, "greater than," "less than," and "exceed" are understood to exclude the number itself, while "above," "below," and "within" are understood to include the number itself. The terms "first" and "second" are used solely to distinguish technical features and are not to be construed as indicating or implying relative importance, or as implicitly specifying the number or order of the technical features indicated.

[0053] In the description of this application, "and / or" describes the relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.

[0054] Explanation of terms:

[0055] TTE model: the Text-to-ECG model, a latent diffusion model that incorporates text semantic constraints.

[0056] Diffwave architecture: The Diffwave architecture was first proposed in the paper Kong Z, Ping W, Huang J, et al. Diffwave: A versatile diffusion model for audio synthesis [J]. arXiv preprint arXiv: 2009.09761, 2020. It is a diffusion model that can accept text input and generate high-quality audio.

[0057] Bio_ClinicalBERT model: This is a Transformer-based text encoding model. The model was trained on the large medical database MIMIC III and its weights were made public. It can be used to encode clinical medical text.

[0058] In response to existing technical problems, ECG signal generation technology has become the key to breaking through the data bottleneck. By using generative models such as Generative Adversarial Network (GAN) and Diffusion Model (DM), combined with physiological signal constraints constructed based on clinical prior knowledge, simulated ECG signals with both real waveforms and pathological characteristics can be efficiently synthesized. This type of generated data has dual core values: on the one hand, it provides a standardized data set with controllable scale for classifier training. Especially in the identification of rare diseases, it can supplement pathological subtypes where real data is insufficient through conditional generation; on the other hand, it builds a compliant data sharing mechanism to generate signals that strip away patient privacy information while retaining the core features required for diagnosis, thereby achieving cross-regional sharing of ECG signals while meeting patient privacy protection policies.

[0059] To this end, this paper proposes a latent diffusion model (TTE) that incorporates textual semantic constraints. This model uses medical text descriptions as conditional input and, by embedding textual semantic constraints within the latent diffusion model architecture, generates 12-lead simulated ECG signals that conform to specific pathological features. The generated simulated signals can be used by clinical personnel for waveform analysis and can also serve as training data to support the development and optimization of automated ECG analysis models.

[0060] Example 1

[0061] This embodiment provides a method for generating a 12-lead ECG signal based on medical text, comprising the following steps:

[0062] S1. Obtain text information;

[0063] S2. Input the text information into the pre-trained TTE model to generate a 12-lead electrocardiogram signal.

[0064] Specifically, the TTE model includes an encoder, a noise predictor, and a decoder. During the model training phase, the pre-trained encoder performs feature extraction and dimensionality reduction on the original 12-lead electrocardiogram signal x, maps the high-dimensional time domain signal to a low-dimensional latent feature space, and obtains a latent feature vector z0. The noise predictor uses text semantic constraints as conditional input and constructs a noise sequence z by gradually adding Gaussian noise to the latent feature vector z0. t, to drive the model to learn the mapping relationship between the noisy feature distribution and the text semantic conditions; in the electrocardiogram generation stage, the noise predictor takes the text semantic conditions as input and generates the initial random Gaussian noise z T Starting from this, the latent feature vector that meets the conditional constraints is gradually restored through iterative denoising The pre-trained decoder transforms the latent feature vector Back-mapping to the high-dimensional original signal space to generate a 12-lead ECG signal corresponding to the semantics of the input text

[0065] The following is a detailed description of the three aspects of model overall architecture design, model training and effect evaluation, combined with the accompanying drawings and specific examples.

[0066] (1) Overall model architecture design

[0067] like Figure 1 As shown, the TTE model proposed in this embodiment is configured with three core functional modules: encoder, noise predictor, and decoder. The specific architecture and operation mechanism are as follows:

[0068] During the model training phase, the original 12-lead ECG signal x is first subjected to feature extraction and dimensionality reduction processing through a pre-trained encoder, and the high-dimensional time domain signal is mapped to a low-dimensional latent feature space to obtain a latent feature vector z0. On this basis, the noise predictor uses text semantic constraints (for example: "The disease category corresponding to this electrocardiogram is: Normal ECG. The remaining details are described as: sinus rhythm position type normal normal ECG (The disease category corresponding to this electrocardiogram is: Normal ECG. The remaining details are described as: sinus rhythm position type normal ECG)") as conditional input and is trained in combination with the denoising-denoising process of the latent space. Specifically, the noise sequence z is constructed by gradually adding Gaussian noise to the latent feature vector t , driving the model to learn the mapping relationship between noisy feature distribution and text semantic conditions, and then grasp the potential feature reconstruction rules under the constraints of different pathological characteristics or physiological parameters.

[0069] In the ECG generation stage, the noise predictor is based on the denoising mapping ability learned through training, takes the text semantic conditions as input, and generates the initial random Gaussian noise z T Starting from this, the latent feature vector that meets the conditional constraints is gradually restored through iterative denoising Finally, the pre-trained decoder maps the latent feature vector back to the high-dimensional original signal space to generate a 12-lead ECG signal that strictly corresponds to the semantics of the input text. Realize the conditional generation process from semantic description to waveform data.

[0070] (1.1) Encoder and Decoder

[0071] The TTE model of this embodiment adopts an autoencoder architecture to achieve feature compression and reconstruction of ECG signals. The autoencoder consists of multiple residual blocks, self-attention mechanism layers, downsampling modules and upsampling modules. Among them, the residual blocks effectively alleviate the gradient degradation problem in deep network training through jump connections, while enhancing the model's ability to learn multi-level features of ECG signals; the self-attention mechanism layer captures the long-range dependencies in the ECG signals to extract more pathologically discriminative global feature representations; and the downsampling module and the upsampling module respectively use one-dimensional convolutional layers and one-dimensional deconvolutional layers to achieve layer-by-layer dimensionality reduction and dimensionality increase of the signal dimension. The autoencoder strengthens the modeling capability of complex ECG patterns through the synergistic effect of residual connections and attention mechanisms, providing a highly robust feature basis for the subsequent semantic constraint generation of the latent space.

[0072] (1.2) Noise predictor

[0073] The noise predictor architecture of this embodiment is as follows Figure 2 As shown in , the noise predictor is based on the Diffwave architecture, and the core component consists of multiple cascaded residual blocks. In each residual block, the model is implemented by two cascaded S4-AdaLNZ modules (such as Figure 3 As shown in Figure 3, the diffusion step embedding and text conditional information embedding are processed in sequence, thereby introducing conditional constraints in the feature space.

[0074] See also Figure 3 In terms of processing diffusion step t, this patent generates a 128-dimensional embedding vector t for each diffusion step t emb :

[0075]

[0076] After the vector is transformed by the multi-layer perceptron MLP, it is input into the residual block. Inside the residual block, the S4-AdaLNZ module with the Adaptive Layer Normalization with Zeroinitialization (AdaLNZ) is used to transform the t emb Processing:

[0077] γ t ,β t ,αt =MLP t (t emb )

[0078] z S4T =z S4in +α t ⊙S4((1+γ t )⊙LN(z conv )+β t )

[0079] Among them, z S4in and z S4T They represent the input and output of the first S4-AdaLNZ module, LN represents layer normalization, γ t ,β t ,α t It means that t emb The scale and shift parameters are trained by a multi-layer perceptron (MLP).

[0080] For text conditional information, this embodiment constructs a standardized text condition constraint framework based on clinical diagnosis standards, as follows: The disease category corresponding to this electrocardiogram is: {disease_desc}. The remaining details are described as: {text}. The disease_desc field represents the disease category term corresponding to the ECG signal, and the text field represents the clinical diagnosis report text. For example, the text constraint "The disease category corresponding to this electrocardiogram is: Hypertrophy. The remaining details are described as: sinus tachycardia. Voltages are high in chest leads suggesting left ventricular hypertrophy. Otherwise normal ECG." indicates that the disease category of a certain ECG signal is myocardial hypertrophy, and the diagnosis report shows the presence of features such as sinus tachycardia and elevated chest lead voltages.

[0081] Secondly, the Bio_ClinicalBERT model is used to encode and extract features from the text to obtain a 768-dimensional embedding vector c emb :

[0082] c emb =Bio_ClinicalBERT(c)

[0083] This vector is then input into the residual block. Inside the residual block, the S4-AdaLNZ module with Adaptive Layer Normalization with Zero initialization (AdaLNZ) is used to normalize the c emb Processing:

[0084] γ c ,β c ,α c =MLP c (c emb )

[0085] z S4C =z S4T +a c ⊙S4((1+γ c )⊙LN(z S4T )+β c )

[0086] Among them, z S4T and z S4C They represent the input and output of the second S4-AdaLNZ module, LN represents layer normalization, and γ c ,β c ,α c It means that c emb The scale and shift parameters are trained by a multi-layer perceptron (MLP).

[0087] (2) Model training

[0088] (2.1) Database

[0089] The experiment in this embodiment uses the PTB-XL electrocardiogram diagnostic database. The PTB-XL electrocardiogram diagnostic database includes a total of 21,799 electrocardiogram signal records from 18,869 subjects. Each record is standard 12-lead data with sampling frequencies of 500Hz and 100Hz, and a duration of 10s. The record annotations are divided into five supercategories, such as health, myocardial infarction, and conduction disorder, and cardiovascular disease experts provide corresponding text diagnosis reports. This embodiment uses records with a sampling frequency of 100Hz, and each record lasts for 10 seconds. Except for a small number of records with missing leads, the remaining records can be used normally for this experiment. The statistics of the available data for this experiment are shown in Table 1, where some electrocardiogram signal records contain multiple labels. In addition, this embodiment divides all available data into training set, validation set, and test set in a ratio of 8:1:1.

[0090] Table 1: Experimental data statistics

[0091]

[0092] (2.2) Loss function and model training method

[0093] In this embodiment, for the encoder and decoder, the training objective is to minimize the mean squared error (MSE) between the reconstructed signal and the original input signal. The loss function is defined as follows:

[0094]

[0095] Among them, x i represents the original ECG, x i is the reconstructed ECG, and N is the number of samples. By optimizing this loss function, the model can learn an effective potential representation of the ECG, laying the foundation for the diffusion process in the noise predictor. During the training process, this embodiment uses the Adam optimizer, with an initial learning rate set to 0.01, a model batch size (batch_size) of 128, and a maximum round of 100 epochs. The learning rate is dynamically adjusted based on the performance of the model on the validation set. If the loss function value of the validation set does not improve for three consecutive epochs, the learning rate is reduced to one-tenth of the previous value. If the loss function value of the validation set does not improve for eight consecutive epochs, the model training is stopped.

[0096] For the noise predictor, if only the mean square error between the predicted noise and the actual noise is used as the loss function, insufficient attention will be paid to the high-frequency components in the signal, making it difficult to effectively constrain the high-frequency noise. This embodiment introduces frequency loss on this basis to better constrain the high-frequency noise. In order to further improve the quality of the generated ECG signal, this embodiment proposes the following composite loss function:

[0097]

[0098] in, represents the noise ε predicted by the noise predictor θ The mean square error loss with the true noise ε, represents the frequency loss between the reconstructed ECG latent vector z0 after denoising by the noise predictor and the original ECG latent vector z0, F(·) represents the short-time Fourier transform, which is used to obtain the joint time-frequency distribution of the ECG latent vector, and λ represents the weight coefficient. During training, this embodiment uses the Adam optimizer, the learning rate is set to 0.0002, the model batch size (batch_size) is 8, the number of iterations is 100,000 iterations, and the model parameters that perform best on the validation set are saved every 1,000 iterations.

[0099] (3) Effect evaluation

[0100] (3.1) Quantitative evaluation

[0101] In this embodiment, CLIP Score is used as a quantitative evaluation index to evaluate the semantic-morphological alignment effect of the 12-lead ECG signal generated by the model. Specifically, the evaluation system is constructed through a cross-modal pre-training framework: the Bio_ClinicalBERT model dedicated to the biomedical field is used as a text encoder to extract semantic features from clinical text and obtain the text embedding vector E t ; The one-dimensional convolutional neural network Xresnet1d50 is used as the ECG signal encoder to extract the morphological features of the ECG signal generated by the diffusion model and obtain the signal embedding vector E s .

[0102] The two embedding vectors are mapped to a unified semantic space through a linear projection layer, and the cosine similarity is used to calculate the cross-modal alignment score:

[0103]

[0104] This score represents the strength of the association between the morphological characteristics of the real signal or generated signal and the clinical diagnostic semantics. The closer the value is to 1, the higher the consistency between the pathological feature expression and semantic description of the ECG signal generated by the model.

[0105] The experimental results of the quantitative evaluation are shown in Table 2, where the CLIP Score represents the similarity between the ECG signal generated by the diffusion model and the corresponding clinical text. The CLIP Score Ground Truth represents the similarity between the real ECG signal and the corresponding clinical text. The rCLIP Score is the ratio of the CLIP Score to the CLIP Score Ground Truth. The experimental results show that the TTE model proposed in this example achieved a CLIP Score of 0.7498, outperforming existing ECG signal conditional generation models.

[0106] Table 2

[0107]

[0108] (3.2) Qualitative evaluation

[0109] In this embodiment, two 12-lead ECG signals generated by the TTE model are given (eg Figure 4 and Figure 5 As shown), the generation effect of ECG can be analyzed more intuitively.

[0110] in, Figure 4 This 12-lead ECG signal was generated using the text constraint "The disease category corresponding to this electrocardiogram is: Normal ECG. The remaining details are described as: Sinus rhythm normal ECG." As can be seen, the generated signal has a regular rhythm: the waveforms of each lead exhibit a regular sinus rhythm, with the P wave, QRS complex, and T wave appearing sequentially and in a consistent rhythm, without abnormalities such as premature beats or conduction block. The lead morphology is normal: the P waves in leads I and II of the limb leads are upright, while the P wave in lead aVR is inverted (consistent with the P wave polarity characteristic of normal sinus rhythm). The QRS complex width is normal, with no widening or deformity. The ST segment is not significantly elevated or depressed, and the T wave morphology is normal (no peaking or inversion).

[0111] Figure 5The 12-lead ECG signal is generated with the text constraint "The disease category corresponding to this electrocardiogram is: Hypertrophy. The remaining details are described as: sinus tachycardia. voltages are high in chest leads suggesting left ventricular hypertrophy. otherwise normal ecg." As can be seen, the QRS complex amplitude of the chest leads (V4, V5, V6, etc.) is significantly increased (compared to the Figure 4 Normal ECG, Figure 5 The chest lead waveform is more "tall," consistent with the description of "high voltages in the chest leads," a typical ECG finding of myocardial hypertrophy. The rhythm is regular, with a rapid heart rate and dense waveforms. The intervals between adjacent QRS complexes on the time axis are significantly shorter, consistent with the frequency characteristics of "sinus tachycardia." In addition to the voltage and heart rate, the P wave morphology, QRS duration (no widening), and ST-T segment (no significant depression / elevation, no abnormal T wave inversion) all conform to a normal ECG baseline. There are no additional abnormalities such as myocardial ischemia or conduction block, which is generally consistent with the text description.

[0112] In summary, the present invention has successfully developed and verified a text-conditional 12-lead ECG signal generation model. This model can use medical text descriptions as conditional input and, by embedding text semantic constraints within the latent diffusion model architecture, generate 12-lead simulated ECG signals that conform to specific pathological characteristics. The superiority of the generation effect of the model of the present invention was verified from both quantitative and qualitative evaluation aspects. The generated simulated signals can be used by clinical medical personnel for waveform analysis and can also serve as training data to support the development and optimization of automatic ECG analysis models, providing a viable alternative to the current shortage of labeled ECG datasets.

[0113] The proposed model uses medical text descriptions as conditional input and embeds text semantic constraints within a latent diffusion model architecture to generate 12-lead simulated ECG signals that conform to specific pathological features. Quantitative evaluation (CLIPScore semantic alignment) and qualitative evaluation (clinical expert waveform interpretation) verified that the model-generated signals significantly outperformed traditional generative models in terms of consistency between morphological features and diagnostic semantics. The generated simulated signals have dual application value:

[0114] 1) Clinical assistance level: Provide clinical medical personnel with customizable waveform analysis samples to assist in teaching and training and preliminary research on rare cases.

[0115] 2) Data support level: As standardized synthetic training data, it effectively alleviates the industry pain point of the lack of labeled ECG data, and provides a compliant data foundation for the development, optimization and cross-institutional transfer learning of ECG automatic analysis models.

[0116] 3) This invention, through the deep integration of generative AI technology and medical semantics, has opened up a new path for data acquisition and application in the field of cardiovascular disease diagnosis, and has significant clinical translation value and industry application potential.

[0117] Example 2

[0118] An embodiment of the present invention also provides an electronic device, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set, or an instruction set, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement a 12-lead electrocardiogram signal generation method based on medical text as described in Example 1.

[0119] It is understood that the memory may include random access memory (RAM) or read-only memory (ROM). Optionally, the memory includes a non-transitory computer-readable storage medium. The memory may be used to store instructions, programs, codes, code sets, or instruction sets. The memory may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function, instructions for implementing the various method embodiments described above, etc.; the data storage area may store data created based on the use of the server, etc.

[0120] The processor may include one or more processing cores. The processor uses various interfaces and lines to connect various parts of the entire server. By running or executing instructions, programs, code sets or instruction sets stored in the memory, and calling data stored in the memory, the processor performs various server functions and processes data. Optionally, the processor can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor can integrate one or a combination of a central processing unit (CPU) and a modem. The CPU mainly processes the operating system and application programs, while the modem is used to handle wireless communications. It is understandable that the above-mentioned modem can also be implemented separately through a chip instead of being integrated into the processor.

[0121] Since the electronic device is an electronic device corresponding to a 12-lead ECG signal generation method based on medical text in an embodiment of the present invention, and the principle of solving the problem by the electronic device is similar to that of the method, the implementation of the electronic device can refer to the implementation process of the above-mentioned method embodiment, and the repeated parts will not be repeated.

[0122] Example 3

[0123] An embodiment of the present invention also provides a computer-readable storage medium, which stores at least one instruction, at least one program, code set or instruction set. The at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement a 12-lead electrocardiogram signal generation method based on medical text as described in Example 1.

[0124] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program. The program can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium capable of carrying or storing data.

[0125] Since the storage medium is a storage medium corresponding to a 12-lead ECG signal generation method based on medical text in an embodiment of the present invention, and the principle of solving the problem by the storage medium is similar to that of the method, the implementation of the storage medium can refer to the implementation process of the above-mentioned method embodiment, and the repeated parts will not be repeated.

[0126] Example 4

[0127] In some possible implementations, various aspects of the methods of the embodiments of the present invention may also be implemented in the form of a program product, which includes program code. When the program product is executed on a computer device, the program code is used to cause the computer device to perform the steps of the method for generating a 12-lead ECG signal based on medical text according to various exemplary embodiments of the present application as described above in this specification. The executable computer program code or "code" used to perform the various embodiments may be written in a high-level programming language such as C, C++, Python, Smalltalk, Java, JavaScript, Visual Basic, Structured Query Language (e.g., Transact-SQL), Perl, or in various other programming languages.

[0128] It should be understood that various parts of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0129] In the description of this specification, the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" mean that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.

[0130] The above embodiments are intended only to illustrate the technical concepts and features of the present invention. Their purpose is to enable those skilled in the art to understand the contents of the present invention and implement them accordingly. They are not intended to limit the scope of protection of the present invention. Any equivalent changes or modifications made based on the essence of the present invention are intended to be covered by the scope of protection of the present invention.

Claims

1. A method for generating 12-lead electrocardiogram signals based on medical text, characterized in that: The following steps are involved: Get text information; Input text information into the pre-trained TTE model to generate a 12-lead electrocardiogram signal; Wherein, the TTE model includes an encoder, a noise predictor and a decoder; In the model training phase, the original 12-lead ECG signal x is subjected to feature extraction and dimensionality reduction processing through the pre-trained encoder, and the high-dimensional time domain signal is mapped to the low-dimensional latent feature space to obtain the latent feature vector z0; the noise predictor takes the text semantic constraint as the conditional input and constructs the noise sequence z by gradually adding Gaussian noise to the latent feature vector z0. t , to drive the model to learn the mapping relationship between noisy feature distribution and text semantic conditions; In the ECG generation stage, the noise predictor takes the text semantic condition as input and generates the initial random Gaussian noise z T Starting from this, the latent feature vector that meets the conditional constraints is gradually restored through iterative denoising The pre-trained decoder transforms the latent feature vector Back-mapping to the high-dimensional original signal space to generate a 12-lead ECG signal corresponding to the semantics of the input text 2. The method for generating 12-lead ECG signals based on medical text according to claim 1, characterized in that: The TTE model uses an autoencoder architecture to achieve feature compression and reconstruction of ECG signals; The autoencoder is composed of multiple residual blocks, a self-attention mechanism layer, a downsampling module and an upsampling module; Among them, the residual block effectively alleviates the gradient degradation problem in deep network training through skip connections, while enhancing the model's ability to learn the multi-level features of ECG signals; The self-attention mechanism layer captures the long-range dependencies in the ECG signal to extract more pathologically discriminative global feature representations; The downsampling module and upsampling module use one-dimensional convolution layer and one-dimensional deconvolution layer respectively to achieve layer-by-layer dimensionality reduction and dimensionality increase of the signal dimension.

3. The method for generating 12-lead ECG signals based on medical text according to claim 1, characterized in that: The noise predictor consists of multiple cascaded residual blocks; in each residual block, two cascaded S4-AdaLNZ modules are used to process the diffusion step embedding and the text conditional information embedding in sequence, thereby introducing conditional constraints in the feature space.

4. The method for generating 12-lead ECG signals based on medical text according to claim 3, characterized in that: In terms of processing diffusion step t, an embedding vector t is generated for each diffusion step t emb , vector t emb After the nonlinear transformation of the multi-layer perceptron MLP, it is input into the residual block; Inside the residual block, the S4-AdaLNZ module performs the vector t emb Processing: c t ,b t ,a t =MLP t (t emb ) With S4T =z S4in +α t ⊙S4((1+γ t )LN(z conv )+β t ) Where z S4in and z S4T They represent the input and output of the first S4-AdaLNZ module, LN represents layer normalization, and γ t ,α t Both are represented by vector t emb The scaling parameter β is trained by the multi-layer perceptron. t By vector t emb The offset parameters are trained by the multi-layer perceptron; MLP t Represents a multilayer perceptron used to process the diffusion step; ⊙ represents the element-wise dot product operation.

5. The method for generating 12-lead ECG signals based on medical text according to claim 3, characterized in that: For text conditional information, the Bio_ClinicalBERT model is used to encode and extract features from the text to obtain the embedding vector c emb : c emb =Bio_ClinicalBERT(c) Where c is the input medical text condition information; The vector c emb Input to the residual block, S4-AdaLNZ module is used to calculate c emb Processing: c c ,b c ,a c =MLP c (c emb ) With S4C =z S4T +a c ⊙S4((1+γ c )LN(z S4T )+β c ) Where z S4T and z S4C They represent the input and output of the second S4-AdaLNZ module, LN represents layer normalization, and γ c ,α c Both are represented by vector c emb Scaling parameters trained by a multi-layer perceptron; β c By vector c emb The offset parameters are trained by the multi-layer perceptron; MLP c Represents a multilayer perceptron for processing conditional information.

6. The method for generating 12-lead ECG signals based on medical text according to claim 1, characterized in that: For the encoder and decoder, the training objective is to minimize the mean square error between the reconstructed signal and the original input signal. The loss function is defined as follows: Where x i Represents the original 12-lead ECG signal, x i is the reconstructed 12-lead ECG signal, and N is the number of samples.

7. The method for generating 12-lead ECG signals based on medical text according to claim 1, characterized in that: For the noise predictor, the loss function during training is: Where, represents the noise ε predicted by the noise predictor θ Mean square error loss with the true noise ε; represents the frequency loss between the reconstructed ECG latent vector z0 after denoising by the noise predictor and the original ECG latent vector z0; F(·) represents the short-time Fourier transform; λ represents the weight coefficient.

8. An electronic device, characterized in that: The electronic device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set, or an instruction set, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the method according to any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that The storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the method according to any one of claims 1 to 7.

10. A computer program product, characterized in that The computer program product comprises computer instructions, which are used to perform the method according to any one of claims 1 to 7 when executed by a processor.

Citation Information

Cited By

  • Fracture treatment scheme and operation scheme simulation system based on big data analysis

    CN121839028A

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

    CN122320566A

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

    CN122320566B