Three-stage feature enhanced myocardial infarction positioning method

Through the three-stage feature enhancement method, including data enhancement, pre-training of minority features and weighted loss optimization, combined with the construction of the lead contribution graph, the problem of sample imbalance in the multi-category myocardial infarction classification was solved, and the minority samples were significantly improved Identification ability and positioning accuracy.

CN119488296AActive Publication Date: 2025-02-21CENT SOUTH UNIV

Patent Information

Application Number
CN202510076580.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-17
Publication Date
2025-02-21
Estimated Expiration
2045-01-17

AI Technical Summary

Technical Problem

In the multi-category myocardial infarction classification task, the classification accuracy and adaptability are poor due to the similar ECG signal characteristics of the minority and the majority of the classes and the samples are unbalanced.

Method used

Three-stage feature enhancement method, including data augmentation, pre-training of minority features and weighted loss optimization, dynamically introduce feature differences between leads by constructing a lead contribution graph, so as to achieve detailed modeling of similarity and differences between leads .

Benefits of technology

It significantly improves the recognition ability and recognition accuracy of the model on a few categories of samples, effectively deals with category imbalance problems, and improves the accuracy and robustness of myocardial infarction positioning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119488296A_ABST
    Figure CN119488296A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a three-stage feature enhanced myocardial infarction positioning method, which belongs to the technical field of medicine, and specifically comprises the following steps: sampling original electrocardiogram data at a preset sampling rate; performing data enhancement on the sample data set to obtain a training set; performing first-stage training of the initial model by using the training set to generate a lead contribution diagram; performing initial model two-stage training by using the minority class samples and the lead contribution diagram, updating initial model parameters, and freezing part of network parameters of a backbone network in the initial model; performing three-stage training of an initial model by using the training set and the lead contribution graph, performing back propagation by using a weighted dichotomy cross entropy loss function to update network parameters of a graph time-space cross attention network in the initial model, and forming a target model in combination with a trained backbone network and a multi-branch classification structure; and inputting the target electrocardiogram data into the optimized target model to obtain a positioning result. Through the scheme of the invention, the positioning accuracy and robustness are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of medical technology, and in particular to a three-stage feature-enhanced myocardial infarction positioning method. Background Art

[0002] Currently, in the multi-class myocardial infarction classification task, accurate classification faces many challenges due to the similar features of electrocardiogram (ECG) signals between the minority class and the majority class and the imbalanced samples. Existing studies have explored in depth the key factors that lead to this problem. The morphological differences of ECG signals of different myocardial infarction types are usually small, which increases the difficulty of feature extraction. Especially in the case of minority classes, due to insufficient data, it is difficult for the model to extract effective classification features from limited samples. The majority class and the minority class often overlap in the temporal and morphological features of ECG signals. The temporal and morphological features of different MI types change very similarly, especially the overlapping features between the minority class and the majority class, which further increases the difficulty of classification. In multi-class MI classification, the variability of minority class samples is large, and the majority class and the minority class overlap in ECG features. This ambiguity makes it difficult for machine learning models to effectively distinguish. Due to the difficulty in feature extraction of MI ECG signals, especially when the minority class data is insufficient, the waveform features of different types of myocardial infarction are small, resulting in limited classification results.

[0003] It can be seen that there is an urgent need for a three-stage feature-enhanced myocardial infarction localization method with high classification accuracy and adaptability. Summary of the invention

[0004] In view of this, an embodiment of the present invention provides a three-stage feature-enhanced myocardial infarction localization method, which at least partially solves the problems of poor classification accuracy and adaptability in the prior art.

[0005] The embodiment of the present invention provides a three-stage feature-enhanced myocardial infarction localization method, comprising: Step 1, sampling the original electrocardiogram data at a preset sampling rate to obtain a sample data set; Step 2, performing data enhancement on the sample data set to obtain a training set, wherein the data enhancement includes random cropping and lengthening processing; Step 3, using the training set to perform the initial model first-stage training to generate a lead contribution map; Step 4, use the minority class samples and lead contribution graphs in the training set to perform two-stage training of the initial model, use the weighted binary cross entropy loss function to perform back propagation to update the initial model parameters and freeze some network parameters of the backbone network in the initial model; Step 5: Use the training set and the lead contribution graph to perform three-stage training of the initial model, use the weighted binary cross entropy loss function to perform back propagation to update the network parameters of the graph spatiotemporal cross attention network in the initial model, and combine the trained backbone network and multi-branch classification structure to form the target model; Step 6: Input the target ECG data into the optimized target model to obtain the positioning result.

[0006] According to a specific implementation of the embodiment of the present invention, step 2 specifically includes: Step 2.1, divide the sample data set into majority class samples and minority class samples according to the number of sample categories; Step 2.2: Randomly crop and lengthen the minority class samples to generate new samples and add them to the sample data set to form a training set.

[0007] According to a specific implementation of the embodiment of the present invention, step 3 specifically includes: Step 3.1, input the training set into the initial model, and generate a contribution score for each lead and a preset number of classification tasks in the training set; Step 3.2, for the minority class samples, organize the scores of each lead into a corresponding multi-dimensional vector, wherein the dimension of the vector is the same as the number of sample categories of the minority class samples; Step 3.3, screen out the leads whose contribution scores exceed the threshold, and use the Pearson correlation coefficient to calculate the similarity of each pair of lead contribution vectors among the screened lead vectors; In step 3.4, edges are established between the lead pairs with the highest correlation to form a lead contribution graph.

[0008] According to a specific implementation of the embodiment of the present invention, the expression of the Pearson correlation coefficient is: in, and is the lead contribution vector, and Respectively, vector and The mean of Representation vector No. Quantity, Representation vector No. A quantity.

[0009] According to a specific implementation of the embodiment of the present invention, step 4 specifically includes: Step 4.1, input the minority class samples and lead contribution graphs in the training set into the initial model to obtain the predicted values ​​of the minority class samples; Step 4.2, substitute the predicted value and the true value corresponding to the minority class sample into the weighted binary cross entropy loss function for back propagation to update the initial model parameters and freeze some network parameters of the backbone network in the initial model, wherein the weighted binary cross entropy loss function is in, represents the number of classification tasks, It is The loss of the category, It is The weight of the category, represents the true label, represents the probability output predicted by the initial model; The expression for updating the initial model parameters is: in are model parameters, is the learning rate, is the gradient of the loss function with respect to the model parameters.

[0010] According to a specific implementation of an embodiment of the present invention, the backbone network includes multiple convolution blocks, each of which includes a skip convolution layer, a batch normalization layer, an activation function, a compression and excitation layer, and a pooling layer; The graph spatiotemporal cross attention network includes a graph convolutional network, a graph attention network and a Transformer encoder, wherein the Transformer encoder includes linear projection of input and output, a Transformer encoding layer, layer normalization and a Dropout operation, and the Transformer encoding layer includes a multi-head self-attention mechanism and a feedforward neural network.

[0011] According to a specific implementation of the embodiment of the present invention, step 5 specifically includes: Step 5.1, input the training set into the backbone network, the skip connection layer directly adds the untransformed input to the output, the batch normalization layer obtains the feature map by standardizing the feature distribution, the compression and excitation layer extracts the global features through global average pooling and dynamically adjusts the channel weights to enhance the important features, the pooling layer uses global average pooling to compress the feature map into a global description, and calculates the scaling factor, scales the feature map, and obtains the encoded lead feature, where the expression of the encoded lead feature is in, and is the weight matrix of the fully connected layer, represents the feature map, represents the global average pooling operation, Indicates the pooling operation of compressing and reducing the dimension of the feature map; Step 5.2, the graph convolutional network uses the lead contribution graph to construct an undirected graph, and aggregates the information of adjacent lead features by updating the features of nodes layer by layer based on the adjacency matrix of the undirected graph to form a global representation feature, where the expression of the global representation feature is in, It is The feature representation of the layer, , represents the input lead characteristics, It is The weight matrix of the layer, is the adjacency matrix The degree matrix of , is the activation function; Step 5.3, constructing a fully connected graph, wherein each lead node in the fully connected graph is connected to all other lead nodes; Step 5.4, the graph attention network automatically adjusts the attention weights according to the importance of the lead features based on the fully connected graph, and obtains the aggregated features according to the adjusted attention weights, where the expression of the aggregated features is Among them, the weight Representation Node For Node The influence of is the input feature vector of node i, is a learnable linear transformation matrix for feature mapping, is a learnable attention weight vector, is the node’s neighbor set, is a nonlinear activation function, is a piecewise linear activation function; Step 5.5: Input lead features Mapped to the hidden dimension through linear projection and added with the relative position encoding, followed by layer normalization and Dropout processing. The multi-head attention mechanism concatenates the attention results of different heads and outputs them through linear transformation; Step 5.6, input the global representation features, the aggregated features, the features output by the linear transformation, and the encoded lead features into the multi-branch classification structure to obtain the predicted value; Step 5.7, substitute the predicted value and the true value into the weighted binary cross entropy loss function for back propagation to update the network parameters of the graph spatiotemporal cross attention network; In step 5.8, the target model is formed by combining the trained graph spatiotemporal cross attention network, the trained backbone network and the multi-branch classification structure.

[0012] The three-stage feature-enhanced myocardial infarction localization scheme in the embodiment of the present invention includes: step 1, sampling the original electrocardiogram data at a preset sampling rate to obtain a sample data set; step 2, performing data enhancement on the sample data set to obtain a training set, wherein the data enhancement includes random cropping and stretching processing; step 3, using the training set to perform one-stage training of the initial model to generate a lead contribution map; step 4, using the minority class samples and the lead contribution map in the training set to perform two-stage training of the initial model, using the weighted binary cross entropy loss function to perform back propagation to update the initial model parameters and freeze some network parameters of the backbone network in the initial model; step 5, using the training set and the lead contribution map to perform three-stage training of the initial model, using the weighted binary cross entropy loss function to perform back propagation to update the network parameters of the graph spatiotemporal cross attention network in the initial model and combining the trained backbone network and the multi-branch classification structure to form a target model; step 6, inputting the target electrocardiogram data into the optimized target model to obtain a positioning result.

[0013] The beneficial effects of the embodiments of the present invention are as follows: through the scheme of the present invention, the recognition ability of minority class samples is effectively enhanced through three-stage feature enhancement, and the strategies such as data enhancement, minority class feature pre-training and weighted loss optimization are adopted to significantly improve the sensitivity and recognition accuracy of the model on minority classes, thereby effectively coping with the problem of class imbalance. At the same time, by constructing a lead contribution graph to dynamically introduce feature differences between leads, detailed modeling of similarities and differences between leads is achieved, and the key relationships between leads are captured to improve positioning accuracy. Finally, the global and local feature aggregation mechanism effectively enhances the accuracy and robustness of the model in MI positioning while integrating lead information and focusing on key features. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0015] Figure 1 A schematic flow chart of a three-stage feature-enhanced myocardial infarction localization method provided by an embodiment of the present invention; Figure 2A specific implementation framework diagram of a three-stage feature-enhanced myocardial infarction localization method provided by an embodiment of the present invention; Figure 3 A schematic diagram of a multi-branch classification structure provided by an embodiment of the present invention; Figure 4 A schematic diagram of the structure of a graph spatiotemporal cross attention network provided for an embodiment of the present invention. DETAILED DESCRIPTION

[0016] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0017] The following describes the embodiments of the present invention through specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work belong to the scope of protection of the present invention.

[0018] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein can be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present invention, it should be understood by those skilled in the art that an aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects described herein can be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein can be used to implement this device and / or practice this method.

[0019] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention. The drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0020] Additionally, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects described may be practiced without these specific details.

[0021] The electrocardiogram (ECG) is a non-invasive medical tool that records and analyzes the electrical activity of the heart. It is widely used in clinical diagnosis and cardiac monitoring. As the main screening tool for myocardial infarction, the 12-lead ECG captures the heart's electrical signals by placing electrodes in different parts of the body and converts them into waveform charts, thereby reflecting the heart's electrical conduction process and rhythm state. The conventional 12-lead ECG can observe the heart's electrical activity from multiple angles, which helps to identify abnormal conditions such as arrhythmias, myocardial ischemia, and cardiac hypertrophy. Due to its fast, safe and convenient characteristics, the 12-lead ECG has become a core tool in first aid and daily examinations, and is widely used for heart health monitoring and heart disease risk assessment. Among them, the limb leads include I, II, III, AVR, AVL and AVF leads, and the chest leads include V1 to V6 leads.

[0022] Myocardial infarction is myocardial necrosis caused by acute and persistent coronary ischemia and hypoxia, and is one of the main causes of cardiovascular disease burden worldwide. Myocardial infarction occurs mainly due to the rupture, hemorrhage and thrombosis of unstable atherosclerotic plaques in the coronary arteries, leading to complete vascular occlusion. The corresponding myocardium gradually develops local ischemia, damage and necrosis due to insufficient blood supply. According to pathological characteristics, MI can be divided into ST-segment elevation MI and non-ST-segment elevation MI. The former is essentially a complete occlusion of the coronary artery, and the patient has obvious symptoms and a high mortality rate. Thrombolytic therapy is usually used; the latter is not completely occluded in the coronary artery, but it may develop into ST-segment elevation MI.

[0023] Early studies usually rely on the extraction and rule definition methods of ECG features, mainly based on the amplitude and integral of signals such as T waves, R waves and Q waves for classification. The area of ​​myocardial infarction is divided by simple rules, but the positioning accuracy is low and the dependence on rules is strong. With the development of research, simple machine learning models such as K-Nearest Neighbors (KNN) have been gradually introduced into the field of myocardial infarction detection, using the time domain features of ECG signals for identification and positioning, but the recognition performance for minority classes is poor. Later, researchers extracted multi-scale features of ECG signals through wavelet decomposition and other techniques to obtain richer myocardial infarction features. This method significantly improved the accuracy and sensitivity of detection and gradually realized the multi-region positioning of myocardial infarction. However, the manual feature screening process of this type of method is cumbersome and time-consuming, which makes it difficult to develop a diagnostic system based on this method. Therefore, deep learning models have gradually become mainstream, especially those based on the structure of Convolutional Neural Network (CNN), which improves the resolution of myocardial infarction positioning through multi-layer feature extraction and can identify more complex morphological changes. The latest research focuses on the fusion of multi-dimensional features, using technologies such as Tucker2 decomposition and Tensor structure to extract and fuse cross-lead and cross-beat information from multi-lead ECGs, making the model more robust. In particular, when using structures such as DenseNet, the positioning accuracy is greatly improved through cross-lead information sharing. The recently developed end-to-end convolutional neural network system abandons the traditional cumbersome preprocessing process and directly uses 12-lead ECG images for myocardial infarction detection and location, reducing dependence on medical experts while greatly improving positioning efficiency and accuracy.

[0024] In addition, in the multi-class myocardial infarction classification task, accurate classification faces many challenges due to the similar ECG signal features between the minority class and the majority class and the imbalanced samples. Existing studies have explored in depth the key factors that lead to this problem. The morphological differences of ECG signals of different myocardial infarction types are usually small, which increases the difficulty of feature extraction. Especially in the case of minority classes, due to insufficient data, it is difficult for the model to extract effective classification features from limited samples. The majority class and the minority class often overlap in the temporal and morphological features of ECG signals. The temporal and morphological features of different MI types change very similarly, especially the overlapping features between the minority class and the majority class, which further increases the difficulty of classification. In multi-class MI classification, the variability of minority class samples is large, and the majority class and the minority class overlap in ECG features. This ambiguity makes it difficult for machine learning models to effectively distinguish. Due to the difficulty in feature extraction of MI ECG signals, especially when the minority class data is insufficient, the waveform features of different types of myocardial infarction are small, resulting in limited classification results.

[0025] An embodiment of the present invention provides a three-stage feature-enhanced myocardial infarction localization method, which can be applied to the diagnosis and treatment of myocardial infarction in medical diagnosis scenarios.

[0026] See also Figure 1 , which is a flow chart of a three-stage feature-enhanced myocardial infarction localization method provided in an embodiment of the present invention.

[0027] The present invention provides a three-phase feature enhanced myocardial infarction positioning method (Three-Phase Boosting, TB-Net) based on unbalanced electrocardiogram data, the model algorithm is as follows Figure 2 As shown in the figure. Specifically, TB-Net first processes minority class samples through data augmentation (DA), using methods such as random cropping and stretching to increase the diversity of samples. Next, the minority class features are pre-trained using a pre-trained network (Multi-Stage Training, MST), and some network layers are frozen to ensure that the model remains sensitive to minority class features during training. In the process of constructing the lead contribution graph, an undirected graph is established by calculating the contribution of the lead to the minority class samples to support subsequent graph convolution operations. TB-Net introduces structures such as skip convolution, batch normalization, and squeeze-and-excitation (SE) layers to encode lead features, and realizes local and global feature aggregation between leads through the graph convolutional network (GCN) and graph attention network (GAT) modules of graph spatial-temporal cross-attention (GSCA), thereby enhancing attention to key leads. Finally, TB-Net uses a dual-branch weighted (DBW) classification structure to independently predict seven types of myocardial infarction and uses a weighted binary classification loss optimization model to improve the recognition ability of minority class samples. The experimental results show that TB-Net has significant diagnostic potential and accuracy in clinical myocardial infarction localization applications.

[0028] like Figure 1 and Figure 2 As shown, the method mainly comprises the following steps: Step 1, sampling the original electrocardiogram data at a preset sampling rate to obtain a sample data set; For example, the PTB-XL dataset is selected as the data source. This dataset contains a variety of ECG data with a sampling rate of 500Hz. Since the seven-category positioning task of myocardial infarction requires accurate capture of different types of ECG signal characteristics, it is critical to ensure the sampling consistency of the data. We use a sampling rate of 500Hz to divide the original ECG data into segments of fixed length, with each 5000 sampling points as a sample. Assume that each sample data is , where 5000 represents the time step and 12 is the number of ECG leads. This data partitioning method ensures that the time dimension and feature dimension of each input sample remain consistent, which is conducive to the stable training of the neural network model. At the same time, segmenting longer data segments at a high sampling rate helps to preserve the dynamic characteristics of the ECG, laying the foundation for the model to accurately locate the location of myocardial infarction in the seven-category task. In this way, while ensuring that the temporal information of each sample remains unchanged, sufficient input information is provided, making it easier for the model to capture the feature differences between different categories.

[0029] Step 2, performing data enhancement on the sample data set to obtain a training set, wherein the data enhancement includes random cropping and lengthening processing; Furthermore, the step 2 specifically includes: Step 2.1, divide the sample data set into majority class samples and minority class samples according to the number of sample categories; Step 2.2: Randomly crop and lengthen the minority class samples to generate new samples and add them to the sample data set to form a training set.

[0030] In the specific implementation, in this task, we selected two data augmentation methods: random cropping and lengthening. First, for random cropping, we randomly select a starting point in the time series of the minority class sample, and then crop a data segment with a length of 5000 to form a new training sample. Assume that the original data sample is represented as , then the samples generated by random cropping can be expressed as: ; in is a random starting point from 0 to n-5000, and n is the length of the original sample. Through this method, each cropping generates a new sample, so that the model can see the feature changes of minority class samples in different time periods.

[0031] For the lengthening process, we use the interpolation method to increase the length of the data and maintain the continuity of the signal. is a sample of length 5000. The new sample obtained by stretching can be expressed as , where the length of the signal is increased by linear interpolation or more advanced interpolation methods. The interpolation function can be expressed as: in >1 indicates the magnification factor. The goal of data augmentation is to generate enough minority class samples to balance the category distribution, thereby reducing the model's bias on different categories. Data augmentation can effectively solve the overfitting problem caused by category imbalance and make the model more generalizable. Through random cropping and lengthening operations, we provide more samples for minority classes, so that the model can learn the feature changes of these categories during training, thereby improving the recognition effect of minority classes. This enhancement method is particularly effective on time series data because it retains the original information of the electrocardiogram and increases the diversity of samples.

[0032] Step 3, using the training set to perform the initial model first-stage training to generate a lead contribution map; Based on the above embodiment, step 3 specifically includes: Step 3.1, input the training set into the initial model, and generate a contribution score for each lead and a preset number of classification tasks in the training set; Step 3.2, for the minority class samples, organize the scores of each lead into a corresponding multi-dimensional vector, wherein the dimension of the vector is the same as the number of sample categories of the minority class samples; Step 3.3, screen out the leads whose contribution scores exceed the threshold, and use the Pearson correlation coefficient to calculate the similarity of each pair of lead contribution vectors among the screened lead vectors; In step 3.4, edges are established between the lead pairs with the highest correlation to form a lead contribution graph.

[0033] Furthermore, the expression of the Pearson correlation coefficient is: in, and is the lead contribution vector, and Respectively, vector and The mean of Representation vector No. Quantity, Representation vector No. A quantity.

[0034] In the specific implementation, we performed the first stage of pre-training of the model on the processed data, with the goal of generating a lead contribution graph. By analyzing the contribution of each lead in the model to the seven categories of myocardial infarction classification tasks, we constructed an undirected graph reflecting the correlation between leads, laying the foundation for subsequent graph convolutional network operations. In the first stage of training, 12-lead ECG data was input into the model, and the model quantified the importance of each lead in each classification task through gradient contribution analysis. Specifically, the model generates a contribution score for each lead and seven classification tasks, indicating the importance of the lead in the prediction of a specific category.

[0035] For the four minority classes, the contribution graph organizes the contribution scores of each lead into a four-dimensional vector in Indicates The contribution of the leads to the four minority classes. Then, the leads with a contribution score of more than 0.4 are screened out, and it is considered that these leads have significant contributions to the minority classes. Between the screened lead vectors, we use the Pearson correlation coefficient to calculate the similarity of each pair of lead contribution vectors. We use the Pearson correlation coefficient to calculate the similarity between the screened lead vectors, and the formula is as follows: in, and is the lead contribution vector, and Respectively, vector and The correlation coefficient ranges from [-1,1], and the closer the value is to 1, the more similar the contributions of the two leads are. We establish edges between the pairs of leads with the highest correlation, thereby forming an undirected graph of leads for graph convolutional network operations. This graph not only shows the contribution of the leads to the minority class, but also reveals the relationship between leads with similar contributions. The undirected graph constructed based on the Pearson correlation coefficient can better capture the similarities between leads, especially the feature sharing on the minority class. This graph structure provides spatial relationship information for subsequent graph convolution operations, enabling the model to exploit the potential dependencies between leads, thereby achieving more accurate myocardial infarction recognition in the seven-category localization task.

[0036] Step 4, use the minority class samples and lead contribution graphs in the training set to perform two-stage training of the initial model, use the weighted binary cross entropy loss function to perform back propagation to update the initial model parameters and freeze some network parameters of the backbone network in the initial model; Based on the above embodiment, step 4 specifically includes: Step 4.1, input the minority class samples and lead contribution graphs in the training set into the initial model to obtain the predicted values ​​of the minority class samples; Step 4.2, substitute the predicted value and the true value corresponding to the minority class sample into the weighted binary cross entropy loss function for back propagation to update the initial model parameters and freeze some network parameters of the backbone network in the initial model, wherein the weighted binary cross entropy loss function is in, represents the number of classification tasks, It is The loss of the category, It is The weight of the category, represents the true label, represents the probability output predicted by the initial model; The expression for updating the initial model parameters is: in are model parameters, is the learning rate, is the gradient of the loss function with respect to the model parameters.

[0037] In practice, in the second stage of pre-training, the model focuses on learning the features of minority class samples, aiming to improve its initial recognition ability of these categories. We selected minority class samples that only contain the first fold data for independent pre-training. This process helps the model to specifically learn the features of minority class samples, thereby improving the model's performance on this type of data. This method is similar to distributed learning, which enables the model to reduce the bias towards the majority class due to data imbalance by exposing it to the features of the minority class. Assume that the minority class sample set is , whose characteristics are expressed as ,in Represents a sample, is the label. During training, the loss function is defined by the standard cross entropy loss function: In pre-training, we used a Backbone Network, which consists of multiple convolutional blocks, including skip convolution layers, batch normalization layers, activation functions (ReLU functions and leaky ReLU functions), SE layers (Squeeze-and-Excitation Layers), and pooling layers. This design aims to extract high-quality features so that the model can adapt to subtle changes in minority class data. In addition, a built GSCA module is connected to the backbone network (which will be described in detail in subsequent steps). During training, the model uses the AdamW optimization algorithm for parameter updates to gradually reduce the loss.

[0038] Specifically, the parameter update of the model can be expressed as: in are model parameters, is the learning rate, is the gradient of the loss function with respect to the model parameters.

[0039] The second stage of pre-training aims to build preliminary feature extraction capabilities for the model for minority class samples, enabling it to identify key features and patterns of these categories, thereby avoiding the situation where subsequent training is completely biased towards the majority class. Through this stage of pre-training, the model's learning ability on minority class samples is enhanced.

[0040] Step 5: Use the training set and the lead contribution graph to perform three-stage training of the initial model, use the weighted binary cross entropy loss function to perform back propagation to update the network parameters of the graph spatiotemporal cross attention network in the initial model, and combine the trained backbone network and multi-branch classification structure to form the target model; On the basis of the above embodiment, the backbone network includes multiple convolution blocks, each of which includes a skip convolution layer, a batch normalization layer, an activation function, a compression and excitation layer, and a pooling layer; The graph spatiotemporal cross attention network includes a graph convolutional network, a graph attention network and a Transformer encoder, wherein the Transformer encoder includes linear projection of input and output, a Transformer encoding layer, layer normalization and a Dropout operation, and the Transformer encoding layer includes a multi-head self-attention mechanism and a feedforward neural network.

[0041] Furthermore, the step 5 specifically includes: Step 5.1, input the training set into the backbone network, the skip connection layer directly adds the untransformed input to the output, the batch normalization layer obtains the feature map by standardizing the feature distribution, the compression and excitation layer extracts the global features through global average pooling and dynamically adjusts the channel weights to enhance the important features, the pooling layer uses global average pooling to compress the feature map into a global description, and calculates the scaling factor, scales the feature map, and obtains the encoded lead feature, where the expression of the encoded lead feature is in, and is the weight matrix of the fully connected layer, represents the feature map, represents the global average pooling operation, Indicates the pooling operation of compressing and reducing the dimension of the feature map; Step 5.2, the graph convolutional network uses the lead contribution graph to construct an undirected graph, and aggregates the information of adjacent lead features by updating the features of nodes layer by layer based on the adjacency matrix of the undirected graph to form a global representation feature, where the expression of the global representation feature is in, It is The feature representation of the layer, , represents the input lead characteristics, It is The weight matrix of the layer, is the adjacency matrix The degree matrix of , is the activation function; Step 5.3, constructing a fully connected graph, wherein each lead node in the fully connected graph is connected to all other lead nodes; Step 5.4, the graph attention network automatically adjusts the attention weights according to the importance of the lead features based on the fully connected graph, and obtains the aggregated features according to the adjusted attention weights, where the expression of the aggregated features is Among them, the weight Representation Node For Node The influence of is the input feature vector of node i, is a learnable linear transformation matrix for feature mapping, is a learnable attention weight vector, is the node’s neighbor set, is a nonlinear activation function, is a piecewise linear activation function; Step 5.5: Input lead features Mapped to the hidden dimension through linear projection and added with the relative position encoding, followed by layer normalization and Dropout processing. The multi-head attention mechanism concatenates the attention results of different heads and outputs them through linear transformation; Step 5.6, input the global representation features, the aggregated features, the features output by the linear transformation, and the encoded lead features into the multi-branch classification structure to obtain the predicted value; Step 5.7, substitute the predicted value and the true value into the weighted binary cross entropy loss function for back propagation to update the network parameters of the graph spatiotemporal cross attention network; In step 5.8, the target model is formed by combining the trained graph spatiotemporal cross attention network, the trained backbone network and the multi-branch classification structure.

[0042] When implementing it, Figure 4 As shown in the figure, in the third stage of training, TB-Net further enhances the model's ability to capture the feature relationship between leads by performing graph convolution and graph attention feature aggregation on 12-lead ECG data. The core of this stage is to use graph convolutional networks (GCN) and graph attention networks (GAT) to model the dependency relationship between leads from both the local and global levels. The third stage of training not only optimizes the aggregation method of lead features at the model level, but also improves the model's perception and positioning capabilities for complex pathological features in terms of overall structure.

[0043] In the initial step of the third stage of training, TB-Net first inputs the 12-lead ECG data into the backbone network separately and uses the skip connection in the ResNet structure for feature extraction. The skip connection passes the input directly to the subsequent layers through the residual module to maintain important information in the deep network and improve the training stability of the model. In the residual module, the skip connection adds the input directly to the output to avoid information loss in multiple layers of convolution. Its output can be expressed as: in represents the features generated by the convolution operation, Represents the input features. With this design, the jump connection adds the untransformed input directly to the output, ensuring that the model retains important feature information as the depth increases. In addition to the residual module, the backbone network also includes batch normalization, SE layer (Squeeze-and-Excitation Layer) and pooling layer, which are used to standardize and adaptively adjust the weights of different lead features. Batch normalization accelerates model convergence by standardizing feature distribution, while the SE layer adaptively assigns weights to each lead feature to enhance the feature recognition ability of the model. The specific operations of the SE layer include: Squeeze: Use global average pooling (GAP) to compress the feature map into a global description. Excitation: Calculate the scaling factor and scale the feature map. Assume the feature map The dimension is , then the SE layer output is: in, and is the weight matrix of the fully connected layer. Through the skip connection of ResNet, the model can not only effectively extract deep features, but also retain the key information in the input data, thereby avoiding the gradient vanishing problem caused by too many layers. At the same time, the introduction of batch normalization and SE layer further improves the convergence speed and feature sensitivity of the model, enabling the model to better adapt to the multi-lead data structure of the ECG.

[0044] In the third stage of training, after the backbone network feature extraction is completed, the model uses the Graph Convolutional Network (GCN) and Graph Attention Network (GAT) and Transformer encoder to further process the encoded lead features. The Graph Convolutional Network (GCN) uses the lead contribution graph generated by the first stage of pre-training to construct an undirected graph to capture the correlation between the 12 leads based on contribution similarity. In this contribution graph, each node represents a lead, and each edge connects leads with high contribution similarity. The adjacency matrix of the graph is It is built based on the lead contribution graph and is used to guide GCN to aggregate information between leads. In the lead contribution graph, the adjacency matrix represents the correlation between leads, while graph convolution aggregates the information of adjacent leads by updating the features of nodes layer by layer. The update formula of the GCN layer is: in, It is The feature representation of the layer, . It is The weight matrix of the layer. is the adjacency matrix The degree matrix of , is an activation function (such as ReLU). Through this operation, the model aggregates the features of each lead node and its neighboring nodes layer by layer, and finally generates a global representation that reflects the feature relationship between leads.

[0045] The Graph Attention Network (GAT) is based on a fully connected graph, in which each lead node is connected to all other nodes. This fully connected approach enables GAT to dynamically assign different weights to the relationships between different leads and automatically adjust the attention weights according to the importance of the leads. and , GAT calculates attention weights based on node features : The weight Reflects the node For Node The influence of ensures that the model pays more attention to the important relationship between specific leads when aggregating features. The final feature aggregation is expressed as: Due to the fully connected composition method, GAT can flexibly focus on the feature differences between leads and provide more detailed feature analysis for the seven-category task.

[0046] After completing the GCN and GAT processing of the lead features, TB-Net further introduces the Transformer encoder module to capture the global correlation between lead features using the self-attention mechanism. The Transformer module effectively integrates the long-range dependencies and local feature differences of the leads through relative position encoding, linear projection, and multi-head attention mechanisms, giving the model greater flexibility and accuracy in the dynamic aggregation of lead features.

[0047] The Transformer module uses a custom relative position encoding to add position information to the input lead sequence. The module includes linear projection of input and output, Transformer encoder layer, layer normalization and Dropout operation. The input feature X is first mapped to the hidden dimension by linear projection and added with the relative position encoding. Subsequently, it is processed by layer normalization and Dropout to improve the stability of training and reduce overfitting. The Transformer encoder consists of a multi-head self-attention mechanism and a feedforward neural network. In the multi-head self-attention mechanism, the query matrix of a given input , key matrix Sum Matrix , the calculation formula is: The multi-head attention mechanism concatenates the attention results of different heads and outputs them through linear transformation, enabling the model to capture the feature relationship between leads from different angles.

[0048] The different construction methods of GCN and GAT enable the model to extract lead features at different levels, while the self-attention mechanism of Transformer enhances the performance of the model in lead feature aggregation. GCN relies on the lead contribution graph to aggregate feature information of similar leads, helping to capture local dependencies between leads. GAT uses a fully connected graph to dynamically adjust the weights between leads through an adaptive attention mechanism to capture the global relationship between leads.

[0049] In the prediction part of the third stage training, such as Figure 3 As shown in the figure, the model uses a multi-branch classification structure to independently predict seven myocardial infarction categories. In order to improve the model's recognition ability on minority classes, the loss function design uses weighted binary classification loss entropy and assigns higher weights to minority classes, thereby reducing the impact of data imbalance on classification results. After completing feature extraction and graph convolution processing, the model enters the final classification stage. This stage uses seven independent classification branches, each of which is responsible for binary classification prediction of a category (that is, determining whether the category exists). For the Output of the category, the classification branch of the model calculates the probability output Indicates that the sample belongs to the category The possibility of. Assume that the final feature is expressed as , then The output of the category can be expressed as: in and are the weight and bias of the classification branch respectively, is the activation function (Sigmoid function). Through seven independent classification branches, the model can make predictions for seven categories at the same time, and the design of each branch ensures that the predictions between different categories do not interfere with each other, improving the flexibility and accuracy of the model in multi-classification tasks. Since the minority class samples account for a low proportion in the data set, in order to avoid the model being biased towards the majority class, the loss function is designed to give a higher weight to the minority class. For each category, the loss function uses a weighted binary cross entropy loss, which is expressed as: in, It is The loss of the category. It is The weight of the category is used to enhance the weight of the minority class. The weight of the minority class samples , the weight of the majority class , represents the true label, Represents the probability output predicted by the model. The final total loss function is the weighted sum of all category losses: In this way, the loss function can pay more attention to the minority class in training and reduce the impact of data imbalance. Through the independent prediction and weighted loss design of the seven classification branches, the model can effectively balance the data imbalance problem in the seven-classification positioning task and improve the recognition ability of the minority class. The weighted binary classification loss entropy ensures that the model has higher generalization performance on various types of data, and ultimately achieves accurate positioning and classification of the myocardial infarction location.

[0050] The third stage of training realizes deep mining of lead features and dynamic modeling of relationships between leads by jointly using the backbone network, GCN and GAT. The skip connection structure of the backbone network ensures the effective extraction of deep features and the stability of gradient transfer; GCN uses the lead contribution graph to aggregate local feature relationships and improve the model's ability to capture local dependencies between leads; GAT gives different weights to leads through the attention mechanism of the fully connected graph, realizing flexible modeling of global feature relationships.

[0051] Step 6: Input the target ECG data into the optimized target model to obtain the positioning result.

[0052] In specific implementation, when it is necessary to locate and classify a certain electrocardiogram data that has not been located and classified, it can be used as the target electrocardiogram data, and then input into the optimized target model to obtain the myocardial infarction location result.

[0053] The three-stage feature-enhanced myocardial infarction localization method provided in this embodiment effectively enhances the recognition ability of minority class samples through three-stage feature enhancement, and adopts strategies such as data enhancement, minority class feature pre-training and weighted loss optimization to significantly improve the sensitivity and recognition accuracy of the model on minority classes, thereby effectively addressing the problem of class imbalance. At the same time, by constructing a lead contribution graph to dynamically introduce feature differences between leads, detailed modeling of similarities and differences between leads is achieved, and key relationships between leads are captured to improve positioning accuracy. Ultimately, the global and local feature aggregation mechanism effectively enhances the accuracy and robustness of the model in MI localization while integrating lead information and focusing on key features.

[0054] The method of the present invention will be further described below in conjunction with a specific embodiment. In order to verify the advantages of TB-Net in the automatic localization task of myocardial infarction, we selected the current advanced comparison methods MCA-Net and ML-ResNet. ML-ResNet proposes a method for feature fusion by combining a multi-lead residual neural network structure with a 12-lead ECG record. Specifically, the single-lead feature branch network of ML-ResNet can automatically learn features of different depths, thereby effectively capturing local and global feature information in the ECG data. MCA-net, a multi-task channel attention network proposed in 2022, has demonstrated good performance in the seven-classification localization task of myocardial infarction, with strong generalization ability and accuracy. This method effectively captures features in 12-lead ECG data through a residual structure-based channel attention network, and utilizes shared information between MI detection and localization tasks under a multi-task framework to further improve performance. MCA-Net has achieved high accuracy on the PTB and PTBXL datasets, and is widely regarded as an effective tool in MI localization tasks, suitable for providing support in clinical auxiliary diagnosis.

[0055] In order to fairly compare the performance of TB-Net, ML-ResNet and MCA-Net, this experiment adopts a strict experimental setting. In terms of dataset selection, we used the PTBXL dataset, which is a high-quality dataset containing a variety of electrocardiogram samples and is suitable for the localization study of myocardial infarction. The experiment uses a five-fold cross-validation method to ensure the stability and generalization of the results. The batch size for training is set to 64, the batch size for validation is 128, the random number seed is fixed to 3407 to ensure the repeatability of the experiment, and the dropout rate is fixed to 0.5 to prevent overfitting.

[0056] From Table 1 and Table 2, we can see that TB-Net performs better than MCA-Net and ML-ResNet in many indicators. In particular, in indicators related to minority class recognition such as F1 score and Precision, TB-Net's performance has been significantly improved. The reason is that in the design of TB-Net, through three-stage feature enhancement training and the construction of lead contribution graphs, accurate extraction of minority class features and dynamic aggregation of differences between leads are achieved. These modules make TB-Net more robust in dealing with complex MI pathological changes, and can focus more on the feature similarity between minority class leads, making the model have higher sensitivity and classification accuracy in minority class classification tasks, thereby achieving accurate positioning of myocardial infarction.

[0057] Table 1

[0058] Table 2

[0059] In order to evaluate the contribution of each module in TB-Net to the overall performance of the model, we conducted a five-fold cross-validation ablation experiment to analyze the independent role of different modules. The settings of the ablation experiment include the following three cases: w / o DA means the data augmentation part is deleted; w / o DBW means the loss function weight ratio and multi-branch classifier part are deleted; w / o GSCA means the graph spatiotemporal cross attention network module is deleted. These ablation settings are designed to examine the role of the key modules of TB-Net in minority class recognition and lead information aggregation.

[0060] The results in Tables 3 and 4 show that after removing these modules, the performance of TB-Net on minority classification tasks has significantly decreased. Taking AMI (acute myocardial infarction) as an example, the complete TB-Net model achieved a classification accuracy of 26.78, while in the cases of w / o DA, w / o DBW, and w / o GSCA, the AMI classification accuracy dropped to 17.61, 20.65, and 11.40, respectively. Similarly, in the ALMI (anterolateral myocardial infarction) and Other (other minority classes) classification tasks, the complete model is significantly better than the performance after removing the modules, especially in the absence of the GSCA module, where the model performance drops most significantly.

[0061] These results show that data augmentation, weighted loss optimization, and multi-branch classifiers play a key role in TB-Net's minority class recognition, respectively by enriching the diversity of minority class samples and increasing the weight of minority classes in the loss function to enhance the model's recognition ability. At the same time, the GSCA module effectively integrates feature information between leads through skip graph convolution and graph attention mechanisms, improving the model's robustness and recognition accuracy in lead-related feature extraction. Ablation experiments verify the importance of each module in the TB-Net design, further supporting its effectiveness and stability in the seven-classification task of myocardial infarction.

[0062] The method of the present invention is advanced in the task of automatic MI localization, and can fully capture the difference in the contribution of different leads to MI classification through three-stage training, and provide better recognition ability for minority classes. Experimental results show that the method of the present invention has great application potential in the clinical deployment of computer-assisted MI localization applications.

[0063] Table 3

[0064] Table 4

[0065] It should be understood that various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof.

[0066] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A three-stage feature-enhanced myocardial infarction localization method, characterized in that: include: Step 1, sampling the original electrocardiogram data at a preset sampling rate to obtain a sample data set; Step 2, performing data enhancement on the sample data set to obtain a training set, wherein the data enhancement includes random cropping and lengthening processing; Step 3, using the training set to perform the initial model first-stage training to generate a lead contribution map; Step 4, use the minority class samples and lead contribution graphs in the training set to perform two-stage training of the initial model, use the weighted binary cross entropy loss function to perform back propagation to update the initial model parameters and freeze some network parameters of the backbone network in the initial model; Step 5: Use the training set and the lead contribution graph to perform three-stage training of the initial model, use the weighted binary cross entropy loss function to perform back propagation to update the network parameters of the graph spatiotemporal cross attention network in the initial model, and combine the trained backbone network and multi-branch classification structure to form the target model; Step 6: Input the target ECG data into the optimized target model to obtain the positioning result.

2. The method according to claim 1, characterized in that The step 2 specifically includes: Step 2.1, divide the sample data set into majority class samples and minority class samples according to the number of sample categories; Step 2.2: Randomly crop and lengthen the minority class samples to generate new samples and add them to the sample data set to form a training set.

3. The method according to claim 2, characterized in that The step 3 specifically includes: Step 3.1, input the training set into the initial model, and generate a contribution score for each lead and a preset number of classification tasks in the training set; Step 3.2, for the minority class samples, organize the scores of each lead into a corresponding multi-dimensional vector, wherein the dimension of the vector is the same as the number of sample categories of the minority class samples; Step 3.3, screen out the leads whose contribution scores exceed the threshold, and use the Pearson correlation coefficient to calculate the similarity of each pair of lead contribution vectors among the screened lead vectors; In step 3.4, edges are established between the lead pairs with the highest correlation to form a lead contribution graph.

4. The method according to claim 3, characterized in that The expression of the Pearson correlation coefficient is: in, and is the lead contribution vector, and The vectors are and The mean of Representation vector No. Quantity, Representation vector No. A quantity.

5. The method according to claim 4, characterized in that The step 4 specifically includes: Step 4.1, input the minority class samples and lead contribution graphs in the training set into the initial model to obtain the predicted values ​​of the minority class samples; Step 4.2, substitute the predicted value and the true value corresponding to the minority class sample into the weighted binary cross entropy loss function for back propagation to update the initial model parameters and freeze some network parameters of the backbone network in the initial model, wherein the weighted binary cross entropy loss function is in, represents the number of classification tasks, It is The loss of the category, It is The weight of the category, represents the true label, represents the probability output predicted by the initial model; The expression for updating the initial model parameters is: in are model parameters, is the learning rate, is the gradient of the loss function with respect to the model parameters.

6. The method according to claim 5, characterized in that The backbone network includes a plurality of convolution blocks, each of which includes a skip convolution layer, a batch normalization layer, an activation function, a compression and excitation layer, and a pooling layer; The graph spatiotemporal cross attention network includes a graph convolutional network, a graph attention network and a Transformer encoder, wherein the Transformer encoder includes linear projection of input and output, a Transformer encoding layer, layer normalization and a Dropout operation, and the Transformer encoding layer includes a multi-head self-attention mechanism and a feedforward neural network.

7. The method according to claim 6, characterized in that The step 5 specifically includes: Step 5.1, input the training set into the backbone network, the skip connection layer directly adds the untransformed input to the output, the batch normalization layer obtains the feature map by standardizing the feature distribution, the compression and excitation layer extracts the global features through global average pooling and dynamically adjusts the channel weights to enhance the important features, the pooling layer uses global average pooling to compress the feature map into a global description, and calculates the scaling factor, scales the feature map, and obtains the encoded lead feature, where the expression of the encoded lead feature is in, and is the weight matrix of the fully connected layer, represents the feature map, represents the global average pooling operation, Indicates the pooling operation of compressing and reducing the dimension of the feature map; Step 5.2, the graph convolutional network uses the lead contribution graph to construct an undirected graph, and aggregates the information of adjacent lead features by updating the features of nodes layer by layer based on the adjacency matrix of the undirected graph to form a global representation feature, where the expression of the global representation feature is in, It is The feature representation of the layer, , represents the input lead characteristics, It is The weight matrix of the layer, is the adjacency matrix The degree matrix of , is the activation function; Step 5.3, constructing a fully connected graph, wherein each lead node in the fully connected graph is connected to all other lead nodes; Step 5.4, the graph attention network automatically adjusts the attention weights according to the importance of the lead features based on the fully connected graph, and obtains the aggregated features according to the adjusted attention weights, where the expression of the aggregated features is Among them, the weight Representation Node For Node The influence of is the input feature vector of node i, is a learnable linear transformation matrix for feature mapping, is a learnable attention weight vector, is the node’s neighbor set, is a nonlinear activation function, is a piecewise linear activation function; Step 5.5: Input lead features Mapped to the hidden dimension through linear projection and added with the relative position encoding, followed by layer normalization and Dropout processing. The multi-head attention mechanism concatenates the attention results of different heads and outputs them through linear transformation; Step 5.6, input the global representation features, the aggregated features, the features output by the linear transformation, and the encoded lead features into the multi-branch classification structure to obtain the predicted value; Step 5.7, substitute the predicted value and the true value into the weighted binary cross entropy loss function for back propagation to update the network parameters of the graph spatiotemporal cross attention network; In step 5.8, the target model is formed by combining the trained graph spatiotemporal cross attention network, the trained backbone network and the multi-branch classification structure.

Citation Information

Patent Citations

  • Electrocardiosignal classification method and system based on multi-domain feature learning

    CN114652322A

  • Transform-based electrocardiosignal compressed sensing method

    CN119257611A

  • Method for predicting multi-type electrocardiogram heart rhythms based on graph convolution

    US20230225663A1

  • KR20240013394A

Cited By

  • Eyelid morphological parameter measurement method based on reconstruction-segmentation network of conjoined architecture

    CN120298368A

  • Myocardial ischemia noninvasive detection model training method, detection method and system

    CN121415176A

  • A myocardial ischemia noninvasive detection model training method, detection method and system

    CN121415176B