Electrocardiogram scatter diagram automatic identification and classification method
By using Chebishev distance elimination outliers and density-based clustering algorithms for clustering in electrocardiogram analysis, cluster cluster features are extracted and machine learning classification model is constructed, and the problems of long training cycle and low accuracy of central electrocardiogram recognition in the existing technology are solved, achieving efficient and accurate heart rhythm recognition.
Patent Information
- Application Number
- CN202411498920.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2025-03-04
AI Technical Summary
In the prior art, the training period is long and the recognition result accuracy is not high when identifying ECG scatter plots based on machine learning algorithm models.
By obtaining the original electrocardiogram, eliminating outliers based on the Chebishev distance, clustering is performed using density-based clustering algorithm, key features of clustering are extracted, and machine learning classification model is constructed for identification.
The training cycle is shortened, the accuracy of the recognition results is improved, different types of heart rhythms can be accurately distinguished, and the classification accuracy is high.
Smart Images

Figure CN119557759A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electrocardiogram analysis, and in particular to an automatic recognition and classification method for electrocardiogram scattergrams. Background Art
[0002] ECG scatter plot is a scatter plot drawn from electrocardiogram (ECG) data, and is often used to analyze the electrical activity of the heart. Usually, ECG scatter plots are drawn based on the RR interval, which is the time interval between two consecutive heartbeats. The position of each point in the graph represents the value of two consecutive RR intervals, and the horizontal and vertical axes correspond to the previous and next RR intervals, respectively.
[0003] The ECG scatter plot can intuitively reflect the regularity and changes of heart rhythm. For example, the scatter plot of normal sinus rhythm usually forms a more concentrated and regular area in the plot, showing the stability of the heartbeat. In the case of arrhythmia, such as atrial or ventricular premature beats, atrial fibrillation, etc., the distribution of points on the scatter plot may become more scattered, irregular, or appear in different clusters. ECG scatter plots have important applications in arrhythmia detection and ECG data pattern recognition. Through it, potential abnormalities in ECG signals can be more intuitively revealed.
[0004] With the popularization and use of machine learning algorithms, some technicians in the prior art use machine learning algorithm models to classify and identify ECG scatter plots. However, because scatter plots have the characteristics of large data volume, redundant information, and scattered key information, it often takes a long time to train to obtain a relatively accurate model. In practical applications, it is not suitable for all scenarios. Summary of the invention
[0005] In order to solve the problem in the prior art that the training cycle is long and the recognition accuracy is low when recognizing ECG scatter plots based on machine learning algorithm models, the present invention provides an automatic recognition and classification method for ECG scatter plots, which can shorten the training cycle, accurately distinguish different types of heart rhythms, and has a high classification accuracy.
[0006] The technical solution of the present invention is as follows: a method for automatically identifying and classifying electrocardiogram scattergrams, characterized in that it comprises the following steps:
[0007] S1: Get the original ECG scatter plot;
[0008] S2: Find all outliers based on the Chebyshev distance for the original ECG scatter plot;
[0009] After removing the outliers, a scatter plot after removing the outliers is obtained;
[0010] S3: clustering the scatter plot after outlier removal using a density-based clustering algorithm to obtain a clustered scatter plot;
[0011] The clustered scatter plot includes different clusters;
[0012] S4: performing convex hull calculation for each cluster in the clustered scatter plot to obtain the outermost boundary of each cluster; and then generating the minimum enclosing rectangle of each cluster based on the convex hull of each cluster;
[0013] S5: Extract the key features of each cluster based on the minimum enclosing rectangle of each cluster;
[0014] The key features of clusters include: the centroid position, perimeter, area, rotation angle and aspect ratio of the minimum enclosing matrix of the cluster;
[0015] The centroid position of a cluster represents the center point of the cluster in space;
[0016] perimeter and area, reflecting the size and shape of the cluster;
[0017] The rotation angle of the cluster is the angle between the enclosing rectangle and the coordinate axis, which represents the directionality of the cluster;
[0018] The aspect ratio of the minimum enclosing matrix reflects the aspect ratio of the cluster;
[0019] S6: putting together the cluster key features corresponding to all the clusters corresponding to the original ECG scatter plot to construct: ECG scatter plot key features;
[0020] S7: Construct a scatter plot classification model based on a machine learning algorithm model;
[0021] Based on the ECG scatter plots in the historical data, respectively extract the ECG scatter plot key features corresponding to each ECG scatter plot, and construct a training data set and a validation data set;
[0022] Based on the training set of scatter plot classification models, a trained scatter plot classification model is obtained;
[0023] S8: obtaining an ECG scattergram to be identified, and calculating the ECG scattergram to be identified to obtain a corresponding key feature of the ECG scattergram, which is recorded as the key feature of the ECG scattergram to be identified;
[0024] S9: sending the key features of the ECG scattergram to be identified into the trained scattergram classification model to obtain the final classification result.
[0025] It is further characterized by:
[0026] In step S2, the method for finding outliers in the electrocardiogram scatter plot based on the Chebyshev distance specifically includes the following steps:
[0027] a1: read a point in the ECG scatter plot, recorded as point P;
[0028] Point P = (X 1 ,Y 1 );
[0029] a2: Initialize the neighboring point count Nei of point P to 0;
[0030] a3: Read the other points except point P one by one and record them as point Q;
[0031] Point Q = (X 2 ,Y 2 );
[0032] a4: Calculate the Chebyshev distance between point P and point Q: D Chebys hev (P, Q) = MAX(|X 1 -X 2 |,|Y 1 -Y 2 |);
[0033] a5: Compare D Chebys hev (P, Q) and a preset distance threshold α;
[0034] If D Chebys hev (P, Q)≤α, then the points P and Q are considered to be adjacent points; Nei=Nei+1; execute step a6;
[0035] Otherwise, execute step a6;
[0036] a6: Repeat steps a2 to a5 until all points are involved in the calculation, and then compare Nei with the preset outlier neighbor threshold K;
[0037] If the number of adjacent points of point P is less than K, point P is considered an outlier and the judgment ends;
[0038] Otherwise, point P is not an outlier, and the judgment ends;
[0039] In step S3, the scatter plot is clustered using a density-based clustering algorithm, which specifically includes the following steps:
[0040] b1: For each point P in the scatter graph D, calculate its ∈ neighborhood N ∈ (P):
[0041] N ∈ (P) = {Q∈D|d(P,Q)≤∈};
[0042] Where d(P,Q) represents the Chebyshev distance between point P and point Q, and ∈ is the preset neighborhood distance threshold;
[0043] b2: Calculate the number of points included in the neighborhood of all points and compare it with the preset minimum point count threshold MinPts;
[0044] When the number of neighbors of point P | N ∈ When (P)|≥MinPts, the marked point P is the core point;
[0045] b3: Select one of the core points to perform cluster expansion operation, which specifically includes the following steps:
[0046] b31: Add all points in the neighborhood of the core point to the current cluster;
[0047] b32: record the newly added points in the current cluster as core points;
[0048] b33: looping through steps b31 to b32 until there are no more points to be added, and obtaining an independent cluster;
[0049] b4: executing step b3 for the core points in the scatter diagram D that have not participated in the calculation, until all the core points have participated in the calculation;
[0050] b5: Check whether there are any discrete points in the scatter plot D that do not belong to any cluster. If so, delete them.
[0051] In step S4, the minimum enclosing rectangle of the cluster is calculated based on the rotating caliper algorithm;
[0052] In step S6, each of the ECG scattergram key features is preset to include M groups of cluster key features. If the number of clusters included in the original ECG scattergram is less than M, the M groups of cluster key features are padded with 0 in the ECG scattergram key features.
[0053] The present application provides an automatic recognition and classification method for ECG scatter plots, which removes outliers from ECG scatter plots based on the Chebyshev distance, reduces the impact of unevenly distributed data in multidimensional data on recognition results, and then clusters the scatter plots using a density-based clustering algorithm to obtain all clusters corresponding to the scatter plots, identifies different patterns or trends in the data through clusters, improves the availability of overall data, and provides a clearer basic structure for subsequent pattern recognition and classification; extracts cluster region features and deeply analyzes the morphological structure of the clusters, providing rich reference information for subsequent classification and recognition, helping the scatter plot classification model to better understand the distribution pattern and characteristics of the clusters, which can not only effectively shorten the training cycle of the model, but also improve the overall recognition accuracy and efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 This is a flow chart of the automatic identification and classification method of the central electrical scattergram of this application;
[0055] Figure 2 is an example of a scatter plot that includes outliers;
[0056] Figure 3 This is an example of a scatter plot after clustering;
[0057] Figure 4 This is an example of a minimum enclosing rectangle. DETAILED DESCRIPTION
[0058] like Figure 1 As shown, the present invention includes a method for automatic recognition and classification of electrocardiogram scattergrams, which includes the following steps.
[0059] S1: Get the original ECG scatter plot.
[0060] S2: Find all outliers based on the Chebyshev distance for the original ECG scatter plot;
[0061] After removing the outliers, a scatter plot is obtained.
[0062] In step S2, the method for finding outliers in the electrocardiogram scatter plot based on the Chebyshev distance specifically includes the following steps:
[0063] a1: read a point in the ECG scatter plot, recorded as point P;
[0064] Point P coordinates: (X 1 ,Y 1 );
[0065] a2: Initialize the neighboring point count Nei of point P to 0;
[0066] a3: Read the other points except point P one by one and record them as point Q;
[0067] Point Q coordinates: (X 2 ,Y 2 );
[0068] a4: Calculate the Chebyshev distance between point P and point Q: D Chebys hev (P, Q) = MAX(|X 1 -X 2 |,|Y 1 -Y 2 |);
[0069] a5: Compare D Chebys hev (P, Q) and a preset distance threshold α;
[0070] If D Chebys hev (P, Q)≤α, then the points P and Q are considered to be adjacent points; Nei=Nei+1; execute step a6;
[0071] Otherwise, execute step a6;
[0072] a6: Repeat steps a2 to a5 until all points are involved in the calculation, and then compare Nei with the preset outlier neighbor threshold K;
[0073] If the number of adjacent points of point P is less than K, point P is considered an outlier and the judgment ends;
[0074] Otherwise, point P is not an outlier, and the judgment ends;
[0075] like Figure 2 As shown, the blue points in the figure are non-outliers, and the green stars are identified outliers. In the figure, the horizontal axis is the rr interval between the current heartbeat and the previous heartbeat, and the vertical axis is the rr interval (time interval) between the current heartbeat and the next heartbeat.
[0076] This method identifies outliers by calculating the difference in Chebyshev distance between each data point and other points. Chebyshev distance is more sensitive to extreme deviations in a single dimension and is not affected by other dimensions. In an ECG scatter plot, outliers usually deviate significantly in a certain dimension. Chebyshev distance can effectively capture this deviation, ensuring that outliers can be accurately identified and removed. It is more suitable for use in outlier removal of ECG data than Euclidean distance. If the Chebyshev distance between a point and the points in its neighborhood exceeds the threshold, the point is considered an outlier and is removed. This method can effectively deal with the situation of relatively uneven distribution in multidimensional data and improve the accuracy of ECG data analysis.
[0077] S3: clustering the scatter plot after outliers are removed using a density-based clustering algorithm to obtain a clustered scatter plot;
[0078] The scatter plot after clustering includes different clusters.
[0079] like Figure 3 As shown in the figure, the result of clustering the scatter plot using a density-based clustering algorithm is that the points of the same cluster are enclosed in the same area. In this method, the scatter plot is clustered using a density-based clustering algorithm, which is conducive to providing a clearer basic structure for subsequent pattern recognition and classification. Through clustering, the algorithm can automatically group similar points according to the local density of the data points to form several clusters. This method can identify different patterns or trends in the data and improve the availability of the overall data. In the subsequent recognition process, based on these clustering results, the features of each cluster can be more accurately extracted and used for further classification or diagnosis. For example, in the automatic diagnosis of electrocardiograms, different heart rhythm patterns may appear as different scattered point distributions. Clustering can effectively separate these pattern areas, making the classification algorithm more intuitive and accurate in processing, thereby improving the final recognition efficiency and diagnostic accuracy.
[0080] The density-based clustering algorithm clusters the scatter plot, which specifically includes the following steps:
[0081] b1: For each point P in the scatter graph D, calculate its ∈ neighborhood N ∈ (P):
[0082] N ∈ (P) = {Q∈D|d(P,Q)≤∈};
[0083] Where d(P,Q) represents the Chebyshev distance between point P and point Q, and ∈ is the preset neighborhood distance threshold;
[0084] b2: Calculate the number of points included in the neighborhood of all points and compare it with the preset minimum point count threshold MinPts;
[0085] When the number of neighbors of point P | N ∈ When (P)|≥MinPts, the marked point P is the core point;
[0086] b3: Select a core point to perform cluster expansion operation, which includes the following steps:
[0087] b31: Add all points in the neighborhood of the core point to the current cluster;
[0088] b32: record the newly added points in the current cluster as core points;
[0089] b33: Loop through steps b31 to b32 until there are no more points to add, and an independent cluster is obtained;
[0090] b4: Execute step b3 for each core point in the scatter plot D that has not participated in the calculation, until all core points have participated in the calculation;
[0091] b5: Check whether there are any discrete points in the scatter plot D that do not belong to any cluster. If so, delete them.
[0092] S4: For each cluster in the clustered scatter plot, perform convex hull calculation to obtain the outermost boundary of each cluster; then generate the minimum enclosing rectangle of each cluster based on the convex hull of each cluster. Figure 4 As shown, the red box is the calculation result of the minimum enclosing rectangle of the classified cluster.
[0093] In specific applications, the calculation of the minimum enclosing rectangle can be implemented by any algorithm in the prior art. In this embodiment, the minimum enclosing rectangle of the cluster is calculated based on the rotating caliper algorithm; specifically, the following steps are included.
[0094] c1: Use the convex hull algorithm to find the convex hull of a given set of points in the cluster, which form a polygon;
[0095] c2: Initialize the stuck position:
[0096] Starting from a vertex on the convex hull, place one edge of the calculus on the edge of the vertex and parallel to the edge; place the other edge of the calculus on the opposite edge of the convex hull;
[0097] c3: Rotation jam:
[0098] Rotate the caliper along the convex hull; each time it rotates to the next convex hull edge, record the rectangular area or other required geometric quantities at this time, other required geometric quantities include: width and diameter;
[0099] To calculate the minimum enclosing rectangle, calculate the area of the rectangle at each rotation angle and find the rotation angle with the minimum area;
[0100] Update the rectangle:
[0101] In each rotation step, check whether the calculus is parallel to each side of the convex hull and whether a valid circumscribed rectangle can be formed;
[0102] Termination conditions:
[0103] When the cassette rotates one circle, the algorithm stops; finally, the circumscribed rectangle with the smallest area is recorded, which is the minimum enclosing rectangle.
[0104] Advantages of the rotating caliper algorithm:
[0105] Efficiency: The rotating calculus can process all vertices on the convex hull in linear time, ensuring that the minimum enclosing rectangle is found.
[0106] Flexibility: This algorithm can be used not only for the minimum enclosing rectangle problem, but also for other geometric problems such as maximum diameter, minimum width, etc.
[0107] In this method, the convex hull of each cluster after clustering is first calculated to obtain the outermost boundary of each cluster. The convex hull can comprehensively summarize the data distribution range and morphology of the cluster. Next, based on the calculated convex hull, the minimum enclosing rectangle of each cluster is further generated. The minimum enclosing rectangle can most compactly surround the data points of the entire cluster and provide a more accurate representation of the geometric morphology of the cluster. It can not only capture the boundary information of the cluster, but also filter out the noise or subtle shape changes that may exist in the convex hull, ensuring the overall description of the cluster morphology.
[0108] S5: Extract the key features of each cluster based on the minimum enclosing rectangle of each cluster;
[0109] The key features of clusters include: the center of gravity, perimeter, area, rotation angle and aspect ratio of the minimum enclosing matrix of the cluster.
[0110] The centroid position of a cluster represents the center point of the cluster in space; it can be used to analyze the overall position distribution of the cluster.
[0111] Perimeter and area reflect the size and shape of the cluster; they help determine the compactness of the cluster and the density of data points in space.
[0112] The rotation angle of the cluster is the angle between the enclosing rectangle and the coordinate axis, which characterizes the directionality of the cluster. It can characterize the directionality of the cluster and is particularly suitable for irregular and highly directional data sets.
[0113] The aspect ratio of the minimum enclosing matrix intuitively reflects the aspect ratio of the cluster, revealing whether it presents a stretched, flat or approximately square shape.
[0114] In this embodiment, the key cluster features of a specific cluster are obtained as follows:
[0115] Center of gravity position: 1.1 1.0; circumference: 0.8; area: 0.03; rotation angle: 0.79; aspect ratio: 3.
[0116] S6: Put together the cluster key features corresponding to all clusters in the original ECG scatter plot to construct: ECG scatter plot key features.
[0117] In step S6, each ECG scatter plot key feature is preset to include M groups of cluster key features, M≥1; if the number of clusters included in the original ECG scatter plot is less than M, the M groups of cluster key features are padded with 0 in the ECG scatter plot key features.
[0118] By extracting these geometric features, this method can not only analyze the morphological structure of clusters more deeply, but also provide rich reference information for subsequent classification and recognition. This feature extraction method is particularly suitable for processing clusters with complex and diverse shapes, and can help classification algorithms better understand the distribution patterns and characteristics of clusters, thereby improving overall recognition accuracy and efficiency.
[0119] S7: Constructing scatter plot classification model based on machine learning algorithm;
[0120] Based on the ECG scatter plots in the historical data, the key features of the ECG scatter plots corresponding to each ECG scatter plot are extracted to construct a training data set and a validation data set;
[0121] Based on the scatter plot classification model trained in the training set, a trained scatter plot classification model is obtained.
[0122] In this method, multiple geometric features are extracted from the minimum enclosing rectangle of each cluster, such as the center of gravity, perimeter, area, rotation angle, and aspect ratio. These features can fully reflect the morphology and spatial distribution of clusters in the ECG scatter plot. The scatter plot classification model can be trained more accurately and quickly. In specific implementation, a scatter plot classification model can be constructed based on existing machine learning algorithm models such as KNN, decision tree, and SVM.
[0123] In this embodiment, support vector machines are used to classify the extracted features. SVM is a powerful supervised learning algorithm that can accurately distinguish different clusters according to their features by constructing the optimal classification boundary in high-dimensional space. By training the SVM model, the algorithm can effectively learn the mapping relationship between these geometric features and categories, and then realize the automatic classification of new data points. Ultimately, the support vector machine classifier based on these features can realize the automatic recognition and classification of different data patterns in the scatter plot, ensuring the accuracy and robustness of the classification results.
[0124] S8: Obtain the ECG scatter graph to be identified, and obtain the corresponding key features of the ECG scatter graph after calculating the ECG scatter graph to be identified, which are recorded as: key features of the ECG scatter graph to be identified.
[0125] S9: Send the key features of the ECG scatter plot to be identified into the trained scatter plot classification model to obtain the final classification result.
[0126] The effectiveness of this method is verified based on 23 sets of ECG data in MIT-BIH. The 23 sets of data in the MIT-BIH database include normal sinus rhythm, uncoupled premature beats (atrial premature beats, ventricular premature beats), bigeminy premature beats, trigeminy premature beats, and mixed premature beats, as shown in Table 1.
[0127] Table 1: Data classification
[0128] Heart rhythm Data No. Normal sinus rhythm 101,103,112,113,117,121,122 Uncoupled premature beats (atrial premature beats, ventricular premature beats) 100,105,116,118,205,209,220 Bigeminy premature beats 200,207 Trigeminy premature beats 208 Mixed premature beats 106,119,214,223,228,233
[0129] The 23 sets of data shown in Table 1 were used to draw scatter plots, a total of 23 original scatter plots. In order to obtain more sample data, 1000 RR intervals were selected each time in each original scatter plot to draw a scatter plot as a scatter plot sample data, that is, each scatter plot sample data was at least 10 minutes of data. In order to obtain as many training samples as possible, for each original scatter plot, starting from the initial sampling point, 10 RR intervals were moved each time as the starting point to draw a scatter plot sample of a preset time length. Based on the 23 sets of data, a total of 2819 samples were obtained in this experiment, and each sample included about 10 minutes of data.
[0130] 85% of the data are randomly selected as training samples, and the remaining 15% are used as test samples. The experimental results are shown in Tables 2 and 3 below.
[0131] Table 2: Classification results
[0132]
[0133] Table 3: Sample accuracy
[0134] Data No. Sample size Accuracy 101 21 95.2%(20 / 21) 103 20 100%(20 / 20) 112 16 100%(16 / 16) 113 13 100%(13 / 13) 117 19 100%(19 / 19) 121 28 100%(28 / 28) 122 15 100%(15 / 15) 100 18 100%(18 / 18) 105 17 100%(17 / 17) 116 18 100%(18 / 18) 118 30 100%(30 / 30) 205 12 100%(12 / 12) 209 15 100%(15 / 15) 220 18 100%(18 / 18) 200 26 96.2%(25 / 26) 207 21 95.2%(20 / 21) 208 10 80%(8 / 10) 106 13 100%(13 / 13) 119 21 100%(21 / 21) 214 16 100%(16 / 16) 223 23 100%(23 / 23) 228 18 100%(18 / 18) 233 15 100%(15 / 15) total 423 98.8%(418 / 423)
[0135] The experimental results shown in Table 2 and Table 3 show that the accuracy of this method in the classification task reaches 98.8%, showing a high classification accuracy.
[0136] After using the technical solution of the present invention, firstly, the outliers are removed from the original electrocardiogram scattergram, and then the scattergram is clustered and segmented using a density-based clustering algorithm, and the morphology and features of each segmented cluster are extracted. Finally, the extracted features are classified by a support vector machine, thereby realizing the automatic diagnosis of the electrocardiogram. When the five rhythms of normal sinus rhythm, uncoupled premature beats, bigeminy premature beats, trigeminy premature beats and mixed premature beats are classified, the results show that the algorithm can accurately distinguish different types of rhythms, and the classification accuracy is high, which is of great significance to the automatic diagnosis of electrocardiograms.
Claims
1. A method for automatic recognition and classification of electrocardiogram scattergrams, characterized in that: It includes the following steps: S1: Get the original ECG scatter plot; S2: Find all outliers based on the Chebyshev distance for the original ECG scatter plot; After removing the outliers, a scatter plot after removing the outliers is obtained; S3: clustering the scatter plot after outlier removal using a density-based clustering algorithm to obtain a clustered scatter plot; The clustered scatter plot includes different clusters; S4: performing convex hull calculation for each cluster in the clustered scatter plot to obtain the outermost boundary of each cluster; Then, based on the convex hull of each cluster, generate the minimum enclosing rectangle of each cluster; S5: Extract the key features of each cluster based on the minimum enclosing rectangle of each cluster; The key features of clusters include: the centroid position, perimeter, area, rotation angle and aspect ratio of the minimum enclosing matrix of the cluster; The centroid position of a cluster represents the center point of the cluster in space; perimeter and area, reflecting the size and shape of the cluster; The rotation angle of the cluster is the angle between the enclosing rectangle and the coordinate axis, which represents the directionality of the cluster; The aspect ratio of the minimum enclosing matrix reflects the aspect ratio of the cluster; S6: putting together the cluster key features corresponding to all the clusters corresponding to the original ECG scatter plot to construct: ECG scatter plot key features; S7: Construct a scatter plot classification model based on a machine learning algorithm model; Based on the ECG scatter plots in the historical data, respectively extract the ECG scatter plot key features corresponding to each ECG scatter plot, and construct a training data set and a validation data set; Based on the training set of scatter plot classification models, a trained scatter plot classification model is obtained; S8: obtaining an ECG scattergram to be identified, and calculating the ECG scattergram to be identified to obtain a corresponding key feature of the ECG scattergram, which is recorded as the key feature of the ECG scattergram to be identified; S9: sending the key features of the ECG scattergram to be identified into the trained scattergram classification model to obtain the final classification result.
2. The method for automatically identifying and classifying an electrocardiogram according to claim 1, characterized in that: In step S2, the method for finding outliers in the electrocardiogram scatter plot based on the Chebyshev distance specifically includes the following steps: a1: read a point in the ECG scatter plot, recorded as point P; Point P = (X1, Y1); a2: Initialize the neighboring point count Nei of point P to 0; a3: Read the other points except point P one by one and record them as point Q; Point Q = (X2, Y2); a4: Calculate the Chebyshev distance between point P and point Q: D Chebyshev (P, Q)=MAX(|X1-X2|, |Y1-Y2|); a5: Compare D Chebyshev (P, Q) and a preset distance threshold α; If D Chebyshev (P, Q)≤α, then the points P and Q are considered to be adjacent points; Nei=Nei+1; execute step a6; Otherwise, execute step a6; a6: Repeat steps a2 to a5 until all points are involved in the calculation, and then compare Nei with the preset outlier neighbor threshold K; If the number of adjacent points of point P is less than K, point P is considered an outlier and the judgment ends; Otherwise, point P is not an outlier and the judgment ends.
3. The method for automatic recognition and classification of electrocardiograms according to claim 1, characterized in that: In step S3, the scatter plot is clustered using a density-based clustering algorithm, which specifically includes the following steps: b1: For each point P in the scatter graph D, calculate its ∈ neighborhood N ∈ (P): N ∈ (P)={Q∈D|d(P,Q)≤∈}; Where d(P,Q) represents the Chebyshev distance between point P and point Q, and ∈ is the preset neighborhood distance threshold; b2: Calculate the number of points included in the neighborhood of all points and compare it with the preset minimum point count threshold MinPts; When the number of neighbors of point P | N ∈ When (P)|≥MinPts, the marked point P is the core point; b3: Select one of the core points to perform cluster expansion operation, which specifically includes the following steps: b31: Add all points in the neighborhood of the core point to the current cluster; b32: record the newly added points in the current cluster as core points; b33: looping through steps b31 to b32 until there are no more points to be added, and obtaining an independent cluster; b4: executing step b3 for the core points in the scatter diagram D that have not participated in the calculation, until all the core points have participated in the calculation; b5: Check whether there are any discrete points in the scatter plot D that do not belong to any cluster. If so, delete them.
4. The method for automatically identifying and classifying an electrocardiogram according to claim 1, characterized in that: In step S4, the minimum enclosing rectangle of the cluster is calculated based on the rotating caliper algorithm.
5. The method for automatic recognition and classification of electrocardiograms according to claim 1, characterized in that: In step S6, each of the ECG scattergram key features is preset to include M groups of cluster key features. If the number of clusters included in the original ECG scattergram is less than M, the M groups of cluster key features are padded with 0 in the ECG scattergram key features.