Method for imaging transmembrane potential of heart based on electrocardiogram combined with physiological model

By using a deep learning network based on the attention mechanism of a 12-lead electrocardiogram and physiological model, the ill-posedness of the inverse problem in non-invasive electrocardiographic imaging was solved, achieving high-precision reconstruction of cardiac transmembrane potentials. This network is suitable for accurate localization of ectopic pacing and infarction, and exhibits good generalization and robustness.

CN117557667BActive Publication Date: 2026-07-21ZHEJIANG UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG UNIV
Filing Date
2023-11-14
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing non-invasive electrophysiological imaging techniques suffer from mathematical non-uniqueness and pathological conditions. Multi-lead devices are expensive and not widely available. Deep learning methods require large amounts of computation and are difficult to parallelize when dealing with long sequence problems, making it impossible to guide cardiac electrophysiological ablation in real time.

Method used

By employing a combined physiological model and attention mechanism based on 12-lead electrocardiogram, and introducing a deep learning network with self-attention and cross-attention modules, the ill-posedness of the inverse problem is addressed, dynamic physiological information of cardiac transmembrane potential is extracted, and cardiac transmembrane potential is reconstructed.

Benefits of technology

It achieves high-precision, real-time reconstruction of cardiac transmembrane potentials, improves the accuracy of ectopic pacing localization and the reconstruction accuracy of infarct location range, and has good generalization and robustness, making it suitable for different cardiac structures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117557667B_ABST
    Figure CN117557667B_ABST
Patent Text Reader

Abstract

The application discloses a kind of cardiac transmembrane potential imaging methods based on 12 lead electrocardiogram joint physiological model and attention mechanism, to solve the serious ill-conditioned problem caused by information asymmetry between 12 lead signal and TMP, reconstruct cardiac transmembrane potential from 12 lead ECG signal.In order to obtain the dynamic physiological information of BSP and TMP, the application introduces self-attention mechanism to capture the long-term, periodic dynamic activation process characteristics of cardiac electrophysiology, extract the similarity within the sequence, calculate the attention score, then multiply the score with the input sequence, extract the key segment in the sequence, i.e.the segment that is expected to be "noticed".Meanwhile, the application regards the inverse problem as the potential feature mapping of TMP on BSP, captures the dynamic characteristics of inverse relationship by introducing cross-attention module, learns the inverse feature mapping relationship from a large number of data pairs using neural network, and solves the ill-posed problem of inverse problem.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of cardiac potential imaging technology, specifically relating to a cardiac transmembrane potential imaging method based on a 12-lead electrocardiogram combined with a physiological model and attention mechanism. Background Technology

[0002] With the rapid development of modern science and technology and clinical medicine, the diagnosis of heart disease can be divided into invasive and non-invasive methods. Invasive cardiac electrophysiological examination uses a catheter to make direct contact with the surface of the heart (endocardium and epicardium). Although it can obtain potentials directly and accurately, this process is complex and costly, and may also stimulate the myocardium, often causing fatal arrhythmias and leading to sudden death.

[0003] Non-invasive electrophysiological (EP) imaging aims to reconstruct cardiac electrical activity from measured body surface signals. It determines the electrical activity of cardiomyocytes, such as transmembrane potentials (TMPs), through body surface potential (BSP) and patient-specific trunk-heart geometry. However, solving the inverse EP problem is mathematically non-unique and pathological. Clinically widely used ECG diagnosis is also a form of solving an inverse ECG problem, but it relies on the physician's extensive prior clinical knowledge to infer the physiological state of the heart from body surface potentials. Therefore, a common approach is to impose constraints on the solution, limiting it to an appropriate range based on prior physiological information, and then finding the optimal solution. Currently, non-invasive electrophysiological imaging based on standard body surface leads uses 64-lead, 120-lead, or 128-lead systems; more leads mean higher accuracy. However, multi-lead devices are not only expensive but also not widely available clinically, requiring extensive physician experience and unable to provide real-time guidance for cardiac electrophysiological ablation.

[0004] Deep learning (DL) methods have achieved promising results in electrocardiogram (ECG) reconstruction. Based on data-driven and model-driven approaches, DL overcomes the pathological nature of inverse problems by learning features from large datasets and incorporating physiological prior information to impose constraints. ECG signals are regular, periodic signals, and variations in different ECG segments reflect underlying cardiac issues. Since ECG signals represent a series of sequences, traditional RNN structures are generally used to handle sequence problems. While RNNs have significant advantages in solving dynamic problems, when the time step is too long, adjusting the weight matrix using gradient calculation often results in exploding or vanishing values ​​after many time steps due to the continuous multiplication of numerous partial derivatives. This makes it difficult for RNNs to learn long-range information and hinders parallel computation. Furthermore, the paper [Lipton ZC, Kale DC, Elkan C, et al. Learning to Diagnose with LSTM Recurrent Neural Networks[J]. Computer Science, 2017.DOI:10.48550 / arXiv.1511.03677] proposes using LSTM for modeling clinical data. However, the LSTM module increases computational cost and consumes significant resources when dealing with long sequence problems. Model-driven methods also incorporate prior knowledge from physics or other fields to guide the deep learning process. For example, the paper [HUANG X, YU C, LIU H. Physiological Model Based Deep Learning Framework for Cardiac TMP Recovery; procedures of the International Conference on Medical Image Computing and Computer-Assisted Intervention, F, 2022[C]. Springer] introduces a Kalman filter-based framework combined with the dynamic activation model of TMP, but it does not consider the dynamic information of the BSP itself.

[0005] To address this issue, Self-Attention and Cross-Attention modules were introduced into deep learning networks. Compared to recurrent neural networks, these modules allow for parallel processing; compared to convolutional neural networks, they have a larger receptive field, enabling them to focus on global information of the sequence. Considering the limitations of existing methods, this study, based on the attention mechanism to extract dynamic physiological change information from the sequence, achieved accurate reconstruction results for transmembrane potentials in the heart. Summary of the Invention

[0006] In view of the above, the present invention provides a cardiac transmembrane potential imaging method based on 12-lead electrocardiogram combined with physiological model and attention mechanism. By introducing cross-attention mechanism to extract inverse relation, and using neural network to learn inverse feature mapping relation from a large number of data pairs, the ill-posed problem of inverse problem is solved.

[0007] A cardiac transmembrane potential imaging method based on 12-lead electrocardiography combined with a physiological model and attention mechanism includes the following steps:

[0008] (1) Collect the body surface potential data and chest cavity tomography image data of the research subjects, and solve the positive mapping relationship between body surface potential and cardiac transmembrane potential by boundary element method;

[0009] (2) By simulating the construction of cardiac transmembrane potential data under different infarction sites and different pacemakers, a large number of data samples are obtained. Each data sample contains a set of cardiac transmembrane potential sequences and the body surface potential sequence obtained through positive mapping (with noise added). All data samples are then divided into training set, validation set and test set according to the proportion.

[0010] (3) Construct a deep learning network model based on joint physiological model and attention mechanism, which consists of two parts: encoder and decoder. The decoder includes two parts: pre-stage and post-stage. The encoder and pre-stage decoder extract the internal similarity of body surface potential sequence and cardiac transmembrane potential sequence through self-attention mechanism, respectively. The post-stage decoder uses cross-attention mechanism to extract the inverse relationship, namely the potential feature mapping of cardiac transmembrane potential on body surface potential.

[0011] (4) The above network model is trained using the data samples of the training set, thereby obtaining the cardiac transmembrane potential reconstruction model;

[0012] (5) Input the body surface potential sequence in the test set data sample into the cardiac transmembrane potential reconstruction model, and the reconstruction result of the cardiac transmembrane potential sequence can be directly output.

[0013] Further, in step (1), a three-dimensional trunk geometric model and a three-dimensional heart geometric model of the research object are first established based on the chest tomography image data. Then, the two models are unified into the same coordinate system and fused to obtain the geometric correspondence between the heart and the trunk. Then, a quasi-static electric field model of the heart-trunk is established based on the geometric correspondence. The boundary element method is used to solve the electric field model to obtain the positive mapping relationship between the body surface potential and the transmembrane potential of the heart, i.e., Φ = HU, where H is the mapping matrix, U is the transmembrane potential of the heart, and Φ is the body surface potential.

[0014] Further, in step (2), the cardiac geometry is first divided into 17 parts according to the American Heart Association standard, and infarction is set separately in each part (the conductivity of the infarct area is set to 0.45, and the conductivity of the other normal areas is set to 0.15), resulting in a total of 17 infarction categories, plus a category of no infarction in all parts; for any category, pacing is set separately at each node of the three-dimensional cardiac geometry model, and for any pacing point, the partial differential equation of the state transition equation of the Aliev-Panfilov model is solved according to its transmembrane potential and the conductivity of each part to obtain the transmembrane potential of all nodes; by traversing in this way, 18×m sets of cardiac transmembrane potential sequences can be obtained, where m is the number of nodes in the three-dimensional cardiac geometry model, and each set of cardiac transmembrane potential sequences contains the transmembrane potentials of all nodes for multiple consecutive frames.

[0015] Furthermore, for the body surface potential sequence input to the network model, it is first embedded through a linear layer to make its size 12×n×d, and then its position is encoded before being input to the encoder, where d is the dimension of the embedding vector and n is the number of frames; for the cardiac transmembrane potential sequence input to the network model, it is first concatenated with a start_token of length m and all values ​​of -1 to make its size m×(n+1), and then its feature is embedded through a linear layer to make its size m×(n+1)×d, and finally its position is encoded before being input to the front-end decoder.

[0016] Furthermore, both the encoder and the pre-decoder are composed of multiple cascaded Transformers. Each Transformer consists of a multi-head self-attention mechanism layer, a regularization layer L1, a feedforward neural network, and a regularization layer L2 connected in sequence. The input to the regularization layer L1 is the superposition of the output and input of the multi-head self-attention mechanism layer, and the input to the regularization layer L2 is the superposition of the output and input of the feedforward neural network. The multi-head self-attention mechanism layer in the pre-decoder incorporates a masking mechanism. Specifically, a lower triangular matrix is ​​added, where the parts with values ​​of 0 are the masked parts. These parts are set to infinitesimal, and after passing through the softmax layer, they essentially become 0, having no impact on the result.

[0017] Furthermore, the subsequent decoder is composed of multiple cascaded Transformers, each of which consists of a multi-head cross-attention mechanism layer, a regularization layer L1, a feedforward neural network, and a regularization layer L2 connected in sequence. The input of the regularization layer L1 is the superposition of the output and input of the multi-head cross-attention mechanism layer, and the input of the regularization layer L2 is the superposition of the output and input of the feedforward neural network. The multi-head cross-attention mechanism layer multiplies the encoder output with the corresponding linear transformation matrix to obtain the key vector matrix K and the value vector matrix V, and multiplies the output of the previous Transformer layer of the decoder with the corresponding linear transformation matrix to obtain the query vector matrix Q. Then, the attention score is calculated based on the vector matrices K, V, and Q.

[0018] Furthermore, the specific process of training the network model in step (4) is as follows:

[0019] 4.1 Initialize model parameters, including the bias vector and weight matrix of each layer, learning rate, maximum number of iterations, and optimizer;

[0020] 4.2 Input the body surface potential sequence and cardiac transmembrane potential sequence from the training set data samples into the encoder and decoder of the model, respectively. The model outputs the corresponding TMP reconstruction result through forward propagation. Calculate the loss function between the reconstruction result and the ground truth label.

[0021] 4.3 Based on the loss function, the optimizer iteratively updates the model parameters using gradient descent until the loss function converges, and the training is complete;

[0022] 4.4 After training is completed, the model is validated using validation set data samples. The model that performs best on the validation set is taken as the final cardiac transmembrane potential reconstruction model.

[0023] Furthermore, the expression for the loss function is as follows:

[0024]

[0025] Where: L represents the loss function, H is the mapping matrix, and y k Let u represent the body surface potential sequence in the k-th data sample. k Indicates y k The corresponding true value of the cardiac transmembrane potential sequence (i.e., the sequence data of the cardiac transmembrane potential sequence shifted one frame in the k-th data sample). Indicates y k The corresponding TMP reconstruction result, where N represents the number of samples in a batch.

[0026] This invention develops a joint physiological model attention mechanism to address the severe pathological inverse problem caused by information asymmetry between 12-lead signals and transmembrane potentials (TMPs), reconstructing cardiac transmembrane potentials from 12-lead ECG signals. To obtain dynamic physiological information from the bone surface area (BSP) and TMPs, this invention introduces a self-attention mechanism to capture the long-term, periodic dynamic activation process characteristics of cardiac electrophysiology, extracting intra-sequence similarity. Attention scores are calculated, and then multiplied by the input sequence to extract key segments in the sequence—those that are desired to be "attentioned." Simultaneously, this invention treats the inverse problem as a latent feature mapping of TMPs on the BSP, introducing a cross-attention module to capture the dynamic features of the inverse relationship. A neural network is then used to learn the inverse feature mapping relationship from a large number of data pairs, thus resolving the ill-posedness of the inverse problem.

[0027] The above process is completed simultaneously in multiple subspaces, which expands the model's ability to learn different features of the sequence. In the experiment, we used different heart models for training, which improved the generalization of the present invention. Compared with other deep learning methods, the model of the present invention is more accurate in ectopic pacing localization in the training dataset during the test, has high accuracy in reconstructing the location and extent of infarction, and has good generalization and robustness to different network structures. Attached Figure Description

[0028] Figure 1 This is a schematic diagram illustrating the construction process of a three-dimensional heart-torso geometric model.

[0029] Figure 2 This is a schematic diagram of the deep learning network structure based on the joint physiological model and attention mechanism of the present invention.

[0030] Figure 3 This is a schematic diagram of the structure of the self-attention module (left) and the cross-attention module (right).

[0031] Figure 4 The images show the results of dynamic reconstruction of transmembrane potentials from simulation data of various methods. The red areas represent the earliest activated positions, and the blue areas represent the inactive positions. From top to bottom, they correspond to the results of the ground truth image, the method of this invention, TV, FcVAE, and ISTAN reconstructions, respectively.

[0032] Figure 5 Three simulation data localization results of pacing at different locations were selected for various methods. From left to right, they correspond to the ground truth image, the method of this invention, TV, FcVAE, and ISTAN reconstruction results, respectively.

[0033] Figure 6Reconstruction results of three cases of infarction at different locations (from top to bottom) were selected for each method. The blue area represents the location and extent of myocardial infarction, and the red area represents the normally activated area. From left to right, the results correspond to the ground truth image, the method of this invention, TV, FcVAE, and ISTAN reconstruction.

[0034] Figure 7 The images show the TMP curve reconstruction results for various methods, where the red curve represents the true curve, and the blue, sky blue, black, and magenta colors correspond to the reconstruction results of the method of this invention, FcVAE, ISTAN, and TV, respectively.

[0035] Figure 8 The results of the generalization study of this invention on different cardiac structures (from left to right) are shown in the figure below. From top to bottom, they are the ground truth plot, the reconstruction plot of the method of this invention, and the TMP curve reconstruction results (red is the ground truth curve, and blue is the reconstruction curve).

[0036] Figure 9 The images show the reconstruction results of real clinical data according to the present invention. From top to bottom, they are Cine MR images of ectopic pacing, myocardial infarction, and the reconstruction results of myocardial infarction using the method of the present invention. Detailed Implementation

[0037] To describe the present invention in more detail, the technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0038] This invention relates to a cardiac transmembrane potential imaging method based on a 12-lead electrocardiogram combined with a physiological model and attention mechanisms, comprising the following steps:

[0039] (1) Construct a 3D trunk-heart geometric model and a positive mapping matrix.

[0040] Twelve-lead electrocardiogram (ECG) surface potential data and thoracic computed tomography (CT) images were collected from the study subjects. Based on the CT images, three-dimensional trunk and cardiac geometric models were established for each subject. These models were then unified into a single coordinate system to obtain a three-dimensional heart-trunk model. Figure 1 As shown; the quasi-static electric field model of the heart-truncusa region is solved using the boundary element method, and the model of the heart transmembrane potential being positively mapped to the body surface potential through the transformation matrix is ​​as follows:

[0041] Φ=HU

[0042] Where: Φ represents the body surface potential, U is the cardiac transmembrane potential, and H is the positive mapping from the transmembrane potential to the body surface potential, which is only related to the geometry and conductivity of the heart-trunk structure.

[0043] (2) Simulation data.

[0044] This invention divides the heart's geometry into 17 parts according to the American Heart Association standard, and sets an infarct in each part. The conductivity of the infarcted area is set to 0.45, while that of the remaining normal parts is set to 0.15. A pacing device is set at each node, and the cardiac electrophysiology satisfies the Aliev-Panfilov model.

[0045]

[0046]

[0047] Where: u is the transmembrane potential, v is the vector of the recovery current, D is the diffusion tensor, k is the repolarization parameter, and a is the cardiomyocyte conductivity.

[0048] Based on the state transition equation of the Aliev-Panfilov model, with the initial state being the set pacemaker, the partial differential equation is solved to obtain TMP data for different pacing sites and infarct sites; after forward calculation and adding 30dB noise, BSP data is obtained to obtain simulation data pairs.

[0049] In the specific implementation process, we run TMPSimulation.cpp based on the generated geometric structure files (heart.cor, heart.fib, heart_tet.cor, heart.tet), inputting the geometric structure file path, the number of heart nodes, the number of leads, isotropy, and the conductivity α value to generate Mass.bin and Stiff.bin. We then calculate the state transition matrix Trans_state.bin using MATLAB. Next, we input the generated state transition matrix and the standard 17-segment segmentation file heart.seg into TMP_simulation.mat. By setting the pacing position for each node and rotating the 17 segmentation sites for infarction, we simulated TMP simulation data including infarction and ectopic pacing. Finally, using H.mat and TMP.mat, we set the added Gaussian noise to 30dB, and obtained BSP.mat through forward computation. After normalization, we obtained data pairs, which were then divided into training, validation, and test sets in an 8:1:1 ratio.

[0050] (3) Build the model.

[0051] A deep learning network based on a joint physiological model and attention mechanism was constructed. Y, representing the body surface potential (BSP), and X, representing the corresponding transmembrane potential (TMP), were input into the network for training. The network consists of an encoder and a decoder, each with three encoding blocks and three decoding blocks. In the encoding structure, the input to the first encoding block is a vector matrix incorporating positional encoding; subsequent encoding blocks receive the output of the previous block. After three encoding blocks, the encoding structure outputs an encoded information matrix. In the decoding structure, the input to the first decoding block is a vector matrix incorporating positional encoding information and a mask; subsequent decoding blocks receive the output of the previous block. After three decoding blocks, the decoding structure outputs the final result.

[0052] like Figure 2 As shown, the batch_size is set to 1, meaning the input BSP data has a dimension of 12×200, where 200 is the number of frames. Before being input into the network, it passes through a linear layer for feature embedding, changing the dimension to 12×200×d, which serves as the encoder input, where d is the embedding_size. The TMP sequence has a dimension of m×200, where m is the number of heart geometric nodes. TMP first concatenates a long sequence start_token consisting entirely of -1s as a marker to begin prediction, thus changing the TMP input dimension to m×201. Similarly, TMP passes through a linear layer for feature embedding, changing the dimension to m×201×d, which serves as the decoder input. In this embodiment, d = 200.

[0053] To achieve parallel input, relative positional information needs to be embedded in the data to represent the position of the current value in the long sequence. Positional encoding is used to store the relative or absolute position of the current potential in the sequence. Therefore, we use trigonometric functions to extract local features of the long sequence and introduce time-related information as follows:

[0054] PE (pos,2i) =sin(pos / 10000) (2i / d) )

[0055] PE (pos,2i+1) =cos(pos / 10000) (2i / d) )

[0056] Where: pos represents the current node's position in the sequence, 2i and 2i+1 represent even and odd dimensions, and d is the total number of features, which equals 200 in the network; the advantage of using trigonometric functions for position encoding is that the signal at a certain moment can be linearly transformed from the signals at other moments, and the relative position information of the sequence can be represented in this way, i.e.:

[0057] PE(pos+k,2i)=PE(pos,2i)PE(k,2i+1)+PE(pos,2i+1)·PE(k,2i)

[0058] PE(pos+k,2i+1)=PE(pos,2i+1)·PE(k,2i+1)-PE(pos,2i)·PE(k,2i)

[0059] Meanwhile, since parallel computing can be achieved, the positional encoding information of the sequence is summed with the result after linear transformation and then input into the encoding / decoding end.

[0060] The encoding block consists of four parts: Multi-head Attention, Add&Norm, Feed Forward, and Add&Norm. Multi-head Attention comprises eight self-attention mechanisms, divided into eight subspaces. The input dimension of each self-attention mechanism is m×s, where s = d / 8. The input vector matrix and the linear transformation matrix W... Q W K and W V Multiply these to obtain Q, K, and V, then calculate the attention score using the following formula:

[0061]

[0062] Where: s is the number of columns in matrices Q, K, and V, and softmax is calculated for each row of the matrix.

[0063]

[0064] The output of each Self-Attention is of dimension R. n×t×s The matrix is ​​obtained by concatenating the eight output matrices and passing them through a linear layer to obtain a matrix of dimension R. n×t×d The matrix is ​​the output of Multi-Head Attention.

[0065] Feed Forward consists of two linear layers. The first linear layer has a ReLU activation function, while the second linear layer does not. This can be expressed by the formula:

[0066] FeedForard(x)=W2RELU(W1x+b1)+b2

[0067] Add&Norm includes residual connectivity and layer normalization, expressed by the formula:

[0068] Add&Norm(x)=LayerNorm(x+F(x))

[0069] Where: LayerNorm() represents layer normalization, which normalizes different channels of the same sample, and F(x) represents the calculation result of the input matrix x after Multi-Head Attention or Feed Forward.

[0070] The decoding block consists of six parts: Multi-Head Attention, Add&Norm, Feed Forward, Add&Norm, Cross-Attention, Add&Norm, and Feed Forward. Multi-Head Attention takes X with the added start_token as input and extracts information from the TMP sequence itself. It adds a masking operation to the basic attention mechanism. Since the decoder needs to predict based on data before the current time step, data after the current time step needs to be hidden. This is achieved by adding a lower triangular matrix, where the zero parts represent the masked positions. The masked areas are made infinitesimally small, resulting in essentially zeros after the softmax layer, having no impact on the result. The first encoder extracts the attention information of the X sequence itself. Cross-Attention is the cross-attention module, such as... Figure 3 As shown, it uses the encoded information matrix as K and V, and the output of the Multi-Head Attention module at the decoding end as Q, which is then transformed by the linear transformation matrix W. Q W K and W V Multiply these to obtain Q, K, and V, and then calculate the attention score.

[0071] (4) Online training.

[0072] First, set the optimizer, learning rate, batch size, and maximum number of iterations to initialize the network parameters.

[0073] Then, X and Y from the training set are randomly batch-input into the network, and the network outputs a prediction TMP. The loss function between the predicted X value and the ground truth label is calculated:

[0074]

[0075] Where: u k and y k These are the actual values ​​of TMP and BSP, respectively. Here, H represents the reconstructed TMP predictions, and H is the transfer matrix.

[0076] Finally, gradient descent is used to update the network parameters. During training, a validation set is used to validate the network model. Training is complete when the loss function converges to its minimum or the maximum number of iterations is reached. During validation, the Mean Square Error (MSE) between the predicted and ground truth labels is calculated using the following formula:

[0077]

[0078] (5) Test results.

[0079] Input the BSP of the test set into the encoder of the trained network model, and simultaneously input the start_token (all values ​​of -1) into the encoder of the network to obtain the corresponding TMP reconstruction result.

[0080] The effectiveness of this invention is verified by simulation experiments, which are conducted on ectopic pacing data and myocardial infarction data in the test set. Figure 4 This is the reconstructed TMP dynamic propagation process. From top to bottom, the results are the true value, the method of this invention, TV, Fcvae, and ISTAN method. The red part represents the earliest pacing site. It can be seen that the entire cardiac potential is first activated by the activation point and then gradually spreads to the entire heart. In one ECG cycle, the moments of 10ms, 50ms, 100ms, and 150ms are compared. It can be seen that the method of this invention has the closest effect to the true value in dynamic temporal reconstruction.

[0081] Figure 5 Three different ectopic pacing cases were selected, with the earliest activated site indicated in red; Figure 6 The results of reconstructing myocardial infarction are shown in blue, where the infarct area represents the area that has never been activated. The visualization results of the reconstructed infarct area by the method of this invention are higher than those of other methods, which verifies the effectiveness of the present invention in reconstructing the infarct area. Figure 7 The results are the reconstructed TMP curves. The red curve represents the true label value, the blue curve represents the reconstruction result of the method of this invention, which is not only close to the true value but also has small oscillations; the sky blue curve represents the reconstruction result of Fcvae, and it can be seen that the curve reconstructed by this method has relatively large oscillations; the black and magenta curves represent the reconstruction results of ISTAN and TV, respectively.

[0082] Figure 8 The results were validated on three different cardiac structures. From top to bottom, they show the true TMP distribution, the reconstruction results of this invention, and a comparison of the true TMP curve and the reconstructed TMP curve. It can be seen that this invention can be applied to different cardiac structures and has strong generalization ability.

[0083] Table 1 shows the quantitative analysis results of the method of this invention (STFEM) and other methods in locating ectopic pacing and reconstructing infarct sites. Compared with other methods, the reconstruction effect of this invention is superior.

[0084] Table 1

[0085]

[0086] Figure 9 The results are validated using real clinical data. From top to bottom, they show the actual ectopic pacing, Cine MR images of myocardial infarction, and the reconstructed infarct site. In the first row, the white nodes represent the actual pacing location, and the black nodes represent the reconstructed pacing location. Clinically, the positioning error is approximately 30-40 mm. This result indicates that although the method of this invention cannot achieve precise positioning, it can be used to guide doctors in locating ectopic pacing sites and can also be used for intraoperative guidance. In the second row of Cine MR images, the white area represents the myocardial infarction site as indicated by the contrast agent, marked with a red circle. The third row shows the reconstruction result, with the blue area representing the infarct area. For infarction detection tasks, it can be seen that this invention can perform detection with relatively high accuracy.

[0087] Experimental results show that the cardiac transmembrane potential reconstruction method based on 12-lead electrocardiography combined with dynamic physiological information and attention mechanism is effective. It can reconstruct cardiac transmembrane potential non-invasively, achieving more accurate disease diagnosis. The application to different cardiac structures also demonstrates the generalizability and robustness of the method. The verification of real clinical cases also demonstrates the feasibility of the invention in clinical application.

[0088] The above description of the embodiments is provided to enable those skilled in the art to understand and apply the present invention. Those skilled in the art can readily make various modifications to the above embodiments and apply the general principles described herein to other embodiments without creative effort. Therefore, the present invention is not limited to the above embodiments, and any improvements and modifications made to the present invention by those skilled in the art based on the disclosure thereof should be within the scope of protection of the present invention.

Claims

1. A method for cardiac transmembrane potential imaging based on 12-lead electrocardiography combined with a physiological model and attention mechanisms, comprising the following steps: (1) Collect the body surface potential data and chest cavity tomography image data of the research subjects, and solve the positive mapping relationship between body surface potential and cardiac transmembrane potential by boundary element method; (2) By simulating the construction of cardiac transmembrane potential data under different infarction sites and different pacemakers, a large number of data samples are obtained. Each data sample contains a set of cardiac transmembrane potential sequences and the body surface potential sequence obtained through positive mapping relationship. Then, all data samples are divided into training set, validation set and test set according to proportion. (3) Construct a deep learning network model based on joint physiological model and attention mechanism. It consists of two parts: encoder and decoder. The decoder includes two parts: pre-stage and post-stage. The encoder and pre-stage decoder extract the internal similarity of body surface potential sequence and cardiac transmembrane potential sequence through self-attention mechanism. The post-stage decoder uses cross-attention mechanism to extract the inverse relationship, namely the potential feature mapping of cardiac transmembrane potential on body surface potential. Both the encoder and the pre-decoder are composed of multiple cascaded Transformer layers. Each Transformer layer consists of a multi-head self-attention mechanism layer, a regularization layer L1, a feedforward neural network, and a regularization layer L2 connected in sequence. The input of the regularization layer L1 is the superposition of the output and input of the multi-head self-attention mechanism layer, and the input of the regularization layer L2 is the superposition of the output and input of the feedforward neural network. The multi-head self-attention mechanism layer in the pre-decoder has a masking mechanism, specifically by adding a lower triangular matrix, where the parts with values ​​of 0 are the masked parts. The subsequent decoder consists of multiple cascaded Transformer layers. Each Transformer layer is composed of a multi-head cross-attention mechanism layer, a regularization layer L1, a feedforward neural network, and a regularization layer L2 connected in sequence. The input of the regularization layer L1 is the superposition of the output and input of the multi-head cross-attention mechanism layer, and the input of the regularization layer L2 is the superposition of the output and input of the feedforward neural network. The multi-head cross-attention mechanism layer multiplies the encoder output with the corresponding linear transformation matrix to obtain the key vector matrix K and the value vector matrix V. It multiplies the output of the previous Transformer layer of the decoder with the corresponding linear transformation matrix to obtain the query vector matrix Q. Then, the attention score is calculated based on the vector matrices K, V, and Q. (4) The above network model is trained using the data samples of the training set to obtain the cardiac transmembrane potential reconstruction model; (5) Input the body surface potential sequence in the test set data sample into the cardiac transmembrane potential reconstruction model, and the reconstruction result of the cardiac transmembrane potential sequence can be directly output.

2. The cardiac transmembrane potential imaging method according to claim 1, characterized in that: Further, in step (1), a three-dimensional trunk geometric model and a three-dimensional heart geometric model of the research object are first established based on the chest tomography image data. Then, the two models are unified into the same coordinate system and fused to obtain the geometric correspondence between the heart and the trunk. Then, a quasi-static electric field model of the heart-trunk is established based on the geometric correspondence. The boundary element method is used to solve the electric field model to obtain the positive mapping relationship between the body surface potential and the transmembrane potential of the heart, i.e., Φ=HU, where H is the mapping matrix, U is the transmembrane potential of the heart, and Φ is the body surface potential.

3. The cardiac transmembrane potential imaging method according to claim 1, characterized in that: In step (2), the cardiac geometry is first divided into 17 parts according to the American Heart Association standard, and infarction is set separately in each part, resulting in a total of 17 infarction categories, plus a category of no infarction in all parts; for any category, pacing is set separately at each node of the three-dimensional cardiac geometry model. For any pacing point, based on its transmembrane potential and the conductivity of each part, the partial differential equation is solved through the state transition equation of the Aliev-Panfilov model to obtain the transmembrane potential of all nodes; by traversing in this way, 18×m sets of cardiac transmembrane potential sequences can be obtained, where m is the number of nodes in the three-dimensional cardiac geometry model, and each set of cardiac transmembrane potential sequences contains the transmembrane potentials of all nodes for multiple consecutive frames.

4. The cardiac transmembrane potential imaging method according to claim 1, characterized in that: For the body surface potential sequence input to the network model, it is first embedded into a linear layer to make its size 12×n×d, and then its position is encoded before being input to the encoder. d is the dimension of the embedding vector and n is the number of frames. For the transmembrane potential sequence input to the network model, it is first concatenated with a start_token of length m and all values ​​of -1 to make its size m×(n+1), and then embedded into a linear layer to make its size m×(n+1)×d. Finally, its position is encoded before being input to the front-end decoder.

5. The cardiac transmembrane potential imaging method according to claim 1, characterized in that: The specific process of training the network model in step (4) is as follows: 4.1 Initialize model parameters, including the bias vector and weight matrix of each layer, learning rate, maximum number of iterations, and optimizer; 4.2 Input the body surface potential sequence and cardiac transmembrane potential sequence from the training set data samples into the encoder and decoder of the model, respectively. The model outputs the corresponding TMP reconstruction result through forward propagation. Calculate the loss function between the reconstruction result and the ground truth label. 4.3 Based on the loss function, the optimizer iteratively updates the model parameters using gradient descent until the loss function converges, and the training is complete; 4.4 After training is completed, the model is validated using validation set data samples. The model that performs best on the validation set is taken as the final cardiac transmembrane potential reconstruction model.

6. The cardiac transmembrane potential imaging method according to claim 5, characterized in that: The expression for the loss function is as follows: in: L Let H represent the loss function, and H be the mapping matrix. y k Indicates the first k Body surface potential sequences in the group data samples, u k express y k The corresponding true value of the cardiac transmembrane potential sequence, express y k The corresponding TMP reconstruction results, N This indicates the number of samples in a batch.