ST segment anomaly detection method and system based on inversion Transform and fusion attention

By using the convolutional neural network model of inverted Transformer and fusion attention in the ST segment abnormality detection of electrocardiogram, combined with median filtering and data amplification technology, the problems of insufficient detection accuracy and poor noise resistance in the existing technology are solved, and high accuracy and robust ST segment abnormality detection are achieved.

CN119598363AActive Publication Date: 2025-03-11GUANGXI NORMAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411594004.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-08
Publication Date
2025-03-11
Estimated Expiration
2044-11-08

AI Technical Summary

Technical Problem

The prior art has problems such as insufficient accuracy, poor noise resistance and insensitive response to complex signal modes in the detection of ST segment abnormalities in electrocardiogram.

Method used

The convolutional neural network model based on inversion Transformer and fusion attention is adopted, combined with median filtering and data amplification technology, preprocessing and classification of ECG signals. This model extracts time series features by inverting Transformer, and the channel prior attention mechanism captures the spatial correlation of the signal, improving the accuracy and robustness of the detection.

Benefits of technology

The accuracy of ST segment abnormality detection has been significantly improved, reaching an accuracy of 96.14% and a sensitivity of 96.2%. It has also made significant progress in noise resistance and dynamic feature capture, which is better than the previous methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119598363A_ABST
    Figure CN119598363A_ABST
Patent Text Reader

Abstract

The invention belongs to but is not limited to the technical field of electrocardiogram anomaly detection, and discloses an ST segment anomaly detection method based on inversion Transform and fusion attention, which adopts a median filtering method to carry out de-noising processing on an input data sample, and carries out data amplification on abnormal ST data; and classifying the electrocardiosignals by using a convolutional neural network model which fuses an inversion Transform and a channel prior attention mechanism. According to the method, the features can be effectively extracted and fused by utilizing the inversion Transform and the time sequence channel convolution, and the model can keep related time sequence information while accurately capturing the spatial correlation of each dimension in the electrocardiosignal in combination with a channel prior attention mechanism, so that the accuracy of ST segment anomaly detection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to but is not limited to the technical field of electrocardiogram abnormality detection, and in particular relates to a method and system for detecting ST segment abnormality based on inverse Transformer (iTransformer) and fusion attention. Background Art

[0002] The elevation or depression of the ST segment in the electrocardiogram (ECG) is usually caused by the blockage of one or more coronary arteries that supply blood to the heart. In addition, ST segment abnormalities can be attributed to a variety of diseases, including pericarditis, myocarditis, right bundle branch occlusion, and stress cardiomyopathy. Therefore, it is crucial to effectively diagnose and prevent these diseases. To address the limitations of manual detection, computer-assisted ECG analysis methods have been developed and widely used. Due to the advancement of computing power and the exponential expansion of data collection, deep neural networks have shown superior performance compared to traditional machine learning methods. Although deep learning has been proven to be advanced in ECG classification tasks, it still faces many limitations and challenges due to the complexity of ECG data and the capabilities of computer learning methods. For example, deep learning techniques rely heavily on features extracted from the training set data for learning and classification. However, when applied to different patients, these features may lack sufficient effectiveness and generalization, thereby limiting the classification results due to reliance on invalid or single features, resulting in poor classification performance.

[0003] In addition, the sensitivity of ECG ST segment shift detection is very high, and there is a common problem that the characteristics are not clear in clinical diagnosis. The existing ECG diagnosis of arrhythmia automatic detection technology mainly focuses on the QRS band, lacking an effective and autonomous method to identify abnormal cardiac activity based on the ECG. Summary of the invention

[0004] In view of the problems existing in the prior art, the present invention provides a method and system for detecting ST segment abnormality based on inverted Transformer and fusion attention.

[0005] The present invention is implemented as follows: a method for detecting ST segment abnormalities based on inverted Transformer and fusion attention, comprising the following steps:

[0006] Step 1, data preprocessing: use the median filtering method to denoise the input data samples and perform data amplification on abnormal ST data;

[0007] Step 2: Use a convolutional neural network model that combines the inverse Transformer and channel prior attention (CPCA) mechanism to classify the ECG signals.

[0008] Furthermore, the step 1 uses two filters with window lengths of 20% and 60% of the sampling rate to remove high-frequency noise and process baseline drift; the shorter window enhances the model's ability to capture the high-frequency part of the feature, and the longer window maintains the baseline trend of the signal.

[0009] Furthermore, in step 1, the abnormal ST data is amplified 8 times, and the sample size is increased by combining translation and noise. The enhancement process includes: randomly shifting the data by 0 to 100 sampling points; and then randomly selecting one of low-frequency noise, high-frequency noise and white noise to be superimposed on the signal.

[0010] Furthermore, in step 2, the preprocessed data is initially input into the network model, and two parallel fusion networks are used to extract features, and then the extracted features are simultaneously input into the classifier to classify each record.

[0011] Furthermore, the InceptionTime network consists of three Inception modules and two residual blocks. In each Inception module, the input is initially reduced using a sliding filter of size 1.

[0012] Furthermore, the inverted Transformer is used to invert the time series, and each time series is embedded into a sequence independently; the inverted Transformer utilizes the encoder structure of the traditional Transformer to extract sequence representations through the self-attention interaction between sequences and the shared feedforward network.

[0013] Furthermore, a channel-prior convolutional attention mechanism collects spatial features from feature maps using average pooling and max pooling operations; the two sets of contextual features are then input into a multi-layer perceptron (MLP), and the resulting outputs are combined to generate feature maps containing contextual information at different scales.

[0014] Another object of the present invention is to provide an ST segment anomaly detection system based on inverted Transformer and fused attention based on ST segment anomaly detection method, comprising:

[0015] The data preprocessing module uses the median filtering method to denoise the input data samples and amplify the abnormal ST data;

[0016] The ECG signal classification module uses a convolutional neural network model that combines the inverse Transformer and the channel prior attention mechanism to classify ECG signals.

[0017] Another object of the present invention is to provide a computer device, the computer device includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the ST segment anomaly detection method based on inverted Transformer and fusion attention.

[0018] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to perform the steps of the ST segment abnormality detection method based on inverted Transformer and fusion attention.

[0019] In combination with the above technical solutions and the technical problems solved, the advantages and positive effects of the technical solutions to be protected by the present invention are as follows:

[0020] First, the present invention uses a convolutional neural network model that combines the inverse transformer and the channel prior attention mechanism to identify abnormal ST segment records. First, the inverse transformer and the time series channel convolution are introduced to ensure that the features can be effectively extracted and fused. Secondly, the channel prior attention mechanism is combined to enable the model to accurately capture the spatial correlation of each dimension in the ECG signal while retaining the relevant time series information, thereby improving the accuracy of ST segment abnormality detection.

[0021] The method of the present invention combines the inverse Transformer, convolutional network (CNN) and CPCA modules to provide valuable clinical guidance and reference for arrhythmia detection. The method was evaluated on two databases, the Chinese Cardiovascular Disease Database (CCDD) and the PTB-XL database. In the CCDD test set, an accuracy of 96.14%, a sensitivity of 96.2%, a positive predictive value of 99.88%, an F1 score of 96.17% and a Youden index of 92.34% were achieved. In the PTB-XL database, an accuracy of 88.58% was also achieved. The experimental results show that the method of the present invention is superior to previously published methods in terms of single-lead ST segment abnormality detection performance.

[0022] Second, as auxiliary evidence of the inventiveness of the claims of the present invention, it is also reflected in the following important aspects:

[0023] (1) The expected benefits and commercial value of the technical solution of the present invention after transformation are:

[0024] There are many heart diseases that manifest as ST segment abnormalities, such as pericarditis, myocarditis, right bundle branch occlusion, and stress cardiomyopathy. First of all, from the perspective of improving the accuracy of medical diagnosis, the present invention can significantly improve the accuracy of ST segment abnormality detection, reduce misdiagnosis and missed diagnosis, and thus directly improve the quality and efficiency of medical services. This advantage not only helps medical institutions establish more reliable patient health records, but also provides doctors with more scientific decision-making support and promotes the formulation and implementation of personalized medical plans.

[0025] Secondly, in terms of commercial value, the technical solution of the present invention has broad market application prospects. With the increasing trend of population aging and the rising incidence of cardiovascular diseases, the demand for efficient and accurate ST segment abnormality detection technology is becoming increasingly urgent. The emergence of the present invention just meets this market demand. Through various means such as technology licensing, product sales, and service provision, the present invention will bring considerable economic benefits to enterprises and promote technological progress and industrial upgrading of electrocardiogram diagnosis.

[0026] In addition, this solution is mainly trained on CCDD collected from domestic clinical practice. Since other ST segment abnormality detection studies generally use foreign data sets, and there are differences in the ECG characteristics of Asian people and other database populations, this solution can provide more accurate and personalized diagnostic services for Asian people. This feature not only enhances the market competitiveness of the present invention, but also provides strong support for domestic enterprises to expand the market and develop new products.

[0027] (2) The technical solution of the present invention fills the technical gap in the industry at home and abroad:

[0028] At present, there are few studies on ST segment anomaly detection at home and abroad, and some of the studies are too old and fail to apply the emerging technologies of deep learning in recent years. This scheme combines the inverted Transformer, CNN and fusion attention modules, and applies them to ST segment anomaly detection, achieving remarkable performance.

[0029] (3) The technical solution of the present invention solves the technical problems that people have been eager to solve but have never been able to solve successfully:

[0030] For a long time, the accuracy of ST segment abnormality detection has been a bottleneck in the field of medical diagnosis that needs to be broken through. This invention significantly improves the detection performance through unique model design and technological innovation, provides doctors with a more reliable and efficient diagnosis basis, solves this long-standing problem that has plagued the industry, and buys patients valuable treatment time.

[0031] Third, the technical solution of the present invention proposes a method for detecting ST segment anomalies based on inverted Transformer and fusion attention, which is mainly used to solve the problems of insufficient accuracy, poor noise resistance and insensitive response to complex signal patterns in ST segment anomaly detection in the prior art. The current ST segment anomaly detection system usually relies only on basic filtering and classification models, which are difficult to effectively deal with noise and baseline drift problems. At the same time, the traditional model lacks the ability to capture the dynamic characteristics of the signal, resulting in low detection accuracy and robustness.

[0032] The present invention effectively overcomes these bottlenecks through innovative signal processing and feature extraction methods.

[0033] First, the present invention introduces a multi-window median filtering mechanism in the data preprocessing stage, using short window and long window filters respectively, which not only removes high-frequency noise but also stabilizes baseline drift. This method significantly improves the purity and data quality of ECG signals, makes subsequent processing more stable, and provides a more reliable signal basis for detecting ST segment abnormalities. This dual-window design particularly enhances the model's ability to capture subtle signal features and overall trends, greatly improving the model's robustness and adaptability to different noise conditions.

[0034] Secondly, through the innovative application of data augmentation technology, the present invention effectively solves the problem of scarcity of abnormal ST data samples. By using a variety of augmentation methods such as translation, low-frequency noise, high-frequency noise and white noise, a rich number of abnormal samples are generated, which greatly improves the model's recognition rate of abnormal patterns. This method not only expands the amount of abnormal samples in terms of data volume, but also enhances the generalization ability of the model in terms of data diversity and complexity, so that it can still maintain a high detection accuracy when dealing with variable signals in actual environments.

[0035] The third innovation of the present invention is to combine the inverted Transformer with the channel prior attention mechanism and apply it to the classification of ECG signals. The multi-head attention mechanism of the inverted Transformer enhances the model's ability to process time series data, especially in detecting the temporal dynamic characteristics of ST segment abnormalities. The channel prior attention mechanism intelligently allocates weights based on the differences in channel characteristics of each frequency band, allowing the model to focus more accurately on the key feature areas of abnormal signals. This combination of the two greatly improves the sensitivity and accuracy of the model, and can still achieve accurate ST segment anomaly detection under complex abnormal patterns.

[0036] In terms of industrial application, the technical solution of the present invention can be applied to ECG monitoring systems, significantly improving the accuracy of ST segment abnormality detection, reducing false detection and missed detection, and ensuring patients' real-time health monitoring needs. At the same time, through low computing requirements and effective signal processing procedures, the solution of the present invention is suitable for integration into portable devices, promoting the progress of telemedicine and real-time health monitoring. Compared with the prior art, the present invention has achieved significant technical progress in noise resistance, dynamic feature capture, and detection accuracy, making ST segment abnormality detection more accurate and practical in practical applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 It is a flow chart of a method for detecting ST segment abnormality based on inverted Transformer and fusion attention provided by an embodiment of the present invention;

[0038] Figure 2 It is a convolutional neural network structure diagram that combines the inverse Transformer and the channel prior attention mechanism provided by an embodiment of the present invention;

[0039] Figure 3 It is a structural diagram of an inverted Transformer and a Transformer provided in an embodiment of the present invention;

[0040] Figure 4 It is a structural diagram of the Inception module provided by an embodiment of the present invention;

[0041] Figure 5 It is a structural diagram of an ST segment anomaly detection system based on inverted Transformer and fusion attention provided by an embodiment of the present invention;

[0042] Figure 6 Schematic diagram of confusion matrix of four models on CCDD provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0043] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0044] like Figure 1 As shown, an ST segment abnormality detection method based on inverted Transformer and fusion attention provided by an embodiment of the present invention includes the following steps:

[0045] Step 1, data preprocessing: use the median filtering method to denoise the input data samples and perform data amplification on abnormal ST data;

[0046] Step 2: Use a convolutional neural network model that combines the inverse Transformer and channel prior attention mechanism to classify the ECG signals.

[0047] The embodiment of the present invention proposes a fusion model that effectively captures the spatiotemporal features of ECG signals. The model combines the inverse Transformer and the temporal channel convolution to ensure the comprehensive fusion of data at each stage, thereby improving performance.

[0048] The embodiment of the present invention adopts a convolutional attention mechanism based on channel prior, so that the model can effectively capture the spatial correlation of each dimension in the ECG signal while maintaining the temporal attention information.

[0049] Taking ST segment abnormality as an example, the method proposed in the embodiment of the present invention can effectively solve the challenges brought by data imbalance and indistinguishable data set features, thereby providing a valuable example for detecting electrocardiogram signals using deep learning technology.

[0050] The ST segment anomaly detection method based on inverted Transformer and fusion attention provided by the present invention has a relatively systematic process in signal and data processing. First, in the data preprocessing stage, in order to improve the robustness of the model to noisy data, the median filtering method is used to remove high-frequency noise and interference in the ECG signal. Two filters with window lengths are specially designed: 20% and 60% of the sampling rate respectively. The short window filter effectively enhances the ability to capture the high-frequency components of the signal and helps to identify rapid changes in the signal; the long window maintains the overall trend of the ECG signal baseline and solves the problem of baseline drift. This dual-window filtering design lays the foundation for the model to extract accurate and stable features.

[0051] In the data augmentation process, an 8-fold data augmentation strategy was adopted to increase the sample size of abnormal ST data to improve the model's recognition performance for abnormal ST segments. The augmentation adopts the method of random translation and superimposed noise, which specifically includes: randomly shifting each sample signal from 0 to 100 sampling points, and then randomly superimposing low-frequency noise, high-frequency noise or white noise to enhance the model's ability to detect abnormal ST data under different noise conditions. This combination of translation and noise addition not only retains the original characteristics of the signal, but also generates a variety of interfered signal forms, enhancing the generalization ability of the model.

[0052] Next, in the feature extraction and classification stage, a convolutional neural network that integrates the inverse transformer and the channel prior attention mechanism is introduced to classify the preprocessed ECG signals. The inverse transformer uses a multi-head attention mechanism to extract features from the ECG signals in time series, enhancing the model's ability to capture time-dependent information. The channel prior attention mechanism focuses on the different frequency band channels of the signal and assigns different weights according to the importance of each channel, thereby capturing abnormal features in different frequency bands in the signal. The combination of the two improves the model's detection sensitivity for ST segment abnormalities.

[0053] Finally, the abnormal ST segment of the ECG signal is identified by analyzing the dynamic characteristics of the signal. Combined with the channel prior attention mechanism, the model can focus on the abnormal area in the signal according to the changes in the characteristics of different frequency bands, and the time series modeling ability of the inverted Transformer ensures that the model can continuously detect abnormal patterns in the signal sequence. This method achieves high-accuracy detection of ST segment abnormalities by processing the dynamic and static characteristics of the ECG signal.

[0054] In order to effectively remove noise while retaining important details, the median filtering method is used to process the input data samples.

[0055] Two filters with window lengths of 20% and 60% of the sampling rate are used. Shorter windows enhance the model's ability to capture the high-frequency portion of the feature, while longer windows help maintain the baseline trend of the signal. This approach can remove high-frequency noise while handling baseline drift, thereby improving the accuracy of signal processing.

[0056] Due to the limited amount of abnormal data, the CCDD training set has a highly unbalanced feature. This imbalance causes the model to ignore minority classes during training, resulting in a decrease in its generalization ability. The present invention performs 8 times data amplification on the abnormal ST data to make it closer to the number of normal categories. The enhancement process includes two steps. First, the data is randomly translated by 0 to 100 sampling points. Then, one of the following three types of noise is randomly selected and superimposed on the signal: low-frequency noise, high-frequency noise, and white noise. The amplitude and phase of the three types of noise are randomly changed. Due to the serious imbalance in the data set, simply translating or adding a single type of noise is not enough to solve the overfitting problem. Therefore, a combination of translation and noise is used to increase the sample size.

[0057] ECG signal classification using an inverted Transformer-based network with fused attention.

[0058] The preprocessed data is initially input into the network, and two parallel fusion networks are used for feature extraction. Subsequently, the extracted features are simultaneously input into the classifier to classify each record. The network model structure is shown in Figure 2 .

[0059] The InceptionTime network consists of three Inception modules and two residual blocks, such as Figure 3 As shown. In each Inception module, the input is initially reduced in dimension using a sliding filter of size 1. This reduction in complexity allows the model to utilize larger convolutions. The application of large convolutions prevents the fragmentation of time series information, facilitating the identification of disease features and the establishment of attention mechanisms. In addition, the Inception module combines multiple convolutions of different sizes to support simultaneous time series filtering and subsequent parallel maximum pooling operations. These operations improve the generalization ability of the model and reduce the model's vulnerability to small perturbations. To further enhance the model's attention to necessary feature information, the channel prior convolutional attention (CPCA) mechanism is incorporated into the InceptionTime network. To enhance the model's channel attention, the CPCA method draws inspiration from the convolutional block attention module (CBAM). It uses average pooling and maximum pooling operations to collect spatial features from feature maps. These two sets of contextual features are then input into a multi-layer perceptron (MLP), and the resulting outputs are combined to generate feature maps containing contextual information at different scales.

[0060] iTransformer is integrated into the proposed model to reverse the time series, which means that each time series is embedded into a sequence independently, such as Figure 4 As shown. iTransformer only utilizes the encoder structure of the traditional Transformer. Through the self-attention interaction between sequences, the sequence representation is extracted with the shared feedforward network. Since the temporal information of the sequence is already implicit in the neurons of the feedforward network, no additional position embedding is required. This reduces the impact of the position encoding process in the Transformer on the ability to model long sequences, making the model more suitable for processing such data. Therefore, the embedded tags in the model capture the global representation of the sequence and avoid the loss of some information caused by sequence cutting. At the same time, the feedforward network can more easily learn the global representation of the sequence. By performing self-attention operations on the entire sequence, the model can better capture the long-range dependencies between different positions in the sequence, thereby enhancing the model's ability to grasp the global characteristics of the sequence.

[0061] This paper proposes a new ST abnormality detection method, which combines the improved Transformer with convolutional technology. By integrating the inverted Transformer and channel prior attention into a unified network, high detection performance and low error single-lead diagnosis are achieved. These models were further trained and validated using the comprehensive database, the China Cardiovascular Disease Database (CCDD). On a data set containing more than 170,000 real clinical ECG records, the overall detection accuracy reached 95.8% and the sensitivity reached 96%, significantly surpassing the accuracy and universality of existing methods, thus providing clinicians with an advanced tool for detecting ST segment abnormalities.

[0062] like Figure 5 As shown, an ST segment anomaly detection method based on inverted Transformer and fusion attention provided by an embodiment of the present invention includes:

[0063] The data preprocessing module uses the median filtering method to denoise the input data samples and amplify the abnormal ST data;

[0064] The ECG signal classification module uses a convolutional neural network model that combines the inverse Transformer and the channel prior attention mechanism to classify ECG signals.

[0065] 1. Working principle of data preprocessing module

[0066] The ST segment anomaly detection system of the embodiment of the present invention first performs denoising and data enhancement processing on the input ECG signal through a data preprocessing module. The input raw ECG data usually contains noise, such as electrode interference, myoelectric interference, etc., which will affect the accuracy of subsequent classification. Therefore, the system uses a median filtering method to denoise the ECG signal to eliminate these high-frequency noises and abnormal points. For abnormal ST segment data, data amplification technology is used to generate more samples to solve the problem of insufficient number of abnormal samples in ECG data. The data amplification method can include translation, rotation, noise addition and other means to ensure that the data samples in the training set are richer, thereby improving the generalization ability of the model.

[0067] 2. Working principle of ECG signal classification module

[0068] The ECG signal classification module is the core part of the ST segment anomaly detection system. It uses a convolutional neural network (CNN) model that combines the inverted Transformer and the channel prior attention mechanism. The model extracts local features of the ECG signal through the convolution layer, and uses the inverted Transformer structure to enhance the model's global dependence on time series information, thereby better capturing the temporal patterns in the ECG signal. In addition, the channel prior attention mechanism allocates different attention weights between different channels, allowing the model to focus more accurately on important channel features in the signal and improve classification accuracy.

[0069] 3. How the Reversed Transformer Mechanism Works

[0070] The core idea of ​​the inverse Transformer mechanism is to model the time series features of ECG signals through the self-attention mechanism. Although traditional convolutional neural networks are good at extracting local features, they have limitations in processing long-term dependent information. The inverse Transformer introduces a reverse self-attention mechanism to model the past and future time series features of the signal, thereby capturing long-range dependencies in the time dimension. In this way, the model can not only judge the current state of the ECG signal, but also take into account historical and future information, providing a more comprehensive basis for the detection of ST segment abnormalities.

[0071] 4. Working principle of channel prior attention mechanism

[0072] The channel prior attention mechanism assigns different attention weights to different channels, allowing the model to focus on the key features in the ECG signal. In the ECG signal classification task, the importance of different lead signals may be different. The channel prior attention mechanism can automatically learn the weight of each channel, so that the model can better extract effective features in the key channels. In addition, this mechanism can also effectively reduce the model's dependence on unimportant information and improve the accuracy and robustness of classification. By integrating this mechanism, the entire ST segment anomaly detection system can more accurately identify abnormal ST segments and significantly improve the performance of ECG signal classification.

[0073] This scheme was used to perform application tests on ST segment abnormality detection on CCDD and PTB-XL databases. In order to test the performance more objectively, in CCDD, normal data and ST segment abnormality data were randomly sampled and divided into training set, validation set, and test set with a ratio of about 2:1:7, and the scheme was tested on these randomly divided data. In the PTB-XL database, the traditional 10-fold validation method was used for application testing, referring to the way others used this database for research.

[0074] In order to evaluate the performance of the classification model proposed in the present invention, its accuracy (Acc), sensitivity (Se), specificity (Sp) and positive predictive value (PPV) scores were measured. In the context of disease classification, when the accuracy rates are similar, more emphasis is placed on the sensitivity index. Because higher sensitivity reduces the possibility of missed diagnosis. In order to evaluate the results of the model more comprehensively, the F1 score (F1) was introduced. The F1 score takes into account both sensitivity and specificity, thereby better representing the overall performance of the model. In addition, the Youden index (γ) is used to evaluate the ability of the method to avoid failure. The higher the Youden index, the stronger the ability of the method to avoid failure. The calculation methods of these indicators are as follows. Wherein, TN is used to represent the number of correctly classified non-abnormal records, TP is used to represent the number of correctly classified abnormal records, FN is used to represent the number of incorrectly classified abnormal records, and FP is used to represent the number of incorrectly classified non-abnormal records.

[0075]

[0076] Figure 6 The confusion matrix generated by the four models on the CCDD test set is shown. The horizontal direction of the confusion matrix represents the real data, and the vertical direction on the left represents the predicted data.

[0077] exist Figure 6 In (a), the iTransformer model is used. Figure 6 In (b), the InceptionTime model is used. Figure 6 (c) shows the results of combining the iTransformer and InceptionTime models. Figure 6 (d) shows the results of the CPCA mechanism based on the fusion of two models. Table 1 shows the Acc, Se, Sp, PPV and Youden index obtained by the four models. The results show that the model proposed in the present invention enhances the feature extraction and disease classification results obtained for ST abnormalities in each corresponding component.

[0078] Table 1 Ablation comparison results of the method of the present invention and other methods on CCDD

[0079]

[0080] Table 2 gives the comparison between the proposed method and other models on the CCDD test set. Fcnwang is a 3-layer convolutional network with kernel sizes of 8, 5, and 3. ATI-CNN is designed for ECG classification, which combines a fully convolutional neural network, an LSTM layer, and an attention module. The structure of the convolutional layer in the model is similar to the VGG network.

[0081] Table 2 Performance comparison between the method of the present invention and other models on CCDD

[0082]

[0083] Table 3 gives the comparison between our model and other models on the PTB-XL test set. ST-CNN-GAP5, an advanced model designed specifically for detecting heart disease, achieves an astonishing AUC of 93.41% on the PTB-XL dataset. The model consists of five temporal layers, one spatial layer, and two skip connections, and uses global average pooling in the final convolutional layer. On the other hand, the DLECGCVD model adopts a feature selection method based on improved swallow swarm optimization to overcome the local optimal problem. On the PTB-XL dataset, it achieves a sensitivity of 97.43%, a specificity of 54.27%, an accuracy of 87.72%, and an F1 score of 92.48%. Although this approach focuses on disease classification and effectively achieves enhanced sensitivity, it exhibits significantly reduced specificity and accuracy values, resulting in an overall suboptimal performance. Table 4 shows the results of ablation experiments conducted on our model on the PTB-XL dataset.

[0084] Table 3 Comparison results of the performance of the method of the present invention with other methods on the PTB-XL database

[0085]

[0086] Table 4 Ablation comparison results of the method of the present invention and other methods on the PTB-XL database

[0087]

[0088] It should be noted that the embodiments of the present invention can be implemented by hardware, software, or a combination of software and hardware. The hardware part can be implemented using dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. It can be understood by a person of ordinary skill in the art that the above-mentioned devices and methods can be implemented using computer executable instructions and / or contained in a processor control code, such as a carrier medium such as a disk, CD or DVD-ROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. Such code is provided on the carrier medium. The device and its modules of the present invention can be implemented by hardware circuits such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., can also be implemented by software executed by various types of processors, and can also be implemented by a combination of the above-mentioned hardware circuits and software, such as firmware.

[0089] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope of the present invention.

Claims

1. A ST segment abnormality detection method based on inverted Transformer and fusion attention, characterized in that: The following steps are involved: Step 1, data preprocessing: use the median filtering method to denoise the input data samples and perform data amplification on abnormal ST data; Step 2: Use a convolutional neural network model that combines the inverse Transformer and channel prior attention mechanism to classify the ECG signals.

2. The ST segment anomaly detection method based on inverted Transformer and fusion attention as claimed in claim 1, characterized in that: The step 1 uses two filters with window lengths of 20% and 60% of the sampling rate to remove high-frequency noise and process baseline drift; the shorter window enhances the model's ability to capture the high-frequency part of the feature, and the longer window maintains the baseline trend of the signal.

3. The ST segment abnormality detection method based on inverted Transformer and fusion attention as claimed in claim 1, characterized in that: In the step 1, the abnormal ST data is amplified by 8 times, and the sample size is increased by combining translation and noise. The enhancement process includes: randomly shifting the data by 0 to 100 sampling points; and then randomly selecting one of low-frequency noise, high-frequency noise and white noise to be superimposed on the signal.

4. The ST segment abnormality detection method based on inverted Transformer and fusion attention as claimed in claim 1, characterized in that: The second step initially inputs the preprocessed data into the network model, and uses two parallel fusion networks to extract features, and then simultaneously inputs the extracted features into the classifier to classify each record.

5. The ST segment abnormality detection method based on inverted Transformer and fusion attention as claimed in claim 1, characterized in that: The InceptionTime network consists of three Inception modules and two residual blocks. In each Inception module, the input is initially reduced using a sliding filter of size 1.

6. The ST segment anomaly detection method based on inverted Transformer and fusion attention as claimed in claim 1, characterized in that: The inverted Transformer is used to reverse the time series, and each time series is embedded into a sequence independently; the inverted Transformer uses the encoder structure of the traditional Transformer to extract sequence representations through the self-attention interaction between sequences and the shared feedforward network.

7. The ST segment abnormality detection method based on inverted Transformer and fusion attention as claimed in claim 1, characterized in that: The channel-prior convolutional attention (CPCA) mechanism collects spatial features from feature maps using average pooling and max pooling operations; The two sets of contextual features are then fed into a multi-layer perceptron (MLP), and the resulting outputs are combined to generate feature maps containing contextual information at different scales.

8. A ST segment anomaly detection system based on inverted Transformer and fusion attention according to any one of claims 1 to 7, characterized in that: include: The data preprocessing module uses the median filtering method to denoise the input data samples and amplify the abnormal ST data; The ECG signal classification module uses a convolutional neural network model that combines the inverse Transformer and the channel prior attention mechanism to classify ECG signals.

9. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the ST segment anomaly detection method based on inverted Transformer and fusion attention as described in any one of claims 1-7.

10. A computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to perform the steps of the ST segment abnormality detection method based on inverted Transformer and fusion attention as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Multi-lead electrocardiogram classification and identification method based on convolution and self-attention mechanism

    CN115470828A

  • Multi-band spectrum prediction method and system based on graph convolution inversion Transform

    CN118233035A