Electrocardiosignal clustering method
By introducing Heiglin distance and particle swarm optimization algorithms, combined with a two-layer hybrid classification system, the problems of high computational complexity and noise influence of traditional ECG signal clustering algorithms are solved, achieving efficient and accurate ECG signal clustering and arrhythmia detection.
Patent Information
- Application Number
- CN202511347016.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-19
- Publication Date
- 2026-02-03
AI Technical Summary
Traditional ECG signal clustering algorithms have high computational complexity and excessive memory consumption when processing long-term dynamic ECGs. They are also susceptible to noise and have difficulty accurately capturing frequency domain and nonlinear dynamic features, resulting in low accuracy in arrhythmia detection.
Using Heiglin distance as a metric, and combining dynamic block division and particle swarm optimization algorithms, the distance between the ECG signal and the data is calculated independently by dividing the ECG signal into data sub-blocks. The candidate feature subset with the highest fitness value is selected, and a two-layer hybrid classification system is used for fine evaluation.
It improves the accuracy and stability of ECG signal clustering, reduces computational complexity and memory usage, enhances the similarity measurement of ECG signals, and improves the accuracy of arrhythmia detection.
Smart Images

Figure CN121456513A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent medical technology, specifically to a clustering method for electrocardiogram (ECG) signals. Background Technology
[0002] ECG signal clustering algorithms, as a core technology for arrhythmia detection and dynamic ECG analysis, still face several key challenges in practical applications. First, traditional clustering algorithms suffer from computational inefficiency when processing long-term dynamic ECGs due to a surge in computational complexity, making them unsuitable for real-time analysis. Furthermore, the need to store complete heartbeat waveforms for global matching leads to excessive memory consumption. Second, ECG signals are susceptible to noise such as baseline drift and electromyographic interference, resulting in decreased stability of feature extraction, particularly in distinguishing morphologically similar heartbeats such as atrial premature beats and ventricular premature beats. Finally, related technologies rely excessively on time-domain features such as R-wave amplitude and RR interval for feature extraction, making it difficult to effectively capture frequency-domain and nonlinear dynamic features. Commonly used metrics such as Euclidean distance and dynamic time programming suffer from being overly sensitive to time shifts and having excessively high computational costs.
[0003] These limitations in related technologies severely restrict the clinical application of ECG clustering algorithms. Therefore, how to overcome the performance bottlenecks of existing algorithms and develop ECG clustering methods with high accuracy has become a key breakthrough in promoting the development of arrhythmia detection technology. Summary of the Invention
[0004] In view of this, the present invention provides a clustering algorithm for electrocardiogram (ECG) signals. By introducing Heiger distance as a novel metric, this distance metric can effectively capture key diagnostic features such as P waves and QRS complexes in ECG signals, thereby more accurately approximating the optimal cluster center and solving the problem of low accuracy in ECG clustering results in current related technologies.
[0005] In a first aspect, the present invention provides a clustering method for electrocardiogram (ECG) signals, the method comprising:
[0006] Acquire arrhythmia data, preprocess the arrhythmia data to obtain an electrocardiogram signal dataset composed of standard electrocardiogram signals;
[0007] Initial cluster centers are selected from the electrocardiogram signal dataset, and the standard electrocardiogram signal is divided into several data sub-blocks;
[0008] Calculate the Hellinger distance between each data sub-block and the initial cluster center, and use the Hellinger distance to cluster the data sub-blocks to obtain candidate cluster centers;
[0009] Calculate the fitness value of each candidate feature subset in the candidate cluster centers, and select the candidate feature subset with the highest fitness value as the optimal feature subset;
[0010] The ECG signal dataset is clustered based on the location of the optimal feature subset.
[0011] This invention divides the electrocardiogram (ECG) signal into data sub-blocks for independent Heringer distance calculation, abandoning the traditional random center point initialization method. This fundamentally solves the problem of unstable algorithm convergence and improves the accuracy of similarity measurement for high-dimensional ECG signals.
[0012] In one optional implementation, the step of acquiring arrhythmia data and preprocessing the arrhythmia data includes:
[0013] Acquire cardiac arrhythmia data and label the cardiac arrhythmia data according to cardiac arrhythmia patterns;
[0014] The labeled arrhythmia data were normalized and denoised to obtain standard electrocardiogram signals.
[0015] An electrocardiogram (ECG) signal dataset is constructed based on the aforementioned standard ECG signal.
[0016] Since abnormalities in electrocardiogram (ECG) signals typically exhibit specific characteristic patterns, classifying and labeling ECG signals according to abnormalities during preprocessing can more accurately cluster similar signals together, thereby improving clustering results. Normalization and noise reduction processing of the extracted ECG signal segments effectively removes electromyographic interference and baseline drift, resulting in standard ECG signals and an ECG signal dataset composed of these standard signals. This ensures that the ECG signal dataset has a unified scale standard.
[0017] In one optional implementation, the step of clustering the data sub-blocks using the Helling distance to obtain candidate cluster centers includes:
[0018] S1. Assign each data sub-block to the initial cluster center with the shortest Hellinger distance to obtain the initial clustering result;
[0019] S2. Select several first cluster centers from the initial clustering results;
[0020] S3. Calculate the first Heringer distance between each data sub-block and the first cluster center, and assign each data sub-block to the first cluster center with the shortest first Heringer distance to obtain the first clustering result;
[0021] S4. Repeat S2 to S3 until the first clustering result that meets the error threshold is obtained, and take the first clustering center corresponding to the first clustering result that meets the error threshold as the candidate clustering center.
[0022] In traditional clustering algorithms, the random selection of initial cluster centers may lead to local optima. Therefore, this invention avoids the problem of local optima by iteratively updating the initial cluster centers multiple times until stable candidate cluster centers are obtained.
[0023] In one optional implementation, calculating the first Hellinger distance between each of the data sub-blocks and the first cluster center includes:
[0024] The first cluster center is divided into several data blocks;
[0025] Estimate the first probability density function of the data sub-block and the second probability density function of the data block, respectively;
[0026] The first Hellinger distance between the data sub-block and the data block is calculated based on the first probability density function and the second probability density function.
[0027] The dynamic segmented Heringer distance calculation mechanism in this invention improves the accuracy of similarity measurement of high-dimensional ECG signals by intelligently segmenting the ECG signal into data blocks and calculating the distance independently.
[0028] In an optional implementation, the method further includes:
[0029] The electrocardiogram signal dataset is divided into several data clusters;
[0030] Calculate the displacement of the candidate cluster centers relative to the standard electrocardiogram signal;
[0031] The candidate cluster centers are assigned to the data clusters based on the number of data clusters and the displacement.
[0032] This invention combines a method for calculating weights using polynomial equations with a method for calculating displacements to assign candidate cluster centers to data clusters. Compared to the random selection and allocation methods in traditional schemes, this invention improves the accuracy of cluster centers.
[0033] In one optional implementation, calculating the fitness value of each candidate feature subset in the candidate cluster centers includes:
[0034] Obtain the subset of candidate features contained in the candidate cluster centers;
[0035] A particle swarm is generated based on the candidate feature subset, wherein the spatial position of each particle in the particle swarm is represented as a candidate feature subset.
[0036] Calculate the current fitness value of each particle at its corresponding spatial position based on the objective function;
[0037] Compare the current fitness value of each particle with its historical best fitness value. If the current fitness value is better, update the particle's individual best position and individual best fitness value.
[0038] Compare the individual optimal fitness values of all particles in the particle swarm, and determine the spatial position corresponding to the particle with the highest individual optimal fitness value as the global optimal position, and determine the individual optimal fitness value as the global optimal fitness value;
[0039] The subset of candidate features with the highest fitness values is selected as the optimal feature subset, including:
[0040] The candidate feature subset corresponding to the particle with the highest optimal fitness value of the individual is determined as the optimal feature subset.
[0041] The dual-particle optimization algorithm used in this invention overcomes the shortcomings of traditional algorithms that are prone to getting trapped in local optima, and further enhances the stability of clustering results.
[0042] In an optional implementation, after clustering the ECG signal dataset based on the location of the optimal feature subset, the method further includes:
[0043] Obtain the clustered target ECG signal, and select several ECG signal vectors belonging to the same dimension from the target ECG signal;
[0044] Calculate the measurement distance between each pair of ECG signal vectors, and classify and filter the ECG signal dataset based on the measurement distance to obtain a test dataset whose measurement distance is not greater than a measurement distance threshold;
[0045] The dataset to be tested is divided into several mutually exclusive subsets, each subset containing a training subset and a test subset;
[0046] Obtain an initial performance evaluation model, and train the initial performance evaluation model using the training subset to obtain a target performance evaluation model;
[0047] Based on the target performance evaluation model, the test subset is tested several times to obtain several test results;
[0048] The average value of several test results is calculated as standard ECG data, which is used to assess whether there are any abnormalities in the ECG signal.
[0049] This invention employs a dual-layer hybrid classification system for more refined classification and evaluation of electrocardiogram signal datasets. Its parallel dual-channel processing mechanism can simultaneously optimize the feature selection process of two independent clusters, effectively avoiding the defect of traditional single-path optimization that is prone to getting trapped in local optima. Secondly, by generating differentiated feature subset combinations, the generalization performance of the classification model is significantly improved.
[0050] Secondly, the present invention provides a clustering device for electrocardiogram signals, the device comprising:
[0051] The data acquisition module is used to acquire arrhythmia data, preprocess the arrhythmia data, and obtain an electrocardiogram signal dataset composed of standard electrocardiogram signals.
[0052] The data segmentation module is used to select initial cluster centers from the electrocardiogram signal dataset and segment the standard electrocardiogram signal into several data sub-blocks;
[0053] The first clustering module is used to calculate the Hellinger distance between each data sub-block and the initial cluster center, and to cluster the data sub-blocks using the Hellinger distance to obtain candidate cluster centers;
[0054] The subset selection module is used to calculate the fitness value of each candidate feature subset in the candidate cluster centers, and select the candidate feature subset with the highest fitness value as the optimal feature subset;
[0055] The second clustering module is used to cluster the electrocardiogram signal dataset based on the location of the optimal feature subset.
[0056] Thirdly, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the electrocardiogram signal clustering method described in the first aspect or any corresponding embodiment thereof.
[0057] Fourthly, the present invention provides a computer program product, including computer instructions for causing a computer to execute the electrocardiogram signal clustering method described in the first aspect or any corresponding embodiment thereof. Attached Figure Description
[0058] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0059] Figure 1 This is a schematic diagram of the waveform composition of an electrocardiogram signal according to an embodiment of the present invention;
[0060] Figure 2 This is a flowchart illustrating a method for clustering electrocardiogram signals according to an embodiment of the present invention;
[0061] Figure 3 This is another flowchart illustrating a method for clustering electrocardiogram signals according to an embodiment of the present invention;
[0062] Figure 4 This is a structural block diagram of an electrocardiogram signal clustering device according to an embodiment of the present invention;
[0063] Figure 5 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation
[0064] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0065] Against the backdrop of rapid development in medical informatization, electrocardiogram (ECG) analysis technology has become an indispensable diagnostic tool in clinical medicine due to its ability to non-invasively and in real-time reflect cardiac electrophysiological activity. Figure 1 The image shows a waveform of an ECG heartbeat. ECG signal clustering algorithms, as a core technology for arrhythmia detection and dynamic ECG analysis, still have many shortcomings in practical applications.
[0066] Based on this, the present invention provides an embodiment of a clustering method for electrocardiogram signals. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0067] This embodiment provides a clustering method for electrocardiogram (ECG) signals. Figure 2 This is a flowchart of a clustering method for electrocardiogram signals according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps:
[0068] Step S201: Obtain arrhythmia data, preprocess the arrhythmia data to obtain an electrocardiogram signal dataset composed of standard electrocardiogram signals.
[0069] This invention uses the MIT-BIH arrhythmia database as the benchmark dataset. The MIT-BIH arrhythmia database contains 48 dual-channel dynamic electrocardiogram (ECG) records, each lasting 30 minutes with a sampling frequency of 360 Hz. In this embodiment, several ECG signal segments can be extracted from the database, for example, 1000 consecutive ECG signal segments of 10 seconds each can be extracted as arrhythmia data (each ECG signal segment contains 3600 sampling points). Then, the extracted ECG signal segments are labeled according to an ECG signal abnormality classification system (such as normal beats, atrial premature beats, ventricular premature beats, bundle branch block, and other abnormalities). Since abnormal conditions in ECG signals usually have specific characteristic patterns, classifying and labeling ECG signals according to abnormal conditions during preprocessing can more accurately cluster similar signals together, thereby improving the clustering effect.
[0070] This invention employs the z-score normalization method to normalize the extracted electrocardiogram signal segments. The specific formula is as follows:
[0071]
[0072] Where x' represents the normalized ECG signal segment, x represents the arrhythmia data, μ represents the mean of the ECG signal, and σ represents the standard deviation of the ECG signal.
[0073] Electromyographic interference (EMG) and baseline drift are two common sources of interference in electrocardiogram (ECG) signals. EMG typically manifests as high-frequency noise, usually above 50 Hz, while baseline drift typically manifests as low-frequency noise, usually below 0.5 Hz. A bandpass filter can allow signals within a specific frequency range to pass while suppressing signals at other frequencies. In this embodiment, a 0.5-35 Hz bandpass filter can be selected. This filter can retain the main frequency components of the ECG signal (the frequency range of ECG signals is typically between 0.5-40 Hz) while filtering out high-frequency EMG interference and low-frequency baseline drift interference. After normalization and noise reduction processing of the ECG signal segments, a standard ECG signal and an ECG signal dataset composed of the standard ECG signal are obtained.
[0074] Step S202: Select initial cluster centers from the ECG signal dataset and divide the standard ECG signal into several data sub-blocks.
[0075] Several initial cluster centers are randomly selected from the electrocardiogram (ECG) signal dataset. For example, in this embodiment of the invention, two initial cluster centers may be randomly selected from the ECG signal dataset. Then, each standard ECG signal in the ECG signal dataset is divided into several non-overlapping data sub-blocks of equal length, and the initial cluster centers are divided into several non-overlapping data blocks of equal length.
[0076] Step S203: Calculate the Hellinger distance between each data sub-block and the initial cluster center, and use the Hellinger distance to cluster the data sub-blocks to obtain candidate cluster centers.
[0077] Before calculating the Hellinger distance between each data sub-block and the initial cluster center, embodiments of the present invention can estimate the probability density function P(x) of the data sub-block and the probability density function Q(y) of the data block. Methods for estimating the probability density function may include histogram methods, kernel density estimation methods, nearest neighbor methods, maximum likelihood estimation methods, Bayesian estimation methods, etc., and the present invention does not specifically limit these methods.
[0078] The Helling distance between each data sub-block and the data block is calculated based on the probability density function P(x) of the data sub-block and the probability density function Q(y) of the data block. The specific formula is as follows:
[0079] First, calculate the BC (Bhattacharyya) coefficient:
[0080]
[0081] Wherein, BC(P(x),Q(y))∈[0,1], the larger the value of BC(P(x),Q(y)), the higher the similarity of the distribution of the data sub-blocks and the data blocks. When BC(P(x),Q(y))=1, it indicates that the distribution of the data sub-blocks and the data blocks is exactly the same.
[0082] Next, the Hellinger distance is calculated based on the BC (Bhattacharyya) coefficient:
[0083]
[0084] in, This indicates that the distribution of data sub-blocks and data blocks is completely consistent, and BC(P(x),Q(y))=1 indicates that the distribution of data sub-blocks and data blocks does not overlap at all.
[0085] After obtaining the Helling distances of the data sub-blocks and data segments, the average Helling distance between the standard ECG signal and the initial cluster centers is calculated:
[0086]
[0087] Where, dij The mean Heringer distance between the standard ECG signal and the initial cluster centers is represented by m, where m is the total number of data sub-blocks into which each standard ECG signal is divided. This represents the Heiling distance between data sub-blocks and data blocks. This represents the k-th data sub-block of the i-th standard electrocardiogram signal. This represents the k-th data block with the j-th initial cluster center, where k represents the number of the data block and its sub-block.
[0088] After calculating the average Heringer distance between the standard ECG signal and the initial cluster centers, for each standard ECG signal, its average Heringer distance is compared with that of each initial cluster center. The initial cluster center with the shortest average Heringer distance is selected to cluster the standard ECG signal.
[0089] Since the initial cluster centers are randomly selected from the ECG signal dataset in step S202, to improve the accuracy of the cluster centers, this embodiment of the invention further updates and iterates the clustering process multiple times after selecting the initial cluster center with the shortest mean Hellinger distance to cluster the standard ECG signal until stable cluster centers are obtained. In some optional embodiments, several first cluster centers different from the initial cluster centers are randomly selected from the clustered ECG signal dataset, and the data blocks of the first cluster centers are used as new data sub-blocks. The new Hellinger distance between the data blocks and the new data sub-blocks is calculated again based on the above formula. The new mean Hellinger distance between the standard ECG signal and the first cluster centers is calculated using the new Hellinger distance. The first cluster center with the shortest new mean Hellinger distance is selected to cluster the standard ECG signal. The above process is repeated until a stable clustering result is obtained, and the cluster centers corresponding to the stable clustering result are used as candidate cluster centers. The specific formula for updating the first cluster center to the candidate cluster center is as follows:
[0090]
[0091] Among them, e j Let E represent the updated j-th candidate cluster center. j Let d(x) represent the j-th standard electrocardiogram signal. i e) represents the average Heringer distance between the standard electrocardiogram signal x and the first cluster center e. The objective function d(x) represents i The value of the independent variable e when it reaches its minimum value is the first cluster center when the mean Haegring distance is the shortest.
[0092] Step S204: Calculate the fitness value of each candidate feature subset in the candidate cluster center, and select the candidate feature subset with the highest fitness value as the optimal feature subset.
[0093] This invention employs a particle swarm optimization (PSO) algorithm to further optimize candidate cluster centers. Specifically, regarding population size, the PSO algorithm independently allocates 60 particles to each candidate cluster center for searching, ensuring sufficient search capability in the solution space. Secondly, the iteration count of the PSO algorithm in this embodiment can be set to 30 times, ensuring sufficient convergence while avoiding unnecessary computational overhead. A linear decreasing strategy is used to set the inertia weight. For example, the initial value of the inertia weight can be set to 0.9, giving the PSO algorithm strong global search capability in the early stages. Then, the inertia weight is gradually decreased to 0.4, focusing more on fine-grained local search in later stages.
[0094] The particle swarm optimization algorithm includes a composite fitness function, which comprehensively considers the classification accuracy and feature dimensionality compression ratio (1-FDR) of the classification model. The specific calculation formula is as follows:
[0095] Fitness=0.7×Accuracy+0.3×(1-FDR)
[0096] Here, Accuracy represents the proportion of correct classifications performed by the classification model on the validation set, reflecting the discriminative power of the candidate feature subsets corresponding to the candidate cluster centers. FDR (Feature Dimension Ratio) represents the ratio of the number of features to the total number of features, used to measure the redundancy of the candidate feature subsets. When FDR = 1, it indicates that no feature selection was performed, and all features were retained; when FDR approaches zero, it indicates that the feature subsets are highly sparse. (1-FDR) is the feature compression ratio; the larger the feature compression ratio, the more concise the candidate feature subsets.
[0097] The embodiments of the present invention use the (1-FDR) feature compression rate term in the composite fitness function to incentivize the particle swarm to automatically eliminate redundant features during the search process, effectively reducing data noise and the risk of overfitting.
[0098] For each candidate feature center, the embodiments of the present invention perform particle swarm optimization to output their respective optimal feature subsets.
[0099] For each candidate cluster center, a set of particles is randomly generated in the search space, and the initial velocity of this set of particles is initialized. The position of each particle in the search space is represented as a subset of candidate features of the candidate cluster center.
[0100] The current fitness value of a particle is calculated using an objective function. This current fitness value represents the current fitness value of the candidate feature subset at that spatial location. In this embodiment of the invention, the objective function may include a classification accuracy function, an F1 score function, or a fitness function; the invention does not impose specific limitations on this. Furthermore, the objective function can be combined with a feature quantity penalty term to calculate the current fitness value of the particle.
[0101] The calculated current fitness value is compared with the particle's historical best fitness value. If the current fitness value is higher than the historical best fitness value, it means that the particle's current position is better than its historical best position, and the historical best position of the particle is updated. If the current fitness value is not higher than the historical best fitness value, the historical best position of the particle is not updated.
[0102] The current fitness values of all particles are compared, and the spatial position of the selected particle is taken as the current global optimal position. The highest current fitness value is then compared with the highest historical optimal fitness value. If the highest current fitness value is still higher than the highest historical optimal fitness value, the current global optimal position is considered better than the historical global optimal position, and the historical global optimal position is updated. If the highest current fitness value is not higher than the highest historical optimal fitness value, the historical global optimal position is not updated.
[0103] When updating the historical best position of a particle and the historical global best position of the particle swarm, the initial velocity of the particle is first adjusted according to the velocity update formula, which is as follows:
[0104] v a (t+1)=w·v a (t)+c1·r1·(pBest a -h a (t))+c2·r2·(gBest-h a (t))
[0105] Among them, v a (t) represents the velocity of particle a at time t, v a (t+1) represents the velocity of particle a at time (t+1), w is the inertia weight; c1 is the individual learning factor, used to control the particle to move towards its historical best position (pBest). a The degree of movement; c2 is the global learning factor, used to control the degree to which the particle moves towards the global optimal position (gBest); r1 and r2 are random numbers between [0,1], used to increase randomness; pBest a Let gBest represent the historical best position of particle a, gBest represent the global best position of the particle swarm, and h represent the historical best position of particle a. a (t) represents the position of particle a at time t.
[0106] After updating the initial velocity of the particles, the historical best position of the particles and the historical global best position of the particle swarm are updated based on the adjusted new velocity. The position update formula is as follows:
[0107] h a (t2)=h a (t1)+(t2-t1)v a (t2)
[0108] Among them, h a (t2) represents the new position of particle a at time t2, h a (t1) represents the current position of particle a at time t1, (t2-t1) represents the time difference between t2 and t1, and v a (t2) represents the new velocity of particle a at time t2.
[0109] The particle swarm optimization process described above is run independently for each candidate cluster center, iterating until convergence, i.e., reaching the maximum number of iterations or obtaining a stable current fitness value. Finally, the optimal feature subset corresponding to each candidate cluster center is output, i.e., the feature subset with the highest fitness. Note that if two candidate cluster centers have significantly different data distributions, their output optimal feature subsets may differ, thus reflecting the specificity of the clustering results.
[0110] Step S205: Cluster the ECG signal dataset based on the location of the optimal feature subset.
[0111] After outputting the optimal feature subset, this embodiment of the invention clusters the electrocardiogram signal dataset based on the position of the optimal feature subset.
[0112] This embodiment provides a clustering method for electrocardiogram (ECG) signals. The method involves acquiring arrhythmia data, preprocessing the arrhythmia data to obtain an ECG signal dataset composed of standard ECG signals, selecting initial cluster centers from the ECG signal dataset, and dividing the standard ECG signals into several data sub-blocks. The Helling distance between each data sub-block and the initial cluster center is calculated, and the data sub-blocks are clustered using the Helling distance to obtain candidate cluster centers. The fitness value of each candidate feature subset among the candidate cluster centers is calculated, and the candidate feature subset with the highest fitness value is selected as the optimal feature subset. The ECG signal dataset is then clustered based on the position of the optimal feature subset. This invention divides the ECG signal into data sub-blocks and performs independent Helling distance calculations, abandoning the traditional random center point initialization method, fundamentally solving the problem of algorithm convergence instability, and improving the accuracy of similarity measurement for high-dimensional ECG signals.
[0113] For step S201, acquiring arrhythmia data and preprocessing the arrhythmia data specifically includes the following steps:
[0114] Acquire cardiac arrhythmia data and label the arrhythmia data according to arrhythmia patterns.
[0115] The labeled arrhythmia data were normalized and denoised to obtain standard electrocardiogram signals.
[0116] An electrocardiogram (ECG) signal dataset was constructed based on standard ECG signals.
[0117] This invention extracts several electrocardiogram (ECG) signal segments from the MIT-BIH arrhythmia database. For example, 1000 continuous ECG signal segments, each 10 seconds long, are extracted as arrhythmia data. The extracted ECG signal segments are then labeled according to an ECG signal abnormality classification system (e.g., normal beats, atrial premature beats, ventricular premature beats, bundle branch block, and other abnormalities). Since abnormal conditions in ECG signals usually have specific characteristic patterns, classifying and labeling ECG signals according to abnormal conditions during preprocessing can more accurately cluster similar signals together, thereby improving the clustering effect.
[0118] Each ECG signal segment was divided into several non-overlapping, equal-length data blocks. For example, a 10-second ECG signal segment was divided into several non-overlapping 5-millisecond data blocks. Then, z-score normalization was used to normalize the extracted ECG signal segments, and a 0.5-35 Hz bandpass filter was used to denoise the ECG signal segments, removing electromyographic interference and baseline drift. This resulted in standard ECG signals and an ECG signal dataset composed of these standard ECG signals, ensuring that the ECG signal dataset had a uniform scale standard.
[0119] like Figure 3 As shown, for step S203, the Hellinger distance between each data sub-block and the initial cluster center is calculated, and the data sub-blocks are clustered using the Hellinger distance to obtain candidate cluster centers. This specifically includes the following steps:
[0120] Step S1: Assign each data sub-block to the initial cluster center with the shortest Hellinger distance to obtain the initial clustering result.
[0121] Step S2: Select several first cluster centers from the initial clustering results.
[0122] Step S3: Calculate the first Heringer distance between each data sub-block and the first cluster center, and assign each data sub-block to the first cluster center with the shortest first Heringer distance to obtain the first clustering result.
[0123] Step S4: Repeat steps S2 to S3 until the first clustering result that meets the error threshold is obtained, and take the first clustering center corresponding to the first clustering result that meets the error threshold as the candidate clustering center.
[0124] After calculating the Hellinger distance between each data block and each initial cluster center, the average Hellinger distance between each standard ECG signal and each initial cluster center is calculated based on the Hellinger distance. Then, for each standard ECG signal, its average Hellinger distance is compared with that of each initial cluster center, and the initial cluster center with the shortest average Hellinger distance is selected to cluster the standard ECG signal to obtain the initial clustering result.
[0125] Since the initial cluster centers are randomly selected from the ECG signal dataset, to improve the accuracy of the cluster centers, this embodiment of the invention further updates and iterates the initial clustering results multiple times until stable cluster centers are obtained. In some optional embodiments, several first cluster centers, distinct from the initial cluster centers, are randomly selected from the initial clustering results. The data blocks of the first cluster centers are used as first data sub-blocks. The first Heringle distance between the data blocks and the first data sub-blocks is calculated. The first mean Heringle distance between the standard ECG signal and the first cluster centers is calculated using the first Heringle distance. The first cluster center with the shortest first mean Heringle distance is selected to cluster the standard ECG signal. The above process is repeated until a stable first clustering result is obtained, and the first cluster centers corresponding to the stable first clustering result are used as candidate cluster centers.
[0126] In traditional clustering algorithms, the random selection of initial cluster centers may lead to local optima. Therefore, this invention avoids the problem of local optima by iteratively updating the initial cluster centers multiple times until stable candidate cluster centers are obtained.
[0127] For step S203, calculating the first Heringer distance between each data sub-block and the first cluster center specifically includes the following steps:
[0128] The first cluster center is divided into several data blocks.
[0129] Estimate the first probability density function of the data sub-block and the second probability density function of the data block, respectively.
[0130] The first Hellinger distance between data sub-blocks and data blocks is calculated based on the first probability density function and the second probability density function.
[0131] In this embodiment of the invention, the initial cluster center can be divided into several non-overlapping data blocks of equal length, and the probability density function of the data sub-blocks and the probability density function of the data blocks can be estimated. Based on the probability density function of the data sub-blocks and the probability density function of the data blocks, the Heringer distance between each data sub-block and the data blocks can be calculated. Furthermore, the average Heringer distance between the standard electrocardiogram signal and the initial cluster center can be calculated based on the Heringer distance.
[0132] In some optional embodiments, after obtaining candidate cluster centers based on step S4, the present invention can further divide the ECG signal dataset into several data clusters, calculate the displacement of the candidate cluster centers relative to the standard ECG signal, and assign the candidate cluster centers to the data clusters according to the number of data clusters and the displacement. The specific calculation formula is as follows:
[0133]
[0134] Where n represents the number of vector terms in the candidate cluster centers, X i M represents the i-th vector term in the ECG signal dataset; M represents X. i The weights are used to assign higher weights to vectors that are closer to the candidate cluster centers and lower weights to vectors that are farther away. The formula for calculating M is as follows:
[0135]
[0136] Where, d i For vector term X i Distance from candidate cluster centers, l n ~l0 are polynomial coefficients, and the polynomial coefficients satisfy M = d i It is a monotonically decreasing function.
[0137] After calculating the weights, the candidate feature subsets are sorted in ascending order of weight, and then the sorted candidate feature subsets are weighted again according to these weights.
[0138] Based on the number of data clusters and their displacement, the ranked and weighted candidate cluster centers are assigned to the data cluster with the smallest displacement. This invention combines a polynomial equation weight calculation method with a displacement calculation method to assign candidate cluster centers to data clusters. Compared to the random selection and allocation methods in traditional schemes, the embodiments of this invention improve the accuracy of cluster centers.
[0139] For step S204, the fitness value of each candidate feature subset in the candidate cluster centers is calculated, which specifically includes the following steps:
[0140] Obtain the subset of candidate features contained in the candidate cluster centers.
[0141] Particle swarms are generated based on candidate feature subsets, and the spatial position of each particle in the swarm is represented as a candidate feature subset.
[0142] Calculate the current fitness value of each particle at its corresponding spatial position based on the objective function.
[0143] Compare the current fitness value of each particle with its historical best fitness value. If the current fitness value is better, update the particle's individual best position and individual best fitness value.
[0144] Compare the individual optimal fitness values of all particles in the particle swarm, and determine the spatial position of the particle with the highest individual optimal fitness value as the global optimal position and the individual optimal fitness value as the global optimal fitness value.
[0145] The subset of candidate features corresponding to the particle with the highest individual fitness value is determined as the optimal feature subset.
[0146] For each candidate feature center, the embodiments of the present invention perform particle swarm optimization to output their respective optimal feature subsets.
[0147] For each candidate cluster center assigned to a data cluster, a set of particles is randomly generated in the search space, and the initial velocity of this set of particles is initialized. The position of each particle in the search space is represented as a subset of candidate features of the candidate cluster center.
[0148] The current fitness value of a particle is calculated using an objective function. This current fitness value represents the current fitness value of the candidate feature subset at that spatial location. In this embodiment of the invention, the objective function may include a classification accuracy function, an F1 score function, or a fitness function; the invention does not impose specific limitations on this. Furthermore, the objective function can be combined with a feature quantity penalty term to calculate the current fitness value of the particle.
[0149] The calculated current fitness value is compared with the particle's historical best fitness value. If the current fitness value is higher than the historical best fitness value, it means that the particle's current position is better than its historical best position, and the historical best position of the particle is updated. If the current fitness value is not higher than the historical best fitness value, the historical best position of the particle is not updated.
[0150] The current fitness values of all particles are compared, and the spatial position of the selected particle is taken as the current global optimum. The highest current fitness value is then compared with the highest historical best fitness value. If the highest current fitness value is still higher than the highest historical best fitness value, the current global optimum position is considered superior to the historical global optimum position, and the historical global optimum position is updated. If the highest current fitness value is not higher than the highest historical best fitness value, the historical global optimum position is not updated. This particle swarm optimization process is run independently for each candidate cluster center, iterating until convergence, i.e., reaching the maximum number of iterations or obtaining a stable current fitness value. Finally, the optimal feature subset corresponding to each candidate cluster center is output, i.e., the feature subset with the highest fitness. Note that if the data distributions of two candidate cluster centers differ significantly, their output optimal feature subsets may differ, thus reflecting the specificity of the clustering results.
[0151] This invention combines dynamically adjusted inertia weights, optimized learning factors, and a composite fitness function design to more accurately approximate the optimal cluster centers, thus improving the accuracy of arrhythmia detection. Compared to traditional methods, this invention effectively solves the problems of misclassification and boundary ambiguity.
[0152] In some optional embodiments, after step S205, the present invention can further employ a two-layer hybrid classification structure to perform a more refined classification evaluation of the ECG signal dataset to improve the accuracy of the clustering results. The first layer of the two-layer hybrid classification system uses a Minkowski classifier for coarse classification, while the second layer utilizes a Support Vector Machine (SVM) for fine classification. The Minkowski classifier, based on the Minkowski distance metric, adjusts the distance parameter p to adapt to the characteristics of different data distributions, thereby achieving a preliminary partition of the optimal feature subset. This allows for rapid screening of clearly separable data points, reducing the complexity of subsequent processing. The second-layer SVM classifier uses a radial basis function (RBF) as its kernel function. The kernel function achieves more accurate classification decisions by mapping features to a high-dimensional space. Its hyperparameter γ is set to 0.1 to balance the complexity and generalization ability of the SVM.
[0153] During classification evaluation, the clustered ECG signal dataset is input into the Minkowski classifier and the SVM classifier. The Minkowski classifier is used to quickly remove simple ECG signal data from the ECG signal dataset, while the SVM classifier is used to remove difficult ECG signal data with ambiguous boundaries from the ECG signal dataset, thereby improving the overall classification efficiency and accuracy.
[0154] This invention employs a dual-layer hybrid classification system for more refined classification and evaluation of electrocardiogram signal datasets. Its parallel dual-channel processing mechanism can simultaneously optimize the feature selection process of two independent clusters, effectively avoiding the defect of traditional single-path optimization that is prone to getting trapped in local optima. Secondly, by generating differentiated feature subset combinations, the generalization performance of the classification model is significantly improved.
[0155] Furthermore, ten-fold cross-validation can be used to evaluate the performance of the ECG signal dataset processed by the classifier. The ECG signal dataset is divided into ten mutually exclusive subsets. Nine of these subsets are used to train the initial performance evaluation model, resulting in the trained target performance evaluation model. The remaining subset is used to test the target performance evaluation model multiple times. The average of the test results is used as the standard ECG data, which is then used to evaluate anomalies in other ECG signal data. The specific steps include:
[0156] Obtain the clustered target ECG signal, and select several ECG signal vectors belonging to the same dimension from the target ECG signal.
[0157] The measurement distance between each pair of ECG signal vectors is calculated, and the ECG signal dataset is classified and filtered based on the measurement distance to obtain the test dataset with a measurement distance not greater than the measurement distance threshold.
[0158] The dataset to be tested is divided into several mutually exclusive subsets, which include training subsets and test subsets.
[0159] Obtain the initial performance evaluation model, and train the initial performance evaluation model using the training subset to obtain the target performance evaluation model.
[0160] Based on the target performance evaluation model, the test subset was tested several times, and the test results were obtained.
[0161] The average of several test results is calculated as the standard ECG data, which is used to assess whether there are any abnormalities in the ECG signal.
[0162] This invention discloses a clustering method for electrocardiogram (ECG) signals. The method involves acquiring arrhythmia data, preprocessing the arrhythmia data to obtain an ECG signal dataset composed of standard ECG signals, selecting initial cluster centers from the ECG signal dataset, and dividing the standard ECG signals into several data sub-blocks. The Helling distance between each data sub-block and the initial cluster center is calculated, and the data sub-blocks are clustered using the Helling distance to obtain candidate cluster centers. The fitness value of each candidate feature subset among the candidate cluster centers is calculated, and the candidate feature subset with the highest fitness value is selected as the optimal feature subset. The ECG signal dataset is then clustered based on the position of the optimal feature subset. This invention divides the ECG signal into data sub-blocks and performs independent Helling distance calculations, abandoning the traditional random center point initialization method, fundamentally solving the problem of algorithm convergence instability, and improving the accuracy of similarity measurement for high-dimensional ECG signals.
[0163] This embodiment also provides a clustering device for electrocardiogram signals, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0164] This embodiment provides a clustering device for electrocardiogram signals, such as... Figure 4 As shown, it includes:
[0165] The data acquisition module 401 is used to acquire arrhythmia data, preprocess the arrhythmia data, and obtain an electrocardiogram signal dataset composed of standard electrocardiogram signals.
[0166] The data segmentation module 402 is used to select initial cluster centers from the electrocardiogram signal dataset and segment the standard electrocardiogram signal into several data sub-blocks.
[0167] The first clustering module 403 is used to calculate the Hellinger distance between each data sub-block and the initial cluster center, and to cluster the data sub-blocks using the Hellinger distance to obtain candidate cluster centers.
[0168] The subset selection module 404 is used to calculate the fitness value of each candidate feature subset in the candidate cluster center and select the candidate feature subset with the highest fitness value as the optimal feature subset.
[0169] The second clustering module 405 is used to cluster the electrocardiogram signal dataset based on the location of the optimal feature subset.
[0170] In some optional implementations, the data acquisition module 401 includes:
[0171] The data acquisition unit is used to acquire arrhythmia data and label the arrhythmia data according to the arrhythmia pattern.
[0172] The data preprocessing unit is used to normalize and reduce noise in the labeled arrhythmia data to obtain standard electrocardiogram signals.
[0173] Dataset building unit, used to build ECG signal datasets based on standard ECG signals.
[0174] In some alternative implementations, the first clustering module 403 includes:
[0175] The initial clustering unit is used to assign each data sub-block to the initial cluster center with the shortest Hellinger distance to obtain the initial clustering result.
[0176] The cluster center selection unit is used to select several first cluster centers from the initial clustering results.
[0177] The clustering result generation unit is used to calculate the first Heringer distance between each data sub-block and the first cluster center, and to assign each data sub-block to the first cluster center with the shortest first Heringer distance to obtain the first clustering result.
[0178] The cluster center update unit is used to repeatedly execute S2 to S3 until the first clustering result that meets the error threshold is obtained, and the first cluster center corresponding to the first clustering result that meets the error threshold is used as the candidate cluster center.
[0179] In some alternative implementations, the first clustering module 403 further includes:
[0180] Cluster center partitioning unit is used to divide the first cluster center into several data blocks.
[0181] The function estimation unit is used to estimate the first probability density function of the data sub-block and the second probability density function of the data block, respectively.
[0182] The distance calculation unit is used to calculate the first Hellinger distance between data sub-blocks and data blocks based on the first probability density function and the second probability density function.
[0183] In some alternative implementations, after the first update unit, the first clustering module 403 further includes:
[0184] The data cluster generation unit is used to divide the electrocardiogram signal dataset into several data clusters.
[0185] The displacement calculation unit is used to calculate the displacement of candidate cluster centers relative to the standard electrocardiogram signal.
[0186] Cluster center allocation unit is used to allocate candidate cluster centers to data clusters based on the number of data clusters and the displacement.
[0187] In some alternative implementations, the subset filtering module 404 includes:
[0188] The subset acquisition unit is used to acquire a subset of candidate features contained in the candidate cluster centers.
[0189] The particle swarm generation unit is used to generate a particle swarm based on a subset of candidate features. The spatial position of each particle in the particle swarm is represented as a subset of candidate features.
[0190] The fitness calculation unit is used to calculate the current fitness value of each particle at its corresponding spatial position based on the objective function.
[0191] The individual comparison unit is used to compare the current fitness value of each particle with its historical best fitness value. If the current fitness value is better, the individual best position and individual best fitness value of the particle are updated.
[0192] The global comparison unit is used to compare the individual optimal fitness values of all particles in the particle swarm, and to determine the spatial position of the particle with the highest individual optimal fitness value as the global optimal position and the individual optimal fitness value as the global optimal fitness value.
[0193] The subset selection unit is used to determine the candidate feature subset corresponding to the particle with the highest individual optimal fitness value as the optimal feature subset.
[0194] In some alternative embodiments, the apparatus further includes:
[0195] The vector selection module is used to acquire the clustered target ECG signal and select several ECG signal vectors belonging to the same dimension from the target ECG signal.
[0196] The classification and filtering module is used to calculate the measurement distance between pairs of ECG signal vectors and classify and filter the ECG signal dataset based on the measurement distance to obtain the test dataset with a measurement distance not greater than the measurement distance threshold.
[0197] The subset partitioning module is used to divide the dataset to be tested into several mutually exclusive subsets, which include training subsets and test subsets.
[0198] The model training module is used to obtain an initial performance evaluation model, and to train the initial performance evaluation model using a training subset to obtain the target performance evaluation model.
[0199] The subset testing module is used to perform several tests on the test subset based on the target performance evaluation model and obtain several test results.
[0200] The signal evaluation module is used to calculate the average value of several test results as standard ECG data, which is used to evaluate whether there are any abnormalities in the ECG signal.
[0201] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0202] In this embodiment, the ECG signal clustering device is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0203] This invention also provides a computer device having the above-described features. Figure 4 The diagram shows a clustering device for electrocardiogram signals.
[0204] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 5 As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 5 Take a processor 10 as an example.
[0205] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GPA), or any combination thereof.
[0206] The memory 20 stores instructions executable by at least one processor 10 to cause at least one processor 10 to perform the method shown in the above embodiments.
[0207] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0208] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0209] The computer device also includes a communication interface 30 for communicating with other devices or communication networks.
[0210] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.
[0211] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0212] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A clustering method for electrocardiogram (ECG) signals, characterized in that, The method includes: Acquire arrhythmia data, preprocess the arrhythmia data to obtain an electrocardiogram signal dataset composed of standard electrocardiogram signals; Initial cluster centers are selected from the electrocardiogram signal dataset, and the standard electrocardiogram signal is divided into several data sub-blocks; Calculate the Hellinger distance between each data sub-block and the initial cluster center, and use the Hellinger distance to cluster the data sub-blocks to obtain candidate cluster centers; Calculate the fitness value of each candidate feature subset in the candidate cluster centers, and select the candidate feature subset with the highest fitness value as the optimal feature subset; The ECG signal dataset is clustered based on the location of the optimal feature subset.
2. The method according to claim 1, characterized in that, The acquisition of arrhythmia data and the preprocessing of the arrhythmia data include: Acquire cardiac arrhythmia data and label the cardiac arrhythmia data according to cardiac arrhythmia patterns; The labeled arrhythmia data were normalized and denoised to obtain standard electrocardiogram signals. An electrocardiogram (ECG) signal dataset is constructed based on the aforementioned standard ECG signal.
3. The method according to claim 1, characterized in that, The step of clustering the data sub-blocks using the Helling distance to obtain candidate cluster centers includes: S1. Assign each data sub-block to the initial cluster center with the shortest Hellinger distance to obtain the initial clustering result; S2. Select several first cluster centers from the initial clustering results; S3. Calculate the first Heringer distance between each data sub-block and the first cluster center, and assign each data sub-block to the first cluster center with the shortest first Heringer distance to obtain the first clustering result; S4. Repeat S2 to S3 until the first clustering result that meets the error threshold is obtained, and take the first clustering center corresponding to the first clustering result that meets the error threshold as the candidate clustering center.
4. The method according to claim 3, characterized in that, The calculation of the first Hellinger distance between each data sub-block and the first cluster center includes: The first cluster center is divided into several data blocks; Estimate the first probability density function of the data sub-block and the second probability density function of the data block, respectively; The first Hellinger distance between the data sub-block and the data block is calculated based on the first probability density function and the second probability density function.
5. The method according to claim 3, characterized in that, The method further includes: The electrocardiogram signal dataset is divided into several data clusters; Calculate the displacement of the candidate cluster centers relative to the standard electrocardiogram signal; The candidate cluster centers are assigned to the data clusters based on the number of data clusters and the displacement.
6. The method according to claim 1, characterized in that, The calculation of the fitness value of each candidate feature subset in the candidate cluster centers includes: Obtain the subset of candidate features contained in the candidate cluster centers; A particle swarm is generated based on the candidate feature subset, wherein the spatial position of each particle in the particle swarm is represented as a candidate feature subset. Calculate the current fitness value of each particle at its corresponding spatial position based on the objective function; Compare the current fitness value of each particle with its historical best fitness value. If the current fitness value is better, update the particle's individual best position and individual best fitness value. Compare the individual optimal fitness values of all particles in the particle swarm, and determine the spatial position corresponding to the particle with the highest individual optimal fitness value as the global optimal position, and determine the individual optimal fitness value as the global optimal fitness value; The subset of candidate features with the highest fitness values is selected as the optimal feature subset, including: The candidate feature subset corresponding to the particle with the highest optimal fitness value of the individual is determined as the optimal feature subset.
7. The method according to claim 1, characterized in that, After clustering the ECG signal dataset based on the location of the optimal feature subset, the method further includes: Obtain the clustered target ECG signal, and select several ECG signal vectors belonging to the same dimension from the target ECG signal; Calculate the measurement distance between each pair of ECG signal vectors, and classify and filter the ECG signal dataset based on the measurement distance to obtain a test dataset whose measurement distance is not greater than a measurement distance threshold; The dataset to be tested is divided into several mutually exclusive subsets, each subset containing a training subset and a test subset; Obtain an initial performance evaluation model, and train the initial performance evaluation model using the training subset to obtain a target performance evaluation model; Based on the target performance evaluation model, the test subset is tested several times to obtain several test results; The average value of several test results is calculated as standard ECG data, which is used to assess whether there are any abnormalities in the ECG signal.
8. A clustering device for electrocardiogram signals, characterized in that, The device includes: The data acquisition module is used to acquire arrhythmia data, preprocess the arrhythmia data, and obtain an electrocardiogram signal dataset composed of standard electrocardiogram signals. The data segmentation module is used to select initial cluster centers from the electrocardiogram signal dataset and segment the standard electrocardiogram signal into several data sub-blocks; The first clustering module is used to calculate the Hellinger distance between each data sub-block and the initial cluster center, and to cluster the data sub-blocks using the Hellinger distance to obtain candidate cluster centers; The subset selection module is used to calculate the fitness value of each candidate feature subset in the candidate cluster centers, and select the candidate feature subset with the highest fitness value as the optimal feature subset; The second clustering module is used to cluster the electrocardiogram signal dataset based on the location of the optimal feature subset.
9. A computer device, characterized in that, include: A memory and a processor are communicatively connected, the memory storing computer instructions, and the processor executing the computer instructions to perform the clustering method of electrocardiogram signals according to any one of claims 1 to 7.
10. A computer program product, characterized in that, Includes computer instructions for causing a computer to perform the clustering method for electrocardiogram signals according to any one of claims 1 to 7.