ECG Signal Extraction Method and System Based on Multi-Scale Deep Learning
Through the multi-scale deep learning method, combining multi-scale wavelet transformation and isolated forest score, the multi-scale convolutional characteristics of the ECG signal are extracted and fused, which solves the problem of noise interference between ECG signal and improves the classification accuracy and individual adaptability of the signal.
Patent Information
- Application Number
- CN202510096336.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-22
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2045-01-22
AI Technical Summary
The prior art is difficult to effectively remove noise interference in the electrocardiogram signal acquisition process, resulting in unstable signal quality and inability to adapt to individual differences.
The ECG signal extraction method based on multi-scale deep learning is adopted to remove noise and extract the most representative features of the ECG signal through multi-scale wavelet transformation, isolated forest score and multi-scale convolution feature fusion.
It improves the classification accuracy of ECG signals and the accuracy of disease diagnosis, adapts to the characteristics of ECG signals of different individuals, and enhances the stability of signal quality.
Smart Images

Figure CN119523494B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electrocardiogram (ECG) signal extraction, and particularly to an ECG signal extraction method and system based on multi-scale deep learning. Background Art
[0002] In practical applications, the acquisition process of ECG signals is often affected by various noises, which usually come from the acquisition environment and equipment. For example, friction noise caused by the friction during the contact between electrodes and the skin; noise interference caused by the user's breathing and muscle activities. The existence of noise will mask the important features in the ECG signals. Therefore, it is very necessary to remove the influence of noise and extract the ECG signals.
[0003] Traditional electrocardiogram technology is the most commonly used method for extracting ECG signals. Although this method is simple and easy to implement, the signal quality cannot be guaranteed. There are individual differences in ECG signals, and the ECG signals of individuals of different ages, genders, medical histories, and regions are significantly different; the method for extracting ECG signals based on digital filtering can improve the signal quality to a certain extent, but it cannot well adapt to the ECG signals of different individuals. Summary of the Invention
[0004] The method for extracting ECG signals based on deep learning can automatically learn and extract the features of ECG signals. Therefore, the present invention uses a deep learning method to extract ECG signals. At the same time, considering the individual differences of ECG signals, the features of ECG signals are comprehensively described at multiple scales to find the most representative features, so as to improve the classification accuracy of ECG signals and the disease diagnosis accuracy.
[0005] The technical solution proposed by the present invention is an ECG signal extraction method based on multi-scale deep learning, including the following steps:
[0006] S1: Collect ECG signals and perform multi-scale wavelet transform to obtain a multi-scale time-frequency diagram sequence;
[0007] S2: Denoise each time-frequency diagram in the multi-scale time-frequency diagram sequence in the time and frequency dimensions to obtain a smoothed time-frequency diagram sequence;
[0008] S3: Use the Isolation Forest to score each smoothed time-frequency diagram in the smoothed time-frequency diagram sequence to obtain the smoothed time-frequency diagram with the best scale;
[0009] S4: Extract multi-scale convolution features from the smoothed time-frequency diagram with the best scale and fuse them to obtain the optimal convolution fusion features;
[0010] S5: Classify the ECG signals based on the optimal convolution fusion features.
[0011] Optionally, in the step S1, an electrocardiogram signal is collected and multi-scale wavelet transform is performed to obtain a multi-scale time-frequency map sequence, including:
[0012] Collect the electrocardiogram signal, perform wavelet transform on the electrocardiogram signal to obtain a time-frequency map:
[0013] ;
[0014] Among them, represents the time-frequency map, represents the scale of wavelet transform, represents time, represents the position of wavelet transform, represents the electrocardiogram signal changing with time, represents the Haar wavelet mother function, represents integrating the signal within the acquisition time;
[0015] The scale of wavelet transform varies in value to obtain time-frequency maps at different scales , which constitute a multi-scale time-frequency map sequence.
[0016] Optionally, in the step S2, for each time-frequency map in the multi-scale time-frequency map sequence, denoising is performed in the time and frequency dimensions to obtain a smoothed time-frequency map sequence, including:
[0017] For each time-frequency map in the multi-scale time-frequency map sequence , use the second derivative in the time dimension to suppress the spike noise in the time-frequency map:
[0018] ;
[0019] Among them, represents the time-frequency map after suppressing spike noise using the second derivative in the time dimension, represents the adjustment parameter, represents the time-frequency map in the second derivative in the time dimension;
[0020] For the time-frequency maps in the multi-scale time-frequency map sequence , use the second derivative in the frequency dimension to suppress the spike noise in the time-frequency map:
[0021] ;
[0022] Among them, represents the time-frequency map after suppressing spike noise using the second derivative in the frequency dimension, represents the adjustment parameter, represents frequency, represents the time-frequency map Second derivative in the frequency dimension;
[0023] Smoothed time-frequency diagram is:
[0024] ;
[0025] The smoothed time-frequency diagrams at different scales are combined to form a sequence of smoothed time-frequency diagrams.
[0026] Optionally, in step S3, each smoothed time-frequency diagram in the sequence of smoothed time-frequency diagrams is scored using Isolation Forest to obtain the smoothed time-frequency diagram with the best scale, including:
[0027] S31: For each smoothed time-frequency diagram in the sequence of smoothed time-frequency diagrams extract the first-layer convolutional features;
[0028] Based on the first-layer convolutional features, the sequence of smoothed time-frequency diagrams is divided into two subsets, each subset represented by a leaf node;
[0029] S32: Determine the number of elements in each existing subset;
[0030] If the number of elements is greater than 1, then extract the next-layer convolutional features for the smoothed time-frequency diagrams in the subset;
[0031] Based on the next-layer convolutional features, the subset is further divided into new subsets, each new subset represented by a leaf node;
[0032] If the number of elements is equal to 1, do not process the subset;
[0033] S33: Repeat step S32 until the number of elements in each subset is 1;
[0034] The isolation path length of each smoothed time-frequency diagram is equal to the length of the longest path from the root node to the leaf node where the subset containing the smoothed time-frequency diagram is located;
[0035] Select the smoothed time-frequency diagram with the longest isolation path length as the smoothed time-frequency diagram with the best scale .
[0036] Optionally, in step S4, multi-scale convolutional features are extracted from the smoothed time-frequency diagram with the best scale and fused to obtain the optimal convolutional fusion features, including:
[0037] S41: Extract multi-scale convolutional features from the smoothed time-frequency diagram with the best scale and establish a multi-scale convolutional feature set:
[0038] ;
[0039] Among them, represents the multi-scale convolution feature set of the smoothed time-frequency map from the optimal scale, represents the -th layer convolution feature, represents the highest layer number for extracting convolution features;
[0040] S42: Select the features in the set for fusion to obtain the optimal convolution fusion features.
[0041] Optionally, in the step S42, selecting the features in the set for fusion to obtain the optimal convolution fusion features includes:
[0042] S421: Construct a multi-scale convolution feature subset , and initialize the multi-scale convolution feature subset as an empty set;
[0043] S422: Sequentially select each element in the set , put it into the multi-scale convolution feature subset , and calculate the evaluation index of the multi-scale convolution feature subset ;
[0044] S423: Select the element that maximizes the evaluation index of the multi-scale convolution feature subset , retain this element in the multi-scale convolution feature subset , and delete this element from the set ;
[0045] S424: Repeat steps S422 and S423 until the evaluation index of the multi-scale convolution feature subset no longer improves;
[0046] At this time, splice the features in the multi-scale convolution feature subset to obtain the optimal convolution fusion features.
[0047] The present invention also provides a multi-scale deep learning-based electrocardiogram signal extraction system, including:
[0048] Multi-scale wavelet transform module: Collect electrocardiogram signals, perform multi-scale wavelet transform on the electrocardiogram signals to obtain a multi-scale time-frequency map sequence;
[0049] Denoising module: Suppress spike noise using the second-order derivative in the time dimension and suppress spike noise using the second-order derivative in the frequency dimension to obtain a smoothed time-frequency map, and form a smoothed time-frequency map sequence;
[0050] Scoring module: Extract the first-layer convolutional features, divide the sequence of smoothed video graphs into two subsets, represent the subsets with leaf nodes, judge the number of elements in the subsets, calculate the isolation path length of each smoothed time-frequency graph, and select the smoothed time-frequency graph with the longest isolation path length as the smoothed time-frequency graph of the optimal scale;
[0051] Feature fusion module: Extract multi-scale convolutional features, establish a multi-scale convolutional feature set, select features for fusion, and obtain the optimal convolutional fusion features;
[0052] ECG signal classification module: Classify the ECG signals based on the optimal convolutional fusion features.
[0053] Beneficial effects:
[0054] The present invention uses a deep learning method to classify ECG signals based on the features of ECG signals, improving the classification accuracy; adopts multi-scale wavelet transform, and the obtained multi-scale time-frequency graph sequence is conducive to comprehensively describing the features of ECG signals and is not affected by individual differences; evaluates the wavelet transform scale based on the isolated forest, which is conducive to adapting to individual features and obtaining the optimal scale time-frequency transform of ECG signals; based on the extraction and recursive fusion of multi-scale convolutional features of time-frequency graphs, it is ensured that this feature combination has the best evaluation index; it is conducive to finding the most representative features and improving the classification accuracy of ECG signals and the disease diagnosis accuracy.
[0055] For each time-frequency graph of the present invention, by using the second-order derivative in the time dimension and the second-order derivative in the frequency dimension, it is possible to better find the jumps in the time-frequency graph, thereby suppressing spike noise; extract convolutional features layer by layer for the smoothed time-frequency graph, and the isolated forest can effectively process a large number of features, and based on the convolutional features, segment the sequence of smoothed time-frequency graphs, gradually construct subsets, and assign leaf nodes to each smoothed feature graph, which is conducive to clearly displaying the classification results and finding the most characteristic smoothed feature graph. Description of the drawings
[0056] Figure 1 It is a schematic flow chart of a method for extracting ECG signals based on multi-scale deep learning provided by an embodiment of the present invention.
[0057] Figure 2 It is an ECG signal graph collected in step S1 provided by an embodiment of the present invention. Detailed implementation manners
[0058] The present invention will be further described below with reference to the drawings, but the present invention is not limited in any way. Any transformation or replacement made based on the teachings of the present invention falls within the protection scope of the present invention.
[0059] Embodiment 1:
[0060] A method for extracting electrocardiogram signals based on multi-scale deep learning, as Figure 1 shown, includes the following steps:
[0061] S1: Collect electrocardiogram signals and perform multi-scale wavelet transform to obtain a multi-scale time-frequency map sequence:
[0062] Collect electrocardiogram signals, perform wavelet transform on the electrocardiogram signals to obtain a time-frequency map:
[0063] ;
[0064] Among them, represents the time-frequency map, represents the scale of the wavelet transform, represents time, represents the position of the wavelet transform, represents the electrocardiogram signal varying with time, represents the Haar wavelet mother function, represents integrating the signal over the acquisition time;
[0065] The scale of the wavelet transform varies in value to obtain time-frequency maps at different scales , which form a multi-scale time-frequency map sequence.
[0066] In the embodiment of the present invention, Figure 2 as shown is a simple simulated electrocardiogram signal with a signal frequency of 10 Hz and a signal amplitude of 0.5; the operations of steps S1-S5 are performed on this signal, and finally the classification of the signal is achieved, and an electrocardiogram signal label is added to the signal.
[0067] S2: For each time-frequency map in the multi-scale time-frequency map sequence, denoise in the time and frequency dimensions to obtain a smoothed time-frequency map sequence:
[0068] For each time-frequency map in the multi-scale time-frequency map sequence , use the second derivative in the time dimension to suppress the spike noise in the time-frequency map:
[0069] ;
[0070] Among them, represents the time-frequency map after suppressing spike noise using the second derivative in the time dimension, represents the adjustment parameter, represents the time-frequency map and is the second derivative of the time-frequency map
[0071] For the time-frequency maps in the multi-scale time-frequency map sequence , use the second derivative in the frequency dimension to suppress the spike noise in the time-frequency map:
[0072] ;
[0073] Among them, represents the time-frequency diagram after suppressing spike noise using the second derivative of the frequency dimension, represents the adjustment parameter, represents the frequency, represents the time-frequency diagram the second derivative in the frequency dimension;
[0074] The smoothed time-frequency diagram is:
[0075] ;
[0076] The smoothed time-frequency diagrams at different scales are combined to form a sequence of smoothed time-frequency diagrams.
[0077] In the embodiments of the present invention, the adjustment parameter controls the denoising intensity and is determined through experiments.
[0078] S3: Use Isolation Forest to score each smoothed time-frequency diagram in the sequence of smoothed time-frequency diagrams to obtain the smoothed time-frequency diagram with the best scale:
[0079] S31: Extract the first-layer convolutional features for each smoothed time-frequency diagram in the sequence of smoothed time-frequency diagrams ;
[0080] Based on the first-layer convolutional features, the sequence of smoothed time-frequency diagrams is divided into two subsets, and each subset is represented by a leaf node;
[0081] S32: Judge the number of elements in each existing subset;
[0082] If the number of elements is greater than 1, then extract the next-layer convolutional features for the smoothed time-frequency diagrams in the subset;
[0083] Based on the next-layer convolutional features, the subset is further divided into new subsets, and each new subset is represented by a leaf node;
[0084] If the number of elements is equal to 1, do not process the subset;
[0085] S33: Repeat step S32 until the number of elements in each subset is 1;
[0086] The isolation path length of each smoothed time-frequency diagram is equal to the longest path length from the root node to the leaf node where the subset containing the smoothed time-frequency diagram is located;
[0087] Select the smoothed time-frequency map with the longest isolation path length as the smoothed time-frequency map of the optimal scale 。
[0088] In the embodiment of the present invention, convolutional features are extracted layer by layer, and the sequence of smoothed time-frequency maps is segmented based on the convolutional features until there is only one smoothed time-frequency map in each subset; at this time, the deepest convolutional feature layer for identifying the smoothed time-frequency map can be determined, and the smoothed feature map with significant features in this case is the smoothed time-frequency map of the optimal scale; that is, the convolutional features of each layer can distinguish the smoothed time-frequency map of the optimal scale from other smoothed time-frequency maps.
[0089] S4: Extract multi-scale convolutional features from the smoothed time-frequency map of the optimal scale and fuse them to obtain the optimal convolutional fusion features:
[0090] S41: Extract multi-scale convolutional features from the smoothed time-frequency map of the optimal scale and establish a multi-scale convolutional feature set:
[0091] ;
[0092] Among them, represents the multi-scale convolutional feature set derived from the smoothed time-frequency map of the optimal scale, represents the th layer convolutional feature, represents the highest layer number for extracting convolutional features;
[0093] S42: Select the features in the set for fusion to obtain the optimal convolutional fusion features:
[0094] S421: Construct a multi-scale convolutional feature subset and initialize the multi-scale convolutional feature subset as an empty set;
[0095] S422: Sequentially select each element in the set and put it into the multi-scale convolutional feature subset , and calculate the evaluation index of the multi-scale convolutional feature subset ;
[0096] S423: Select the element that maximizes the evaluation index of the multi-scale convolutional feature subset , retain this element in the multi-scale convolutional feature subset , and delete this element from the set ;
[0097] S424: Repeat steps S422 and S423 until the evaluation index of the multi-scale convolutional feature subset no longer improves;
[0098] At this time, the multi-scale convolution feature subsets are concatenated to obtain the optimal convolution fusion features.
[0099] In the embodiment of the present invention, the method for calculating the evaluation index of the multi-scale convolution feature subset is as follows: Extract the multi-scale convolution feature subset from the training data , concatenate the features in the multi-scale convolution feature subset , train the deep learning network to obtain a deep learning network model; use the accuracy of the deep learning network model as the evaluation index of the multi-scale convolution feature subset .
[0100] S5: Classify the electrocardiogram signals based on the optimal convolution fusion features.
[0101] Embodiment 2: The present invention also provides an electrocardiogram signal extraction system based on multi-scale deep learning, which includes the following five modules:
[0102] Multi-scale wavelet transform module: Collect electrocardiogram signals, perform multi-scale wavelet transform on the electrocardiogram signals to obtain a multi-scale time-frequency diagram sequence;
[0103] Denoising module: Use the second derivative in the time dimension to suppress spike noise, and use the second derivative in the frequency dimension to suppress spike noise to obtain a smoothed time-frequency diagram, and form a smoothed time-frequency diagram sequence;
[0104] Scoring module: Extract the first-layer convolution features, divide the smoothed video diagram sequence into two subsets, represent the subsets with leaf nodes, judge the number of elements in the subsets, calculate the isolation path length of each smoothed time-frequency diagram, and select the smoothed time-frequency diagram with the longest isolation path length as the smoothed time-frequency diagram of the optimal scale;
[0105] Feature fusion module: Extract multi-scale convolution features, establish a multi-scale convolution feature set, select features for fusion to obtain the optimal convolution fusion features;
[0106] Electrocardiogram signal classification module: Classify the electrocardiogram signals based on the optimal convolution fusion features.
[0107] It should be noted that the serial numbers of the above embodiments of the present invention are only for description and do not represent the superiority or inferiority of the embodiments. And the terms "including", "comprising" or any other variant thereof in this article are intended to cover non-exclusive inclusion, so that a process, apparatus, article or method including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, apparatus, article or method. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, apparatus, article or method including that element.
[0108] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product is stored in a storage medium as described above (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to enable a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present invention.
[0109] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present invention.
Claims
1. A method for extracting electrocardiogram signals based on multi-scale deep learning, characterized in that: The method comprises: S1: Collect ECG signals and perform multi-scale wavelet transform to obtain multi-scale time-frequency image sequence; S2: For each time-frequency graph in the multi-scale time-frequency graph sequence, denoise it in the time and frequency dimensions to obtain a smoothed time-frequency graph sequence, including: For each time-frequency graph in the multi-scale time-frequency graph sequence , using the second-order derivative in the time dimension to suppress the spike noise in the time-frequency diagram: ; in, It represents the time-frequency diagram after using the second-order derivative of the time dimension to suppress the spike noise. represents the adjustment parameter, Representation of time-frequency diagram The second derivative in the time dimension; For each time-frequency graph in the multi-scale time-frequency graph sequence , using the second-order derivative in the frequency dimension to suppress spike noise in the time-frequency diagram: ; in, It represents the time-frequency diagram after using the second-order derivative in the frequency dimension to suppress the spike noise. represents the adjustment parameter, Indicates frequency, Representation of time-frequency diagram The second derivative in the frequency dimension; Smoothed time-frequency plot for: ; The different scales Smoothed time-frequency diagram of Composing a smoothed time-frequency graph sequence; S3: Use isolation forest to score each smoothed time-frequency graph in the smoothed time-frequency graph sequence to obtain a smoothed time-frequency graph with the best scale; S4: Extract multi-scale convolution features from the smoothed time-frequency graph of the best scale and fuse them to obtain the optimal convolution fusion features; S5: Classify ECG signals based on the optimal convolutional fusion features.
2. The ECG signal extraction method based on multi-scale deep learning according to claim 1 is characterized in that: The step S1 comprises: Collect ECG signals, perform wavelet transform on them, and obtain the time-frequency diagram: ; in, represents a time-frequency diagram, represents the scale of wavelet transform, Indicates time, represents the position of wavelet transform, represents the ECG signal that changes over time. represents the Haar wavelet mother function, Indicates that the signal is integrated during the acquisition time; Wavelet transform scale The value changes to get different scales The time-frequency diagram below , forming a multi-scale time-frequency graph sequence.
3. The ECG signal extraction method based on multi-scale deep learning according to claim 2 is characterized in that: The step S3 comprises: S31: For each smoothed time-frequency graph in the smoothed time-frequency graph sequence Extract the first layer of convolution features; Based on the first layer of convolutional features, the smoothed time-frequency graph sequence is divided into two subsets, each of which is represented by a leaf node; S32: Determine the number of elements in each existing subset; If the number of elements is greater than 1, the next layer of convolution features is extracted from the smoothed time-frequency graph in the subset; Based on the next layer of convolutional features, the subset is further divided into new subsets, each of which is represented by a leaf node; If the number of elements is equal to 1, the subset is not processed; S33: Repeat step S32 until the number of elements in each subset is 1; The isolation path length of each smoothed time-frequency graph is equal to the longest path length from the root node to the leaf node where the subset containing the smoothed time-frequency graph is located; Select the smoothed time-frequency graph with the longest isolation path length as the smoothed time-frequency graph with the best scale .
4. The ECG signal extraction method based on multi-scale deep learning according to claim 3 is characterized in that: The step S4 comprises: S41: Extract multi-scale convolution features from the optimal scale smoothed time-frequency graph and establish a multi-scale convolution feature set: ; in, represents the multi-scale convolution feature set derived from the smoothed time-frequency graph of the optimal scale, Indicates Layer convolutional features, Indicates the highest number of layers for extracting convolutional features; S42: Select a collection The features in are fused to obtain the optimal convolutional fusion features.
5. The method for extracting electrocardiogram signals based on multi-scale deep learning according to claim 4, characterized in that: The step S42 comprises: S421: Constructing multi-scale convolutional feature subsets , initialize the multi-scale convolution feature subset is an empty set; S422: Select the collections one by one Each element in is put into a multi-scale convolution feature subset , calculate multi-scale convolution feature subsets Evaluation indicators; S423: Selecting a multi-scale convolution feature subset The element with the largest evaluation index is retained in the multi-scale convolution feature subset. , and remove the element from the collection Delete from; S424: Repeat steps S422 and S423 until the multi-scale convolution feature subset The evaluation indicators are no longer improved; At this time, the multi-scale convolution feature subset The features in are concatenated to obtain the optimal convolution fusion features.
6. An electrocardiogram signal extraction system based on multi-scale deep learning, characterized in that: include: Multi-scale wavelet transform module: collect ECG signals, perform multi-scale wavelet transform on the ECG signals, and obtain a multi-scale time-frequency graph sequence; Denoising module: Use the second-order derivative of the time dimension to suppress spike noise, and use the second-order derivative of the frequency dimension to suppress spike noise, obtain a smooth time-frequency graph, and form a smooth time-frequency graph sequence; Scoring module: extract the first layer of convolutional features, divide the smoothed video image sequence into two subsets, use leaf nodes to represent the subsets, determine the number of elements in the subsets, calculate the isolation path length of each smoothed time-frequency image, and select the smoothed time-frequency image with the longest isolation path length as the smoothed time-frequency image with the best scale; Feature fusion module: extract multi-scale convolution features, establish a multi-scale convolution feature set, select features for fusion, and obtain the optimal convolution fusion features; ECG signal classification module: classifies ECG signals based on the optimal convolution fusion features; To realize the electrocardiogram signal extraction method based on multi-scale deep learning as described in any one of claims 1-5.
Citation Information
Patent Citations
Time series data flow anomaly detection method
CN112308235A
Electrocardiogram classification method and device based on time sequence feature map and attention mechanism
CN116458896A