Electrocardiosignal extraction method and system based on multi-scale deep learning
Through multi-scale deep learning methods, combined with multi-scale wavelet transformation and isolated forest algorithm, the characteristics of ECG signals are extracted and denoised, and the problem of unstable signal quality in the existing technology is solved, achieving higher classification accuracy and disease diagnosis accuracy.
Patent Information
- Application Number
- CN202510096336.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-22
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2045-01-22
AI Technical Summary
The prior art is difficult to effectively remove noise interference in the process of electrocardiogram signal acquisition, resulting in unstable signal quality and unable to adapt to the characteristics of electrocardiogram signals of different individuals.
The ECG signal extraction method based on multi-scale deep learning is adopted, and the characteristics of the ECG signal are denoised and extracted through multi-scale wavelet transformation and isolated forest algorithm, and the multi-scale convolutional features are fused to improve the classification accuracy.
It effectively removes noise interference in the ECG signal, improves signal quality and classification accuracy, adapts to the characteristics of ECG signal in different individuals, and improves the accuracy of disease diagnosis.
Smart Images

Figure CN119523494A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electrocardiogram (ECG) signal extraction, and in particular to an ECG signal extraction method and system based on multi-scale deep learning. Background Art
[0002] In practical applications, ECG signal acquisition is often affected by various noise sources, including the acquisition environment and equipment. Examples include friction noise caused by contact between electrodes and skin, and interference noise from the user's breathing and muscle activity. This noise can obscure important features in ECG signals. Therefore, removing noise and extracting ECG signals is crucial.
[0003] Traditional electrocardiogram (ECG) technology is the most commonly used method for extracting ECG signals. While simple and easy to use, this method cannot guarantee signal quality. ECG signals vary significantly between individuals, with significant differences found in age, gender, medical history, and region. While digital filtering-based ECG signal extraction methods improve signal quality to a certain extent, they cannot effectively adapt to different individuals' ECG signals. Summary of the Invention
[0004] The ECG signal extraction method based on deep learning can automatically learn and extract the features of ECG signals. Therefore, the present invention adopts a deep learning method to extract ECG signals, while taking into account the individual differences of ECG signals, comprehensively describing the features of ECG signals at multiple scales, and finding the most representative features to improve the classification accuracy of ECG signals and the accuracy of disease diagnosis.
[0005] The technical solution proposed in the present invention is a method for extracting electrocardiogram signals based on multi-scale deep learning, which includes the following steps: S1: Collect ECG signals and perform multi-scale wavelet transform to obtain multi-scale time-frequency graph sequence; S2: De-noise each time-frequency graph in the multi-scale time-frequency graph sequence in the time and frequency dimensions to obtain 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 the smoothed time-frequency graph with the best scale; S4: Extract multi-scale convolution features from the smoothed time-frequency map of the optimal scale and fuse them to obtain the optimal convolution fusion features; S5: Classify ECG signals based on the optimal convolutional fusion features.
[0006] Optionally, in step S1, collecting the ECG signal and performing a multi-scale wavelet transform to obtain a multi-scale time-frequency graph sequence includes: Collect the ECG signal, perform wavelet transform on it, and obtain the time-frequency diagram: ; in, represents the 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 obtain different scales The time-frequency diagram below , forming a multi-scale time-frequency graph sequence.
[0007] Optionally, in step S2, each time-frequency graph in the multi-scale time-frequency graph sequence is denoised 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 of 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 Second derivative in the time dimension; For the 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 of 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: ; Different scales Smoothed time-frequency diagram , forming a smoothed time-frequency graph sequence.
[0008] Optionally, in step S3, each smoothed time-frequency graph in the smoothed time-frequency graph sequence is scored using isolation forest to obtain a smoothed time-frequency graph with an optimal scale, including: S31: For each smoothed time-frequency graph in the smoothed time-frequency graph sequence Extract the first layer of convolutional 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 containing the subset of smoothed time-frequency graphs; Select the smoothed time-frequency graph with the longest isolation path length as the smoothed time-frequency graph with the best scale .
[0009] Optionally, in step S4, extracting multi-scale convolution features from the smoothed time-frequency graph of the optimal scale and fusing them to obtain the optimal convolution fusion features includes: S41: Extract multi-scale convolution features from the smoothed time-frequency graph of the optimal scale and establish a multi-scale convolution feature set: ; in, represents the multi-scale convolution feature set derived from the smoothed time-frequency map of the optimal scale, Indicates the 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.
[0010] Optionally, in step S42, a set is selected The features in are fused to obtain the optimal convolutional fusion features, including: S421: Constructing multi-scale convolutional feature subsets , initialize the multi-scale convolution feature subset is an empty set; S422: Select the collection in sequence Each element in is put into a multi-scale convolution feature subset , calculate the multi-scale convolution feature subset 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 in; S424: Repeat steps S422 and S423 until the multi-scale convolution feature subset is obtained. The evaluation indicators no longer improve; At this time, the multi-scale convolution feature subset The features in are spliced to obtain the optimal convolution fusion features.
[0011] The present invention also provides an electrocardiogram signal extraction system based on multi-scale deep learning, comprising: Multi-scale wavelet transform module: collects ECG signals, performs multi-scale wavelet transform on them, and obtains a multi-scale time-frequency graph sequence; Denoising module: uses the second-order derivative of the time dimension to suppress spike noise, and uses the second-order derivative of the frequency dimension to suppress spike noise, obtaining a smoothed time-frequency graph and forming a smoothed time-frequency graph sequence; Scoring module: Extracts the first-layer convolutional features, divides the smoothed video graph sequence into two subsets, represents the subsets with leaf nodes, determines the number of elements in the subsets, calculates the isolation path length of each smoothed time-frequency graph, and selects the smoothed time-frequency graph with the longest isolation path length as the optimally scaled smoothed time-frequency graph; Feature fusion module: extracts multi-scale convolution features, establishes a multi-scale convolution feature set, selects features for fusion, and obtains the optimal convolution fusion features; ECG signal classification module: classifies ECG signals based on the optimal convolutional fusion features.
[0012] Beneficial effects: The present invention adopts a deep learning method to classify ECG signals based on their characteristics, thereby improving classification accuracy. It adopts a multi-scale wavelet transform to obtain a multi-scale time-frequency graph sequence that is conducive to comprehensively describing the characteristics of ECG signals and is not affected by individual differences. It evaluates the wavelet transform scale based on the isolation forest, which is conducive to adapting to individual characteristics and obtaining the optimal scale time-frequency transform of ECG signals. It extracts multi-scale convolution features based on the time-frequency graph and recursively fusion to ensure that the 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 accuracy of disease diagnosis.
[0013] For each time-frequency graph, the present invention uses the second-order derivative of the time dimension and the second-order derivative of the frequency dimension to better find the jump in the time-frequency graph and thus suppress the spike noise; the convolution features are extracted layer by layer from the smoothed time-frequency graph, and the isolation forest is used to effectively process a large number of features. The smoothed time-frequency graph sequence is segmented based on the convolution features, and subsets are gradually constructed. Leaf nodes are assigned to each smooth feature graph, which is conducive to clearly displaying the classification results and finding the most characteristic smooth feature graph. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 A flowchart of an electrocardiogram signal extraction method based on multi-scale deep learning is provided in accordance with an embodiment of the present invention.
[0015] Figure 2 This is an electrocardiogram signal graph collected in step S1 according to an embodiment of the present invention. DETAILED DESCRIPTION
[0016] The present invention will be further described below with reference to the accompanying drawings, but the present invention is not limited in any way. Any changes or substitutions made based on the teachings of the present invention fall within the scope of protection of the present invention.
[0017] Example 1: A multi-scale deep learning-based ECG signal extraction method, such as Figure 1 As shown, the following steps are included: S1: Collect ECG signals and perform multi-scale wavelet transform to obtain a multi-scale time-frequency sequence: Collect the ECG signal, perform wavelet transform on it, and obtain the time-frequency diagram: ; in, represents the 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 obtain different scales The time-frequency diagram below , forming a multi-scale time-frequency graph sequence.
[0018] In the embodiment of the present invention, Figure 2The figure shows a simple simulated ECG signal with a signal frequency of 10 Hz and a signal amplitude of 0.5. The signal is subjected to the operations of steps S1 to S5 to finally classify the signal and add an ECG signal label to the signal.
[0019] 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: For each time-frequency graph in the multi-scale time-frequency graph sequence , using the second-order derivative of 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 Second derivative in the time dimension; For the 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 of 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: ; Different scales Smoothed time-frequency diagram , forming a smoothed time-frequency graph sequence.
[0020] In the embodiment of the present invention, the adjustment parameters Controls the strength of denoising, determined experimentally.
[0021] S3: Use isolation forest to score each smoothed time-frequency graph in the smoothed time-frequency graph sequence to obtain the smoothed time-frequency graph with the best scale: S31: For each smoothed time-frequency graph in the smoothed time-frequency graph sequence Extract the first layer of convolutional 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 containing the subset of smoothed time-frequency graphs; Select the smoothed time-frequency graph with the longest isolation path length as the smoothed time-frequency graph with the best scale .
[0022] In an embodiment of the present invention, convolutional features are extracted layer by layer, and the smoothed time-frequency graph sequence is segmented based on the convolutional features until there is only one smoothed time-frequency graph in each subset; at this time, the deepest number of convolutional feature layers for identifying the smoothed time-frequency graph can be determined, and the smoothed feature graph with significant features in this case is the smoothed time-frequency graph of the optimal scale; that is, the convolutional features of each layer can be used to distinguish the smoothed time-frequency graph of the optimal scale from other smoothed time-frequency graphs.
[0023] S4: Extract multi-scale convolution features from the smoothed time-frequency graph of the optimal scale and fuse them to obtain the optimal convolution fusion features: S41: Extract multi-scale convolution features from the smoothed time-frequency graph of the optimal scale and establish a multi-scale convolution feature set: ; in, represents the multi-scale convolution feature set derived from the smoothed time-frequency map of the optimal scale, Indicates the 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 convolution fusion features: S421: Constructing multi-scale convolutional feature subsets , initialize the multi-scale convolution feature subset is an empty set; S422: Select the collection in sequence Each element in is put into a multi-scale convolution feature subset , calculate the multi-scale convolution feature subset 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 in; S424: Repeat steps S422 and S423 until the multi-scale convolution feature subset is obtained. The evaluation indicators no longer improve; At this time, the multi-scale convolution feature subset The features in are spliced to obtain the optimal convolution fusion features.
[0024] In the embodiment of the present invention, the multi-scale convolution feature subset Evaluation index calculation method: extract multi-scale convolution feature subsets from training data , subset the multi-scale convolutional features The features in the dataset are spliced together to train the deep learning network and obtain the deep learning network model; the accuracy of the deep learning network model is used as the multi-scale convolution feature subset. evaluation indicators.
[0025] S5: Classify ECG signals based on the optimal convolutional fusion features.
[0026] Example 2: The present invention also provides an ECG signal extraction system based on multi-scale deep learning, comprising the following five modules: Multi-scale wavelet transform module: collects ECG signals, performs multi-scale wavelet transform on them, and obtains 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: Extracts the first-layer convolutional features, divides the smoothed video graph sequence into two subsets, represents the subsets with leaf nodes, determines the number of elements in the subsets, calculates the isolation path length of each smoothed time-frequency graph, and selects the smoothed time-frequency graph with the longest isolation path length as the optimally scaled smoothed time-frequency graph; Feature fusion module: extracts multi-scale convolution features, establishes a multi-scale convolution feature set, selects features for fusion, and obtains the optimal convolution fusion features; ECG signal classification module: classifies ECG signals based on the optimal convolutional fusion features.
[0027] It should be noted that the serial numbers of the above-mentioned embodiments of the present invention are for descriptive purposes only and do not represent the advantages or disadvantages of the embodiments. In addition, the terms "including", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "including a ..." does not exclude the presence of other identical elements in the process, device, article or method comprising the element.
[0028] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0029] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also 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; 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 S2 comprises: 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 Composed of smoothed time-frequency diagram sequence.
4. The ECG signal extraction method based on multi-scale deep learning according to claim 3 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 .
5. The method for extracting electrocardiogram signals based on multi-scale deep learning according to claim 4, 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.
6. The method for extracting electrocardiogram signals based on multi-scale deep learning according to claim 5, 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.
7. 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-6.
Citation Information
Patent Citations
Electrocardiogram classification method and device based on wavelet transform and DCNN (Deep Convolutional Neural Networks)
CN111202512A
Time series data flow anomaly detection method
CN112308235A
Nuclear magnetic signal peak noise suppression method based on quasi-periodic wavelet coefficient recovery
CN115017933A
Power line carrier communication noise suppression method
CN116455481A
Electrocardiogram classification method and device based on time sequence feature map and attention mechanism
CN116458896A