Lightweight electrocardiogram diagnosis method and device based on generative adversarial network and distillation learning

By applying the method of generative adversarial network and distillation learning in ECG diagnosis, the computational complexity of deep learning models and single-lead ECG diagnostic accuracy in embedded devices are solved, and lightweight, real-time and efficient ECG diagnosis is achieved.

CN119577551APending Publication Date: 2025-03-07SHENZHEN POLYTECHNIC

Patent Information

Application Number
CN202411749853.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-02
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

In the prior art, deep learning models have high computational complexity and huge models, which are difficult to operate in embedded devices in real time, the diagnostic accuracy of single-lead ECG is relatively low, and multi-view feature fusion and generative adversarial network technology have not been fully utilized in ECG diagnosis.

Method used

Using a lightweight electrocardiogram diagnostic method based on generative adversarial network and distillation learning, by converting the 12-lead electrocardiogram signal into multi-view, using the teacher network to learn multi-view features and fuse it. The student network as a generator extracts features from the single-lead signal, and classifies and optimizes through the discriminator to achieve knowledge transfer and feature generation.

Benefits of technology

It significantly reduces inference time and computing resource consumption, improves the reliability and generalization of diagnostic results, is suitable for real-time applications of embedded devices and portable devices, while maintaining similar performance to teacher networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119577551A_ABST
    Figure CN119577551A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of physiological signal measurement, and discloses a light-weight electrocardiogram diagnosis method and device based on a generative adversarial network and distillation learning. The method specifically comprises the following steps: converting a 12-lead electrocardiogram signal to obtain multiple views, learning the characteristics of each view in the multiple views by utilizing a teacher network, and fusing to obtain real characteristics; the student network is used as a generator, features are extracted from the single-lead electrocardiogram signals, and generated features which are as vivid as possible are obtained; the input features are classified through a discriminator, and whether the input features are from the teacher network or the student network is determined through the classification result. Through combination of multi-view feature extraction and generative adversarial learning, the knowledge migration ability of the teacher model is effectively improved, so that the student network maintains similar performance to the teacher network while the model is lightweight.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of physiological signal measurement, and specifically to a lightweight electrocardiogram diagnosis method and device based on generative adversarial networks and distillation learning. Background Art

[0002] Electrocardiogram (ECG) is an important tool for clinical diagnosis of heart disease. It records the electrical activity of the heart in a non-invasive way and is widely used in the detection and monitoring of heart diseases such as arrhythmias and myocardial infarction. At present, the 12-lead ECG system is the clinical standard, which can record the electrical activity information of the heart through multiple leads and provide a more comprehensive basis for diagnosis. However, although the existing deep learning models have achieved remarkable success in processing multi-lead ECG signals, especially using convolutional neural networks (CNN) to extract complex spatiotemporal features to identify heart diseases, their models are highly complex and require large computing resources, making them difficult to deploy efficiently in resource-constrained embedded systems.

[0003] In contrast, single-lead ECG has gradually become a popular choice in smart wearable devices due to its portability and ease of use. However, single-lead ECG can only provide limited diagnostic information, and its detection accuracy is far inferior to that of multi-lead ECG, which also limits its application in high-precision heart disease detection. Current research mainly focuses on independent classification models of single-lead or multi-lead ECGs, and there is still a lack of in-depth research on knowledge transfer from multi-lead models to single-lead models. This knowledge transfer can improve inference speed and resource utilization efficiency while ensuring accuracy by transferring the knowledge of complex multi-lead models to lighter single-lead models.

[0004] In recent years, knowledge distillation technology has been gradually applied to the field of medical signal processing. It can effectively compress the model and improve its reasoning efficiency by transferring the knowledge of a complex model (i.e., the teacher model) to a simple model (i.e., the student model). Existing studies have shown that by combining generative adversarial networks (GANs) with knowledge distillation technology, the student model can learn rich feature expressions from the teacher model and maintain high classification performance in an environment with limited computing resources. However, most existing studies are limited to a single teacher model and fail to fully utilize the advantages of multi-view teacher networks, which limits the generalization ability of the student model on different tasks and data.

[0005] Generative adversarial networks (GANs) have been widely used in image generation and classification tasks in recent years. However, in the field of electrocardiogram diagnosis, the existing generative adversarial network technology has not been fully utilized, especially in combining multi-view feature extraction and knowledge distillation. Related research is still in its preliminary stage.

[0006] Therefore, the existing technology has the following major problems: the deep learning model has high computational complexity and large model size, making it difficult to run in real time in embedded devices; the diagnostic accuracy of a single-lead ECG is relatively low; and multi-view feature fusion and generative adversarial network technology have not yet been fully utilized in ECG diagnosis. Summary of the invention

[0007] The present application provides a lightweight electrocardiogram diagnosis method based on generative adversarial networks and distillation learning to solve the problems in the prior art, such as high computational complexity and large model of deep learning models, difficulty in real-time operation in embedded devices, relatively low diagnostic accuracy of single-lead electrocardiograms, and the fact that multi-view feature fusion and generative adversarial network technologies have not been fully utilized in electrocardiogram diagnosis.

[0008] Correspondingly, the present application also provides a lightweight electrocardiogram diagnostic device based on generative adversarial networks and distillation learning, an electronic device, and a computer-readable storage medium to ensure the implementation and application of the above method.

[0009] In order to solve the above technical problems, the present application discloses a lightweight electrocardiogram diagnosis method based on generative adversarial network and distillation learning, the method comprising:

[0010] Convert 12-lead ECG signals to obtain multiple views;

[0011] Use the teacher network to learn the features of each view in multiple views and fuse them to obtain the real features;

[0012] The student network is used as a generator to extract features from the single-lead ECG signal to obtain generated features;

[0013] The real features and generated features are used as the input of the discriminator, the input features are classified by the discriminator, and the classification results are used to determine whether the input features come from the teacher network or the student network;

[0014] The generator optimizes the generated features through the generator's loss function, and the generator's loss function is used to minimize the probability that the discriminator mistakenly judges the generated features as false;

[0015] The discriminator optimizes the classification result through the discriminator's loss function; the discriminator's loss function is used to maximize the output of the real features and minimize the output of the generated features.

[0016] The present application also discloses a lightweight electrocardiogram diagnostic device based on generative adversarial network and distillation learning, the device comprising:

[0017] A data preprocessing module, used to convert 12-lead electrocardiogram signals to obtain multiple views;

[0018] The multi-view feature extraction module is used to use the teacher network to learn the features of each view in the multi-view and fuse them to obtain the real features;

[0019] A generator module is used to extract features from a single-lead electrocardiogram signal using the student network as a generator to obtain generated features;

[0020] The discriminator module is used to take the real features and the generated features as the input of the discriminator, classify the input features through the discriminator, and determine whether the input features come from the teacher network or the student network through the classification results;

[0021] The generator optimizes the generated features through the generator's loss function, and the generator's loss function is used to minimize the probability that the discriminator mistakenly judges the generated features as false;

[0022] The discriminator optimizes the classification result through the discriminator's loss function; the discriminator's loss function is used to maximize the output of the real features and minimize the output of the generated features.

[0023] The present application also discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, one or more methods described in the present application are implemented.

[0024] The present application also discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, one or more methods described in the present application are implemented.

[0025] In this application, the 12-lead ECG signal is converted to obtain multiple views, and the teacher network is used to learn the features of each view in the multiple views, and the real features are obtained by fusion; the student network is used to extract features from the single-lead ECG signal to obtain the most realistic generated features. Through the knowledge distillation technology, the complex teacher model knowledge is effectively transferred to the lightweight student model, which significantly reduces the inference time and computing resource consumption, and is suitable for real-time applications of embedded devices and portable devices. In addition, this application uses the student network as a generator, classifies the input features through the discriminator, and determines whether the input features come from the teacher network or the student network through the classification results. The introduced generative adversarial network technology enables the student model to have stronger generalization ability, can cope with noise and variation in different ECG signals, and improve the reliability of diagnostic results. This application effectively improves the knowledge transfer ability of the teacher model by combining multi-view feature extraction with generative adversarial learning, so that the student network maintains similar performance to the teacher network while the model is lightweight.

[0026] Additional aspects and advantages of the present application will be given in the following description, which will become apparent from the following description, or will be understood through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0028] Figure 1 A flowchart of a lightweight electrocardiogram diagnosis method based on generative adversarial network and distillation learning provided in an embodiment of the present application;

[0029] Figure 2 A framework diagram of a lightweight electrocardiogram diagnostic model provided in an embodiment of the present application;

[0030] Figure 3 A schematic diagram of the feature extraction and fusion process provided in an embodiment of the present application;

[0031] Figure 4 A workflow diagram of generative adversarial learning provided in an embodiment of the present application;

[0032] Figure 5 Energy efficiency comparison diagram of the teacher-student model on the Nvidia Tesla V100 GPU provided in the embodiment of the present application;

[0033] Figure 6 A comparison chart of the inference time and speedup ratio of the student network and the teacher network under MVFT-GAN-KD on the Nvidia Tesla V100 GPU provided in the embodiment of the present application;

[0034] Figure 7 A schematic diagram of the structure of a lightweight electrocardiogram diagnostic device based on a generative adversarial network and distillation learning provided in an embodiment of the present application;

[0035] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0036] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application.

[0037] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.

[0038] Those skilled in the art will appreciate that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art in the field to which the present invention belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as here.

[0039] The solution provided in the embodiments of the present application can be executed by any electronic device, such as a terminal device or a server, wherein the server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, and this application does not limit this. With regard to the technical problems existing in the prior art, the lightweight electrocardiogram diagnosis method and device based on generative adversarial networks and distillation learning provided in this application is intended to solve at least one of the technical problems of the prior art.

[0040] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0041] The present application embodiment provides a possible implementation method, such as Figure 1As shown, a flowchart of a lightweight electrocardiogram diagnosis method based on generative adversarial networks and distillation learning is provided. The scheme can be executed by any electronic device, and optionally, can be executed on a server or terminal device.

[0042] like Figure 1 As shown in , the method may include the following steps:

[0043] Step 101, converting the 12-lead electrocardiogram signal to obtain multiple views.

[0044] In the embodiment of the present application, the 12-lead electrocardiogram signal is preprocessed, including converting it into a format suitable for different model inputs to enhance the feature expression capability of the signal.

[0045] Step 102, using the teacher network to learn the features of each view in the multi-view, and fusing them to obtain the real features.

[0046] Among them, the teacher network can extract the features of each view through different networks, and then fuse and output the features of views in different formats to improve the feature expression ability of the signal.

[0047] Step 103, using the student network as a generator, extracting features from the single-lead electrocardiogram signal to obtain generated features.

[0048] Step 104, using the real features and the generated features as inputs of the discriminator, classifying the input features through the discriminator, and determining whether the input features come from the teacher network or the student network based on the classification results.

[0049] The generator optimizes the generated features through the generator's loss function, and the generator's loss function is used to minimize the probability that the discriminator mistakenly judges the generated features as false;

[0050] The discriminator optimizes the classification result through the discriminator's loss function; the discriminator's loss function is used to maximize the output of the real features and minimize the output of the generated features.

[0051] In the embodiment of the present application, the generative adversarial network (GAN) and the multi-teacher model strategy are combined in the knowledge distillation process. The student model acts as a generator, and gradually generates feature representations similar to the teacher model through adversarial training, while the discriminator is responsible for distinguishing the generated features from the real features output by the teacher model. In this process, the student model gradually improves its feature extraction ability through generative adversarial learning and learns the rich knowledge expression of the teacher model. Through the combination of adversarial loss and other optimization strategies, the student model can reduce the computational complexity while still maintaining efficient diagnostic accuracy and reasoning speed, thereby improving the performance of the entire system.

[0052] In the embodiment of the present application, the 12-lead ECG signal is converted to obtain multiple views, the features of each view in the multiple views are learned by the teacher network, and the real features are obtained by fusion, and the features are extracted from the single-lead ECG signal by the student network to obtain the most realistic generated features. Through the knowledge distillation technology, the complex teacher model knowledge is effectively transferred to the lightweight student model, which significantly reduces the reasoning time and computing resource consumption, and is suitable for real-time applications of embedded devices and portable devices. In addition, the present application uses the student network as a generator, classifies the input features through the discriminator, and determines whether the input features come from the teacher network or the student network through the classification results. The introduced generative adversarial network technology enables the student model to have stronger generalization ability, can cope with noise and variation in different ECG signals, and improve the reliability of the diagnostic results. The embodiment of the present application effectively improves the knowledge transfer ability of the teacher model by combining multi-view feature extraction with generative adversarial learning, so that the student network maintains performance similar to that of the teacher network while the model is lightweight.

[0053] In an optional embodiment, the multiple views include a recursive map of a 12-lead electrocardiogram signal, a Gram's angle field image, and a vector cardiogram;

[0054] In an optional embodiment, the 12-lead electrocardiogram signal is converted to obtain multiple views, including:

[0055] The 12-lead electrocardiogram signal is normalized and noise filtered to obtain a standard 12-lead electrocardiogram signal;

[0056] The standard 12-lead ECG signal is converted into polar coordinates, where each signal value is converted into an angle, and the cosine function is used to generate a Gram angular field image;

[0057] The standard 12-lead ECG signal is converted into a vector ECG using the Kors transformation matrix, and a recursive graph of the vector ECG is generated based on the vector ECG.

[0058] Optionally, the specific implementation method is as follows:

[0059] (1) Preprocessing of 12-lead electrocardiogram (ECG) signals:

[0060] The original 12-lead ECG signal is normalized and noise filtered. In order to ensure that the signal amplitude is within a controllable range, the normalization in the embodiment of the present application limits the amplitude of the ECG signal to the range of [0,1] through a scaling operation, thereby standardizing the signal and reducing the impact of amplitude changes. Noise filtering uses a bandpass filter to remove high-frequency noise and baseline drift in the ECG signal to ensure the accuracy of subsequent feature extraction. The normalization formula is:

[0061]

[0062] Where X(i) is the original ECG signal of the i-th sampling point, max(X) and min(X) are the maximum and minimum values ​​of the signal, respectively.

[0063] (2) Convert the 12-lead ECG signal into polar coordinates:

[0064] The Gram Angular Field (GAF) image is generated by converting the time series into polar coordinates and calculating the cosine similarity between time points. In this step, the normalized signal is first converted into polar coordinates, where each signal value is converted into an angle, and then the cosine function is used to generate a two-dimensional image. The formula is as follows:

[0065] GAF i,j =cos(θ i +θ j )

[0066] Among them, θ i =arccos(X std (i)),X std (i) is the normalized signal, θ i and θ j are the angles of the signal at time i and j respectively. This formula is used to generate a GAF image containing time and phase information.

[0067] (3) Recursive diagram of converting 12-lead ECG signal into vector ECG:

[0068] In order to generate a vector cardiogram (VCG) from a standard 12-lead electrocardiogram (ECG) signal, the Kors transformation matrix is ​​used in the embodiment of the present application to convert the standard 12-lead signal into a three-dimensional signal. The specific steps are as follows:

[0069] First, assume that the normalized ECG signal matrix is ​​X std , the dimension is (n samples ,12,length), where n samples is the number of samples, 12 is the number of leads, and length is the length of the signal. To perform matrix multiplication with the Kors transformation matrix K, first transform X std Reshape into a 2D matrix:

[0070] X reshaped = reshaped(X std ,(-1,12))

[0071] Next, the ECG signal is converted into a three-dimensional VCG signal through the Kors transformation matrix. The formula is as follows:

[0072] V=X reshaped ·KT

[0073] Where V is the three-dimensional VCG signal matrix, and K is the Kors transformation matrix. At this time, the dimension of the VCG signal is (n samples ×length,3), indicating the three signal channels generated by each sample.

[0074] Then, the VCG signal is reshaped into a three-dimensional matrix with the dimension:

[0075] V reshaped = reshape(V,(n samples ,length,3))

[0076] In order to capture the time dependency of the signal, a recurrence graph (RP) is used to further process the VCG signal. The recurrence graph reflects the relationship of the time series by comparing the signal values ​​at different time points. The formula for generating the recurrence graph is:

[0077]

[0078] Where V(i) represents the value of the VCG signal at time point i, V(j) represents the value at time point j, and N is the number of time points. The recurrence graph generates a matrix that reflects the pattern of the time series by measuring the difference of the signal at different time points.

[0079] Finally, the generated recursive graph is resized to expand it to the target size:

[0080] I 3D (j,k,:,:)=resize(RP j ,(target_size,target_size))

[0081] Through these steps, the 12-lead ECG signal can be converted into a VCG recursive graph to generate a three-dimensional feature graph for further feature extraction and analysis. This recursive graph not only captures the time dependency of the ECG signal, but also presents the complex pattern of cardiac electrical activity in three-dimensional space, which helps to diagnose diseases more accurately.

[0082] In an optional embodiment, the teacher network includes a one-dimensional convolutional neural network, a two-dimensional convolutional neural network, and a three-dimensional convolutional neural network;

[0083] The teacher network is used to learn the features of each view in multiple views and fuse them to obtain the real features, including:

[0084] A one-dimensional convolutional neural network is used to extract time series features from 12-lead electrocardiogram signals to obtain first view features;

[0085] A two-dimensional convolutional neural network is used to extract spatial features in the Gram angular field image to obtain the second view features;

[0086] A three-dimensional convolutional neural network is used to extract the temporal and spatial features of the recurrence graph of the vector electrocardiogram to obtain the third view features;

[0087] The first view features, the second view features and the third view features are fused through the attention mechanism to obtain the true features.

[0088] In the present application embodiment, Figure 2 As shown in the figure, the 12-lead ECG signal (12-lead ECG) is converted into a GAF image (12-lead GAF-ECG) and a VCG recursive graph (3D RP image of VCG) through the above operations. Among them, the GAF image retains the time and phase information of the signal. The recursive graph of the vector electrocardiogram measures the difference of the signal at different time points, maps the time series into an image form, and converts the 12-lead ECG signal (12-lead ECG) into a VCG recursive graph to capture the time dependency of the signal.

[0089] In the embodiment of the present application, ECG data of different formats are processed by different convolutional neural networks. Among them, a one-dimensional convolutional neural network (1D CNN) is used to process the original ECG signal and extract important features in the time series. The network first performs a convolution operation on the original 12-lead ECG signal through a one-dimensional convolutional layer (Conv1D) to extract the timing pattern and event features in the signal. In order to increase the depth of the network and improve the feature expression ability, a one-dimensional residual block (ResBlock1d) is used between each convolutional layer. The residual block can alleviate the gradient vanishing problem in the deep network through jump connections and enhance the representation ability of the model. A batch normalization layer (Batch Normalization, BN) is usually added after each convolutional layer to accelerate training and reduce internal covariance offset. Then the maximum pooling layer (MaxPooling1D) is used to perform dimensionality reduction operations, reduce the length of the time series and retain the most representative timing information, and enhance the stability of the features. Finally, the features extracted by the convolutional layer, residual block and pooling layer are flattened through the fully connected layer (FC) to generate the first view features, which reflect the temporal dependency of the signal.

[0090] A 2D convolutional neural network is used to process 12-lead ECG images obtained through Gram Angular Field (GAF) transformation, extract spatial features in the image, and obtain second view features. The network first convolves the GAF image through a 2D convolutional layer (Conv2D) to capture the local spatial patterns in the image. To further enhance the model's feature learning ability, a 2D residual block (ResBlock2d) is used to increase the depth of the network, help alleviate the gradient vanishing problem, and enhance the model's ability to express complex spatial features.

[0091] After each convolutional layer, a batch normalization layer (BN) is usually added to ensure the stability of the training process. Then, a maximum pooling layer (MaxPooling2D) is used for dimensionality reduction to reduce the size of the image while retaining the key spatial information in the image. Finally, the spatial features extracted by the convolutional layer, residual block, and pooling layer are flattened by the fully connected layer (FC) to generate second-view features that highlight the important patterns of the signal in the spatial dimension.

[0092] A 3D convolutional neural network (3D CNN) is used to process the recurrent graph of the vector cardiogram (VCG), combining the temporal and spatial features of the signal to obtain the third view features. The VCG recurrent graph maps the time series into an image form by measuring the difference between the signals at different time points to better capture the temporal dependency. The 3D convolution layer (Conv3D) extracts the spatiotemporal features of the signal through convolution operations in three dimensions (time, space, depth). Each 3D convolution layer is usually followed by a batch normalization layer (BN) to maintain the stability of the training. Then, a dimensionality reduction operation is performed through a 3D maximum pooling layer (MaxPooling3D) to reduce the size of the spatiotemporal feature map while maintaining important features. Finally, the features extracted by the convolution and pooling operations are flattened through a fully connected layer (FC) to generate the third view features.

[0093] The above processing steps lay the foundation for the final multi-view feature fusion.

[0094] In an optional embodiment, if Figure 3 As shown, the first view features, the second view features and the third view features are fused through the attention mechanism to obtain the real features, including:

[0095] Assigning the first view feature, the second view feature, and the third view feature as a query vector (query), a key vector (key), and a value vector (value), respectively;

[0096] Obtaining weight coefficients of the first view feature, the second view feature, and the third view feature by calculating similarity scores between the query vector, the key vector, and the value vector;

[0097] According to the weight coefficient, the first view feature, the second view feature and the third view feature are weightedly fused to obtain the real feature.

[0098] In the embodiment of the present application, the ECG feature set includes the first view feature obtained by extracting features from the 12-lead electrocardiogram signal, the GAF-ECG feature set includes the second view feature obtained by extracting features from the GAF image, and the VCG feature set includes the third view feature obtained by extracting features from the VCG recursive graph. Figure 2 As shown, in the embodiment of the present application, the first view feature, the second view feature and the third view feature are fused through the cross-attention fusion module. The core of feature fusion is to use cross-attention to automatically adjust the attention weight of each view feature, and then use matrix multiplication to multiply each view with the corresponding attention weight, and finally add the results of each matrix multiplication output to extract the most diagnostically valuable global feature. The specific calculation formula is as follows:

[0099]

[0100] Among them, q represents the query vector, k represents the key vector, and v represents the value vector. is the dimension of the key vector. This formula determines the weight of the value vector by measuring the similarity between the query and the key, thereby passing the most relevant feature information to the downstream classification model.

[0101] In practical applications, the features of different views (such as ECG and GAF, ECG and VCG) are fused through a cross-modal attention mechanism to generate a unified global feature representation. This fused feature can more comprehensively reflect the information of each view, improve the diagnostic accuracy and robustness of the model, and then be used for subsequent classification tasks.

[0102] In an optional embodiment, the generator performs multi-layer feature extraction through a convolutional neural network (CNN).

[0103] In an embodiment of the present application, a single-lead ECG signal (1-lead ECG) is preprocessed by standardization and noise filtering (normalized to the [0,1] interval and high-frequency noise is removed), and the time series signal of the preprocessed single-lead ECG signal subjected to one-dimensional convolution processing is used as input data of the generator.

[0104] like Figure 2As shown in the figure, the generator (student network) performs multi-layer feature extraction on the preprocessed single-lead ECG signal (1-lead ECG) through a convolutional neural network (CNN). First, the single-lead ECG signal is normalized (normalized to the [0,1] interval) and denoised (removing high-frequency noise and interference signals) to ensure that the input data amplitude is consistent and retain key ECG features. The preprocessed signal is input to the one-dimensional convolution layer (Conv1d) for primary feature extraction. This layer mainly captures the local features of the ECG signal, such as the amplitude of the R wave and the shape and position of the QRS complex wave. The convolutional feature map is normalized by the batch normalization (BN) layer to avoid gradient vanishing or exploding phenomena, and the ReLU activation function is used to introduce nonlinearity to enhance the network's ability to express complex patterns.

[0105] Next, the signal is fed into a deeper one-dimensional convolutional layer to extract high-level features that reflect the global pattern of the signal, such as changes in heart rhythm and dynamic characteristics of heart rate. As the network depth increases, the convolution kernel captures a wider range of time windows, thereby extracting more abstract high-dimensional temporal features. After multiple convolutional layers, the feature map is reduced in dimension through the maximum pooling layer (Max-Pooling), reducing computational complexity and retaining the main features.

[0106] Subsequently, the feature map enters the 1×1 convolutional layer, which is used to adjust the number of channels of the feature map, optimize computational efficiency and retain key information. The reduced features are further compressed by the global pooling layer to extract global semantic features, and finally mapped to the target feature space through the fully connected layer (FC) to generate the final feature representation. The features generated by the generator are then passed to the discriminator and compared with the real features extracted by the teacher network for optimization of generative adversarial learning. The goal of the generator is to continuously adjust parameters in the game of generative adversarial learning to generate high-quality feature representations similar to those of the teacher network, thereby approaching the performance of the teacher network.

[0107] like Figure 4 As shown in Figure 1, the features generated by the generator are passed to the discriminator for judgment. During the training process, the goal of the generator is to generate a set of features similar to the features of the teacher network, and to "cheat" the discriminator as much as possible, so that it cannot distinguish whether these features come from the student network or the teacher network, thereby approaching the complex teacher model in performance. Therefore, the generator will continuously adjust its own parameters to improve the fidelity of the generated features.

[0108] In an optional embodiment, the discriminator includes a convolutional layer, an activation function, a random dropout layer, a pooling layer, and a Sigmoid classifier.

[0109] In the embodiment of the present application, the input of the discriminator includes two parts:

[0110] Teacher feature set: high-quality feature representations (real features) extracted by the teacher network, which are usually obtained by processing 12-lead ECG signals and have rich diagnostic information.

[0111] Fake feature set: feature representations (generated features) generated by the student network (generator), which are learned based on single-lead ECG signals.

[0112] The task of the discriminator is to determine whether the input feature set comes from the teacher network (real) or the student network (fake). Figure 4 As shown in the figure, the network structure of the discriminator consists of multiple convolutional layers (Conv1d), activation functions (ReLU), random inactivation layers (Dropout), pooling layers (Pooling&FC) and the final Sigmoid classifier. Through this layer structure, the discriminator processes the input feature set layer by layer and outputs a binary classification result at the end, indicating whether the source of the input feature set is the teacher network or the generator.

[0113] In the process of generative adversarial learning, the loss function is the key. The generator and the discriminator compete with each other and optimize their respective loss functions. Through this adversarial process, the student network (generator) continuously improves its feature generation ability, with the goal of generating a feature set that can deceive the discriminator and make it difficult to distinguish from the real feature set.

[0114] In an optional embodiment, the total loss function of the generator is composed of the following parts:

[0115] (1) Classification Task Cross Entropy Loss (CE Loss)

[0116] The cross entropy loss for the classification task ensures that the generator can correctly classify the input ECG signal:

[0117]

[0118] Among them, G(x) represents the output of the generator (predicted probability) and y represents the true label.

[0119] (2) Adversarial Loss

[0120] Adversarial loss is used to guide the generator to generate more realistic features, making it difficult for the discriminator to distinguish between the generated features and the real features:

[0121]

[0122] Among them, D(s) represents the discriminant output of the generator features.

[0123] (3) KL Divergence Loss

[0124] The KL divergence loss is used to align the output of the student network with the output of the teacher network during the knowledge distillation process:

[0125]

[0126] Where T(x) represents the output of the teacher network for input x.

[0127] The total loss of the generator is a weighted combination of the above losses:

[0128]

[0129] Among them, λ adv and λ KL is a hyperparameter used to adjust the weights.

[0130] In an optional embodiment, the loss function of the discriminator is the sum of the discriminator true loss function and the discriminator false loss function;

[0131] The discriminator's true loss function maximizes the discrimination results of real features and enhances the ability to distinguish real features;

[0132] The discriminator false loss function enables the discriminator to better identify generated features by minimizing the discrimination results of generated features.

[0133] (1) Discriminator true loss function

[0134] By maximizing the discrimination results of real features, the ability to distinguish real features is enhanced:

[0135]

[0136] Where D(t) represents the output of the discriminator for the true features.

[0137] (2) Discriminator False Loss Function

[0138] By minimizing the discriminant results of the generated features, the discriminator can better identify the generated features:

[0139]

[0140] The total loss of the discriminator is the sum of the above two parts:

[0141]

[0142] Among them, t~p teacher represents the true feature distribution from the teacher network, s~p student represents the generated feature distribution from the student network.

[0143] The loss function of the generator and the loss function of the discriminator work together to construct an adversarial learning framework. By continuously optimizing the adversarial loss, a balance between the discriminator and the generator is achieved, which not only ensures the classification performance of the student model but also enhances the authenticity of the generated features.

[0144] In the embodiment of the present application, through generative adversarial learning, the student network (generator) gradually learns the high-quality feature representation of the teacher network, achieving a diagnostic accuracy close to that of the teacher network under limited computing resources. This mechanism ensures that the student network has high recognition ability while remaining lightweight.

[0145] In order to verify the effectiveness of the multi-view feature teacher network and generative adversarial learning, extensive experiments were conducted on the PTB-XL and ICBEB2018 datasets in the embodiments of this application. The following are the performance of each experimental model and its related experimental data.

[0146] (1) Model compression effect

[0147] Table 1 shows the number of parameters, compression ratio, and computational complexity (MFLOPs) of the multi-view feature teacher network and student network on different models.

[0148] Table 1 Model compression impact of MVFT-GAN-KD

[0149]

[0150] The model compression effect of the distillation learning network framework (MVFT-GAN-KD) based on the generative adversarial network proposed in the embodiment of this application is particularly significant in the experimental results, especially in terms of the number of parameters, computational cost and energy consumption optimization of the student model compared to the teacher model. By transferring the complex features in the teacher model to the student model, not only the number of parameters and computational cost of the model are significantly reduced, but also the high classification performance of the model is maintained.

[0151] Specifically, the teacher model (MVFT) contains about 60.62M parameters and has a computational cost of up to 284,123MFLOPs, which poses a great challenge to deployment on resource-limited devices. However, through the knowledge distillation strategy of MVFT-GAN-KD, the student models (such as MobileNetV2 and ShuffleNetV2) successfully reduced the number of parameters to 2.24M and 1.26M, with compression ratios of 27 times and 48 times respectively, and the computational cost was significantly reduced. In extreme cases, the number of parameters of the SqueezeNet1.1 model is only 0.74M, and the compression ratio reaches 81.92 times, which makes the student model more practical in resource-constrained environments.

[0152] Although the number of parameters and computation of the student models has been greatly reduced, they still maintain excellent performance. For example, the AUC value of MobileNetV2 on the PTB-XL dataset has increased from 86.7% to 90.3%, and the AUC value on the ICBEB2018 dataset has increased from 91.6% to 96.5%. This shows that although the model has been greatly compressed, the knowledge distillation process effectively retains the classification ability of the model, ensuring the high performance of the student model on multiple electrocardiogram (ECG) datasets.

[0153] In addition, in terms of energy consumption and inference speed, experimental results show that the inference speed of the student model on the NVIDIA Tesla V100 GPU has been greatly improved. For example, the power consumption of the MobileNet V3_small model is only 0.57 mW, and the inference time is only 0.0023 seconds, which is 8.3 times faster. At the same time, although the SqueezeNet 1.1 model has the highest compression ratio, its energy consumption (7.07 mW) is relatively high and its inference speed is relatively medium (0.0026 seconds). These results show that while maintaining good classification performance, the student model significantly optimizes inference efficiency and energy consumption through knowledge distillation and generative adversarial learning, making it have greater deployment potential in mobile devices or resource-constrained application scenarios (such as remote medical monitoring).

[0154] In summary, the MVFT-GAN-KD framework not only achieves efficient compression of complex teacher models through effective knowledge distillation and generative adversarial learning, but also significantly improves the reasoning speed and energy efficiency of student models. This compression effect that balances performance and resource consumption provides strong technical support for model deployment in practical application scenarios.

[0155] (2) Energy efficiency comparison

[0156] Figure 5The inference power consumption of different models on Nvidia Tesla V100 GPU is shown, where the power consumption unit is mW. In the experiment of the embodiment of the present application, by comparing the energy efficiency performance of the teacher model (Teather Models) and the student model (Student Models), it is found that the MVFT-GAN-KD framework significantly improves the energy efficiency performance of the student model, especially in terms of inference speed and power consumption optimization.

[0157] First, although the teacher model performs well in classification performance, it contains up to 60.62M parameters and 284,123MFLOPs of computing power, resulting in a power consumption of up to 2715mW during inference, which makes it difficult to deploy on mobile devices or other resource-constrained environments. In contrast, the student model transfers the complex knowledge in the teacher model to a lightweight model through knowledge distillation and generative adversarial learning strategies, thereby significantly reducing the demand for computing resources while maintaining high performance.

[0158] In the specific energy efficiency comparison, MobileNetV3_small performed particularly well, with power consumption of only 0.57mW during inference, which is much lower than that of the teacher model. In addition, the inference speed of MobileNetV3_small also reached 0.0023 seconds, which is about 8.3 times faster than that of the teacher model. This significant power consumption and speed optimization is particularly suitable for scenarios that require real-time computing and are resource-constrained, such as electrocardiogram monitoring systems in medical equipment.

[0159] Although the SqueezeNet1.1 model has the highest compression ratio (parameter volume is 0.74M, compression ratio is 81.92 times), its power consumption (7.07mW) is slightly higher than other student models, and its inference speed is 0.0026 seconds, slightly lower than MobileNetV3_small. This shows that although SqueezeNet1.1 has a clear advantage in the number of parameters, it may not be better than other student models in terms of energy efficiency, suggesting the importance of model architecture design in energy efficiency optimization.

[0160] In summary, the MVFT-GAN-KD framework enables the student model to achieve significant optimization in terms of computational cost, inference speed, and power consumption through generative adversarial learning and knowledge distillation techniques. In practical applications, especially in environments that require high energy efficiency, such as remote medical equipment, portable health monitoring equipment, etc., these improvements in the student model are of great practical value.

[0161] (3) Inference time and speedup ratio

[0162] Figure 6The figure shows the comparison of inference time and speedup of the student network with the teacher network on an Nvidia Tesla V100 GPU. The MobileNetV3_small student model has the shortest inference time (0.0023 seconds) and the highest speedup (8.3 times).

[0163] In the experiments on model inference time and acceleration ratio, the MVFT-GAN-KD framework significantly reduced the model’s inference time and significantly improved the acceleration ratio through knowledge distillation and generative adversarial learning, which enables the student model to have efficient computing capabilities in actual deployment.

[0164] In terms of inference time, the inference time of the teacher model (MVFT) is about 0.019 seconds. Due to its complex network structure and large number of parameters, the inference time is relatively long. After compression, the inference time of the student model has been greatly improved. Among them, the inference time of the MobileNetV3_small model is only 0.0023 seconds, which is more than 8.3 times faster than the teacher model. Such an inference time advantage allows the student model to run in real time on resource-constrained devices, which is especially suitable for medical equipment and health monitoring systems that require fast response.

[0165] Although SqueezeNet1.1 has a significant compression effect on the number of parameters, its inference time is 0.0026 seconds, slightly higher than MobileNetV3_small, and its acceleration ratio is 7.3 times, slightly lower than MobileNetV3_small. This shows that although SqueezeNet1.1 has an advantage in model size, its inference time optimization is not as significant as expected. This may be related to its model architecture design, suggesting that different architectures may have different inference efficiency when processing the same task.

[0166] In addition, although other student models such as MobileNetV2 and ShuffleNetV2.1.0 have inference times of 0.0054 seconds and 0.0046 seconds respectively, which are somewhat improved compared to the teacher model, their acceleration ratios are only 3.6 times and 4.1 times, which are not as good as MobileNetV3_small and SqueezeNet1.1. In comparison, MobileNetV3_small combines low inference time and high acceleration ratio, demonstrating extremely high energy efficiency and computing performance.

[0167] In summary, the significant reduction in inference time and the improvement in acceleration ratio enable the student model under the MVFT-GAN-KD framework to achieve lightweight and efficient inference performance while maintaining high accuracy, which is particularly suitable for application in medical scenarios with high real-time requirements.

[0168] (4) Ablation experiment analysis

[0169] In order to better understand the contribution of each loss function to the performance of the MVFT-GAN-KD framework, an ablation experiment was conducted in the embodiment of this application, and the results are shown in Table 2. When only the cross entropy loss and KL divergence loss of the classification task are used, the AUC is 92.2%. After adding the adversarial loss, the AUC is increased to 94.7%. When all loss functions are used in combination, the AUC reaches a maximum of 96.5%.

[0170] Table 2 The impact of each loss component in the ablation study

[0171]

[0172] In the ablation experiment analysis, by removing different loss items, the contribution of each loss component to the final performance of the model was evaluated in detail. The tabular data shows the impact of using different loss combinations on the AUC (area under the receiver operating characteristic curve) indicator, and shows that the joint optimization of the cross entropy loss, adversarial loss and KL divergence loss for the classification task plays a vital role in improving the classification performance of the model.

[0173] First, using only the cross entropy loss and KL divergence loss for classification tasks, the model achieves an AUC of 92.2%. This result shows that relying on these two loss terms alone can provide some performance gains, but there is still room for improvement. In particular, these loss terms ensure that the student model learns the output of the teacher model, but lack further optimization of the feature representation.

[0174] After adding adversarial loss, AUC significantly increased to 94.7%. This is because adversarial loss improves the student model's ability to generate more discriminative features through generative adversarial learning, which enables the student model to have stronger generalization ability when processing complex data. The introduction of adversarial loss allows the student model to continuously receive feedback from the discriminator during feature learning, thereby generating feature representations that are closer to the teacher model, significantly improving classification performance.

[0175] When the full MSMT-GAN-KD framework is used, that is, the full combination of classification task cross entropy loss, adversarial loss, and KL divergence loss, the model's AUC reaches 96.5%, which is the best result in the experiment. This shows that by jointly optimizing these three losses, the model can fully utilize the advantages of each loss term to achieve the best classification effect. Among them, the classification task cross entropy loss ensures the classification accuracy of the model, the adversarial loss improves the ability to distinguish the features of the student model, and the KL divergence loss further narrows the gap between the student model and the teacher model through soft targets.

[0176] This experiment shows that the complete MSMT-GAN-KD framework can significantly improve the generalization ability and robustness of the student model in the process of knowledge distillation through the comprehensive optimization of task, adversarial and distillation losses, especially when dealing with noisy data or unbalanced data sets, with obvious performance improvements.

[0177] (5) Comparison with existing state-of-the-art methods

[0178] Table 3 shows the comparison results of the MVFT-GAN-KD method and the existing 12-lead ECG classification model on the ICBEB2018 and PTB-XL datasets. β=2 It outperforms other models in all indicators, showing its advantages in multi-view generative adversarial learning.

[0179] Table 3 Comparison of MVFT and state-of-the-art 12-lead ECG classification models on public datasets

[0180]

[0181] In comparison with the most advanced electrocardiogram (ECG) classification methods, the knowledge distillation (MSMT-GAN-KD) framework of the multi-view feature teacher network joint adversarial learning in the embodiment of the present application shows significant advantages in both performance and efficiency. Through comparative experiments, combined with several existing deep learning models, the following key conclusions are drawn:

[0182] First, the experimental results on the ICBEB2018 and PTB-XL datasets show that the MSMT-GAN-KD framework significantly improves the AUC (area under the receiver operating characteristic curve) and F β=2 Specifically, the MSMT-GAN-KD framework achieved an AUC of 98.3% on the ICBEB2018 dataset, significantly outperforming the existing XResNet1d101 (97.4%) and Resnet1d_wang (96.9%). β=2 The performance in the score is also excellent, reaching 82.7%, while XResNet1d101 is only 80.6% and Resnet1d_wang is 79.4%. This shows that the framework of the embodiment of the present application not only outperforms the existing methods in overall performance, but also has stronger performance when processing unbalanced data sets.

[0183] Secondly, in the sub-classification task (PTB-XL.sub) of the PTB-XL dataset, the AUC of MSMT-GAN-KD is 93.8%, which is also higher than other advanced models, such as Inception1d (93.0%) and Lstm model (92.8%). In the super classification task (PTB-XL.super) of PTB-XL, the AUC of the embodiment of the present application reached 93.3%, continuing to demonstrate its robustness and consistency in various ECG classification tasks.

[0184] From the perspective of model lightweight and computational efficiency, MSMT-GAN-KD is particularly outstanding in reducing model parameters and computational costs. Compared with the single feature model, the multi-view feature teacher network provides richer and more diverse feature representations, and the student model can approach the performance of the teacher model without increasing the computational cost. In addition, through knowledge distillation and cross-modal fusion, the feature learning ability of the student model has been significantly improved, especially when processing complex ECG signals.

[0185] Compared with existing methods, the existing single-teacher network has certain limitations in feature representation capabilities and is difficult to fully capture the complex patterns in ECG signals. The MSMT-GAN-KD framework can perform a more comprehensive analysis of ECG signals from different angles through multi-view feature fusion, so it can show better performance in classification tasks. While keeping the model lightweight, this method can also be efficiently deployed on mobile devices or in resource-limited environments, and has a wide range of practical application value.

[0186] Based on the same principle as the method provided in the embodiment of the present application, the embodiment of the present application also provides a lightweight electrocardiogram diagnostic device based on generative adversarial network and distillation learning, such as Figure 7 As shown, the device comprises:

[0187] The data preprocessing module 701 is used to convert the 12-lead electrocardiogram signal to obtain multiple views;

[0188] A multi-view feature extraction module 702 is used to learn the features of each view in the multi-view using a teacher network and fuse them to obtain the real features;

[0189] A generator module 703 is used to extract features from a single-lead electrocardiogram signal using a student network as a generator to obtain generated features;

[0190] A discriminator module 704 is used to use the real features and the generated features as inputs of the discriminator, classify the input features through the discriminator, and determine whether the input features come from the teacher network or the student network according to the classification results;

[0191] The generator optimizes the generated features through the generator's loss function, and the generator's loss function is used to minimize the probability that the discriminator mistakenly judges the generated features as false;

[0192] The discriminator optimizes the classification result through the discriminator's loss function; the discriminator's loss function is used to maximize the output of the real features and minimize the output of the generated features.

[0193] In the embodiment of the present application, the 12-lead ECG signal is converted to obtain multiple views, the features of each view in the multiple views are learned by the teacher network, and the real features are obtained by fusion, and the features are extracted from the single-lead ECG signal by the student network to obtain the most realistic generated features. Through the knowledge distillation technology, the complex teacher model knowledge is effectively transferred to the lightweight student model, which significantly reduces the reasoning time and computing resource consumption, and is suitable for real-time applications of embedded devices and portable devices. In addition, the present application uses the student network as a generator, classifies the input features through the discriminator, and determines whether the input features come from the teacher network or the student network through the classification results. The introduced generative adversarial network technology enables the student model to have stronger generalization ability, can cope with noise and variation in different ECG signals, and improve the reliability of the diagnostic results. The embodiment of the present application effectively improves the knowledge transfer ability of the teacher model by combining multi-view feature extraction with generative adversarial learning, so that the student network maintains performance similar to that of the teacher network while the model is lightweight.

[0194] The lightweight electrocardiogram diagnostic device based on generative adversarial network and distillation learning provided in the embodiment of the present application can achieve Figures 1 to 6 To avoid repetition, the various processes implemented in the method embodiment are not described here.

[0195] The lightweight ECG diagnostic device based on generative adversarial network and distillation learning in the embodiment of the present application can execute the lightweight ECG diagnostic method based on generative adversarial network and distillation learning provided in the embodiment of the present application. The implementation principle is similar. The actions performed by each module and unit in the lightweight ECG diagnostic device based on generative adversarial network and distillation learning in each embodiment of the present application correspond to the steps in the lightweight ECG diagnostic method based on generative adversarial network and distillation learning in each embodiment of the present application. For the detailed functional description of each module of the lightweight ECG diagnostic device based on generative adversarial network and distillation learning, please refer to the description of the corresponding lightweight ECG diagnostic method based on generative adversarial network and distillation learning shown in the previous text, which will not be repeated here.

[0196] Based on the same principle as the method shown in the embodiment of the present application, the embodiment of the present application also provides an electronic device, which may include but is not limited to: a processor and a memory; a memory for storing a computer program; a processor for executing the lightweight electrocardiogram diagnosis method based on generative adversarial network and distillation learning shown in any optional embodiment of the present application by calling a computer program. Compared with the prior art, the lightweight electrocardiogram diagnosis method based on generative adversarial network and distillation learning provided by the present application converts the 12-lead electrocardiogram signal to obtain multiple views, uses the teacher network to learn the features of each view in the multiple views, and fuses them to obtain real features, and uses the student network to extract features from the single-lead electrocardiogram signal to obtain as realistic generated features as possible. Through the knowledge distillation technology, the complex teacher model knowledge is effectively transferred to the lightweight student model, which significantly reduces the inference time and computing resource consumption, and is suitable for real-time applications of embedded devices and portable devices. In addition, the present application uses the student network as a generator, classifies the input features through the discriminator, and determines whether the input features come from the teacher network or the student network through the classification results. The introduced generative adversarial network technology enables the student model to have stronger generalization ability, can cope with noise and variation in different electrocardiogram signals, and improve the reliability of diagnostic results. The embodiment of the present application effectively improves the knowledge transfer ability of the teacher model by combining multi-view feature extraction with generative adversarial learning, so that the student network maintains similar performance to the teacher network while making the model lightweight.

[0197] In an optional embodiment, an electronic device is also provided, such as Figure 8 As shown, Figure 8 The electronic device 800 shown may be a server, including: a processor 801 and a memory 803. The processor 801 and the memory 803 are connected, such as through a bus 802. Optionally, the electronic device 800 may further include a transceiver 804. It should be noted that in actual applications, the transceiver 804 is not limited to one, and the structure of the electronic device 800 does not constitute a limitation on the embodiments of the present application.

[0198] The processor 801 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor 801 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0199] The bus 802 may include a path to transmit information between the above components. The bus 802 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 802 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0200] The memory 803 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, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.

[0201] The memory 803 is used to store the application code for executing the solution of the present application, and the execution is controlled by the processor 801. The processor 801 is used to execute the application code stored in the memory 803 to implement the content shown in the above method embodiment.

[0202] Among them, electronic devices include but are not limited to: mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 8 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0203] The server provided in this application can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal can be a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected by wired or wireless communication, and this application does not limit this.

[0204] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer can execute the corresponding content in the aforementioned method embodiment.

[0205] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0206] It should be noted that the computer-readable storage medium mentioned above in the present application can also be a computer-readable signal medium or a combination of a computer-readable storage medium and a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal can take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0207] The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device.

[0208] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.

[0209] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the lightweight electrocardiogram diagnosis method and apparatus based on generative adversarial network and distillation learning provided in the above-mentioned various optional implementations.

[0210] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0211] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0212] The modules involved in the embodiments described in this application can be implemented by software or hardware. The name of the module does not limit the module itself in some cases. For example, the data preprocessing module can also be described as "a data preprocessing module for converting 12-lead electrocardiogram signals to obtain multiple views".

[0213] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other to form a technical solution.

Claims

1. A lightweight electrocardiogram diagnosis method based on generative adversarial network and distillation learning, characterized in that: The method comprises: Convert 12-lead ECG signals to obtain multiple views; Use the teacher network to learn the features of each view in multiple views and fuse them to obtain the real features; The student network is used as a generator to extract features from the single-lead ECG signal to obtain generated features; Using the real features and the generated features as inputs of the discriminator, classifying the input features through the discriminator, and determining whether the input features come from the teacher network or the student network through the classification results; The generator optimizes the generated features through a loss function of the generator, and the loss function of the generator is used to minimize the probability that the discriminator mistakenly judges that the generated features are false; The discriminator optimizes the classification result through the loss function of the discriminator; the loss function of the discriminator is used to maximize the output of the real features and minimize the output of the generated features.

2. The lightweight electrocardiogram diagnosis method based on generative adversarial network and distillation learning according to claim 1 is characterized in that: The multiple views include a 12-lead electrocardiogram signal, a Grammar angle field image, and a recursive map of a vector cardiogram.

3. The lightweight electrocardiogram diagnosis method based on generative adversarial network and distillation learning according to claim 2 is characterized in that: The 12-lead electrocardiogram signal is converted to obtain multiple views, including: Normalizing and noise filtering the 12-lead electrocardiogram signal to obtain a standard 12-lead electrocardiogram signal; Converting a standard 12-lead electrocardiogram signal into polar coordinates, wherein each signal value is converted into an angle, and using a cosine function to generate the Gram angular field image; A standard 12-lead electrocardiogram signal is converted into a vector electrocardiogram using a Kors conversion matrix, and a recursive graph of the vector electrocardiogram is generated based on the vector electrocardiogram.

4. The lightweight electrocardiogram diagnosis method based on generative adversarial network and distillation learning according to claim 2 is characterized in that: The teacher network includes a one-dimensional convolutional neural network, a two-dimensional convolutional neural network and a three-dimensional convolutional neural network; The teacher network is used to learn the features of each view in multiple views and fuse them to obtain the real features, including: Extracting time series features from the 12-lead electrocardiogram signal using the one-dimensional convolutional neural network to obtain first view features; Extracting spatial features in the Gram angular field image using the two-dimensional convolutional neural network to obtain second view features; Extracting the temporal features and spatial features of the recursive graph of the vector electrocardiogram using the three-dimensional convolutional neural network to obtain third view features; The first view feature, the second view feature and the third view feature are fused through an attention mechanism to obtain the real feature.

5. The lightweight electrocardiogram diagnosis method based on generative adversarial network and distillation learning according to claim 4 is characterized in that: The fusing the first view feature, the second view feature and the third view feature through an attention mechanism to obtain the real feature includes: assigning the first view feature, the second view feature, and the third view feature as a query vector, a key vector, and a value vector, respectively; Obtaining weight coefficients of the first view feature, the second view feature, and the third view feature by calculating similarity scores between the query vector, the key vector, and the value vector; The first view feature, the second view feature and the third view feature are weightedly fused according to the weight coefficient to obtain the real feature.

6. The lightweight electrocardiogram diagnosis method based on generative adversarial network and distillation learning according to claim 1 is characterized in that: The discriminator includes a convolutional layer, an activation function, a random dropout layer, a pooling layer and a Sigmoid classifier.

7. The lightweight electrocardiogram diagnosis method based on generative adversarial network and distillation learning according to claim 1 is characterized in that: The loss function of the discriminator is the sum of the true loss function of the discriminator and the false loss function of the discriminator; The discriminator real loss function enhances the ability to distinguish real features by maximizing the discrimination results of real features; The discriminator false loss function enables the discriminator to better identify the generated features by minimizing the discrimination results of the generated features.

8. A lightweight electrocardiogram diagnostic device based on generative adversarial network and distillation learning, characterized in that: The device comprises: A data preprocessing module, used to convert 12-lead electrocardiogram signals to obtain multiple views; The multi-view feature extraction module is used to use the teacher network to learn the features of each view in the multi-view and fuse them to obtain the real features; A generator module is used to extract features from a single-lead electrocardiogram signal using the student network as a generator to obtain generated features; A discriminator module, used to take the real features and the generated features as inputs of the discriminator, classify the input features through the discriminator, and determine whether the input features come from the teacher network or the student network according to the classification results; The generator optimizes the generated features through a loss function of the generator, and the loss function of the generator is used to minimize the probability that the discriminator mistakenly judges that the generated features are false; The discriminator optimizes the classification result through the loss function of the discriminator; the loss function of the discriminator is used to maximize the output of the real features and minimize the output of the generated features.

9. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Heart disease detection method based on deep learning model of three-dimensional image

    CN111261278A

  • Arrhythmia classification method based on comparison test time adaptation

    CN115836849A

  • Electrocardiosignal classification method based on attention mechanism feature fusion

    CN116649899A

  • Self-supervised multi-view knowledge distillation method for single-lead arrhythmia diagnosis

    CN116913504A

  • Model lightweight method based on confrontation knowledge distillation and attention mechanism

    CN117057402A

Cited By

  • Accurate rhythm generation method based on generative adversarial network

    CN121456467A