Open set arrhythmia classification method based on GAN-AE-CNN

The GAN-AE-CNN method is used to generate unknown ECG data and construct an error distribution model. Combined with adaptive threshold optimization, it solves the misjudgment problem of traditional arrhythmia classification algorithms in open environments, achieves effective detection of unknown categories and accurate classification of known categories, and improves diagnostic performance.

CN120611245APending Publication Date: 2025-09-09DALIAN UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510784242.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-12
Publication Date
2025-09-09

AI Technical Summary

Technical Problem

Traditional arrhythmia classification algorithms are prone to misjudging or ignoring unknown category signals in open environments, resulting in a high risk of misdiagnosis or missed diagnosis. Existing closed-set recognition models are difficult to effectively classify unknown categories.

Method used

A GAN-AE-CNN-based method is adopted to generate unknown ECG data by constructing a GAN network. Dual-source error analysis and adaptive threshold optimization are combined to achieve accurate classification of known categories and effective detection of unknown categories. The AE module is used to build an error distribution model, and CNN is used for fine-grained classification. The optimal detection threshold is determined through joint optimization.

Benefits of technology

Significantly improve the accuracy and reliability of arrhythmia classification in an open environment, reduce the risk of misdiagnosis and missed diagnosis, improve the ability to recognize unknown categories, and maintain the classification accuracy of known categories.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120611245A_ABST
    Figure CN120611245A_ABST
Patent Text Reader

Abstract

The invention discloses a GAN-AE-CNN-based open-set arrhythmia classification method, and belongs to the technical field of intelligent diagnosis of electrocardiosignals. The method comprises the following steps: independently training GAN, AE and CNN base models on the basis of closed set known electrocardiogram data; an unknown category of simulated electrocardiosignals are generated through the GAN, and the blank of open scene data is filled up; calculating a normalized mean square error of a known class and a generated sample by using AE, and constructing a double-source frequency histogram; the false alarm rate and the omission ratio are jointly optimized based on the probability density integral, and an optimal open set detection threshold value is determined; and after the MSE of the test sample is calculated through the AE, if the MSE exceeds a threshold value, the test sample is judged as an unknown class, otherwise, the CNN outputs a known class fine-grained label. Decision boundary optimization is driven through error distribution statistics, and dependence of a traditional model on a closed data set is remarkably reduced. By generating a sample expansion decision boundary, the problem of misjudgment of a traditional closed set model on unknown class signals is solved, the classification precision of known classes is kept in an open set scene, and the recognition capability of unknown classes is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent diagnosis of electrocardiogram signals, and in particular to an open-set arrhythmia classification method based on GAN-AE-CNN. Background Art

[0002] In recent years, with the accelerating pace of life and increasing stress, people have been forced to adapt to this high-pressure lifestyle. However, this can easily lead to tachycardia and elevated blood pressure, and long-term persistence can lead to cardiovascular disease. Arrhythmia is a major complication of cardiovascular disease, closely related to abnormalities in the human circulatory system. Arrhythmias can not only lead to serious conditions such as heart failure but, in severe cases, can be life-threatening. Therefore, the ability to accurately detect and automatically identify arrhythmias is crucial for preventing cardiovascular disease.

[0003] The primary method for detecting arrhythmias is the electrocardiogram (ECG), which reflects voltage changes during the cardiac electrical cycle and records the relationship between voltage and the duration of cardiac activity. Experienced medical personnel diagnose by observing ECG rhythm information and waveform characteristics. However, due to the large scale of clinical ECG data, manual diagnosis is time-consuming and labor-intensive, reducing medical staff's work efficiency. With the development of artificial intelligence, computer-assisted ECG diagnosis technology has become increasingly important for analyzing arrhythmias. A growing number of researchers are using traditional machine learning and deep neural networks to classify arrhythmias.

[0004] Traditional machine learning methods require expert experience for feature extraction, and the accuracy of arrhythmia classification depends largely on prior knowledge. One-dimensional convolutional neural networks have strong computing power and do not rely on manual feature extraction. As the number of layers increases, they can learn the hidden features of the data from a large number of training samples, which can better achieve classification. At present, arrhythmia classification algorithms generally adopt a closed-set recognition model, that is, they can only effectively classify known categories defined in the training set. However, this model has significant limitations: when the input signal is an unknown category not covered by the training set, the algorithm is likely to misjudge such unknown signals as known categories or directly ignore their abnormal features, resulting in a significantly increased risk of misdiagnosis or missed diagnosis. Summary of the Invention

[0005] The purpose of this invention is to overcome the problem of misjudgment of unknown categories faced by existing closed-set classification models in open environments. An open-set arrhythmia classification method based on GAN-AE-CNN is proposed. By constructing a GAN network to simulate unknown class ECG data, combined with dual-source error analysis and an adaptive threshold optimization method based on joint risk minimization, the accurate classification of known categories and the effective detection of unknown categories are achieved.

[0006] The object of the present invention is achieved through the following technical solution: an open set arrhythmia classification method based on GAN-AE-CNN, comprising the following steps:

[0007] Step 1: ECG signal preprocessing and data set division

[0008] Collect lead II ECG signals, perform denoising and filtering, R-peak location, beat segmentation, data labeling, and normalization on the raw signals; divide the processed ECG signal data into known classes (N, S, and V) and unknown classes (F and Q) according to the AAMI EC57 standard; divide the known classes into training and test sets in an 8:2 ratio; and use all unknown classes as the test set.

[0009] Step 2: Build a GAN network based on transposed convolution to generate unknown class prediction data

[0010] The GAN network's generator consists of a fully connected layer, four one-dimensional transposed convolutional layers (channels 512→256→128→27, stride 5→5→2→3, kernel width 5), and an output reconstruction layer. It uses 1024-dimensional normal noise as input to generate a simulated unknown ECG waveform of dimension 864. The discriminator consists of three convolutional layers (channels 64→128→256, stride 1→2→2, kernel width 5) with LeakyReLU activation (α=0.01). Training is performed using an adversarial training framework constructed using a binary cross-entropy loss function based on a known class training set.

[0011] Step 3: Construct AE module to realize dual-source error distribution modeling

[0012] The AE module's encoder consists of three levels of convolutional layers (channels 16→32→64, kernel width 34) and a maximum pooling layer to achieve feature compression, which is then reduced to a two-dimensional latent space via flattening and fully connected layers. The decoder reconstructs the feature dimension via fully connected layers, and reconstructs the waveform via two levels of transposed convolutional layers (channels 32→16, kernel width 34) and a final convolutional layer. After optimizing the AE parameters based on a known class training set, the normalized mean squared error (MSE) between the training set samples and the GAN-generated samples is calculated and the data is binned. The two error classes are each divided into 100 equal-width bins, and the sample density in each bin is calculated to generate a dual-source frequency histogram.

[0013] Step 4: Design a CNN network for fine-grained classification

[0014] The CNN network consists of four convolutional layers (channel number 16→8→8→1, kernel width 34), batch normalization (BN) layer and maximum pooling layer, using the cosine annealing learning rate strategy ( , ) Perform fine-grained classification training on known classes;

[0015] Step 5: Establish a joint optimization criterion to determine the optimal open set detection threshold

[0016] According to the known class error distribution in step 3 and generate sample error distribution , by jointly optimizing the false alarm rate and missed detection rate Determining the optimal open set detection threshold ;

[0017] Defining the false alarm rate The probability density curve of the known class sample is The integrated area on the right side, the function is:

[0018]

[0019] in, is the mean square error threshold, is the reconstruction mean square error variable of the input sample, The probability density function of the reconstruction error for known class samples;

[0020] Defining the false alarm rate To generate the probability density curve in the sample The integral area on the left side, the function is:

[0021]

[0022] in, To generate the probability density function of sample reconstruction error;

[0023] Iterate over all candidate thresholds , select smallest As the optimal open set detection threshold ;

[0024] Step 6: Open set classification verification

[0025] Input the test set into the AE model and calculate its MSE; if , then it is judged as an unknown class; if , it is determined to be a known category, and the CNN module completes the fine-grained classification of the known category and outputs a specific arrhythmia type label; the classification result is compared with the label corresponding to the test set, completing the test of the classification model in the open set scenario and obtaining the final classification accuracy.

[0026] Furthermore, in step 1, the ECG signal acquisition uses the MIT-BIH database as the original ECG signal data with a sampling frequency of 360 Hz, and the ECG data is read using the WFDB library function, and each R peak is annotated according to the AAMI EC57 standard, namely, category N - normal beat, category S - supraventricular abnormal beat, category V - ventricular abnormal beat, category F - fusion beat and category Q - unclassified beat;

[0027] ECG signal preprocessing uses a Butterworth bandpass filter for denoising, with a passband frequency of 0.5-40 Hz. A heartbeat segment of 864 sampling points (2.4 seconds) is intercepted with the R peak as the center, and the annotation of the central R peak is used as the sample label. The Min-Max function is used for normalization to map the ECG signal data of each sample to the range of [0, 1]. The function is:

[0028]

[0029] in, To input ECG signal data, and are the minimum and maximum values ​​of the input ECG signal data, is the normalized ECG data.

[0030] Furthermore, in step 2, the binary cross entropy loss function is:

[0031]

[0032] in, is the true label of the sample one-hot encoding, Output probability for the model;

[0033] Its loss function system includes the generator loss function and the discriminator loss function , the generator loss function for:

[0034]

[0035] in, is the cross entropy function, is the input noise, For the generator, is the discriminator;

[0036] Discriminator loss function for:

[0037]

[0038] in, is the cross entropy function, is the real ECG data input, is the input noise, For the generator, is the discriminator;

[0039] During the training process, the generator is fixed first, the discriminator is updated, and the discriminator loss function is calculated. , back propagation updates the discriminator parameters, minimizing ; Then fix the discriminator, update the generator, and calculate the generator loss function , back-propagation updates the generator parameters, minimizing ; The Adam optimizer is used to alternately update the parameters of these two parts of the network, so that the generator and the discriminator compete in the game and eventually reach equilibrium.

[0040] Furthermore, in step 3, the training set samples of known classes are Perform sample-by-sample reconstruction and calculate the normalized mean square error. The function is:

[0041]

[0042] in, is the number of time series data points of a single ECG sample, is the sample index, For the The first sample The true value of the data point, For the The first sample The reconstructed values ​​of data points, for The reconstruction error, is the total number of samples in the training set of known classes;

[0043] Simulating unknown class samples generated by the GAN network Performing the same normalized mean square error calculation yields The reconstruction error is ;

[0044] Will and Data binning, interval number , interval width , the sample distribution density is counted for each interval, thereby establishing a dual-source probability density histogram (the horizontal axis is the MSE error value, and the vertical axis is the probability density).

[0045] Furthermore, in step 4, in order to accelerate convergence and reduce overfitting, a BN layer and ReLU function are integrated after each convolution operation. The BN layer function is:

[0046]

[0047] in, and The current batch The mean and variance of the channel, and is a learnable parameter;

[0048] The cosine annealing strategy is used to simulate the changes in the cosine curve, so as to adjust the learning rate for model training and optimize the model convergence; the initial learning rate is set to , the minimum learning rate is , each training cycle The learning rate of is decayed by the cosine function, which is:

[0049]

[0050] in, is the total training cycle.

[0051] Furthermore, an electronic device includes a processor and a memory;

[0052] The memory is used to store executable code;

[0053] The processor executes the code to implement the above-mentioned arrhythmia classification method.

[0054] Furthermore, a computer-readable storage medium stores a program, and the program is executed by a processor to implement the above-mentioned arrhythmia classification method.

[0055] This method is based on closed-set known-class ECG data, independently training GAN, AE, and CNN-based models. GAN generates simulated ECG signals of unknown classes to fill the data gap in open scenarios. AE calculates the normalized mean square error between known and generated samples to construct a dual-source frequency histogram. The false alarm rate and missed detection rate are jointly optimized based on probability density integral to determine the optimal open-set detection threshold. After the MSE of a test sample is calculated by AE, if it exceeds the threshold, it is classified as an unknown class; otherwise, CNN outputs a fine-grained label of a known class. By driving decision boundary optimization through error distribution statistics, the dependence of traditional models on closed datasets is significantly reduced. By expanding the decision boundary through generated samples, the traditional closed-set model's misjudgment of unknown class signals is resolved. In open-set scenarios, the classification accuracy of known classes is maintained while the recognition ability of unknown classes is improved.

[0056] This invention uses a three-level linkage architecture of "generation-reconstruction-decision-making" to achieve a technological leap from a closed environment to an open scenario for arrhythmia classification, significantly improving the diagnostic performance of the arrhythmia classification system in an open environment. By implementing this invention, the following beneficial effects can be achieved:

[0057] (1) Breakthrough in unknown class detection capability in open scenarios: Generate simulated unknown class ECG signals through the GAN network to solve the misjudgment problem caused by the lack of unknown class data in the traditional closed-set model; construct a dual-source frequency histogram of known classes and generated samples based on the AE reconstruction error, quantify the distribution difference, and provide an explainable basis for open-set decision-making.

[0058] (2) Dynamic threshold optimization improves classification reliability: By minimizing the weighted sum of the false alarm rate (FAR) and the missed detection rate (MDR), the optimal open set detection threshold is dynamically selected without manual intervention; the threshold is marked in the dual-source probability density curve. , intuitively display the separation boundary between known classes and unknown classes, and assist in verifying model logic.

[0059] (3) Multi-module collaborative efficient classification architecture: The GAN-AE-CNN multi-module collaborative classification architecture can adapt to the needs of ECG signal classification in an open environment, improve the accuracy and reliability of arrhythmia diagnosis, reduce the risk of misdiagnosis and missed diagnosis, and enhance the robustness and adaptability of classification. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 This is a flow chart of the open-set arrhythmia detection method based on GAN-AE-CNN in the present invention.

[0061] Figure 2 Schematic diagram of the GAN network structure in the method of the present invention.

[0062] Figure 3 Schematic diagram of the AE network structure in the method of the present invention.

[0063] Figure 4 Schematic diagram of the CNN network structure in the method of the present invention. DETAILED DESCRIPTION

[0064] The specific implementation of the present invention is further described in detail below with reference to the accompanying drawings and examples.

[0065] Example 1

[0066] like Figure 1 As shown, this embodiment provides an open set arrhythmia classification method based on GAN-AE-CNN, and the specific steps are as follows:

[0067] Step 1: ECG signal preprocessing and data set division

[0068] Lead II of the MIT-BIH database was used as the original ECG signal data with a sampling frequency of 360 Hz. The ECG data was read using the WFDB library function, and each R peak was annotated according to the AAMI EC57 standard, including category N - normal beat, category S - supraventricular abnormal beat, category V - ventricular abnormal beat, category F - fusion beat, and category Q - unclassified beat.

[0069] A Butterworth bandpass filter was used for denoising, with a passband frequency of 0.5-40 Hz. A heartbeat segment of 864 sampling points (2.4 seconds) was intercepted with the R peak as the center, and the annotation of the central R peak was used as the sample label, extracting a total of 104,682 samples. The Min-Max function was used for normalization to map the ECG signal data of each sample to the range of [0, 1]. The function is:

[0070]

[0071] in, To input ECG signal data, and are the minimum and maximum values ​​of the input ECG signal data, is the normalized ECG data;

[0072] The processed ECG signal data is divided into known classes: N, S, V and unknown classes: F and Q. The known classes are divided into a training set (80,200 samples) and a test set (20,050 samples) in a ratio of 8:2. All unknown classes are used as a test set (4,432 samples) to ensure the authenticity of the open-set detection scenario.

[0073] Step 2: Build a GAN network based on transposed convolution to generate unknown class prediction data

[0074] like Figure 2 As shown, in this embodiment, the structure of the GAN network consists of a generator and a discriminator. The input of the generator is a 1024-dimensional normally distributed noise vector, and the output dimension after the fully connected layer is 8×1024. The activation function is LeakyReLU (α=0.01). The output is converted into a three-dimensional tensor (1, 8×1024) after the reshaping layer to adapt to the input of the subsequent transposed convolution layer. The transposed convolution structure consists of four levels of one-dimensional transposed convolution layers (channel number 512→256→128→27, step size 5→5→2→3, kernel width 5) and an output reconstruction layer to generate a simulated unknown class ECG waveform of dimension 864; the discriminator consists of three layers of convolution layers (channel number 64→128→256, step size 1→2→2, kernel width 5) and LeakyReLU activation (α=0.01); based on the known class training set, the binary cross entropy loss function is used. Build an adversarial training framework. The function is:

[0075]

[0076] in, is the true label of the sample one-hot encoding, Output probability for the model;

[0077] Its loss function system includes the generator loss function and the discriminator loss function , the generator loss function for:

[0078]

[0079] in, is the cross entropy function, is the input noise, For the generator, is the discriminator;

[0080] Discriminator loss function for:

[0081]

[0082] in, is the cross entropy function, is the real ECG data input, is the input noise, For the generator, is the discriminator;

[0083] During the training process, the generator is fixed first, the discriminator is updated, and the discriminator loss function is calculated. , back propagation updates the discriminator parameters, minimizing ; Then fix the discriminator, update the generator, and calculate the generator loss function , back-propagation updates the generator parameters, minimizing ; The Adam optimizer is used to alternately update the parameters of these two parts of the network, so that the generator and the discriminator compete in the game and eventually reach equilibrium.

[0084] Step 3: Construct AE module to realize dual-source error distribution modeling

[0085] like Figure 3As shown in the figure, in this embodiment, the structure of the AE module consists of an encoder and a decoder. The encoder uses three levels of convolutional layers (channel number 16→32→64, kernel width 34) and a maximum pooling layer to achieve feature compression, and reduces it to a two-dimensional latent space through a flattening layer and a fully connected layer; the decoder reconstructs the feature dimension through a fully connected layer, and reconstructs the waveform through two levels of transposed convolutional layers (channel number 32→16, kernel width 34) and a final convolutional layer; after optimizing the AE parameters based on a known class training set, the samples of the known class training set are trained. Perform sample-by-sample reconstruction and calculate the normalized mean square error. The function is:

[0086]

[0087] in, is the number of time series data points of a single ECG sample, is the sample index, For the The first sample The true value of the data point, For the The first sample The reconstructed values ​​of data points, for The reconstruction error, is the total number of samples in the training set of known classes;

[0088] Simulating unknown class samples generated by the GAN network Performing the same normalized mean square error calculation yields The reconstruction error is ;

[0089] Will and Data binning, number of intervals , interval width , the sample distribution density is counted for each interval, thereby establishing a dual-source probability density histogram (the horizontal axis is the MSE error value, and the vertical axis is the probability density).

[0090] Step 4: Design a CNN network for fine-grained classification

[0091] like Figure 4 As shown, in this embodiment, the CNN network includes four convolutional layers (channel number 16→8→8→1, kernel width 34) and three maximum pooling layers. In order to accelerate convergence and reduce overfitting, a BN layer and ReLU function are integrated after each convolution operation. The BN layer function is:

[0092]

[0093] in, and The current batch The mean and variance of the channel, and is a learnable parameter;

[0094] The cosine annealing strategy is used to simulate the changes in the cosine curve, so as to adjust the learning rate for model training and optimize the model convergence; the initial learning rate is set to , the minimum learning rate is , each training cycle The learning rate of is decayed by the cosine function, which is:

[0095]

[0096] in, is the total training cycle.

[0097] Step 5: Establish a joint optimization criterion to determine the optimal open set detection threshold

[0098] According to the known class error distribution in step 3 and generate sample error distribution , by jointly optimizing the false alarm rate and missed detection rate Determining the optimal open set detection threshold ;

[0099] Defining the false alarm rate The probability density curve of the known class sample is The integrated area on the right side, the function is:

[0100]

[0101] in, is the mean square error threshold, is the reconstruction mean square error variable of the input sample, The probability density function of the reconstruction error for known class samples;

[0102] Defining the false alarm rate To generate the probability density curve in the sample The integral area on the left side, the function is:

[0103]

[0104] in, To generate the probability density function of sample reconstruction error;

[0105] Iterate over all candidate thresholds , select smallest As the optimal open set detection threshold ;

[0106] Step 6: Open set classification verification

[0107] Input the test set into the AE model and calculate its MSE; if It is judged as an unknown class; if , it is determined to be a known category, and the CNN module completes the fine-grained classification of the known category and outputs a specific arrhythmia type label; the classification result is compared with the label corresponding to the test set, completing the test of the classification model in the open set scenario and obtaining the final classification accuracy.

[0108] The electronic device in this application includes a memory and a processor. The memory stores executable code, and when the executable code is executed by the processor, the processor executes the method in the above embodiment.

[0109] The processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0110] The memory may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage devices. Among them, the system memory may be a readable and writable storage device or a volatile readable and writable storage device, such as dynamic random access memory, and may also store some or all instructions and data required by the processor during operation. ROM may store static data or instructions required by the processor or other modules of the computer. The permanent storage device may be a readable and writable storage device, or it may be a non-volatile storage device that does not lose the stored instructions and data even after the computer is powered off. In some embodiments, the permanent storage device uses a large-capacity storage device (such as a magnetic disk or optical disk, flash memory) as the permanent storage device. In other embodiments, the permanent storage device may be a removable storage device (such as a floppy disk, optical drive).

[0111] Furthermore, the memory can support any combination of computer-readable storage media, including various types of semiconductor memory chips (DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), magnetic disks, and optical disks. In some embodiments, the memory can include a removable readable or writable storage device, such as a compact disc (CD), a read-only digital versatile disc (e.g., DVD-ROM, double-layer DVD-ROM), a read-only Blu-ray disc, an ultra-high-density optical disc, a flash memory card (e.g., SD card, miniSD card, Micro-SD card, etc.), a magnetic floppy disk, and the like. The memory stores executable code, which, when processed by a processor, can cause the processor to execute some or all of the methods described above.

[0112] In addition, the method according to the present application may also be implemented as a computer program or a computer program product, which includes computer program code instructions for executing some or all of the steps in the above method of the present application.

[0113] Alternatively, the present application may also be implemented as a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor of an electronic device, the processor executes part or all of the steps of the above method according to the present application.

[0114] The above descriptions of the various embodiments of the present application are exemplary, not exhaustive, and are not limited to the disclosed embodiments.

Claims

1. An open set arrhythmia classification method based on GAN-AE-CNN, characterized by: The steps include: Step 1: ECG signal preprocessing and data set division Collect lead II ECG signals for preprocessing, and divide the processed ECG signal data into known classes (N, S, V) and unknown classes (F, Q) according to the AAMI EC57 standard; the known class data are divided into training sets and test sets; all the unknown class measured data are used as the test set; Step 2: Build a GAN network based on transposed convolution to generate unknown class prediction data The generator of the GAN network consists of a fully connected layer, a four-level one-dimensional transposed convolution layer, and an output reconstruction layer. It inputs 1024-dimensional normal noise to generate a simulated unknown ECG-like waveform with a dimension of 864, and obtains the GAN-generated sample. The discriminator consists of three convolutional layers with LeakyReLU activations. It is trained using an adversarial training framework constructed using a binary cross-entropy loss function based on a known class training set. Step 3: Construct AE module to realize dual-source error distribution modeling The encoder of the AE module is composed of three levels of convolutional layers and maximum pooling layers to achieve feature compression, and is reduced to a two-dimensional latent space through flattening layers and fully connected layers; The decoder reconstructs the feature dimension through a fully connected layer, and reconstructs the waveform through two levels of transposed convolutional layers and a final convolutional layer. After optimizing the AE parameters based on a known class training set, the normalized mean square error between the training set samples and the GAN-generated samples is calculated, and the data is binned and divided into intervals. The sample density in each interval is counted to generate a dual-source frequency histogram. Step 4: Design a CNN network for fine-grained classification The CNN network consists of four convolutional layers, batch normalization layers, and maximum pooling layers, and uses a cosine annealing learning rate strategy to perform fine-grained classification training on known classes; Step 5: Establish a joint optimization criterion to determine the optimal open set detection threshold Defining the false alarm rate The probability density curve of the known class sample is The integrated area on the right side, the function is: ; in, is the mean square error threshold, is the reconstructed mean square error variable of the input sample, The probability density function of the reconstruction error for known class samples; Defining the false alarm rate To generate the probability density curve in the sample The integral area on the left side, the function is: ; in, To generate the probability density function of sample reconstruction error; Iterate over all candidate thresholds , select smallest As the optimal open set detection threshold ; Step 6: Open set classification verification Input the test set into the AE model and calculate its MSE; if It is judged as an unknown class; if , it is determined to be a known category, and the CNN module completes the fine-grained classification of the known category and outputs a specific arrhythmia type label; the classification result is compared with the label corresponding to the test set, completing the test of the classification model in the open set scenario and obtaining the final classification accuracy.

2. The open-set arrhythmia classification method based on GAN-AE-CNN according to claim 1, characterized in that: In step 1, the original signal is subjected to preprocessing operations such as denoising filtering, R peak location, heart beat segmentation, data labeling and normalization, which specifically include: Step 1.1: ECG signal acquisition: Use the MIT-BIH database as the raw ECG signal data with a sampling frequency of 360 Hz. Use the WFDB library function to read the ECG data and annotate each R peak according to the AAMI EC57 standard, including N category (normal beat), S category (supraventricular abnormal beat), V category (ventricular abnormal beat), F category (fusion beat), and Q category (unclassified beat). Step 1.2: ECG signal preprocessing: Use a Butterworth bandpass filter to remove noise, with a passband frequency of 0.5-40 Hz; intercept the heartbeat segment centered on the R peak, and use the annotation of the central R peak as the sample label; use the Min-Max function for normalization to map the ECG signal data of each sample to the range of [0, 1]. The function is: ; in, To input ECG signal data, and are the minimum and maximum values ​​of the input ECG signal data, is the normalized ECG data.

3. The open set arrhythmia classification method based on GAN-AE-CNN according to claim 1, characterized in that: In step 2, the binary cross entropy loss function is: ; in, is the true label of the sample one-hot encoding, Output probability for the model; Its loss function system includes the generator loss function and the discriminator loss function , the generator loss function for: ; in, is the cross entropy function, is the input noise, For the generator, is the discriminator; Discriminator loss function for: ; in, is the cross entropy function, is the real ECG data input, is the input noise, For the generator, is the discriminator; During the training process, the generator is fixed first, the discriminator is updated, and the discriminator loss function is calculated. , back propagation updates the discriminator parameters, minimizing ; Then fix the discriminator, update the generator, and calculate the generator loss function , back-propagation updates the generator parameters, minimizing ; The Adam optimizer is used to alternately update the parameters of these two parts of the network, so that the generator and the discriminator compete in the game and eventually reach equilibrium.

4. The open set arrhythmia classification method based on GAN-AE-CNN according to claim 1, characterized in that: In step 3, the training set samples of known classes are Perform sample-by-sample reconstruction and calculate the normalized mean square error. The function is: ; in, is the number of time series data points of a single ECG sample, is the sample index, For the The first sample The true value of the data point, For the The first sample The reconstructed values ​​of data points, for The reconstruction error, is the total number of samples in the training set of known classes; Simulating unknown class samples generated by the GAN network Performing the same normalized mean square error calculation yields The reconstruction error is ; Will and Data binning, interval number , interval width , the sample distribution density is counted for each interval, thereby establishing a dual-source probability density histogram.

5. The open set arrhythmia classification method based on GAN-AE-CNN according to claim 1, characterized in that: Said step 4 specifically further includes: Step 4.1: Each convolution operation of the CNN network is followed by a BN layer and a ReLU function. The BN layer function is: ; in, and The current batch The mean and variance of the channel, and is a learnable parameter; Step 4.2: Use the cosine annealing strategy to simulate the change of the cosine curve, and set the initial learning rate to , the minimum learning rate is , each training cycle The learning rate of is decayed by the cosine function, which is: ; in, is the total training cycle.

6. An electronic device, characterized in that: including a processor and a memory; The memory is used to store executable code; The processor executes the code to implement the arrhythmia classification method according to any one of claims 1 to 5.

7. A computer-readable storage medium, characterized in that The storage medium stores a program, and the program is executed by a processor to implement the arrhythmia classification method according to any one of claims 1 to 5.