Atrial fibrillation classification method, electronic equipment, readable storage medium and program product
By using multi-scale convolution modules, deep separable convolution and attention mechanisms in the classification of atrial fibrillation, and AI networks with bidirectional long and short-term memory layers, the problems of large amount of calculation and low accuracy of atrial fibrillation classification in the existing technology are solved, and higher classification accuracy and generalization capabilities are achieved.
Patent Information
- Application Number
- CN202510484732.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-17
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2045-04-17
AI Technical Summary
In the prior art, the method of classification of atrial fibrillation through neural networks is relatively large in calculations, and the classification results are relatively accurate.
A method of classification of atrial fibrillation is provided, and electrocardiogram signal data is classified and processed through an artificial intelligence AI network. The AI network includes a multi-scale convolution module, a first feature processing module, a second feature processing module and a classification module. The specific steps include extracting multi-scale features through a multi-scale convolution module, extracting the first feature through a depth separation convolution and attention processing, extracting the second feature including context information through a bidirectional long and short-term memory layer, and finally classifying it through a fully connected layer.
By extracting features and depths at different scales, the combination of convolution and attention can be separated, and the feature expression can be enriched, and the accuracy of the classification results of atrial fibrillation and the generalization ability of the model can be improved.
Smart Images

Figure CN120123912A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical fields of artificial intelligence and medical data analysis. Specifically, the present disclosure relates to a method for classifying atrial fibrillation, an electronic device, a readable storage medium, and a program product. Background Art
[0002] Atrial fibrillation (AF) is the most common persistent arrhythmia, and its detection, diagnosis, and management are costly. In the diagnosis and management of atrial fibrillation, standard 12-lead electrocardiogram or single-lead electrocardiogram (≥30 s) recordings can be used to diagnose atrial fibrillation. At the same time, mobile health and artificial intelligence (AI) technologies can be used for the screening and risk prediction of atrial fibrillation.
[0003] With the development of technology, deep learning, as an important branch of the field of artificial intelligence, has been applied in various fields of the medical industry. By learning the internal laws and representation levels of sample data, deep learning enables machines to have the ability to analyze and learn, and can diagnose and evaluate diseases. Deep learning is a machine learning method based on artificial neural networks. Classical models include feedforward neural networks, convolutional neural networks, recurrent neural networks, and long short-term memory networks. With the development of deep learning technology, new models and methods such as the Transformer model, attention mechanism, generative adversarial network, and graph neural network have emerged, enhancing the capabilities of deep learning.
[0004] However, in the prior art, the method for classifying atrial fibrillation through a neural network has a large computational amount and a low accuracy of classification results. Summary of the Invention
[0005] Embodiments of the present disclosure provide a method for classifying atrial fibrillation, an electronic device, a readable storage medium, and a program product to solve at least one of the above technical problems. The technical solutions are as follows: In a first aspect, embodiments of the present disclosure provide a method for classifying atrial fibrillation, which classifies electrocardiogram signal data through an artificial intelligence AI network to obtain classification information related to atrial fibrillation; The AI network includes a multi-scale convolution module, a first feature processing module, a second feature processing module, and a classification module; Among them, the classifying the electrocardiogram signal data includes: Extracting feature data of at least two scales for the electrocardiogram signal data through the multi-scale convolution module; Performing depthwise separable convolution processing on the feature data through the first feature processing module, and performing channel attention and spatial attention processing to obtain a first feature; Extracting a second feature including context information based on the first feature through the second feature processing module; Based on the second feature, the classification module determines classification information related to atrial fibrillation.
[0006] In a feasible embodiment, the first feature processing module includes at least one sub-module composed of a depthwise separable convolution unit and an attention unit, and at least two depthwise separable convolution units connected in cascade and with residual connections are included in at least one sub-module; Among them, the process of performing depthwise separable convolution on the feature data by the first feature processing module and performing channel attention and spatial attention processing to obtain the first feature includes: Performing depth convolution and point convolution processing on the input feature through the depthwise separable convolution unit; Performing channel attention and spatial attention processing on the input feature through the attention unit; Among them, in the residual connection structure, the output of the previous unit is added to the output of the cascaded unit as the input of the next unit.
[0007] In a feasible embodiment, the second feature processing module includes at least one bidirectional long short-term memory layer; The process of extracting the second feature including context information based on the first feature by the second feature processing module includes: Performing context processing on the first feature through the at least one bidirectional long short-term memory layer.
[0008] In a feasible embodiment, the second feature processing module further includes an attention layer arranged after the bidirectional long short-term memory layer; The attention layer is used to perform global attention processing on the output of the bidirectional long short-term memory layer.
[0009] In a feasible embodiment, the classification module includes at least one fully connected layer; Among them, the process of determining classification information related to atrial fibrillation based on the second feature by the classification module includes: Performing feature mapping with each heart rhythm category based on the second feature through the at least one fully connected layer to determine classification information related to atrial fibrillation.
[0010] In a feasible embodiment, the electrocardiogram signal data includes single-lead data; The classification information related to atrial fibrillation includes one of the following: Multi-classification information, including at least one classification information of atrial fibrillation, sinus bradycardia, supraventricular tachycardia, atrial bigeminy; Binary classification information, including classification information of atrial fibrillation or non-atrial fibrillation.
[0011] In a feasible embodiment, the AI network is trained through the following operations: Obtain sample data; the sample data includes electrocardiogram signal sample data with rhythm labels; Select the data of any lead from the electrocardiogram signal sample data to obtain single-lead sample data; According to the rhythm label, segment the single-lead sample data to obtain a number of signal segments of a preset length; Perform denoising and normalization processing on each signal segment to obtain training data, and determine a corresponding class label for each training data; Train the AI network based on the training data and its class label.
[0012] In a second aspect, an embodiment of the present disclosure provides an electronic device, including a memory, a processor, and a computer program stored on the memory. The processor executes the computer program to implement the steps of the method according to the first aspect and any of its embodiments.
[0013] In a third aspect, an embodiment of the present disclosure provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method according to the first aspect and any of its embodiments are implemented.
[0014] In a fourth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program. When the computer program is executed by a processor, the steps of the method according to the first aspect and any of its embodiments are implemented.
[0015] The beneficial effects brought by the technical solutions provided by the embodiments of the present disclosure are: An embodiment of the present disclosure provides an atrial fibrillation classification method, which can classify electrocardiogram signal data through an AI network to obtain classification information related to atrial fibrillation. Among them, the AI network architecture provided by the embodiment of the present disclosure may include a multi-scale convolution module, a first feature processing module, a second feature processing module, and a classification module. Specifically, through the multi-scale convolution module, feature extraction can be performed on the input electrocardiogram signal data to obtain feature data at at least two scales. Subsequently, through the first feature processing module, depthwise separable convolution can be performed on the feature data, and channel attention and spatial attention processing can be performed to obtain a first feature. Furthermore, through the second feature processing module, a second feature including context information can be extracted based on the first feature, and finally, the classification module can determine the classification information related to atrial fibrillation based on the second feature. In the embodiment of the present disclosure, by extracting feature data at different scales as the basis for subsequent operations, the feature expression can be enriched, and the accuracy of the atrial fibrillation classification result can be improved. Through the hybrid processing of depthwise separable convolution and attention, the model complexity can be reduced while effectively improving the network performance. In addition, the processing of channel attention and spatial attention can improve the classification accuracy and generalization ability of the model. On this basis, obtaining the context information in the features can effectively improve the expression ability of the model, and then classifying based on these extracted features is beneficial to improving the generalization ability and accuracy of the model for processing electrocardiogram signal data. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the following will briefly introduce the drawings required for the description in the embodiments of the present disclosure.
[0017] Figure 1 It is a flowchart of an atrial fibrillation classification method provided by an embodiment of the present disclosure; Figure 2 It is a schematic structural diagram of an AI network provided by an embodiment of the present disclosure; Figure 3 It is a schematic structural diagram of a depthwise separable convolution module provided by an embodiment of the present disclosure; Figure 4 It is a schematic structural diagram of an AI network provided by an embodiment of the present disclosure; Figure 5a It is an electrocardiogram of a patient when normal; Figure 5b It is an electrocardiogram of a patient during atrial fibrillation attack; Figure 6 It is a schematic diagram of an average confusion matrix provided by an embodiment of the present disclosure; Figure 7 It is a schematic diagram of a confusion matrix provided by an embodiment of the present disclosure; Figure 8Schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. Detailed implementation manners
[0018] The embodiments of the present disclosure will be described below with reference to the accompanying drawings in the present disclosure. It should be understood that the implementation manners described below in conjunction with the accompanying drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present disclosure, and do not constitute limitations on the technical solutions of the embodiments of the present disclosure.
[0019] Those skilled in the art of the present technology can understand that, unless specifically stated otherwise, the singular forms "a", "an", "the" and "said" used herein may also include the plural forms. It should be further understood that the terms "comprising" and "including" used in the embodiments of the present disclosure mean that the corresponding features can be implemented as the presented features, information, data, steps, operations, elements, and / or components, but do not exclude the implementation of other features, information, data, steps, operations, elements, components, and / or their combinations supported by the art of the present technology, etc. It should be understood that when we say that an element is "connected" or "coupled" to another element, the one element can be directly connected or coupled to the other element, or it can mean that the one element and the other element establish a connection relationship through an intermediate element. In addition, the "connection" or "coupling" used herein may include a wireless connection or a wireless coupling. The term "and / or" used herein indicates at least one of the items defined by the term, for example, "A and / or B" can be implemented as "A", or implemented as "B", or implemented as "A and B".
[0020] In the various embodiments of the present disclosure, the term "based on" can be interpreted as the premise, condition or information on which it is based is not the only one, but at least one or a part of it. That is to say, it indicates that there is at least one clear basis, and other possible bases are not excluded.
[0021] To make the purpose, technical solutions and advantages of the present disclosure clearer, the embodiments of the present disclosure will be further described in detail below with reference to the accompanying drawings.
[0022] The technical solutions of the embodiments of the present disclosure and the technical effects produced by the technical solutions of the present disclosure will be described below through the description of several exemplary implementation manners. It should be noted that the following implementation manners can be referred to, learned from or combined with each other. For the same terms, similar features and similar implementation steps in different implementation manners, they will not be described repeatedly.
[0023] The atrial fibrillation classification method provided by the embodiments of the present disclosure will be described below.
[0024] Specifically, as Figure 1 shown, the atrial fibrillation classification method includes classifying electrocardiogram signal data through an AI network to obtain classification information related to atrial fibrillation.
[0025] Optionally, the electrocardiogram signal data may include data collected by an electrocardiogram (ECG). An electrocardiogram is a graph obtained by placing electrodes on the body surface to record the weak electrical signals generated during the contraction and relaxation of the heart muscle, amplifying them, and recording them. These signals are presented in the form of waveforms and contain information about heart activities.
[0026] Optionally, the AI network can classify atrial fibrillation based on multi-lead data or single-lead data. In the embodiments of the present disclosure, in order to reduce the computational complexity of the model and lightweight the model, single-lead data is used as the input of the AI network. When the AI network processes single-lead data, since the data volume is relatively small, it can be analyzed faster, improving the efficiency of atrial fibrillation classification. Among them, the single-lead data can be the data of one of the leads selected from the collected electrocardiogram signal data.
[0027] Optionally, the electrocardiogram signal data can be preprocessed data. Exemplarily, the duration of a recorded data is 24 hours (only one example, and it can also be a longer time). After being processed into each single-lead data through the selection of a single lead, it can be cut, such as cut into signal segments with a length of 5 seconds or other specific time lengths, to improve the processing efficiency of the model and reduce the complexity. And in order to improve the classification accuracy, the data can also be denoised and normalized.
[0028] Optionally, the electrocardiogram signal data input into the model may further include auxiliary data, such as user data corresponding to the single-lead data in the above embodiments, which may include information such as age, gender, and genetic medical history. The user data, as an auxiliary input to the AI network, can improve the accuracy of classification.
[0029] Optionally, such as Figure 2As shown, the AI network may include a multi-scale convolution module, a first feature processing module, a second feature processing module, and a classification module. Among them, the multi-scale convolution module can extract multi-scale features. Extracting features of different scales can effectively enrich the expression of features, making the subsequent feature extraction cover a wider range and reducing information loss. In atrial fibrillation classification, considering local detail information (such as a rhythm with smaller changes) synchronously on the basis of considering global information (such as a rhythm with larger changes) can effectively improve the ability of the network, enabling the AI network to better capture information in the data. Among them, the first feature processing module can be configured with a lightweight module design to reduce the number of parameters and the amount of computation while maintaining high performance. The second feature processing module can be configured to process the context information of the electrocardiogram signal to effectively adapt to the complex sequence data of the electrocardiogram signal data and improve the generalization ability and accuracy of the electrocardiogram signal data processing. The classification module can be configured with a module design to assist in improving the classification accuracy, such as processing the rich features obtained through a fully connected layer to obtain a more accurate classification result.
[0030] Optionally, the classification information related to atrial fibrillation includes multi-classification information, which may include at least one classification information of atrial fibrillation, sinus bradycardia, supraventricular tachycardia, and atrial bigeminy. It can be understood that it can be a classification of multiple different abnormal heart rhythms. Exemplarily, it can be identified in the form of a label, such as configuring a class label for each heart rhythm category and outputting the result in the form of a class label.
[0031] Optionally, the classification information related to atrial fibrillation includes binary classification information, which may include classification information of atrial fibrillation or non-atrial fibrillation. Among them, Figure 5a shows the normal heart rhythm record (non-atrial fibrillation) of a certain patient, Figure 5b shows the atrial fibrillation attack record (atrial fibrillation) of a certain patient; among them, the vertical axis voltage in the figure indicates the voltage value of the electrocardiogram signal, and the unit is millivolt (mV).
[0032] In a feasible embodiment, classifying the electrocardiogram signal data includes S101 to S104: S101. Through the multi-scale convolution module, extract feature data of at least two scales for the electrocardiogram signal data.
[0033] Exemplarily, such as Figure 4As shown, the multi-scale convolution module may include at least two branches, with each branch corresponding to a convolution block. Each branch may use convolution kernels of different sizes (such as 3×3, 5×5, 7×7, etc.) or different dilation rates to extract features. Small convolution kernels can capture local details, while large convolution kernels or dilated convolutions capture global context. Subsequently, features of different scales can be fused through concatenation or weighted summation to form a comprehensive feature representation, that is, feature data. Optionally, each convolution block may include two layers of one-dimensional convolution and two pooling layers, and at least one normalization layer and at least one activation layer are cascaded after convolution to extract multi-scale features under different convolution kernel sizes and enrich the feature expression. Among them, the pooling layer may be a max pooling layer, which is used to select the maximum value within the receptive field as the output.
[0034] Optionally, after the electrocardiogram signal data passes through the multi-scale convolution module to obtain features of at least two scales, it can be concatenated in the channel dimension and then output for processing in the subsequent network module.
[0035] S102. Through the first feature processing module, perform depthwise separable convolution on the feature data and perform channel attention and spatial attention processing to obtain the first feature.
[0036] Optionally, as Figure 4 shown, the first feature processing module may include a depthwise separable convolution unit (such as depthwise separable convolution blocks 1, 2......10) and an attention unit, such as CBAM (Convolutional Block Attention Module), a lightweight attention mechanism module that combines channel attention and spatial attention.
[0037] Optionally, the depthwise separable convolution unit may be composed of a cascade of a layer of depthwise convolution (such as Depthwise Convolution, which can perform convolution on each input channel separately to extract spatial features) and a pointwise convolution (such as Pointwise Convolution, which can mix channel information). After each convolution, at least one normalization layer (such as Bn, Batch Normalization) and at least one activation layer (such as Relu6, Rectified Linear Unit 6, an improved activation function that limits the input value between 0 and 6) are configured, as Figure 3 shown. The design of the depthwise separable convolution unit can reduce the complexity of the model and improve the model processing efficiency.
[0038] Optionally, the attention unit may be composed of a cascaded channel attention block and a spatial attention block, which calculate weight information in the channel dimension and the spatial dimension respectively to focus on important features and improve the feature expression ability.
[0039] S103. Through the second feature processing module, based on the first feature, extract a second feature including context information.
[0040] Optionally, considering that the electrocardiogram signal data involves complex sequence data, in order to better perform feature expression, a network capable of extracting context information may be configured to capture local and global, short-term and long-term dependencies. Exemplarily, a convolutional neural network (CNN) and its variants (such as Pyramid Pooling), a recurrent neural network (RNN) and its variants (such as BiLSTM), a self-attention mechanism, and a Transformer architecture may be configured to achieve the extraction of context information.
[0041] S104. Through the classification module, based on the second feature, determine classification information related to atrial fibrillation.
[0042] Optionally, as the output module of the AI network, the classification module is responsible for classification based on the extracted features, located at the end of the AI network, receiving features from the previous network layer, and outputting classification results. Exemplarily, the classification module may include fully connected layers (Fully Connected Layers), or other types of layers, such as a softmax layer. In the embodiments of the present disclosure, through the processing of the softmax layer, multiple heart rhythm categories can be distinguished, that is, a multi-classification task is performed; it can also be a sigmoid layer. In the embodiments of the present disclosure, through the processing of the sigmoid layer, whether atrial fibrillation occurs can be distinguished, that is, a binary classification task is performed.
[0043] In a feasible embodiment, as Figure 4 shown, the first feature processing module includes at least one sub-module composed of a depthwise separable convolution unit and an attention unit, and at least one sub-module includes at least two cascaded and residually connected depthwise separable convolution units.
[0044] Exemplarily, the first feature processing module may include multiple groups of sub-modules. For example, Figure 4 in, the depthwise separable convolution block 1, the depthwise separable convolution block 2, and CBAM constitute the first sub-module, the depthwise separable convolution block 3, the depthwise separable convolution block 4, and CBAM constitute the second sub-module, and the depthwise separable convolution blocks 5 to 10 and CBAM constitute the third sub-module. Among them, the serial numbers of each depthwise separable convolution block correspond to their sorting positions from left to right in Figure 4 correspondingly.
[0045] Optionally, to avoid network degradation and improve the model's expressive ability, a residual connection structure is also configured in the third sub-module. As Figure 4 shown, the output of the depthwise separable convolution block 6 is added to the output of the depthwise separable convolution block 8 and merged as the input of the depthwise separable convolution block 9; correspondingly, the input of the depthwise separable convolution block 9 is added to the output of the depthwise separable convolution block 10 and merged as the input of the subsequent CBAM module.
[0046] Optionally, in S102, through the first feature processing module, depthwise separable convolution is performed on the feature data, and channel attention and spatial attention processing are performed to obtain the first feature, including steps A1 to A2: Step A1: Through the depthwise separable convolution unit, perform depth convolution and point convolution processing on the input features.
[0047] Step A2: Through the attention unit, perform channel attention and spatial attention processing on the input features.
[0048] Among them, in the residual connection structure, the output of the previous unit is added to the output of the cascaded unit as the input of the next unit.
[0049] Optionally, as Figure 4 shown, the first sub-module consists of a depthwise separable convolution block (Depthwise Block) 1, a depthwise separable convolution block 2, and a CBAM module, and the three parts are cascaded. In the second sub-module, the output of the first sub-module is used as the input for feature processing, including a depthwise separable convolution block 3, a depthwise separable convolution block 4, and a CBAM module, and the three parts are cascaded. In the third sub-module, there are six cascaded depthwise separable convolution blocks and a CBAM module, and a residual structure is configured. Among them, the output of the depthwise separable convolution block 6 can be added to the output of the depthwise separable convolution block 8 and used as the input of the depthwise separable convolution block 9, and the input of the depthwise separable convolution block 9 can be added to the output of the depthwise separable convolution block 10 and used as the input of the CBAM module.
[0050] In the embodiments of the present disclosure, the channel attention mechanism and the spatial attention mechanism are comprehensively applied, which can improve the classification accuracy and generalization ability of the model; in addition, a hybrid stack of depthwise separable convolution units and attention units is designed, which can deepen the network and reduce the model complexity at the same time.
[0051] In a feasible embodiment, the second feature processing module includes at least one bidirectional long short-term memory layer.
[0052] Optionally, in S103, the second feature processing module extracts a second feature including context information based on the first feature, including step B1: performing context processing on the first feature through the at least one bidirectional long short-term memory layer.
[0053] Optionally, as Figure 4 shown, the second feature processing module is designed with a bidirectional long short-term memory (BiLSTM) layer. Through the processing of BiLSTM, the context information of the electrocardiogram signal can be concerned, and the long-term dependence features of the sequence can be extracted.
[0054] Optionally, the designed BiLSTM layer can improve the expression ability of the model. BiLSTM can effectively capture the context information of the sequence data and extract key features, and then transfer these features to the classification module (such as the fully connected layer), so that the classification module can perform more accurate classification or regression based on these rich features. The design of this network structure can make the entire AI network better adapt to the complex sequence data such as electrocardiogram signal data, and improve the generalization ability and accuracy of the model in processing electrocardiogram signal data.
[0055] Optionally, as Figure 4 shown, a BiLSTM layer can be designed to capture the information of the sequence data in two directions (forward and backward), such as capturing future information and past information. The ability to capture information bidirectionally can make the AI network have a stronger expression ability and improve the time series analysis ability of electrocardiogram signal data.
[0056] Optionally, the second feature processing module further includes an attention layer arranged after the bidirectional long short-term memory layer, such as Figure 4 the global attention module shown. The attention layer is used to perform global attention processing on the output of the bidirectional long short-term memory layer.
[0057] Optionally, global attention processing can calculate the weight of each feature, so that the model can focus on more important information when processing sequence data. Configuring a global attention layer after the BiLSTM layer can assist the model to more comprehensively understand the internal rules and structures of the sequence data by calculating the correlation degree between each feature and the entire sequence, so as to better perform the subsequent atrial fibrillation classification task.
[0058] In the embodiments of the present disclosure, although the addition of the global attention layer increases the complexity of the model, the global attention layer can improve the efficiency of the model by giving more weights to important features. For example, when processing long sequence data of electrocardiogram signals, the global attention layer can guide the model to only focus on the features valuable for atrial fibrillation classification, thereby reducing unnecessary computational effort.
[0059] In a feasible embodiment, as Figure 4 shown, the classification module (Classification) includes at least one fully connected layer.
[0060] Optionally, in S104, the classification information related to atrial fibrillation is determined based on the second feature through the classification module, including: through the at least one fully connected layer, performing feature mapping related to each heart rhythm category based on the second feature to determine the classification information related to atrial fibrillation.
[0061] Optionally, the fully connected layer can fuse the features extracted by the previous network layer and map them to the label space of the sample (such as the heart arrhythmia category) for classification.
[0062] Exemplarily, the network layer configured before the fully connected layer (such as the convolutional layer, pooling layer, etc.) can extract features from the input data and express them in the form of a two-dimensional feature map (matrix). Subsequently, the fully connected layer can fuse the features extracted by the previous layers. For example, each node is connected to all nodes of the previous layer, and a linear transformation is performed through the weight matrix and bias vector to convert the feature map into a one-dimensional vector. Then, based on activation functions such as the softmax function, each element of the one-dimensional vector is converted into a probability value, and the probability value indicates the possibility that the input data belongs to each heart rhythm category.
[0063] In the embodiments of the present disclosure, as Figure 4 shown, the electrocardiogram signal passes through the multi-scale convolution module to obtain features of at least two scales. After being concatenated in the channel dimension, it is input into the subsequent network blocks. Among them, the first two sub-modules in the first feature processing module are composed of two depthwise separable convolution units and one layer of CBAM unit stacked; the third sub-module is a cascade of a 6-layer depthwise separable convolution block and one layer of CBAM, and among them, the last 4 depthwise separable convolution units are pairwise connected in a residual connection; among them, the second feature processing module is composed of BiLSTM and global attention, and the output is used as the input of the classification module, and the final classification is performed through two fully connected layers of the classification module.
[0064] Next, in combination with Figure 4 an example is given to illustrate the AI network architecture provided by this common embodiment.
[0065] Exemplarily, the network includes two parts, one part is used for feature extraction, such as Figure 4The shown FeatureExtractor part can extract corresponding feature representations from the input data for subsequent tasks (such as classification); the other part is used for classification, such as Figure 4 the shown Classification part.
[0066] Among them, the input data of the network can be a heart rhythm data containing 3840 data points (such as Input 1 3840).
[0067] Among them, the feature extraction part includes the multi-scale convolution module (such as Multi-Conv) described in the above embodiment, the first feature processing module (such as the part composed of Depthwise Block and CBAM), and the second feature processing module (such as the part composed of BiLSTM and Global Attention).
[0068] Among them, the classification part includes the fully connected layer (such as FC) described in the above embodiment. Exemplarily, the data input to FC for processing includes the result obtained by performing a multiplication operation (such as Figure 4 in ") on the output of BiLSTM and the output of Global Attention, that is, multiplying the weight calculated based on global attention by the feature map processed by BiLSTM to obtain a weighted feature map as the input of FC.
[0069] Among them, the output data of the network can be classification results, such as AF (atrial fibrillation) and NSR (normal sinus rhythm).
[0070] The training process of the AI network provided by the embodiments of the present disclosure will be described below.
[0071] In a feasible embodiment, the AI network is trained through the operations of the following steps C1 to C5: Step C1, obtain sample data; the sample data includes electrocardiogram signal sample data with rhythm labels.
[0072] Step C2, select the data of any lead from the electrocardiogram signal sample data to obtain single-lead sample data.
[0073] Step C3, segment the single-lead sample data according to the rhythm label to obtain several signal segments of a preset length.
[0074] Step C4, perform denoising and normalization processing on each signal segment to obtain training data, and determine the corresponding class label for each training data.
[0075] Step C5: Train the AI network based on the training data and their class labels.
[0076] Optionally, a certain number of ECG signal data with rhythm labels can be collected. The data of one lead is selected to form a single-lead data set. Then, the data of different categories are divided according to the rhythm labels and segmented into segments of a certain length. After excluding severely noisy segments, the remaining ECG segments are denoised and normalized, and the class labels corresponding to each signal segment are determined. Then, the processed data is divided into a training set, a validation set, and a test set. The training set is input into the model for model fitting to adjust the network weights; the validation set is used to adjust the hyperparameters so that the model can perform better on the test set; the test set is used to evaluate the performance of the model.
[0077] The effects achievable by the embodiments of the present disclosure will be described below in conjunction with experimental data.
[0078] ECG data is collected from the public database LTAFDB (Long Term AF Database). The database includes 84 two-lead ECG data of 84 patients, and the duration of each data is about 24 hours. According to the rhythm annotation (such as the rhythm label in the above embodiment), the data is segmented, and noise segments are excluded, denoised, and normalized. 133,240 30s ECG segments are intercepted, and each ECG segment is assigned a class label, including 65,314 atrial fibrillation segments and 67,926 normal segments. The training set, validation set, and test set are divided in the ratio of 8:1:1, and the patients among the three data sets do not overlap.
[0079] The Adam optimizer is used for model training. Data augmentation is performed by random translation and random noise, and ten-fold cross-validation is performed on the model. The average classification accuracy on the test set is 96.10%, the average recall rate is 93.86%, and the average F1 score is 95.77%. The average confusion matrix is as Figure 6 shown. To evaluate the generalization ability of the model, an external test set is used to evaluate the generalization ability of the model. Data is obtained from the public database MIT-BIH AFDB (MIT-BIH AF Database), and the same data processing is performed to obtain 20,485 30s ECG segments. The above-trained model is used for testing, and the test accuracy is 92.98%. The confusion matrix is as Figure 7 shown. It can be understood that Figure 6 shown is the average confusion matrix of the test set in the ten-fold cross-validation of the training data set, showing the average situation corresponding to ten results. Figure 7 shown is the confusion matrix of the external test set, showing the situation corresponding to one result.
[0080] The experimental results show that the model designed by the present invention can perform atrial fibrillation classification well and has good generalization ability.
[0081] It should be noted that in the optional embodiments of the present disclosure, for the information involved (such as electrocardiogram signal data, etc.), when the above embodiments of the present disclosure are applied to specific products or technologies, permission or consent from the user is required, and the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of the relevant countries and regions. That is to say, if the data related to the user is involved in the embodiments of the present disclosure, such data needs to be obtained with the authorization and consent of the user and in compliance with the relevant laws, regulations, and standards of the country and region.
[0082] An electronic device is provided in the embodiments of the present disclosure, which may specifically be a medical device. The host of the device includes a memory, a processor, and a computer program stored on the memory. The processor executes the above computer program to implement the steps of the atrial fibrillation classification method. Compared with the related art, it can be achieved that: the electrocardiogram signal data is classified by the AI network to obtain classification information related to atrial fibrillation; wherein, the AI network architecture provided in the embodiments of the present disclosure may include a multi-scale convolution module, a first feature processing module, a second feature processing module, and a classification module. Specifically, the multi-scale convolution module can be used to extract features from the input electrocardiogram signal data to obtain feature data at at least two scales; then, the first feature processing module can perform depthwise separable convolution on the feature data and perform channel attention and spatial attention processing to obtain a first feature; further, the second feature processing module can extract a second feature including context information based on the first feature, and finally the classification module can determine the classification information related to atrial fibrillation based on the second feature. In the embodiments of the present disclosure, by extracting feature data at different scales as the basis for subsequent operations, the feature expression can be enriched and the accuracy of the atrial fibrillation classification result can be improved; through the hybrid processing of depthwise separable convolution and attention, the network performance can be effectively improved while the model complexity is reduced; in addition, the processing of channel attention and spatial attention can improve the classification accuracy and generalization ability of the model; on this basis, obtaining the context information in the features can effectively improve the expression ability of the model, and then classifying based on these extracted features is beneficial to improving the generalization ability and accuracy of the model in processing electrocardiogram signal data.
[0083] In an optional embodiment, an electronic device is provided, such as Figure 8 shown Figure 8The electronic device 4000 shown includes: a processor 4001 and a memory 4003. Among them, the processor 4001 and the memory 4003 are connected, such as connected through a bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, and the transceiver 4004 can be used for data interaction between this electronic device and other electronic devices, such as data sending and / or data receiving, etc. It should be noted that in practical applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation to the embodiments of the present disclosure.
[0084] The processor 4001 may be a CPU (Central Processing Unit, central processor), a general-purpose processor, a DSP (Digital Signal Processor, data signal processor), an ASIC (Application Specific Integrated Circuit, application-specific integrated circuit), an FPGA (Field Programmable Gate Array, field programmable gate array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logic blocks, modules, and circuits described in connection with the present disclosure. The processor 4001 may also be a combination that implements computing functions, such as a combination including one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0085] The bus 4002 may include a path for transmitting information between the above components. The bus 4002 may be a PCI (Peripheral Component Interconnect, peripheral component interconnect standard) bus or an EISA (Extended Industry Standard Architecture, extended industry standard architecture) bus, etc. The bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, Figure 8 only a thick line is used to represent it in the figure, but it does not mean that there is only one bus or one type of bus.
[0086] The memory 4003 can be a ROM (Read Only Memory), or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory), or other types of dynamic storage devices that can store information and instructions. It can also be an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory), or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium that can be used to carry or store computer programs and can be read by a computer, which is not limited herein.
[0087] The memory 4003 is used to store the computer program for implementing the embodiments of the present disclosure and is controlled by the processor 4001 for execution. The processor 4001 is used to execute the computer program stored in the memory 4003 to implement the steps shown in the foregoing method embodiments.
[0088] The embodiments of the present disclosure provide a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps and corresponding contents of the foregoing method embodiments can be implemented.
[0089] The embodiments of the present disclosure also provide a computer program product, including a computer program. When the computer program is executed by a processor, the steps and corresponding contents of the foregoing method embodiments can be implemented.
[0090] The terms "first", "second", "third", "fourth", "1", "2", etc. (if any) in the specification, claims and drawings of the present disclosure are used to distinguish similar objects and do not necessarily need to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances so that the embodiments of the present disclosure described herein can be implemented in an order other than that shown in the drawings or described in words.
[0091] It should be understood that although the flowchart of the embodiments of the present disclosure indicates each operation step by an arrow, the execution order of these steps is not limited to the order indicated by the arrow. Unless otherwise clearly stated herein, in some implementation scenarios of the embodiments of the present disclosure, the implementation steps in each flowchart may be executed in other orders according to requirements. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on the actual implementation scenario. Some or all of these sub-steps or stages may be executed at the same time, and each sub-step or stage among these sub-steps or stages may also be executed at different times. In the scenario where the execution times are different, the execution order of these sub-steps or stages can be flexibly configured according to requirements, and the embodiments of the present disclosure do not limit this.
[0092] The above are only optional implementation manners of some implementation scenarios of the present disclosure. It should be noted that for those of ordinary skill in the art, without departing from the technical concept of the solution of the present disclosure, adopting other similar implementation means based on the technical idea of the present disclosure also belongs to the protection scope of the embodiments of the present disclosure.
Claims
1. A method for classifying atrial fibrillation, characterized in that: Through the artificial intelligence AI network, ECG signal data is classified and processed to obtain classification information related to atrial fibrillation; The AI network includes a multi-scale convolution module, a first feature processing module, a second feature processing module and a classification module; The classification processing of the ECG signal data includes: Extracting feature data of at least two scales from the electrocardiogram signal data through the multi-scale convolution module; By using the first feature processing module, the feature data is subjected to depthwise separable convolution, and channel attention and spatial attention processing are performed to obtain a first feature; extracting, by the second feature processing module, a second feature including context information based on the first feature; Classification information related to atrial fibrillation is determined based on the second feature by the classification module.
2. The method according to claim 1, characterized in that The first feature processing module includes at least one submodule consisting of a depthwise separable convolution unit and an attention unit, and at least one submodule includes at least two cascaded and residually connected depthwise separable convolution units; The first feature processing module performs a depth-separable convolution on the feature data, and performs channel attention and spatial attention processing to obtain a first feature, including: The input features are processed by depth convolution and point convolution through the depth separable convolution unit; Through the attention unit, channel attention and spatial attention processing are performed on the input features; Among them, in the residual connection structure, the output of the previous unit is added to the output of the cascade unit as the input of the next unit.
3. The method according to claim 1, characterized in that The second feature processing module includes at least one bidirectional long short-term memory layer; The extracting, by the second feature processing module, a second feature including context information based on the first feature comprises: Context processing is performed based on the first feature through the at least one bidirectional long short-term memory layer.
4. The method according to claim 3, characterized in that The second feature processing module further includes an attention layer arranged after the bidirectional long short-term memory layer; The attention layer is used to perform global attention processing on the output of the bidirectional long short-term memory layer.
5. The method according to claim 1, characterized in that: The classification module includes at least one fully connected layer; Wherein, determining classification information related to atrial fibrillation based on the second feature by the classification module includes: By means of the at least one fully connected layer, feature mapping with each heart rhythm category is performed based on the second feature to determine classification information related to atrial fibrillation.
6. The method according to any one of claims 1 to 5, characterized in that The electrocardiogram signal data includes single-lead data; The categorized information related to atrial fibrillation includes one of the following: Multiple classification information, including at least one of atrial fibrillation, sinus bradycardia, supraventricular tachycardia, and atrial bigeminy; Binary information, including categorical information of atrial fibrillation or non-atrial fibrillation.
7. The method according to claim 1, characterized in that The AI network is trained by the following operations: Acquire sample data; the sample data includes ECG signal sample data with rhythm labels; Selecting data of any lead from the electrocardiogram signal sample data to obtain single-lead sample data; According to the rhythm label, the single lead sample data is segmented to obtain a number of signal segments of preset lengths. De-noising and normalizing are performed on each signal segment to obtain training data, and a corresponding category label is determined for each training data; The AI network is trained based on the training data and its category labels.
8. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Electrocardiogram data classification method and device and electronic equipment
CN116383695A
Method for realizing atrial fibrillation prediction by using neural network with multi-scale attention mechanism
CN116898451A
Burn deep artificial intelligence identification method and system based on deep learning model
CN117612704A
Lightweight segmentation method and device and storage medium
CN117853719A
Partial discharge fault type classification method based on GAN adversarial network and CNN-BiLSTM-Attention mechanism
CN119249227A
Cited By
Electrocardiosignal atrial fibrillation detection system and method and electronic equipment
CN121040922A