Electrocardiogram classification method and related apparatus
By extracting and fusing features from multiple perspectives, and combining quantum and classical feature models, the generalization and overfitting problems of traditional ECG classification methods are solved, achieving more efficient and accurate automated ECG classification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ORIGIN QUANTUM COMPUTING TECH (HEFEI) CO LTD
- Filing Date
- 2025-01-23
- Publication Date
- 2026-07-31
AI Technical Summary
Traditional automated electrocardiogram (ECG) classification methods struggle to capture complex patterns and nonlinear relationships in ECGs, exhibit poor generalization, and suffer from annotation discrepancies due to reliance on expert experience.
We employ first, second, and third feature extraction models with distinct structures to extract deep, spatial, and temporal features from electrocardiograms, respectively. These features are then fused using a classifier. By utilizing quantum and classical feature extraction models working collaboratively in the cloud, we reduce the risk of overfitting.
It improves the generalization ability of ECG classification, automatically extracts high-level abstract features, captures complex patterns and nonlinear relationships, reduces the risk of overfitting, and improves the accuracy and reliability of classification.
Smart Images

Figure CN122490179A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of data classification, and in particular to an electrocardiogram classification method and related apparatus. Background Technology
[0002] Electrocardiography (ECG) is a non-invasive diagnostic method that captures abnormal cardiac activity by recording electrical signals conducted through the heart, thereby diagnosing cardiovascular diseases. ECG is currently the most widely used diagnostic tool in the clinical diagnosis of cardiovascular diseases. A standard ECG has 12 leads, including 6 limb leads (I, II, III, aVR, aVL, aVF) and 6 chest leads (V1, V2, V3, V4, V5, V6). These leads (corresponding to electrodes placed on the body to record the electrical signals acquired by the electrodes) are used to record the signals from the body surface electrodes. Accurate interpretation of ECGs requires highly experienced professionals, and given the wide variety of cardiovascular diseases, misinterpretation of ECGs can lead to inappropriate clinical diagnoses and adverse consequences.
[0003] Traditional automated electrocardiogram (ECG) classification typically relies on expert-defined feature recognition methods. These methods extract features from the ECG (such as P waves, QRS complexes, T wave morphology, ST segment changes, etc.) using pre-defined rules and then classify them using traditional machine learning algorithms (such as support vector machines, decision trees, random forests, etc.). While this approach offers strong interpretability and controllability, it struggles to capture complex patterns and nonlinear relationships within the ECG and suffers from numerous hyperparameter types. Consequently, it often cannot be refitted to specific data, resulting in poor generalization. Summary of the Invention
[0004] The purpose of this application is to provide an electrocardiogram (ECG) classification method and related apparatus, which aims to improve the generalization of ECG classification.
[0005] One embodiment of this application provides an electrocardiogram (ECG) classification method, the method comprising:
[0006] Sample an electrocardiogram (ECG) to be classified to obtain sampled data;
[0007] Based on the obtained sampled data, deep features, spatial features, and time series features of the sampled data are extracted using a first feature extraction model, a second feature extraction model, and a third feature extraction model, respectively. The first feature extraction model, the second feature extraction model, and the third feature extraction model have different structures.
[0008] By fusing the deep features, the spatial features, and the time series features, a fused feature is obtained.
[0009] The fused features are processed by a classifier to obtain the classification result of the electrocardiogram.
[0010] Optionally, at least one of the first feature extraction model, the second feature extraction model, and the third feature extraction model is a quantum feature extraction model.
[0011] Optionally, when the first feature extraction model, the second feature extraction model, and the third feature extraction model are not all quantum feature extraction models, the second sampling frequency is higher than the first sampling frequency. The first sampling frequency is the sampling frequency at which the first sub-sample data is obtained from the electrocardiogram, and the second sampling frequency is the sampling frequency at which the second sub-sample data is obtained from the electrocardiogram. The sampled data includes the first sub-sample data and the second sub-sample data. The first sub-sample data is used for feature extraction by the quantum feature extraction model, and the second sub-sample data is used for feature extraction by the classical feature extraction model.
[0012] Optionally, the extracted deep features, spatial features, and time series features have the same dimension;
[0013] The fusion feature is obtained by concatenating the deep feature, the spatial feature, and the time series feature;
[0014] The classifier is a deep neural network composed of multiple fully connected layers.
[0015] Optionally, the quantum feature extraction model is trained by updating parameters using a parameter shifting method.
[0016] Optionally, at least one of the first feature extraction model, the second feature extraction model, and the third feature extraction model has skip connections.
[0017] Optionally, the quantum feature extraction model is deployed on a quantum computer in the cloud, and the classical feature extraction model is deployed on a classical computer in the cloud.
[0018] Another embodiment of this application provides an apparatus for determining a quantum circuit to be executed in parallel, the apparatus comprising:
[0019] The first acquisition module is used to sample an electrocardiogram to be classified and obtain sampled data.
[0020] The extraction module is used to extract deep features, spatial features and time series features of the obtained sampled data by using a first feature extraction model, a second feature extraction model and a third feature extraction model, respectively. The first feature extraction model, the second feature extraction model and the third feature extraction model have different structures.
[0021] The fusion module is used to fuse the deep features, the spatial features, and the time series features to obtain fused features;
[0022] The second acquisition module is used to process the fused features through a classifier to obtain the classification result of the electrocardiogram.
[0023] Another embodiment of this application provides a computer device including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the electrocardiogram classification method of any of the above embodiments.
[0024] Another embodiment of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a computer, causes the computer to perform the electrocardiogram classification method in any of the above embodiments.
[0025] Compared with existing technologies, this application first samples an electrocardiogram (ECG) to be classified to obtain sampled data; then, based on the obtained sampled data, it extracts deep features, spatial features, and time-series features of the sampled data through a first feature extraction model, a second feature extraction model, and a third feature extraction model, respectively; then, it fuses the deep features, spatial features, and time-series features to obtain fused features; finally, it processes the fused features through a classifier to obtain the classification result of the ECG. This application innovatively uses three models with different structures to perform the feature extraction task. These three models form completely different perspectives and learning modes for understanding ECG data, thereby enabling the discovery of various types of highly targeted features. This application comprehensively utilizes the feature extraction capabilities of different models to automatically extract high-level abstract features, capture complex patterns and nonlinear relationships, and extract effective features that meet the requirements for classification. The multi-angle feature extraction method enables the model to extract effective features for classification when facing various complex and variable ECG data, greatly enhancing the generalization ability of the ECG classification method and reducing the risk of overfitting. Attached Figure Description
[0026] Figure 1 An example system block diagram for an electrocardiogram classification method provided in this application embodiment;
[0027] Figure 2 A flowchart of an electrocardiogram (ECG) classification method provided in this application embodiment;
[0028] Figure 3 This is a schematic diagram of a quantum neural network structure provided in an embodiment of this application;
[0029] Figure 4 A 12-lead electrocardiogram is provided as an embodiment of this application;
[0030] Figure 5 An electrocardiogram (ECG) provided as an embodiment of this application;
[0031] Figure 6 A structural diagram of an electrocardiogram (ECG) classification device provided in an embodiment of this application;
[0032] Figure 7 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0033] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0034] Classical computers use transistors to encode information in binary data, such as bits, where each bit can represent a value of 1 or 0. These 1s and 0s act as switches to drive the functions of a classical computer. If there are n bits of data, there are 2^n possible classical states, and one state is represented at a time.
[0035] Quantum computers use quantum processors that operate on data represented by qubits, also known as quantum bits. A qubit can represent the classical binary states "0" or "1", or a superposition of "0" and "1". Because it can represent a superposition of "0" and "1", a qubit can represent both "0" and "1" states simultaneously. For example, if there are n bits of data, n quantum states can be represented simultaneously. Furthermore, qubits in a superposition can be correlated with each other, a phenomenon known as entanglement. The state of one qubit (whether it's 1, 0, or both) can depend on the state of another qubit, and more information can be encoded within two entangled qubits. Based on the principles of superposition and entanglement, qubits enable quantum computers to perform functions that might be relatively complex and time-consuming for classical computers.
[0036] Please refer to Figure 1 This illustrates an example system block diagram for an electrocardiogram (ECG) classification method according to one embodiment of this application. System 100 may be a hybrid computing system comprising a combination of one or more quantum computers, quantum systems, and / or classical computers. Figure 1In the example shown, system 100 may include a quantum system 110 and a classical computer 120. In one implementation, the quantum system 110 and the classical computer 120 may be configured to communicate via one or more wired and / or wireless connections (e.g., wireless networks). The quantum system 110 may include a quantum chipset consisting of one or more quantum chips, comprising various hardware components for processing data encoded in qubits. The quantum chipset may be a quantum computing core surrounded by infrastructure to protect the quantum chips from electromagnetic noise sources, mechanical vibration sources, heat sources, and other noise sources that can degrade the performance of the quantum chips. The classical computer 120 may be electronically integrated with the quantum system 110 via any suitable wired and / or wireless electronic connection.
[0037] exist Figure 1 In the example shown, quantum system 110 can be any suitable set of components capable of performing quantum operations on a physical system. Quantum operations, for example, can be quantum logic gate operations that manipulate the quantum states of qubits to evolve and / or become entangled. Figure 1 In the illustrated example embodiment, the quantum system 110 may include a measurement and control unit 111, an interface 112, and a quantum chip 113. In some embodiments, all or part of each of the measurement and control unit 111, interface 112, and quantum chip 113 may be located in a cryogenic environment to facilitate the performance of quantum operations. The quantum chip 113 may be any hardware capable of processing information using quantum states. This hardware may include multiple qubits and means for coupling or entanglement of the qubits to process information using quantum states. Qubits may include, but are not limited to, charge qubits, flux qubits, phase qubits, spin qubits, and ion qubits. The quantum chip may include a set of quantum logic gates configured to perform quantum logic operations on the qubits stored in a quantum register. The quantum gates may include one or more single-qubit gates, two-qubit gates, and / or other multi-qubit gates.
[0038] The measurement and control unit 111 can be any combination of digital computing devices capable of performing quantum computing (e.g., executing quantum circuits) in conjunction with interface 112. This digital computing device may include a digital processor and memory for storing and executing quantum instructions using interface 112. The digital computing device may also include a communication protocol device for receiving instructions and sending the results of the performed quantum computing to a classical computer. Additionally, the digital computing device may include a communication interface having interface 112. In one embodiment, the measurement and control unit 111 may be configured to receive classical instructions (e.g., from classical computer 120) and convert these classical instructions into measurement and control instructions for interface 112. The measurement and control instructions provided by the measurement and control unit 111 to interface 112 may be, for example, digital signals indicating which quantum gates in a quantum gate array need to be applied to the qubits to perform a specific function. Interface 112 may be configured to convert these digital signals into analog signals (e.g., analog pulses of microwave pulses), which can be used to apply quantum gates to the qubits to manipulate the interactions between the qubits.
[0039] Interface 112 may be a classical-quantum interface, comprising a combination of devices capable of receiving instructions from the integrated measurement and control unit 111 and converting those instructions into a means for implementing quantum operations. In one embodiment, interface 112 may convert instructions from the integrated measurement and control unit 111 into drive signals capable of driving or manipulating qubits, and / or applying quantum gates to qubits. Additionally, interface 112 may be configured to convert signals received from the quantum chip 113 into digital signals capable of being processed and transmitted by the integrated measurement and control unit 111. Devices included in interface 112 may include, but are not limited to, digital-to-analog converters, analog-to-digital converters, waveform generators, attenuators, amplifiers, optical fibers, lasers, and filters. Interface 112 may further include circuitry configured to measure multiple qubits after the application of quantum gates, wherein the measurements may produce results represented in classical bits. Each measurement performed by interface 112 may be read out to a device connected to the quantum system 110, such as a classical computer 120. The multiple measurement results provided by interface 112 may represent probabilistic results.
[0040] The classical computer 120 can include hardware components such as a processor and storage devices (e.g., including memory devices and classical registers) for processing data encoded in classical bits. In one embodiment, the classical computer 120 can be configured to provide the quantum system 110 with various control signals, instructions, and data encoded in classical bits. Further, quantum states measured by the quantum system 110 can be read out by the classical computer 120, and the classical computer 120 can store the measured quantum states as classical bits in classical registers. In one embodiment, the classical computer 120 can be any suitable combination of computer-executable hardware and / or computer-executable software capable of executing the preparation module 121 to perform quantum computation using data stored in the data storage module 122 as part of the construction and computation. The data storage module 122 can be a repository for data to be analyzed using quantum computing algorithms and the results of that analysis. The preparation module 121 can be a program or module capable of preparing classical data from the data storage module 122 as part of a quantum circuit implementation. Preparation module 121 can be instantiated as part of a larger algorithm, such as an application programming interface (API) function call, or by resolving hybrid classical-quantum computing into aspects of quantum and classical computing. For example, preparation module 121 can generate instructions for creating quantum circuits using quantum gates. In an embodiment, such instructions can be stored by the measurement and control unit 111 and can be instantiated by components of interface 112 to execute, enabling quantum operations of quantum gates to be performed on quantum chip 113.
[0041] The classic computer 120 may be a laptop computer, desktop computer, vehicle-integrated computer, smart mobile device, tablet device, and / or any other suitable classic computing device. Additionally or alternatively, the classic computer 120 may also operate as part of a cloud computing service model, such as Software as a Service (SaaS), Platform as a Service (PaaS), or Infrastructure as a Service (IaaS). The classic computer 120 may also reside in a cloud computing deployment model, such as a private cloud, community cloud, public cloud, or hybrid cloud.
[0042] See Figure 2 , Figure 2 An electrocardiogram (ECG) classification method provided in this application includes the following steps:
[0043] S201: Sample an electrocardiogram to be classified and obtain sampled data;
[0044] Electrocardiograms (ECGs) are divided into routine ECGs and Holter monitoring, among others. A routine ECG is a widely used method that records the heart's electrical activity by placing electrodes at specific points on the body. It typically includes 12 leads, which are:
[0045] Standard Leads: I, II, III;
[0046] Unipolar Limb Leads: aVR, aVL, aVF
[0047] Chest leads: V1, V2, V3, V4, V5, V6
[0048] These leads cover different directions and regions of cardiac electrical activity, providing comprehensive electrocardiographic information. The electrocardiogram (ECG) records 10 seconds of data from a patient in a steady state. Ten seconds of ECG data is sufficient to capture cardiac electrical activity and provide enough information for subsequent analysis. The recorded ECG data is processed into an array format. ECG data is typically recorded as a waveform of voltage changes over time; after processing into an array, the data from each lead can be represented as a time-series array. During sampling, the ECG data can be sampled according to a set sampling frequency to obtain sampled data. It should be noted that during sampling, data from different leads at the same time intervals are sampled; this ensures that the subsequent classification results based on the sampled data are reliable.
[0049] In this application, electrocardiogram (ECG) data is directly sampled to obtain input data for the feature extraction model, eliminating the need to wait for annotation by cardiologists or manually extract features (such as P waves, QRS complexes, and T waves) from the ECG. This method allows for rapid data preparation, especially with large datasets. Direct sampling also avoids the annotation discrepancies caused by expert experience, ensuring data objectivity in the initial stages. This allows the three feature extraction models to learn based on more objective data, potentially mitigating model bias caused by inconsistent annotations. Furthermore, direct sampling of ECG data preserves all feature information from the original data, including features that might be considered unimportant by experts but are actually valuable for model learning. This provides richer data diversity, facilitating the model's discovery of more potential feature relationships. This application is also easier to adapt when dealing with new types of ECG data or undertaking new ECG analysis tasks, as it does not rely on specific medical annotation standards or expert knowledge; only appropriate modifications to the sampling method and subsequent data processing workflow are required.
[0050] Before sampling, it is necessary to perform necessary standardization on the 12-lead electrocardiogram data to ensure dimensional consistency. The signal amplitude range of different leads may be different, and standardization can eliminate dimensional differences and make the data distribution more consistent. Min-Max standardization is usually used to uniformly scale the data to the interval [-1, 1].
[0051] S202: Based on the obtained sampled data, the deep features, spatial features and time series features of the sampled data are extracted by the first feature extraction model, the second feature extraction model and the third feature extraction model, respectively. The first feature extraction model, the second feature extraction model and the third feature extraction model have different structures.
[0052] Deep features refer to high-level, abstract features extracted from raw electrocardiogram (ECG) data (sampled data) using a first feature extraction model. These features are not directly observed from the data surface but are obtained through transformation by the first feature extraction model, reflecting the inherent, hidden patterns in the data. Sampled data is typically a series of voltage values that change over time, exhibiting complex waveforms in a time series. Deep features, on the other hand, extract the more complex physiological information behind these waveforms. For example, sampled data may simply record the potential changes of cardiac electrical activity on the body surface, while deep features may contain complex interactive information about atrial and ventricular activity, the functional state of the cardiac conduction system, etc. Exemplary deep features include the following:
[0053] The characteristics of heart rhythm reflect whether the heart rhythm is regular. Normal sinus rhythm has a certain rhythmicity, while arrhythmias (such as atrial fibrillation, premature beats, etc.) may manifest as irregular changes in rhythm in deeper characteristics.
[0054] Myocardial electrical activity features reflect the electrophysiological characteristics of cardiomyocytes. For example, deep feature analysis can reveal abnormalities in the repolarization process of cardiomyocytes during myocardial ischemia. Within the deep feature space of an electrocardiogram (ECG), certain feature dimensions may be related to the slope and amplitude of myocardial repolarization. When myocardial ischemia occurs, the values of these feature dimensions change, reflecting delays or abnormal potential changes in the myocardial cell repolarization process.
[0055] The characteristics of the cardiac conduction system that reflect the functional state of the cardiac conduction system, such as the delay in electrical signal conduction between the atria and ventricles in the case of atrioventricular block, may be represented in the deep features by some features related to signal conduction time. These features may be obtained based on the analysis of changes in electrocardiogram signals within different time windows, and after abstraction and extraction by the first feature extraction model, the characteristics of conduction block are presented in a more representative way.
[0056] Spatial characteristics mainly refer to the distribution and interrelationships of electrocardiogram (ECG) signals in a spatial dimension. An ECG records cardiac electrical activity by placing electrodes at different locations on the body surface. These signals recorded at different locations have spatial correlations, and spatial characteristics describe these correlations. In a 12-lead ECG, each lead records cardiac electrical activity from different angles and positions; the potential differences and waveform morphology differences between them reflect spatial characteristics. For example, limb leads mainly reflect the electrical activity in the frontal plane of the heart, while chest leads focus more on reflecting the electrical activity in the horizontal plane. The voltage amplitude relationship between different leads, the time difference between waveform onset and peak, etc., are all important components of spatial characteristics. Taking the waveform morphology differences as an example, comparing the waveform morphology of limb leads I, II, and III reveals a certain spatial correlation. According to Einthoven's law (I + III = II), the algebraic sum of voltages between these three leads is fixed, reflecting the balance of cardiac electrical activity in the frontal plane. Furthermore, the morphological differences in their P waves, QRS complexes, and T waves also reflect the characteristics of atrial and ventricular electrical activity in different spatial directions. In cases of abnormalities such as myocardial infarction, this balance may be disrupted. For example, in lateral myocardial infarction, the R-wave voltage in leads I and aVL may decrease, causing a change in the relationship of I + III = II. Analyzing these changes in the correlation of potential amplitude between leads can aid in the diagnosis of cardiovascular diseases.
[0057] Time series features can include one or more of the following: rhythm features, waveform duration features, and band interval features. For example, taking the ST segment interval feature as an example, we can explain why time series features can be used as characteristic data for ECG classification. Normally, the ST segment is an isoelectric line; in limb leads, elevation generally does not exceed 0.1 mV, and depression does not exceed 0.05 mV; in precordial leads, elevation generally does not exceed 0.3 mV, and depression does not exceed 0.1 mV. Changes in the ST segment are important markers of myocardial ischemia or injury. For example, in acute myocardial infarction, the ST segment in leads facing the infarct area shows an upward-convex elevation, which alters the normal time series relationship between the ST segment and other waveforms.
[0058] In this embodiment, the three models extract features in parallel without interfering with each other.
[0059] S203: Fuse the deep features, the spatial features, and the time series features to obtain fused features.
[0060] The deep features, spatial features, and time-series features extracted through the three different models mentioned above are fused to form a fused feature. The fused feature integrates key information from different dimensions, allowing the subsequent classifier to consider the characteristics of the electrocardiogram from a more comprehensive perspective, avoiding the limitations of a single feature, and improving the accuracy and reliability of classification.
[0061] In this application, some of the extracted deep features, spatial features, and time series features have the same dimension;
[0062] The fusion feature is obtained by splicing the deep feature, the spatial feature, and the time series feature.
[0063] Ensuring that different features share the same dimension makes subsequent operations such as feature fusion more organized and convenient. It avoids complex alignment and adjustment processes that can arise from inconsistent dimensions, reducing data processing difficulty and the probability of errors, and allowing the entire classification process to proceed more smoothly. Furthermore, shared dimensions mean that each feature contributes information in a relatively equal and balanced manner during fusion. This prevents a particular feature from being overemphasized or underemphasized in the fused feature set, thus facilitating a more reasonable synthesis of the key information contained in each feature dimension and ensuring that the fused feature comprehensively and evenly reflects the various characteristics of the electrocardiogram.
[0064] The fusion feature is obtained by concatenating deep features, spatial features, and time-series features. This concatenation method is simple and direct, clearly combining features from various dimensions in sequence to form a new, comprehensive feature vector containing rich information extracted from different perspectives. Through concatenation, the classifier can sequentially obtain the inherent implicit information reflected by the deep features, the spatial layout information reflected by the spatial features, and the information about changes over time presented by the time-series features. This allows the classifier to comprehensively consider these key elements from different dimensions, thereby more accurately determining the category of the electrocardiogram based on the fusion feature and improving classification accuracy.
[0065] Overall, the two settings of having the same feature dimensions and using a splicing method for fusion further optimize the rationality and effectiveness of the entire ECG classification method, making the classification process based on multi-dimensional features more scientific and efficient. This helps to improve the reliability and accuracy of the final classification results and can better assist ECG-related medical diagnostic work in practical applications.
[0066] S204: The fused features are processed by a classifier to obtain the classification result of the electrocardiogram.
[0067] The classifier outputs the classification result of the electrocardiogram (ECG) based on pre-defined rules, algorithms, and learned patterns, thus completing the entire ECG classification process. When processing the fused features, the classifier integrates features of different dimensions and properties extracted from different feature extraction models. Based on these more comprehensive and higher-quality features, the classifier can make more accurate category judgments. Specifically, the classifier can be a deep neural network composed of multiple fully connected layers. It processes the feature vector layer by layer and finally outputs the predicted probability value. For example, the classifier may include four fully connected layers. The 384-dimensional input vector (fused features) is processed through the first fully connected layer, outputting a 256-dimensional vector. The 256-dimensional output vector is processed through the second fully connected layer, outputting a 128-dimensional vector. The 128-dimensional output vector is then processed through the third fully connected layer, outputting a 64-dimensional vector. Finally, the 64-dimensional output vector is processed through the last fully connected layer, outputting a 1-dimensional vector. The last fully connected layer uses the Sigmoid activation function to output the predicted probability value.
[0068] This application first samples an electrocardiogram (ECG) to be classified, obtaining sampled data. Then, based on the obtained sampled data, it extracts deep features, spatial features, and time-series features from the sampled data using a first feature extraction model, a second feature extraction model, and a third feature extraction model, respectively. The deep features, spatial features, and time-series features are then fused to obtain fused features. Finally, a classifier processes the fused features to obtain the classification result of the ECG. This application innovatively uses three models with different structures to perform the feature extraction task. These three models form completely different perspectives and learning modes for understanding ECG data, thus enabling the discovery of various types of highly targeted features. This application comprehensively utilizes the feature extraction capabilities of different models to automatically extract high-level abstract features, capture complex patterns and nonlinear relationships, and extract effective features that meet the requirements for classification. The multi-angle feature extraction method enables the model to extract effective features for classification when facing various complex and variable ECG data, greatly enhancing the generalization ability of the ECG classification method and reducing the risk of overfitting.
[0069] In some embodiments of this application, at least one of the first feature extraction model, the second feature extraction model, and the third feature extraction model is a quantum feature extraction model.
[0070] Electrocardiogram (ECG) data is highly complex and nonlinear, and quantum feature extraction models have a potential advantage in processing such complex data. The state space of quantum systems grows exponentially, enabling quantum feature extraction models to represent and process complex high-dimensional data more efficiently. For example, quantum neural networks (QNNs) can leverage the superposition and entanglement properties of qubits to explore deeper features in ECGs more comprehensively. Traditional models may struggle to capture subtle, hidden features in high-dimensional data spaces, while quantum models can mine these features through the evolution of quantum states. Furthermore, for large-scale ECG datasets, certain quantum algorithms may offer computational speedups under specific conditions. The parallelism principle of quantum computing allows for simultaneous operations on multiple states when processing feature extraction tasks, giving traditional neural networks a speed advantage.
[0071] In this application embodiment, the first feature extraction model can be a quantum feature extraction model, and the deep features are quantum deep features, which are deep features extracted using the quantum feature extraction model. Compared with deep features extracted using classical feature models, quantum deep features have stronger representational capabilities and the potential to handle complex data relationships. Quantum deep features can utilize these properties of quantum states to represent information more compactly, potentially reducing feature dimensions while maintaining or improving the accuracy of information representation. Quantum deep features can utilize quantum entanglement to more naturally represent and process complex relationships between data, without requiring complex network architectures and large amounts of training data. In addition, because quantum computing has inherent parallelism, quantum logic gate operations can operate on multiple quantum states simultaneously. This means that quantum deep features may be able to utilize this advantage of parallel computing during extraction, especially when dealing with large-scale data and complex models, where quantum deep feature extraction may be more efficient than classical deep feature extraction.
[0072] A quantum feature extraction model can specifically be a quantum neural network (QNN). A QNN leverages the advantages of quantum computing, processing data through qubits and quantum logic gates. QNNs can capture complex patterns that are difficult for classical neural networks to handle. For example, a quantum neural network with 10 qubits can have a network structure like this: Figure 3As shown, the network can include Hadamard gates, amplitude encoding circuits, and a variational quantum circuit layer. A Hadamard gate is applied to each qubit to initialize it to a superposition state. Amplitude encoding is used to convert classical data to quantum state data. The variational layer defines a set of multiple tunable quantum logic gates. Feature learning is performed using a variational circuit composed of these variable-parameter quantum logic gates. For example, the quantum logic gates can include RX, RY, and RZ gates. Rotation gates (RX, RY, RZ) are applied to each qubit, and the rotation angle is adjustable. CNOT gates can also be included, applied between adjacent qubits and between the last qubit and the first qubit, forming a loop structure.
[0073] Spatial features highlight local changes, such as changes in a certain band (rising or falling), which are suitable for convolutional neural networks (CNNs). Therefore, the second feature extraction model can be a CNN. The main characteristic of CNNs is the use of convolutional layers to automatically extract features from the input data. Convolutional layers perform local perception and feature extraction on the input data through convolution operations, effectively capturing spatial structure information within the data. CNNs can extract common features from the data, such as... Figure 4 The image shows a 12-lead electrocardiogram (ECG). By overlaying these 12 leads, the resulting ECG can be obtained, as shown below. Figure 5 As shown, this illustrates an electrocardiogram (ECG) provided in one embodiment of this application. The horizontal axis of the ECG or lead graph represents time, and the vertical axis represents voltage. If we assume the dimension of the lead graph is [1, 5000], then the dimension of the stacked ECG is [12, 5000]. It can be seen that there is some overlap between ECGs from different leads. Two-dimensional convolution can be used to obtain the common features of multiple lead graphs in the spatial dimension.
[0074] Temporal features are more global than spatial features and are more sensitive to local changes. They can be extracted using feature extraction models that are good at capturing long-term dependencies and temporal dynamics in electrocardiograms. Specifically, the third feature extraction model can be a Long Short-Term Memory Network (LSTM). LSTM is a special type of Recurrent Neural Network (RNN) that can effectively solve the gradient vanishing and gradient explosion problems that may occur when traditional RNNs process long sequence data, thus better processing and remembering long-term dependency information.
[0075] In some embodiments of this application, during the training phase, the quantum feature extraction model can be trained by updating parameters using a parameter shifting method. Classical feature extraction models employ traditional neural network parameter update methods, such as gradient descent using the Adam optimizer.
[0076] The parameter shift method is a parameter update approach that estimates the impact of parameters on model output (such as extracted features or model predictions) by making small shifts in the parameters of a specific quantum logic gate and then observing the corresponding changes in the quantum state measurement results. This allows the model to be optimized towards the desired goal (such as better feature extraction or higher classification accuracy). The parameter shift method is well-suited to the characteristics of quantum systems, fully utilizing the manipulability and measurability of quantum states. Unlike traditional machine learning models that update parameters on classical computers, it does not require complex differentiation operations to obtain gradient information (direct differentiation is often difficult in quantum systems). Instead, it indirectly obtains gradient-like information by cleverly shifting the parameters of the quantum logic gate and observing the changes in the quantum state, thus achieving efficient parameter updates. This allows quantum feature extraction models to be trained more smoothly in a quantum computing environment. Furthermore, the parameter shift method avoids large-scale gradient calculations through simple parameter shifts and measurement comparisons, reducing computational complexity and improving training efficiency, making it particularly suitable for training quantum feature extraction models with many qubits and complex structures.
[0077] During model training, the parameters of the quantum feature extraction model are continuously updated using the parameter shifting method. This allows the model to gradually optimize its processing of input ECG data and more accurately extract representative quantum features. For example, when extracting quantum-level features related to the microscopic electrophysiological state of the heart from ECG data, the model can adjust the quantum logic gate parameters as training progresses to better capture features hidden in the quantum state space, thereby improving the accuracy of feature extraction and providing a better feature foundation for subsequent tasks such as ECG classification. The parameter shifting method helps the quantum feature extraction model converge to a better parameter state more quickly. Because it effectively reduces computational complexity and makes reasonable use of the characteristics of quantum systems to obtain parameter update information, the model will not get stuck in a long search process or fail to converge due to complex gradient calculation problems during training. This means that with limited training time and computational resources, the quantum feature extraction model can reach a relatively stable and high-performance state more quickly, improving the efficiency of the entire training process and enabling the model to be deployed in practical ECG classification applications as soon as possible. During training, the parameter shifting method prompts the quantum feature extraction model to continuously optimize its parameters to adapt to different ECG input data. This enables the model to better extract effective quantum features and make reasonable judgments when faced with new, untrained ECG data. In other words, it improves the model's generalization ability, reduces overfitting, and ensures stable and reliable feature extraction performance for various ECG samples in real-world applications, thereby enhancing the accuracy and robustness of the entire ECG classification system.
[0078] In some embodiments of this application, the quantum feature extraction model is deployed on a quantum computer in the cloud, and the classical feature extraction model is deployed on a classical computer in the cloud.
[0079] After acquiring electrocardiogram (ECG) data, the data can be sampled and simultaneously sent to both a quantum computer and a classical computer in the cloud. Each computer can independently perform feature extraction without waiting for the other to complete, significantly reducing the time required for the feature extraction stage, improving overall efficiency, and accelerating subsequent feature fusion and classification processes. The cloud environment provides convenient network conditions and data transmission channels for data interaction between the two models. After completing their respective feature extractions, the quantum features obtained by the quantum feature extraction model and the classical features obtained by the classical feature extraction model can be easily transmitted through the cloud network and aggregated for subsequent feature fusion operations. Furthermore, the cloud's data storage and management functions ensure data security and integrity, preventing data loss or corruption during data interaction, thus laying a solid data foundation for the collaborative use of the two models in ECG classification tasks.
[0080] Deploying quantum feature extraction models on cloud-based quantum computers and classical feature extraction models on cloud-based classical computers offers significant advantages in resource utilization, collaborative work, and maintenance management. This helps to improve the effectiveness of electrocardiogram (ECG) classification methods, enhancing their accuracy and efficiency. It's important to note that quantum feature extraction models utilize quantum computing for feature extraction, while classical feature extraction models utilize classical computing.
[0081] In some embodiments of this application, when the first feature extraction model, the second feature extraction model, and the third feature extraction model are not all quantum feature extraction models, the second sampling frequency is higher than the first sampling frequency. The first sampling frequency is the sampling frequency at which the first sub-sampled data is obtained from the electrocardiogram, and the second sampling frequency is the sampling frequency at which the second sub-sampled data is obtained from the electrocardiogram. The sampled data includes the first sub-sampled data and the second sub-sampled data. The first sub-sampled data is used for feature extraction by the quantum feature extraction model, and the second sub-sampled data is used for feature extraction by the classical feature extraction model.
[0082] This application fully leverages the computational advantages of both classical and quantum feature extraction models by designing input data formats suitable for classical and quantum feature extraction models respectively. The classical feature extraction model input data has a higher sampling frequency, which can capture finer waveform details; while the quantum feature extraction model input data uses a lower sampling frequency to adapt to the resource limitations of quantum computing. At the same time, it utilizes the parallelism and quantum state superposition characteristics of quantum computing to extract deep features from electrocardiogram data.
[0083] Quantum feature extraction models can better leverage their advantage of utilizing quantum state properties to mine features when processing relatively low-dimensional, more representative data. The first subsampled data, obtained at a lower first sampling frequency, has a relatively smaller data volume and lower dimensionality, meeting the processing requirements of quantum feature extraction models. Features extracted from the first subsampled data by quantum feature extraction models may better reflect the intrinsic correlations and potential abstract features of ECG data at the quantum level. Classical feature extraction models, such as Convolutional Neural Networks (CNNs) and Recurrent Neural Networks (RNNs), can typically handle larger datasets and capture rich details from high-frequency sampled data. The second subsampled data, obtained at a higher second sampling frequency, contains more subtle temporal and spatial variations in ECG waveforms, helping classical feature extraction models extract features such as minute fluctuations in ECG waveforms and finer correlations between different leads. For example, CNNs, with their multiple convolutional and pooling layers, can fully mine local spatial features and temporal variations from high-frequency sampled second subsampled data, thus providing better comprehensive feature support for subsequent classification. This provides a more diverse set of features for subsequent feature fusion and classification, which helps to characterize the features of electrocardiograms from multiple dimensions.
[0084] In this embodiment, by setting different sampling frequencies, the quantum feature extraction model can mine unique, deep-level quantum features using limited data, while the classical feature extraction model can extract comprehensive conventional features from richer data. These two approaches complement each other, ultimately improving the performance of the entire ECG classification method and enhancing its accuracy and reliability. Different sampling frequencies ensure a degree of independence in the data entering different models, reducing the repeated extraction of similar features and avoiding feature redundancy. Simultaneously, data with lower sampling frequencies used for quantum feature extraction can filter out some high-frequency noise interference to the quantum feature extraction model, while the classical feature extraction model, leveraging its powerful data processing capabilities, can extract valuable features even from high-frequency sampled data containing some noise through appropriate algorithms (such as filtering and other preprocessing methods combined with feature extraction algorithms), thereby improving the overall quality of feature extraction. Furthermore, the diversity of feature sources and the differences in data characteristics resulting from sampling frequency variations make the entire classification model more adaptable to different ECG data, exhibiting better robustness. Even when faced with ECG data that has certain data quality issues (such as slightly weak signals in some leads or the presence of a small amount of noise), the model can still perform relatively accurate classification by relying on features extracted by different models, reducing the impact of data quality fluctuations on the classification results.
[0085] This application utilizes a quantum-classical parallel architecture (PHN) to comprehensively leverage the advantages of both quantum and classical computing, improving classification performance and efficiency. Quantum and classical computing can process the same data simultaneously; quantum computing extracts smooth, periodic features, while classical computing fills in the gaps in aperiodic features. Their collaborative work enhances overall computational performance and significantly improves the model's generalization ability and robustness, particularly when handling complex datasets. PHN significantly improves model performance and training efficiency during training, especially when dealing with periodic datasets. By combining the outputs of quantum and classical computing, PHN provides a more comprehensive interpretation of features.
[0086] In some embodiments of this application, at least one of the first feature extraction model, the second feature extraction model, and the third feature extraction model has a skip connection.
[0087] Skip connections, also known as residual connections, are a type of connection in neural networks that directly passes input information from one layer to subsequent layers. In traditional deep neural networks (such as Convolutional Neural Networks (CNNs) and Recurrent Neural Networks (RNNs), as the number of network layers increases, information may gradually decay or be lost during forward propagation, leading to problems such as vanishing or exploding gradients, which in turn affect the training effect and performance of the network. Skip connections effectively alleviate these problems by passing information across layers, improving the training efficiency and performance of the network. When extracting deep features from electrocardiograms (ECGs), some key information in the original data (such as the basic morphology of the QRS complex, the relative positions of the P wave and T wave, etc.) is crucial for accurately identifying the ECG type. Deep feature extraction models with skip connections can directly pass some information from the original data to deeper layers during deep feature mining, avoiding the loss of this key information during multi-layer processing. For example, when using a multi-layer convolutional neural network as a deep feature extraction model, skip connections can directly pass the spatial layout information of electrocardiogram data in the initial layer to the subsequent deep convolutional layers, so that the deep network can still refer to this original spatial information when extracting abstract, disease-related deep features.
[0088] When extracting spatial features from an electrocardiogram (ECG), the spatial relationships between different leads are crucial. Spatial feature extraction models with skip connections can better convey this spatial information, enhancing its transfer. For example, in spatial feature extraction models, skip connections can directly pass the initial connection information and features of nodes (leads) to subsequent convolutional layers. This allows the model to better utilize the original spatial connection information when updating node features and learning spatial relationships, thereby more accurately extracting spatial correlation features between different leads, such as the coordinated changes in voltage between different leads.
[0089] The spatial structure of an electrocardiogram (ECG) can vary due to individual differences, electrode placement, and other factors. Skip connections enable spatial feature extraction models to adapt more flexibly to these complex spatial variations. By directly transmitting raw spatial information, the model can better adjust its parameters during the learning process to adapt to different spatial patterns, thereby improving its ability to extract various ECG spatial features.
[0090] For time series data such as electrocardiograms (ECGs), historical information is crucial for prediction and classification. Time series feature extraction models with skip connections can directly pass information from earlier time steps to later processing stages. For example, in a recurrent neural network (RNN) or its variants (such as Long Short-Term Memory (LSTM) or Gated Recurrent Units (GRUs), skip connections can directly pass ECG waveform features from the first few time steps to later processing stages. This helps the model better utilize the complete information of the entire time series, especially for ECG features with long-term dependencies (such as periodic changes in arrhythmias), enabling more effective extraction. Skip connections can also help the model better learn the dynamic patterns of time series changes. By directly passing partial time series information, the model can more accurately capture the trends, periods, and fluctuations of the time series. For example, when extracting ECG time series features of atrial fibrillation, skip connections can help the model better learn the irregular rhythm features of atrial fibrillation, directly passing irregular waveform information from earlier time steps to subsequent processing, thereby improving the extraction efficiency of atrial fibrillation features.
[0091] See Figure 6 , Figure 6 An electrocardiogram (ECG) classification device provided in this application embodiment may include:
[0092] The first acquisition module 601 is used to sample an electrocardiogram to be classified and obtain sampled data.
[0093] The extraction module 602 is used to extract deep features, spatial features and time series features of the obtained sampled data by using a first feature extraction model, a second feature extraction model and a third feature extraction model, respectively. The first feature extraction model, the second feature extraction model and the third feature extraction model have different structures.
[0094] The fusion module 603 is used to fuse the deep features, the spatial features, and the time series features to obtain fused features;
[0095] The second acquisition module 604 is used to process the fused features through a classifier to obtain the classification result of the electrocardiogram.
[0096] The specific functions and effects of the aforementioned electrocardiogram (ECG) classification device can be explained by referring to other embodiments of this application, and will not be repeated here. Each sub-circuit in the ECG classification device can be implemented entirely or partially through software, hardware, or a combination thereof. Each sub-circuit can be embedded in or independent of the processor in a computer device in hardware form, or it can be stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each of the above sub-circuits.
[0097] Please see Figure 7 This application also provides a computer device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the electrocardiogram classification method described in any of the above embodiments. Please refer to [link to relevant documentation]. Figure 7 The computer device can be a classical computer or a quantum computer.
[0098] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a computer, causes the computer to perform the electrocardiogram classification method of any of the above embodiments.
[0099] This application also provides a computer program product containing instructions that, when executed by a computer, cause the computer to perform the electrocardiogram classification method described in any of the above embodiments.
[0100] It is understood that in the various embodiments of this application, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not limit the implementation process of the embodiments of this application in any way.
[0101] It is understood that the various implementation methods described in this application can be implemented individually or in combination, and the implementation methods in this application are not limited in this respect.
[0102] Unless otherwise stated, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The term "and / or" as used in this application includes any and all combinations of one or more of the associated listed items. The singular forms "a," "the," and "the" as used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0103] It is understood that the processor in the embodiments of this application can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method embodiments can be completed by the integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software sub-circuits in the decoding processor. The software sub-circuits can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above method.
[0104] It is understood that the memory in the embodiments of this application may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Specifically, non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may be random access memory (RAM). It should be noted that the memory in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0105] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0106] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the aforementioned method implementations, and will not be repeated here.
[0107] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0108] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0109] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0110] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0111] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method of electrocardiogram classification, characterized by, The method includes: Sample an electrocardiogram (ECG) to be classified to obtain sampled data; Based on the obtained sampled data, deep features, spatial features, and time series features of the sampled data are extracted using a first feature extraction model, a second feature extraction model, and a third feature extraction model, respectively. The first feature extraction model, the second feature extraction model, and the third feature extraction model have different structures. By fusing the deep features, the spatial features, and the time series features, a fused feature is obtained. The fused features are processed by a classifier to obtain the classification result of the electrocardiogram.
2. The method of claim 1, wherein, At least one of the first feature extraction model, the second feature extraction model, and the third feature extraction model is a quantum feature extraction model.
3. The method of claim 2, wherein, When the first feature extraction model, the second feature extraction model, and the third feature extraction model are not all quantum feature extraction models, the second sampling frequency is higher than the first sampling frequency. The first sampling frequency is the sampling frequency at which the first sub-sample data is obtained from the electrocardiogram, and the second sampling frequency is the sampling frequency at which the second sub-sample data is obtained from the electrocardiogram. The sampled data includes the first sub-sample data and the second sub-sample data. The first sub-sample data is used for feature extraction by the quantum feature extraction model, and the second sub-sample data is used for feature extraction by the classical feature extraction model.
4. The method of claim 1, wherein, The extracted deep features, spatial features, and time series features have the same dimension; The fusion feature is obtained by concatenating the deep feature, the spatial feature, and the time series feature; The classifier is a deep neural network composed of multiple fully connected layers.
5. The method as described in claim 2, characterized in that, The quantum feature extraction model is trained by updating parameters using the parameter shifting method.
6. The method as described in claim 1, characterized in that, In the first feature extraction model, the second feature extraction model, and the third feature extraction model, at least one feature extraction model has skip connections.
7. The method as described in claim 3, characterized in that, The quantum feature extraction model is deployed on a quantum computer in the cloud, and the classical feature extraction model is deployed on a classical computer in the cloud.
8. An electrocardiogram (ECG) classification device, characterized in that, The device includes: The first acquisition module is used to sample an electrocardiogram to be classified and obtain sampled data. The extraction module is used to extract deep features, spatial features and time series features of the obtained sampled data by using a first feature extraction model, a second feature extraction model and a third feature extraction model, respectively. The first feature extraction model, the second feature extraction model and the third feature extraction model have different structures. The fusion module is used to fuse the deep features, the spatial features, and the time series features to obtain fused features; The second acquisition module is used to process the fused features through a classifier to obtain the classification result of the electrocardiogram.
9. A computer device comprising a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the electrocardiogram classification method of any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, which, when executed by a computer, causes the computer to perform the electrocardiogram classification method of any one of claims 1-7.