Intelligent electrocardiosignal classification method based on mixed cross-correlation distance
By combining the segmented aggregation approximation PAA algorithm with the hybrid cross-correlation distance, the problem of low computational efficiency in ECG signal classification is solved, achieving high-precision and low-latency ECG signal classification, which is suitable for resource-constrained medical monitoring systems.
Patent Information
- Application Number
- CN202511715254.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-21
- Publication Date
- 2026-02-17
AI Technical Summary
Existing automatic ECG signal classification technologies have low computational efficiency when dealing with waveform morphology changes and phase shifts, making it difficult to balance overall morphological similarity with local features. Furthermore, they have high computational overhead, making them difficult to deploy efficiently in resource-constrained devices.
The segmented aggregation approximation PAA algorithm is used for dimensionality reduction and compression. The hybrid cross-correlation distance of global and local cross-correlation distances is combined for ECG signal classification. Efficient classification is achieved through fast Fourier transform and majority voting principle.
While ensuring high classification accuracy, it significantly reduces computational complexity, meeting the requirements of modern medical monitoring systems for high accuracy, low latency, and high robustness.
Smart Images

Figure CN121542877A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of time series analysis and intelligent classification technology, and in particular to an intelligent classification method for electrocardiogram signals based on hybrid cross-correlation distance. Background Technology
[0002] Electrocardiography (ECG), as a non-invasive and convenient method for assessing cardiac function, plays a crucial role in the early screening and diagnosis of diseases such as arrhythmias, myocardial infarction, and cardiac structural abnormalities. It is also an important basis for doctors to diagnose and treat cardiovascular diseases. Intelligent analysis of ECG signals can assist doctors in quickly and accurately identifying abnormal heart rhythms, which is of great significance for the development of remote monitoring, wearable devices, and intelligent diagnostic systems.
[0003] In the intelligent classification task of electrocardiogram (ECG) signals, existing research mainly adopts traditional machine learning methods and deep learning methods. Traditional methods usually rely on "feature engineering", that is, manually extracting features such as time domain, frequency domain, mean and heart rate variability from the raw ECG signals, and then using algorithms such as support vector machines, random forests, and decision trees for training. However, the quality of features extracted by these methods is highly dependent on domain experience, and the performance of manually designed features is often unstable on different datasets. In recent years, deep learning models represented by convolutional neural networks and recurrent neural networks have achieved "end-to-end" classification, which can automatically learn high-level features from raw data and achieve good results in ECG signal classification tasks. However, these methods still have the following problems: (1) The model parameters are large and the training cost is high, making it difficult to deploy efficiently in resource-constrained wearable or embedded devices; (2) The model interpretability is poor, which constitutes a significant obstacle in clinical diagnosis with high reliability requirements.
[0004] Besides the two methods mentioned above, time series classification methods based on similarity metrics (such as the K-nearest neighbors algorithm) are also widely used for time series classification tasks due to their simple models and strong interpretability. Among the commonly used similarity metrics, Euclidean distance has the highest computational efficiency, but it is sensitive to phase shifts, amplitude scaling, and noise in time series, and is prone to errors when comparing asynchronous ECG waveforms. Dynamic time warping (DTW) distance achieves waveform alignment by "bending" the time axis, which can effectively alleviate the phase shift problem, but its computational complexity is high and it is difficult to meet the requirements of real-time classification.
[0005] In summary, existing automatic ECG signal classification technologies still have the following shortcomings in practical applications: 1) There is a lack of a distance metric that can robustly handle waveform morphology changes and phase shifts while also having high computational efficiency; 2) It is difficult to simultaneously consider the overall morphological similarity and local segmental features of ECG signal waveforms; 3) The computational overhead for distance calculation of long-term sequences (whether Euclidean distance or DTW) is relatively large. Summary of the Invention
[0006] In view of this, the purpose of this invention is to provide an intelligent classification method for electrocardiogram signals based on hybrid cross-correlation distance, which significantly reduces computational complexity while ensuring high classification accuracy, so as to meet the requirements of modern medical monitoring systems for high accuracy, low latency and high robustness.
[0007] To achieve the above objectives, the present invention adopts the following technical solution: an intelligent classification method for electrocardiogram signals based on hybrid cross-correlation distance, comprising the following steps:
[0008] Step 1: For the original ECG signal time series of length L, the segmented aggregation approximation (PAA) algorithm is used for dimensionality reduction and compression. The sequence is divided into N segments, and the compressed sequence represented by PAA is obtained by calculating the average value of the data in each segment.
[0009] Step 2: Calculate the mixed cross-correlation distance between the test data and the candidate data. This distance is obtained by weighting the global cross-correlation distance and the local cross-correlation distance with the harmonic parameter α. The global cross-correlation distance is calculated and normalized in the frequency domain by fast Fourier transform and inverse transform. The local cross-correlation distance is obtained by dividing the data into sub-segments and calculating the mean value of the global cross-correlation distance.
[0010] Step 3: Sort the mixed cross-correlation distances in ascending order, select the top K nearest neighbors, and determine the final category of the ECG signal to be tested based on the majority voting principle.
[0011] In a preferred embodiment, in step 1, the segmented aggregation approximation (PAA) algorithm is used to reduce the dimensionality of the time series and obtain the corresponding PAA representation of the time series data;
[0012] Given a raw electrocardiogram (ECG) signal time series data of length L, X=(x1,x2,……,x L The compressed segment is compressed according to the compression ratio value paa_ratio, and the length of the compressed segment is [length missing]. Then it will transform into There are several segments; then, the average value within each segment is calculated to represent that segment, where the formula for calculating the k-th segment is as follows:
[0013]
[0014] The final compressed ECG signal time series is P=(p1,p2,...,p...). S ), This represents the value of the i-th sampling point in the time series X of the initial electrocardiogram signal.
[0015] In a preferred embodiment, in step 2, a hybrid cross-correlation distance is proposed, which includes a global cross-correlation distance and a local cross-correlation distance. The global cross-correlation distance effectively captures the overall morphological similarity of the sequences and is insensitive to phase shifts, while the local cross-correlation distance focuses on the similarity of local detailed features between two time series. Finally, by combining the overall and local aspects, a similarity measurement result is obtained.
[0016] In a preferred embodiment, the global cross-correlation distance in step 2 is used to measure the difference between the two time series. and The overall morphological similarity between them is measured and calculated efficiently in the frequency domain using Fast Fourier Transform (FFT), followed by normalization; global cross-correlation distance. The calculation steps are as follows:
[0017]
[0018] in, and These are two compressed time series data sets. This represents the Fast Fourier Transform (FFT). Indicates complex conjugation. This represents the Inverse Fast Fourier Transform (IFFT). The L2 norm of a vector is represented by its Euclidean length.
[0019] In a preferred embodiment, step 2 involves combining the two time series... and The system is synchronously divided into S equal-length sub-segments, and then each pair of corresponding sub-segments is processed... Calculate its global cross-correlation distance Finally, the average global cross-correlation distance is calculated for the W sub-segments; the local cross-correlation distance is also calculated. The calculation formula is as follows:
[0020] .
[0021] In a preferred embodiment, in step 2, for the compressed ECG signal training dataset and the test data, the M candidate time series data closest to the test data are initially screened by directly calculating the Euclidean distance, and a candidate training dataset is constructed; then the test data is... Data from candidate training data Calculate the mixed cross-correlation distance The mixed cross-correlation distance is a weighted combination of the global cross-correlation distance and the local cross-correlation distance of the two time series data. For the mixed cross-correlation harmonic parameters;
[0022] .
[0023] In a preferred embodiment, step 3 uses a KNN classification algorithm based on a two-stage distance metric to classify the ECG signal time series; specifically, the PAA coarse screening stage, the mixed cross-correlation distance fine sorting stage, and the KNN algorithm stage.
[0024] In a preferred embodiment, the coarse screening stage targets the original ECG signal time series training dataset. and the data to be tested The training dataset was obtained after compression using the PAA algorithm. and time series data of the ECG signal to be tested Through calculation Data and The Euclidean distance between them is used to initially select the M candidate time series data that are closest to the data to be tested, and a candidate training dataset is constructed. , }
[0025] In a preferred embodiment, the hybrid cross-correlation distance fine-ranking stage further refines the candidate set after coarse screening; the time series data of the ECG signal to be tested are then... With candidate training datasets { , } The time series data are used to calculate the mixed cross-correlation distance, resulting in a distance set. .
[0026] In a preferred embodiment, for the set of mixed cross-correlation distances calculated in the second stage Sort in ascending order and select distance. The smallest K neighbors are called the K nearest neighbors. The category labels of these K nearest neighbors are counted, and the majority voting principle is used to confirm the original ECG signal time series data to be tested. The final category.
[0027] Compared with existing technologies, the present invention has the following advantages: it significantly reduces computational complexity while ensuring high classification accuracy, thereby meeting the requirements of modern medical monitoring systems for high accuracy, low latency, and high robustness. Attached Figure Description
[0028] Figure 1 This is a flowchart of the algorithm of a preferred embodiment of the present invention. Detailed Implementation
[0029] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0030] It should be noted that the following detailed descriptions are illustrative and intended to provide further explanation of this application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.
[0031] It should be noted that the terminology used herein is for the purpose of describing particular implementations only and is not intended to limit the exemplary implementations according to this application; as used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise; furthermore, it should be understood that when the terms “comprising” and / or “including” are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.
[0032] A smart classification method for electrocardiogram signals based on hybrid cross-correlation distance, reference Figure 1 This includes the following steps:
[0033] Step 1: Time series data compression
[0034] To avoid excessive computational overhead when calculating the distance between two time series data due to the excessive length of the time series, the Piecewise Aggregate Approximation (PAA) algorithm is used to reduce the dimensionality of the time series and obtain the corresponding PAA representation of the time series data.
[0035] Given a raw electrocardiogram (ECG) signal time series data of length L, X=(x1,x2,……,x L The compressed segment is compressed according to the compression ratio value paa_ratio, and the length of the compressed segment is [length missing]. Then it will transform into There are several segments. Then, the average value within each segment is calculated to represent that segment, where the formula for calculating the k-th segment is as follows:
[0036]
[0037] The final compressed ECG signal time series is P=(p1,p2,...,p...). S ).
[0038] Step 2: Mixed cross-correlation distance
[0039] To more comprehensively reflect the similarity between two time series data, we propose a hybrid cross-correlation distance, which includes global cross-correlation distance and local cross-correlation distance. The global cross-correlation distance effectively captures the overall morphological similarity of the sequences and is insensitive to phase shifts, while the local cross-correlation distance focuses on the similarity of local detailed features between the two time series. Finally, by combining the global and local cross-correlation distances, we obtain a more robust and accurate similarity measure than traditional Euclidean distance and DTW distance.
[0040] Step 21: Global cross-correlation distance
[0041] Global cross-correlation distance is used to measure the cross-correlation distance between two time series. and This measure of overall morphological similarity between sequences is robust, especially to phase shifts. Its calculation is efficiently performed in the frequency domain using a Fast Fourier Transform (FFT) followed by normalization. The calculation steps for this distance are as follows:
[0042]
[0043] in, and These are two compressed time series data sets. This represents the Fast Fourier Transform (FFT). Indicates complex conjugation. This represents the Inverse Fast Fourier Transform (IFFT). The L2 norm (Euclidean length) of a vector is used to represent the vector.
[0044] Step 22: Local cross-correlation distance
[0045] Local cross-correlation distance is the distance between two time series. and The system is synchronously divided into S equal-length sub-segments, and then each pair of corresponding sub-segments is compared... Calculate its global cross-correlation distance Finally, the average of the global cross-correlation distances corresponding to the W sub-segments is calculated. The formula for calculating the local cross-correlation distance is as follows:
[0046]
[0047] Step 23: Mixed cross-correlation distance
[0048] For the compressed ECG signal training dataset and the test data, the M candidate time-series data closest to the test data are initially selected by directly calculating the Euclidean distance, and a candidate training dataset is constructed. Then, the test data... Data from candidate training data Calculate the mixed cross-correlation distance This prepares the distance metric for subsequent classification. The mixed cross-correlation distance is a weighted combination of the global cross-correlation distance and the local cross-correlation distance of the two time series data. For the mixed cross-correlation harmonic parameters.
[0049]
[0050] Step 3: KNN classification algorithm based on two-stage distance metric
[0051] For the classification of ECG signal time series, we adopted a KNN classification algorithm based on a two-stage distance metric to achieve a balance between high efficiency and high accuracy.
[0052] Step 31: PAA coarse screening stage
[0053] Training dataset for raw electrocardiogram signal time series and the data to be tested The training dataset was obtained after compression using the PAA algorithm. and time series data of the ECG signal to be tested Through calculation Data and The Euclidean distance between them is used to initially select the M candidate time series data that are closest to the data to be tested, and a candidate training dataset is constructed. , }
[0054] Step 32: Mixed cross-correlation distance fine-tuning stage
[0055] The candidate set after coarse screening is further refined and ranked to improve the final classification accuracy. This involves processing the time series data of the ECG signals to be tested. With candidate training datasets { , } The time series data are used to calculate the mixed cross-correlation distance, resulting in a distance set. .
[0056] Step 33: KNN Algorithm
[0057] For the set of mixed cross-correlation distances calculated in the second stage Sort in ascending order and select distance. The smallest K nearest neighbors (i.e., K-neighbors) are identified, and their category labels are calculated. A majority vote is then used to confirm the original ECG signal time series data to be tested. The final category.
Claims
1. A method for intelligent classification of electrocardiogram signals based on hybrid cross-correlation distance, characterized in that, Includes the following steps: Step 1: For the original ECG signal time series of length L, the segmented aggregation approximation (PAA) algorithm is used for dimensionality reduction and compression. The sequence is divided into N segments, and the compressed sequence represented by PAA is obtained by calculating the average value of the data in each segment. Step 2: Calculate the mixed cross-correlation distance between the test data and the candidate data. This distance is obtained by weighting the global cross-correlation distance and the local cross-correlation distance with the harmonic parameter α. The global cross-correlation distance is calculated and normalized in the frequency domain by fast Fourier transform and inverse transform. The local cross-correlation distance is obtained by dividing the data into sub-segments and calculating the mean value of the global cross-correlation distance. Step 3: Sort the mixed cross-correlation distances in ascending order, select the top K nearest neighbors, and determine the final category of the ECG signal to be tested based on the majority voting principle.
2. The intelligent classification method for electrocardiogram signals based on hybrid cross-correlation distance according to claim 1, characterized in that, In step 1, the segmented aggregation approximation PAA algorithm is used to reduce the dimensionality of the time series and obtain the corresponding PAA representation of the time series data; Given a raw electrocardiogram (ECG) signal time series data of length L, X=(x1,x2,……,x L The compressed segment is compressed according to the compression ratio value paa_ratio, and the length of the compressed segment is [length missing]. Then it will transform into There are several segments; then, the average value within each segment is calculated to represent that segment, where the formula for calculating the k-th segment is as follows: The final compressed ECG signal time series is P=(p1,p2,...,p...). S ), This represents the value of the i-th sampling point in the time series X of the initial electrocardiogram signal.
3. The intelligent classification method for electrocardiogram signals based on hybrid cross-correlation distance according to claim 1, characterized in that, In step 2, a hybrid cross-correlation distance is proposed, which includes global cross-correlation distance and local cross-correlation distance. The global cross-correlation distance effectively captures the overall morphological similarity of the sequences and is not sensitive to phase shifts. The local cross-correlation distance focuses on the similarity of local detailed features between two time series. Finally, by combining the overall and local cross-correlation distances, the similarity measurement results are obtained.
4. The intelligent classification method for electrocardiogram signals based on hybrid cross-correlation distance according to claim 3, characterized in that, In step 2, the global cross-correlation distance is used to measure the cross-correlation distance between two time series. and The overall morphological similarity between them is measured and calculated efficiently in the frequency domain using Fast Fourier Transform (FFT), followed by normalization; global cross-correlation distance. The calculation steps are as follows: in, and These are two compressed time series data sets. This represents the Fast Fourier Transform (FFT). Indicates complex conjugation. This represents the Inverse Fast Fourier Transform (IFFT). The L2 norm of a vector is represented by its Euclidean length.
5. The intelligent classification method for electrocardiogram signals based on hybrid cross-correlation distance according to claim 3, characterized in that, Step 2 involves combining the two time series. and The system is synchronously divided into S equal-length sub-segments, and then each pair of corresponding sub-segments is processed... Calculate its global cross-correlation distance Finally, the average global cross-correlation distance is calculated for the W sub-segments; the local cross-correlation distance is also calculated. The calculation formula is as follows: 。 6. The intelligent classification method for electrocardiogram signals based on hybrid cross-correlation distance according to claim 3, characterized in that, In step 2, for the ECG signal training dataset and the test data after compression of the time series data, the M candidate time series data that are closest to the test data are initially screened by directly calculating the Euclidean distance, and a candidate training dataset is constructed. Then the data to be tested Data from candidate training data Calculate the mixed cross-correlation distance The mixed cross-correlation distance is a weighted combination of the global cross-correlation distance and the local cross-correlation distance of the two time series data. For the mixed cross-correlation harmonic parameters; 。 7. The intelligent classification method for electrocardiogram signals based on hybrid cross-correlation distance according to claim 1, characterized in that, Step 3 uses the KNN classification algorithm based on a two-stage distance metric to classify the ECG signal time series; specifically, the PAA coarse screening stage, the mixed cross-correlation distance fine ranking stage, and the KNN algorithm stage.
8. The intelligent classification method for electrocardiogram signals based on hybrid cross-correlation distance according to claim 7, characterized in that, The coarse screening stage involves training the dataset using the original ECG signal time series. and the data to be tested The training dataset was obtained after compression using the PAA algorithm. and time series data of the ECG signal to be tested Through calculation Data and The Euclidean distance between them is used to initially select the M candidate time series data that are closest to the data to be tested, and a candidate training dataset is constructed. , } 9. The intelligent classification method for electrocardiogram signals based on hybrid cross-correlation distance according to claim 7, characterized in that, The mixed cross-correlation distance fine-ranking stage further refines the ranking of the candidate set after the initial screening; it also refines the time series data of the ECG signals to be tested. With candidate training datasets { , } The time series data are used to calculate the mixed cross-correlation distance, resulting in a distance set. .
10. The intelligent classification method for electrocardiogram signals based on hybrid cross-correlation distance according to claim 7, characterized in that, For the set of mixed cross-correlation distances calculated in the second stage Sort in ascending order and select distance. The smallest K neighbors are called the K nearest neighbors. The category labels of these K nearest neighbors are counted, and the majority voting principle is used to confirm the original ECG signal time series data to be tested. The final category.