Electrocardiosignal personalized classification method based on quantum features and meta learning and medium
By combining quantum features with meta-learning to classify ECG signals, the problem of slow ECG model adaptation and large individual differences under small sample conditions is solved, realizing fast and accurate personalized ECG analysis and improving classification accuracy and environmental robustness.
Patent Information
- Application Number
- CN202511620350.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-06
- Publication Date
- 2026-01-06
AI Technical Summary
Existing ECG signal analysis methods are slow to adapt to small sample conditions, have large individual differences, and are difficult to effectively integrate global and local features, resulting in insufficient classification accuracy and personalization level, which cannot meet the low power consumption and real-time response requirements of wearable devices.
An electrocardiogram (ECG) signal classification method combining quantum features and meta-learning is adopted. Global nonlinear features are extracted through quantum principal component analysis, local waveform features are extracted by combining one-dimensional convolutional neural networks, and personalized classification models are generated through training using a model-independent meta-learning framework.
Achieving rapid personalized adaptation with a small number of labeled samples improves the accuracy and personalization of ECG analysis, reduces computational overhead and time delay, and enhances the system's stability in low signal-to-noise ratio environments.
Smart Images

Figure CN121278490A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the fields of electrocardiogram (ECG) signal analysis and edge artificial intelligence technology, specifically relating to a personalized ECG signal classification method and medium based on quantum features and meta-learning. Background Technology
[0002] Electrocardiogram (ECG) signals are crucial for the diagnosis of cardiovascular diseases, and automated analysis technology is essential for real-time health monitoring on wearable devices. However, existing AI-based ECG analysis methods face three major challenges in their practical application:
[0003] First, there are significant differences between individual electrocardiogram (ECG) signals, and in practical applications, obtaining a large amount of labeled ECG data for new users is costly and impractical. This leads to a serious small-sample adaptation problem in traditional deep learning models, meaning that the model performs well on the training set, but its classification accuracy drops significantly when facing new users due to differences in data distribution.
[0004] Secondly, existing adaptation methods (such as traditional transfer learning) typically require updating the entire model or most of its parameters, resulting in high computational costs and slow fine-tuning speeds, which cannot meet the stringent requirements of wearable devices for low power consumption and real-time response. Although meta-learning frameworks theoretically support rapid adaptation, their noise robustness to complex physiological signals still needs improvement, limiting their reliability in real-world scenarios.
[0005] Furthermore, at the feature extraction level, traditional linear dimensionality reduction methods (such as Principal Component Analysis (PCA) struggle to effectively capture the complex global nonlinear features in electrocardiogram (ECG) signals; while conventional convolutional neural networks focus too much on local morphological details and lack the ability to model the global context of ECG rhythm. A single feature extraction method is insufficient to form a comprehensive and robust feature representation, thus limiting further improvements in model performance.
[0006] Chinese patent document CN105902266A discloses a method for classifying electrocardiogram (ECG) signals based on a self-organizing neural network. The method first reads the QRS feature vector. It then performs an inner product of the QRS feature vector with all weight vectors to find the winning neuron. The weight vectors within the neighborhood of the winning neuron are adjusted to favor the input QRS feature vector. This inner product process is repeated for all QRS feature vectors with the weight vectors. The learning rate and neighborhood range are adjusted according to the level of data training, and the above process is repeated until the system energy stabilizes. Once the system energy stabilizes, the method stops and outputs the classification result. This prior art does not require extensive pre-training with data. The weight vectors are initialized with random values, making them suitable for various diseases and patients. Once the parameters are set, it is simple and easy to use. However, this prior art lacks pre-processing or anti-interference mechanisms for noise signals, making it susceptible to electromyographic interference and power frequency interference in ECG signals in practical applications, resulting in insufficient robustness and generalization ability.
[0007] Chinese patent document CN117708670A discloses a method, device, and storage medium for constructing an electrocardiogram (ECG) signal classification and prediction model. This method trains a base learner using raw ECG data, then combines the trained base learner with the raw ECG data to train a meta-learner, ultimately combining the trained base learner and the trained meta-learner to form an ECG signal classification and prediction model. This prior art ECG signal classification and prediction model is based on an ensemble of multiple different base learners, and then constructs a meta-learner based on the prediction results, which can avoid erroneous predictions from individual learners. However, it relies on a large amount of raw ECG data with actual class labels, and has poor applicability in unlabeled data or small sample scenarios. It requires building multiple base learners and training them separately, as well as additionally training a meta-learner, resulting in a multi-layered model architecture and a time-consuming training process.
[0008] Therefore, there is an urgent need in this field for an ECG signal classification method that can achieve rapid, accurate, and personalized adaptation with a small number of labeled samples, and can integrate global and local features to improve noise robustness, so as to promote the true intelligence of wearable medical devices. Summary of the Invention
[0009] The technical problem to be solved by this invention is to provide a personalized classification method for electrocardiogram (ECG) signals based on quantum features and meta-learning. This method can solve the problems of slow ECG model adaptation speed and large individual differences under small sample conditions, thereby improving the accuracy and personalization level of ECG analysis.
[0010] To address the aforementioned technical problems, a first aspect of the present invention provides a personalized classification method for electrocardiogram signals based on quantum features and meta-learning, specifically comprising the following steps:
[0011] S1 ECG signal preprocessing: Preprocessing of several raw ECG signals acquired, including sampling rate setting, baseline correction and bandpass filtering, to obtain preprocessed ECG signals;
[0012] S2 Dual-Stream Feature Extraction: First, quantum global feature extraction is used to extract the preprocessed ECG signal to obtain the first feature vector; then, local waveform features of the preprocessed ECG signal are extracted to obtain the second feature vector.
[0013] S3 Feature Fusion: The first feature vector and the second feature vector are concatenated by channels, and the concatenated fusion vector is normalized to unify the dimensions of different feature dimensions and form a unified dual-stream fusion feature representation.
[0014] S4 Meta-learning General Model Training: Based on the model-independent meta-learning framework, the ECG analysis model is meta-trained using the dual-stream fusion features to obtain a general ECG analysis model;
[0015] S5 Personalized Dual-Stream Fusion Features: Acquire short-term ECG data of the target user and process it sequentially through steps S1 to S3 to obtain personalized dual-stream fusion features of the target user; input the personalized dual-stream fusion features into the general ECG analysis model, and perform a small number of iterations of gradient descent fine-tuning with the goal of minimizing the loss of the target user's data, and finally generate a personalized classification model suitable for the target user.
[0016] The above technical solution involves first preprocessing the electrocardiogram (ECG) signal, then using a classical computer-simulated quantum principal component analysis (QPCA) algorithm to extract global nonlinear features, and simultaneously combining this with a one-dimensional convolutional neural network to extract local waveform morphological features. These two methods are then fused to form a dual-stream feature representation. A model-independent meta-learning framework is used to train a general ECG analysis model using multi-user data. When adapting to new users, only a small amount of short-term data is needed, and a high-precision personalized classification model can be generated through rapid fine-tuning. This invention effectively solves the problems of slow ECG model adaptation speed and large individual differences under small sample conditions, improving the accuracy and personalization level of ECG analysis.
[0017] Preferably, in step S1, the preprocessing sampling rate is set to 250-500Hz, and the bandpass filtering range is 0.5-40Hz; baseline correction is achieved using morphological filtering or polynomial fitting methods; wherein, the morphological filtering is achieved through morphological opening operations, specifically by selecting a flattened structuring element S for the electrocardiogram signal. After performing the erosion operation (⊖), a dilation operation (⊕) is performed to obtain the estimated baseline signal. The length L of the structuring element S is based on the sampling rate of the electrocardiogram signal. Set, satisfy Alternatively, the polynomial fitting is achieved through the following steps: performing a k-th order polynomial on the electrocardiogram signal sequence. The fitting process involves a polynomial order k ranging from 3 to 5, followed by subtracting the fitted baseline drift component from the original signal. The corrected signal is obtained.
[0018] Preferably, step S1 further includes dynamic filtering: the preprocessed ECG signal is enhanced using a dynamic filtering algorithm based on a quantum noise model; the specific steps of the dynamic filtering algorithm include:
[0019] For the preprocessed ECG signal sequence Through a threshold function based on probability amplitude The signal is processed to obtain the filtered signal. : ;
[0020] in, It is a dynamically adaptive threshold, the value of which is determined by the statistical characteristics within the local window of the signal; The quantum fluctuation intensity parameter controls the smoothness of the filtering transition. This dynamic filtering algorithm is a nonlinear filtering method inspired by the quantum tunneling effect. The algorithm processes the signal through a threshold function based on probability amplitude, intelligently distinguishing useful signal features from noise. Its core lies in simulating the tunneling behavior of a quantum system in front of a potential barrier, probabilistically attenuating signal components exceeding a specific threshold rather than simply truncating them, thereby better preserving the signal's edges and subtle features while suppressing noise.
[0021] Preferably, the specific steps of step S2 are as follows:
[0022] S21 Quantum Global Feature Extraction: The quantum principal component analysis algorithm simulated by classical computer is used to reduce the dimensionality of the preprocessed signal to obtain the first feature vector;
[0023] S22 Local Waveform Morphology Features: A one-dimensional convolutional neural network is used to extract the waveform morphology features of the preprocessed signal to obtain the second feature vector.
[0024] The quantum principal component analysis algorithm extracts global nonlinear features by treating the signal covariance matrix as a density matrix and performing eigenvalue decomposition and projection. The one-dimensional convolutional neural network automatically learns and extracts local morphological details of the electrocardiogram through its multi-layer convolution and activation operations. The feature retention rate after dimensionality reduction by the quantum principal component analysis algorithm is controlled between 90% and 98%, preferably 95%.
[0025] Preferably, the specific steps of step S21 are as follows:
[0026] S211: Construct a matrix X from the preprocessed ECG signal segments and perform zero-mean normalization to obtain X'; calculate the covariance matrix C of X' and treat it as a density matrix. ;
[0027] S212: Yes Perform eigenvalue decomposition To obtain eigenvalues and eigenvectors;
[0028] S213: Based on the preset feature retention rate The first k principal components are selected to form the projection matrix. Ultimately passed The projection yields the first eigenvector;
[0029] The specific steps of step S22 are as follows:
[0030] S221: First, through convolution operations... A linear output is obtained;
[0031] S222: Then activated by the ReLU function Output the feature map, that is, obtain the j-th feature map of the l-th layer of the one-dimensional convolutional neural network;
[0032] S223: After passing through multiple convolutional layers, the output of the final convolutional layer is subjected to global average pooling to obtain the second feature vector. .
[0033] Preferably, the one-dimensional convolutional neural network used in step S22 includes multiple convolutional layers, and its convolutional kernel size includes at least one of 3×1 and 5×1.
[0034] Preferably, the one-dimensional convolutional neural network used in step S22 includes two convolutional layers. The first layer uses 16 5×1 convolutional kernels, and the second layer uses 32 3×1 convolutional kernels. The stride of both layers is 1, and the activation function is ReLU.
[0035] Preferably, the normalization process in step S3 is a standardization process based on overall data statistics, using Z-Score standardization, with the formula:
[0036] ;
[0037] in, This is the initial fusion vector after channel concatenation. These are the mean vectors of each dimension calculated based on the training dataset during the meta-training phase. These are the standard deviation vectors of each dimension calculated based on the training dataset during the meta-training phase. This is the fusion vector after normalization.
[0038] The normalization process in step S3 is Z-Score standardization, which subtracts the mean vector calculated based on the training dataset in the meta-training stage from the initial fusion vector obtained after channel concatenation, and divides it by the standard deviation vector calculated in the same meta-training stage, so that the fused feature representation conforms to a distribution with a mean of 0 and a standard deviation of 1.
[0039] Preferably, the specific steps for obtaining the general model for electrocardiogram analysis through meta-training in step S4 are as follows:
[0040] S41: Sample from multiple user data to construct multiple meta-learning tasks, with each task's data divided into a support set and a query set;
[0041] S42: Subsequently, for each task, the cross-entropy loss is calculated using the data from its support set, and a gradient descent update is performed on the current parameters of the model to obtain the adaptation parameters for that task. This process is called inner loop fast adaptation.
[0042] S43: Subsequently, based on the sum of the losses of all tasks on the query set under their adaptation parameters, a gradient descent update is performed on the initial parameters of the model to minimize the expected loss of all tasks. This process is called outer loop meta-optimization.
[0043] S44: By iteratively executing the process of rapid adaptation of the inner loop and optimization of the outer loop, a set of initial parameters of the model with rapid adaptability is obtained, which is the general model for electrocardiogram analysis.
[0044] Preferably, in step S4, the number of iterations for the inner loop fast adaptation is 1 to 5, and the learning rate is set to... The learning rate used in the outer loop optimization is... The termination condition of the iterative process is reaching a preset number of outer loop iterations, which ranges from 10,000 to 50,000 times.
[0045] Preferably, the loss in step S5 is a cross-entropy loss function. The formula is:
[0046] ;
[0047] in, Loss is an abbreviation for Loss, representing the loss value, which is a quantitative indicator of how well the model performs on the current data; the goal of the fine-tuning process is to iteratively reduce this value through gradient descent; N (Batch Size) represents the number of target user ECG signal samples contained in a training batch; C (Number of Classes) represents the total number of ECG signal classification categories. (Ground Truth) represents the true label of the i-th sample, using one-hot encoding. (PredictedProbability) represents the probability that the personalized classification model predicts that the i-th sample belongs to category c.
[0048] In step S5, the cross-entropy loss function is used to calculate the difference between the model's predicted probability distribution and the actual label distribution of the target user's ECG data.
[0049] Preferably, the number of iterations for fine-tuning in step S5 is 5 to 15 (preferably 10), and the learning rate is set to... The ECG data of the target users used were 3 to 8 minutes in length.
[0050] Preferably, the electrocardiogram signal comes from a single-lead or multi-lead electrocardiogram signal from a wearable device, and the classification result output by the personalized classification model includes one or more of the following: normal heartbeat, atrial premature beats, ventricular premature beats, and atrial fibrillation.
[0051] A second aspect of the present invention provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores an electrocardiogram (ECG) signal classification program, which, when executed by a processor, implements the steps of the personalized ECG signal classification method described in the first aspect of the present invention.
[0052] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0053] (1) By fusing quantum principal component analysis with the dual-stream features of convolutional neural networks, a complementary and robust characterization of the global nonlinear characteristics and local morphological details of electrocardiogram signals is achieved, laying a solid foundation for high-precision classification.
[0054] (2) With the help of the model-independent meta-learning framework, the model can be quickly fine-tuned by using only a very small amount of data from new users (3-8 minutes) and a small number of iterations (5-15 times), which can achieve efficient personalized adaptation, significantly overcome the problem of individual differences, and greatly reduce the computational overhead and time delay caused by traditional transfer learning.
[0055] (3) In addition, the optional quantum noise filtering enhancement strategy is combined to improve the stability of the system in practical application environments with low signal-to-noise ratio. In summary, the present invention has achieved significant technical progress in addressing key challenges such as adaptation speed, individualization accuracy, and environmental robustness under small sample conditions. Attached Figure Description
[0056] Figure 1 This is a flowchart of the personalized electrocardiogram signal classification method based on quantum features and meta-learning of the present invention. Detailed Implementation
[0057] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings. The following embodiments are only used to illustrate the technical solutions of the present invention more clearly, and should not be used to limit the scope of protection of the present invention.
[0058] Those skilled in the art will understand that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless defined as herein.
[0059] Example: Figure 1 As shown, the personalized classification method for electrocardiogram signals based on quantum features and meta-learning specifically includes the following steps:
[0060] S1 ECG signal preprocessing: Preprocessing of several raw ECG signals acquired, including sampling rate setting, baseline correction and bandpass filtering, to obtain preprocessed ECG signals;
[0061] In step S1, the preprocessing sampling rate is set to 250-500Hz, and the bandpass filtering range is 0.5-40Hz; baseline correction is achieved using morphological filtering or polynomial fitting methods; wherein, the morphological filtering is achieved through morphological opening operations, and the specific steps are as follows:
[0062] A flat structural element S is selected for electrocardiogram signals. After performing the etching operation;
[0063] Then perform the dilation operation ⊕ to obtain the estimated baseline signal. ;
[0064] The length L of the structuring element S is based on the sampling rate of the electrocardiogram signal. Set, satisfy ;
[0065] Alternatively, the polynomial fitting is achieved through the following steps: performing a k-th order polynomial on the electrocardiogram signal sequence. The fitting process involves a polynomial order k ranging from 3 to 5, followed by subtracting the fitted baseline drift component from the original signal. The corrected signal is obtained.
[0066] In some specific embodiments, the morphological filtering is implemented as follows: the morphological opening operation can effectively filter out positive spike pulses (such as QRS waves) in the signal, thereby retaining and extracting the low-frequency components representing baseline drift; its mathematical expression is:
[0067] ;
[0068] in, : Represents the original input electrocardiogram signal; Represents morphological operation symbols;
[0069] S: Represents a flat structural element, usually a horizontal line segment; its shape and length determine the smoothness of the baseline components that can be extracted.
[0070] ⊖: Indicates an etching operation; This operation will "shrink" the signal, reducing the peak value.
[0071] ⊕ indicates an expansion operation; This operation will "expand" the signal, filling in the depressions caused by corrosion.
[0072] : This represents the estimated baseline obtained after the opening operation; ultimately, the baseline-corrected signal is derived from the original signal. Subtract the estimated baseline get;
[0073] The length L of the structuring element S is a key parameter and needs to be determined based on the sampling rate of the electrocardiogram signal. Setting: To ensure coverage of the baseline segment between at least two consecutive heartbeats, its length should meet the following requirements. Specifically, the implementation steps of the polynomial fitting are as follows: the method regards the baseline drift as a smooth low-frequency trend and approximates the trend with a low-order polynomial.
[0074] Suppose the electrocardiogram signal sequence consists of N data points The structure is defined as follows, where i represents the i-th data point; For a point in time, The corresponding amplitude is used; a k-th order polynomial is used for fitting: Find a set of coefficients using the least squares method This makes the polynomial curve With the original signal The overall deviation is minimized, that is, the objective function is minimized. Finally, the corrected signal for: ;
[0075] in, : is a polynomial in The value at that position represents the estimated baseline drift. It represents the amplitude of the pure ECG signal after removing baseline drift; the choice of the polynomial order k is crucial; too low an order (e.g.) Unable to effectively fit complex drifts, order is too high (e.g.) If the value of k is not properly adjusted, it may overfit and mistakenly remove useful low-frequency components (such as the end of the T wave) from the ECG signal as the baseline. Therefore, the preferred value of k is 3 to 5.
[0076] Step S1 further includes dynamic filtering: the preprocessed ECG signal is enhanced using a dynamic filtering algorithm based on a quantum noise model. This dynamic filtering algorithm is a nonlinear filtering method inspired by the quantum tunneling effect, which derives from the tunneling effect in quantum mechanics, where microscopic particles have a certain probability of crossing a potential barrier higher than their own energy. In signal processing, large-amplitude instantaneous impulse noise is considered a "potential barrier" that needs to be crossed, while useful ECG features (such as QRS waves) are considered "particles" that should be retained. This algorithm implements this idea through a nonlinear threshold function, and its specific steps include:
[0077] For the preprocessed ECG signal sequence Through a threshold function based on probability amplitude The signal is processed to obtain the filtered signal. :
[0078] ;
[0079] in, This represents the input electrocardiogram signal sequence after preliminary preprocessing;
[0080] y This represents the output signal sequence after processing by the dynamic filtering algorithm. This indicates a dynamically adaptive threshold. This threshold is not a fixed value, but is dynamically calculated based on the root mean square (RMS) value or median absolute value (MAD) within a local window of the signal. For example... k is an adjustable parameter. This allows the algorithm to adapt to changes in signal strength; This represents the quantum fluctuation intensity parameter, a key control parameter that simulates the uncertainty or fluctuations in a quantum system. The value of determines the smoothness of the transition zone between "full retention" and "significant decay". Smaller values... This will make the filtering behavior closer to the traditional hard threshold, resulting in a sharp transition; a larger... This makes the attenuation smoother, mimicking the probabilistic nature of quantum tunneling. It can suppress noise while minimizing Gibbs ringing or distortion of useful signals (especially sharp QRS waves), thus better preserving waveform morphology details.
[0081] Index Term This is the core "tunneling probability" simulation term. When the signal amplitude... Far exceeding the threshold When the signal amplitude is close to 0, the value of the exponent term approaches 0, causing the sampling point to be strongly attenuated (failing to tunnel); when the signal amplitude is near the threshold, the value of the exponent term is between 0 and 1, producing smooth attenuation (tunneling with a certain probability), which is the key to the algorithm's ability to process signals gently and preserve details.
[0082] The filtering algorithm aims to enable subsequent analysis methods to maintain a classification accuracy of over 85% even in poor environments with a signal-to-noise ratio of 8dB to 15dB.
[0083] S2 Dual-Stream Feature Extraction: First, quantum global feature extraction is used to extract the preprocessed ECG signal to obtain the first feature vector. Then, local waveform features of the preprocessed electrocardiogram signal are extracted to obtain the second feature vector. ;
[0084] The specific steps of step S2 are as follows:
[0085] S21 Quantum Global Feature Extraction: The quantum principal component analysis algorithm simulated by classical computer is used to reduce the dimensionality of the preprocessed signal to obtain the first feature vector;
[0086] S22 Local Waveform Morphology Features: A one-dimensional convolutional neural network is used to extract the waveform morphology features of the preprocessed signal to obtain the second feature vector.
[0087] The specific steps of step S21 are as follows:
[0088] S211 Data Preparation and Density Matrix Construction: Constructing a matrix from preprocessed ECG signal segments. (where m is the number of samples and p is the signal length), and then zero-mean processing is performed to obtain... ;calculate covariance matrix And treat it as a density matrix ;
[0089] S212 eigenvalue decomposition: and treat it as a density matrix ;right Perform eigenvalue decomposition To obtain eigenvalues and eigenvectors; specifically: for the density matrix Eigenvalue decomposition, mathematically expressed as:
[0090] ;
[0091] in, For eigenvalue diagonal matrices V is the corresponding eigenvector matrix;
[0092] S213 Principal Component Projection: Based on the preset feature retention rate The first k principal components are selected to form the projection matrix. Ultimately passed The projection yields the first feature vector; specifically, it is based on a preset feature retention rate. (Its value is controlled between 90% and 98%, preferably 95%), select those that meet the conditions. The smallest k principal components form the projection matrix. Finally, the first eigenvector is obtained through projection: ;
[0093] The one-dimensional convolutional neural network used in step S22 includes multiple convolutional layers, and its kernel size includes at least one of 3×1 and 5×1; the specific steps of step S22 are as follows:
[0094] S221: First, through convolution operations... A linear output is obtained;
[0095] S222: Then activated by the ReLU function Output the feature map, that is, obtain the j-th feature map of the l-th layer of the one-dimensional convolutional neural network;
[0096] S223: After passing through multiple convolutional layers, the output of the final convolutional layer is subjected to global average pooling to obtain the second feature vector. .
[0097] In some specific embodiments, a preferred implementation of the one-dimensional convolutional neural network includes two convolutional layers, and its information transmission process is defined by the following formula:
[0098] The generation process of the j-th feature map in layer l is as follows:
[0099] ;
[0100] ;
[0101] Where * denotes a one-dimensional convolution operation;
[0102] This is the output activation value of the i-th feature map in the (l-1)-th layer. For the input of the first convolutional layer... This refers to the preprocessed electrocardiogram signal;
[0103] These are the convolutional kernel weights that connect the i-th feature map in layer (l-1) to the j-th feature map in layer l; their size is at least one of 3×1 and 5×1.
[0104] It is the bias term of the j-th feature map in the l-th layer;
[0105] It is a linear output after convolution without an activation function;
[0106] It is a linear rectification activation function;
[0107] Specifically, the network parameters of the preferred embodiment are as follows: the first convolutional layer uses 16 convolutional kernels of size 5×1, the second convolutional layer uses 32 convolutional kernels of size 3×1, and the stride is 1 for both.
[0108] The second feature vector The feature maps output from the second convolutional layer are concatenated after global average pooling.
[0109] S3 Feature Fusion: The first feature vector is then fused... With the second feature vector Channel concatenation is performed, and the concatenated fusion vector is then normalized. Specifically, the normalization process uses the Z-Score standardization method, and its specific steps are as follows:
[0110] S31 Channel Concatenation: By directly concatenating the first feature vector With the second feature vector This forms the initial fusion vector: .in, ,and .
[0111] S32 Z-Score Standardization: The initial fusion vector is processed using the following formula:
[0112] ;
[0113] in, It is the initial fusion vector In the meta-training phase (S4), the mean vectors of each dimension are calculated based on the entire meta-training dataset. This is the fusion vector after normalization. It is the initial fusion vector In the meta-training phase (S4), the standard deviation vectors of each dimension are calculated based on the entire meta-training dataset; the subtraction and division in the formula are element-wise operations.
[0114] Through this processing, the dual-stream fusion feature representation By unifying the units of measurement, the convergence of subsequent model training is effectively accelerated and the stability is improved.
[0115] S4 Meta-learning General Model Training: Based on the model-independent meta-learning framework, the ECG analysis model is meta-trained using the dual-stream fusion features to obtain a general ECG analysis model;
[0116] The specific steps of the meta-training in step S4 are as follows:
[0117] S41: Construct M meta-learning tasks by sampling from multiple user data sets. The data for each task is divided into support sets. With query set ;
[0118] S42: Subsequently, for each task, the cross-entropy loss is calculated using the data from its support set, and a gradient descent update is performed on the current parameters of the model to obtain the adaptation parameters for that task. This process is called the inner loop fast adaptation; the formula for the cross-entropy loss is:
[0119] ;
[0120] in, This indicates the current parameters of the electrocardiogram analysis model; Indicates task Support set The number of samples in the dataset; C represents the total number of categories for ECG signal classification; It is a one-hot encoded vector representing the true class label of the j-th sample in the support set, where the true class of sample j is c. Otherwise, it is 0; : Indicates the electrocardiogram analysis model in terms of parameters Predict the probability that the j-th sample belongs to class c;
[0121] The formula for obtaining the adaptation parameters for this task is: ;
[0122] In some specific embodiments, the number of iterations for fast adaptation in the inner loop is 1 to 5 (preferably 3), and the learning rate is... Set as (Preferred) );
[0123] S43: Subsequently, based on the sum of the losses of all tasks on the query set under their adapted parameters, the initial parameters of the model are adjusted. Perform a gradient descent update (this process is called outer loop optimization), where the formula for the sum of losses is: , ;
[0124] In some specific embodiments, the learning rate used in outer loop optimization is... for (Preferred) );
[0125] S44: By iterating the above process, the process terminates when the preset number of outer loop iterations (10,000 to 50,000 times) is reached, and a general model for electrocardiogram analysis is obtained through optimization.
[0126] S5 Personalized Dual-Stream Fusion Features: Acquire short-term ECG data of the target user and process it sequentially through steps S1~S3 to obtain personalized dual-stream fusion features of the target user; input the personalized dual-stream fusion features into the general ECG analysis model, and perform a small number of iterations of gradient descent fine-tuning with the goal of minimizing the loss of the target user's data, and finally generate a personalized classification model suitable for the target user;
[0127] Specifically, the loss in step S5 is calculated using the cross-entropy loss function, the formula of which is:
[0128] ;
[0129] in, (Loss): Represents the loss value, a quantitative indicator of how well the model performs on the current data. The goal of fine-tuning is to iteratively reduce this value through gradient descent.
[0130] N (Batch Size): Represents the number of target user ECG signal samples contained in a training batch;
[0131] C (Number of Classes): Represents the total number of categories for classifying electrocardiogram signals, consistent with the categories defined in the instruction manual;
[0132] (Ground Truth): Represents the true label of the i-th sample, using one-hot encoding;
[0133] (Predicted Probability): Represents the probability that the personalized classification model predicts that the i-th sample belongs to category c; this loss function measures the difference between the probability distribution predicted by the model and the true label distribution; by calculating the gradient of this loss with respect to the model parameters and updating the parameters in the opposite direction of the gradient, effective fine-tuning of the target user data can be achieved.
[0134] The number of iterations for fine-tuning in step S5 is 5 to 15 (preferably 10), and the learning rate is set to... The ECG data of the target users used were 3 to 8 minutes in length;
[0135] In this embodiment, the electrocardiogram signal comes from a single-lead or multi-lead electrocardiogram signal from a wearable device, and the classification result output by the personalized classification model includes one or more of the following: normal heartbeat, atrial premature beats, ventricular premature beats, and atrial fibrillation.
[0136] The computer-readable storage medium stores an electrocardiogram (ECG) signal classification program, which, when executed by a processor, implements the steps of the personalized ECG signal classification method described in the first aspect of the present invention.
[0137] For those skilled in the art, the specific embodiments are merely illustrative descriptions of the present invention. Obviously, the specific implementation of the present invention is not limited to the above-described manner. Any non-substantial improvements made using the inventive concept and technical solution of the present invention, or the direct application of the inventive concept and technical solution to other situations without modification, are all within the protection scope of the present invention.
Claims
1. A method for electrocardiogram personalized classification based on quantum feature and meta-learning, characterized in that, Specifically comprising the following steps: S1 ECG signal preprocessing: preprocessing several original ECG signals collected, including sampling rate setting, baseline correction and band pass filtering, to obtain preprocessed ECG signals; S2 dual-flow feature extraction: extracting the preprocessed ECG signals using quantum global feature extraction to obtain a first feature vector; at the same time, extracting the local waveform features of the preprocessed ECG signals to obtain a second feature vector; S3 feature fusion: concatenating the first feature vector and the second feature vector, and normalizing the fused vector after concatenation to unify the dimensions of different feature dimensions, forming a unified dual-flow fusion feature representation; S4 meta-learning general model training: based on a model-independent meta-learning framework, the dual-flow fusion features are used to meta-train the ECG analysis model to obtain an ECG analysis general model; S5 personalized dual-flow fusion features: obtaining ECG data of a target user, and sequentially processing through steps S1-S3 to obtain personalized dual-flow fusion features of the target user; The personalized dual-flow fusion features are input into the ECG analysis general model, and iterative gradient descent fine-tuning is performed to minimize the loss of the target user data, and finally a personalized classification model suitable for the target user is generated.
2. The electrocardiosignal personalized classification method based on quantum feature and meta-learning according to claim 1, characterized in that, In the step S1, the preprocessing sampling rate is set to 250-500Hz, and the band pass filtering range is 0.5-40Hz; the baseline correction is realized by morphological filtering or polynomial fitting method; wherein the morphological filtering is realized by morphological opening operation, and the specific steps are as follows: A flat structuring element S is chosen for the ECG signal after the etching operation performing an inflation operation to obtain an estimated baseline signal ; The length L of the structure element S is dependent on the sampling rate of the electrocardiogram signal is set to satisfy ; Alternatively, the polynomial fitting is achieved by performing a kth order polynomial fit on the sequence of electrocardiogram signals, where k is an integer in the range of 3 to 5, and subtracting the fitted baseline wander component from the original signal to obtain a corrected signal. Alternatively, the polynomial fitting is achieved by performing a kth order polynomial 3. The electrocardiosignal personalized classification method based on quantum feature and meta-learning according to claim 1, characterized in that, In the step S1, dynamic filtering processing is also included: the preprocessed ECG signal is enhanced by a dynamic filtering algorithm based on quantum noise model; The dynamic filtering algorithm is a nonlinear filtering method inspired by quantum tunneling effect, and its specific steps include: For the pre-processed electrocardiogram signal sequence , a filtered signal is obtained by processing through a threshold function based on the probability amplitude : ; wherein, represents the input ECG signal sequence after preliminary preprocessing; y represents the output signal sequence after processing by the dynamic filtering algorithm; is a dynamic adaptive threshold, whose value is determined by the statistical characteristics within the local window of the signal; is a quantum fluctuation intensity parameter, which controls the transition smoothness of the filtering.
4. The electrocardiosignal personalized classification method based on quantum feature and meta-learning according to claim 3, characterized in that, The specific steps of the step S2 are as follows: S21 quantum global feature extraction: using a quantum principal component analysis algorithm simulated by a classical computer to reduce the dimension of the preprocessed signal to obtain a first feature vector; S22 local waveform feature: a one-dimensional convolutional neural network is used to extract the waveform feature of the preprocessed signal to obtain a second feature vector.
5. The electrocardiosignal personalized classification method based on quantum feature and meta-learning according to claim 3, characterized in that, The specific steps of the step S21 are as follows: S211: The preprocessed ECG signal segment is constituted into a matrix X and zero-mean processing is performed to obtain X'; the covariance matrix C of X' is calculated and taken as a density matrix ; S212: performing eigen decomposition on the matrix to obtain eigenvalues and eigenvectors S213: according to the preset feature retention rate Select the first k principal components to form a projection matrix Finally, through Projection to obtain the first feature vector The specific steps of the step S22 are as follows: S221: First by convolution operation get linear output; S222: pass through a ReLU activation function again output the feature map, i.e., obtain the jth feature map of the lth layer of the one-dimensional convolutional neural network; S223: sequentially passing through a plurality of convolutional layers, performing global average pooling on an output of a final convolutional layer, and obtaining a second feature vector .
6. The method of claim 1, wherein, The normalization processing in the step S3 is a standardization processing based on overall data statistics, using Z-Score standardization, and the formula is as follows: ; wherein, is an initial fusion vector after channel splicing, is a mean vector of each dimension calculated based on the training data set in the meta-training stage, is a standard deviation vector of each dimension calculated based on the training data set in the meta-training stage; is a normalized fusion vector.
7. The electrocardiosignal personalized classification method based on quantum feature and meta-learning according to claim 6, characterized in that, The specific steps of obtaining the ECG analysis general model in the step S4 are as follows: S41: sampling and constructing a plurality of meta-learning tasks from a plurality of user data, and dividing the data of each task into a support set and a query set; S42: then, for each task, the cross-entropy loss is calculated using the data of the support set and a step of gradient descent update is performed on the current parameters of the model to obtain the adaptation parameters of the task, and this process is called inner loop fast adaptation; S43: then, based on the sum of the losses of all tasks on the query set under their adaptation parameters, a gradient descent update is performed on the initial parameters of the model to minimize the expected loss of all tasks, and this process is called outer loop meta-optimization; S44: A process of fast adaptation of the inner loop and meta-optimization of the outer loop is iteratively performed to optimize a set of adaptive model initial parameters, i.e., a general model for electrocardiogram analysis.
8. The electrocardiosignal personalized classification method based on quantum feature and meta-learning according to claim 1, characterized in that, The iteration number of the inner loop fast adaptation in the step S4 is 1-5 times, and the learning rate is set to ; the learning rate used in the outer loop element optimization is ; and the termination condition of the iteration process is to reach the preset outer loop iteration number, which ranges from 10,000 to 50,000 times.
9. The electrocardiosignal personalized classification method based on quantum feature and meta-learning according to claim 1, characterized in that, The loss in the step S5 adopts a cross-entropy loss function The formula is: ; wherein, Loss is an abbreviation for loss value, which is a quantitative indicator of how well the model performs on the current data; N represents the number of target user electrocardio signal samples contained in a training batch; C represents the total number of electrocardio signal categories; represents the true label of the i-th sample, in the form of one-hot encoding; represents the prediction probability of the personalized classification model that the i-th sample belongs to category c. The iteration number of the fine tuning in the step S5 is 5-15 times, and the learning rate is set to ; the length of the electrocardiogram data of the target user used is 3-8 minutes; The electrocardio signal in the step S1 is a single-lead or multi-lead electrocardiogram signal from a wearable device, and the classification result output by the personalized classification model includes one or more of normal heartbeat, atrial premature beat, ventricular premature beat, and atrial fibrillation.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores an electrocardio signal classification program, and the electrocardio signal classification program is executed by the processor to implement the steps of the personalized classification method of the electrocardio signal according to any one of claims 1-9.
Citation Information
Patent Citations
Electrocardiographic signal classification method based on self-organizing neural network
CN105902266A
Electrocardiosignal classification prediction model construction method and device and storage medium
CN117708670A