An electrocardiogram signal quality automatic recognition and classification method
By performing discrete wavelet decomposition and time-domain feature extraction on electrocardiogram (ECG) signals, the automatic identification and classification of ECG signal quality is realized, solving the problems of decreased accuracy and insufficient noise type classification in existing technologies, and providing more detailed fault diagnosis information.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUNAN GUITU INFORMATION TECH CO LTD
- Filing Date
- 2025-06-09
- Publication Date
- 2026-04-21
AI Technical Summary
Existing methods for assessing ECG signal quality become less accurate when QRS complex morphology is irregular or when physiological factors are involved, and they lack further classification of local noise types, thus failing to effectively assist in troubleshooting.
By performing discrete wavelet decomposition on the electrocardiogram signal, low-frequency subband, reconstructed subband, and high-frequency subband are obtained, and time-domain features are extracted to achieve global and local noise classification. Combined with wavelet analysis and fault diagnosis technology, the reliance on QRS complex and RR interval features is avoided.
It enables accurate identification and classification of ECG signal quality without relying on QRS complex and RR interval characteristics, improves the ability to identify various types of noise, saves computing resources, and provides more detailed fault diagnosis information.
Smart Images

Figure CN120611223B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of electrocardiogram (ECG) signal classification technology, specifically referring to an automatic identification and classification method for ECG signal quality. Background Technology
[0002] Automatic electrocardiogram (ECG) signal quality identification and classification methods are algorithmic techniques used to analyze and process ECG data, aiming to improve the accuracy and efficiency of ECG signal analysis. This method assists physicians and engineers in quickly and accurately identifying faults in ECG equipment by preprocessing, extracting features, assessing quality, and classifying ECG signals.
[0003] Existing automated electrocardiogram (ECG) signal quality assessment methods have two main problems. First, they rely on event characteristics such as QRS complexes and RR intervals. The accuracy of these methods decreases when the QRS complexes are irregular in shape or under the influence of physiological factors. Second, although they include the localization of local noise, they lack further classification of local noise types, thus failing to provide sufficient reference information for subsequent troubleshooting. Summary of the Invention
[0004] To address the above issues and overcome the shortcomings of existing technologies, this invention provides an automatic identification and classification method for electrocardiogram (ECG) signal quality. Addressing the problems in existing technologies, this invention proposes to perform discrete wavelet decomposition on the ECG signal to obtain low-frequency sub-bands, reconstructed sub-bands, and high-frequency sub-bands. Time-domain features are then extracted from these sub-bands. Based on the results of the time-domain feature extraction, global noise classification and local noise classification are performed. This invention organically combines wavelet analysis, time-domain feature extraction, and fault diagnosis techniques, enabling automatic identification and classification of ECG signal quality without relying on event features such as QRS complexes and RR intervals.
[0005] The technical solution adopted by this invention is as follows: This invention provides an automatic identification and classification method for electrocardiogram signal quality, the method comprising the following steps:
[0006] Step S1: Acquire electrocardiogram (ECG) signals, perform discrete wavelet decomposition on the ECG signals, and obtain ECG sub-bands;
[0007] Step S2: Summarize the low-frequency sub-band, reconstructed sub-band, and high-frequency sub-band from the ECG sub-bands;
[0008] Step S3: Set the adjustable parameter group;
[0009] Step S4: Extract time-domain features from the low-frequency subband, reconstructed subband, and high-frequency subband;
[0010] Step S5: Perform global noise classification and local noise classification based on the results of temporal feature extraction;
[0011] Step S6: Construct an ECG dataset and tune the adjustable parameter group.
[0012] Furthermore, the adjustable parameter set includes a threshold for no effective signal, a baseline drift amplitude threshold, an adjacent amplitude difference threshold, a white noise kurtosis center point, a white noise kurtosis radius, a high-frequency noise amplitude threshold, an envelope peak width threshold, an envelope peak height threshold, and an autocovariance threshold.
[0013] Furthermore, step S4 specifically includes the following steps:
[0014] Step S41: Extract the maximum absolute amplitude of low frequency from the low frequency sub-band, and extract the maximum absolute amplitude of the reconstructed electrocardiogram from the reconstructed sub-band;
[0015] Step S42: Divide the low-frequency subband into equal intervals to obtain low-frequency segments, and summarize them into a low-frequency segment set. Divide the reconstructed subband into equal intervals to obtain reconstructed ECG image segments, and summarize them into a reconstructed ECG image segment set. Divide the high-frequency subband into equal intervals to obtain high-frequency segments, and summarize them into a high-frequency segment set.
[0016] Step S43: Extract the local average amplitude, autocovariance, and kurtosis of each high-frequency segment in the high-frequency segment set; extract the local maximum absolute amplitude of each reconstructed ECG segment in the reconstructed ECG segment set; extract the local maximum absolute amplitude of each low-frequency segment in the low-frequency segment set; and calculate the adjacent amplitude difference of each low-frequency segment in the low-frequency segment set.
[0017] Step S44: Calculate the number of zero-crossings for each high-frequency segment in the high-frequency segment set;
[0018] Step S45: Generate the zero-crossing envelope of the high-frequency sub-band based on the number of zero-crossing points of each high-frequency segment, extract the width and height of each peak in the zero-crossing envelope of the high-frequency sub-band, and label the envelope peak width and envelope peak height corresponding to each high-frequency segment.
[0019] Furthermore, step S5 specifically includes the following steps:
[0020] S51: Perform global noise classification based on the results of temporal feature extraction;
[0021] S52: Classify local noise based on the results of temporal feature extraction;
[0022] S53: Summarize the results of local noise classification into a local noise time series.
[0023] Furthermore, step S51 specifically includes the following steps:
[0024] S511: When the maximum absolute amplitude of the reconstructed ECG is less than the threshold for no effective signal, the global noise type is marked as no effective signal.
[0025] S512: The maximum absolute amplitude of low frequency is greater than the baseline drift amplitude threshold, but the maximum value of the adjacent amplitude difference is less than the adjacent amplitude difference threshold. The global noise type is marked as baseline drift.
[0026] S513: The maximum absolute amplitude of low frequency is greater than the baseline drift amplitude threshold and the maximum value of the difference between adjacent amplitudes is greater than the difference between adjacent amplitudes threshold. The global noise type is marked as a mutation.
[0027] Furthermore, step S52 specifically includes the following steps:
[0028] S521: The local noise type of a reconstructed electrocardiogram segment whose local maximum absolute amplitude is less than the threshold of no effective signal is marked as no effective signal;
[0029] S522: Local noise type of low-frequency segments where the difference between adjacent amplitudes is greater than the threshold between adjacent amplitudes is marked as abrupt change;
[0030] S523: Extract high-frequency segments from the high-frequency segment set whose local average amplitude is greater than the high-frequency noise amplitude threshold, whose envelope peak width is greater than the envelope peak width threshold, and whose envelope peak height is greater than the envelope peak height threshold, and summarize them into a high-frequency noise segment set;
[0031] S524: Determine the white noise kurtosis interval based on the white noise kurtosis radius and the white noise kurtosis center point, and label the local noise type of high-frequency noise segments whose concentrated kurtosis is within the white noise kurtosis interval as white noise;
[0032] S525: High-frequency segments with kurtosis outside the white noise kurtosis range and autocovariance higher than the autocovariance threshold are identified as power line interference.
[0033] S526: Local noise types of high-frequency segments with kurtosis outside the white noise kurtosis range and autocovariance below the autocovariance threshold are labeled as electromyographic artifacts.
[0034] Furthermore, step S53 specifically includes the following steps:
[0035] Step S531: Construct the one-hot encoding of local noise corresponding to each sampling point in the electrocardiogram signal;
[0036] Step S532: Summarize the one-hot encoding of local noise into a local noise time series.
[0037] Furthermore, step S6 specifically includes the following steps:
[0038] Step S61: Collect ECG database and construct ECG dataset;
[0039] Step S62: Extract the ECG signal instances and the corresponding actual local noise time series from the ECG dataset, and extract the theoretical local noise time series of the ECG signal instances based on the adjustable parameter group;
[0040] Step S63: Optimize the adjustable parameter set using Bayesian optimization with the objective of minimizing the average total Hamming difference.
[0041] Furthermore, step S61 specifically includes the following steps:
[0042] Step S611: Extract ECG signal instances and ECG signal annotations from the ECG database;
[0043] Step S612: Extract the actual local noise time series from the ECG signal annotation;
[0044] Step S613: Perform discrete wavelet decomposition on the ECG signal instance and summarize to obtain the instance low-frequency sub-band, instance reconstructed sub-band, and instance high-frequency sub-band;
[0045] Step S614: Stack the actual local noise time series, ECG signal instance, instance low-frequency sub-band, instance reconstructed sub-band, and instance high-frequency sub-band to obtain a multivariate signal time series instance. Image the ECG signal instance, instance low-frequency sub-band, instance reconstructed sub-band, and instance high-frequency sub-band to obtain ECG signal instance map, instance low-frequency sub-band map, instance reconstructed sub-band map, and instance high-frequency sub-band map. Label the fault types of the ECG signal instance, including: no significant noise, patient muscle movement, amplifier fault, filter fault, internal circuit open circuit, internal circuit short circuit, wire damage, wire connection error, poor electrode contact, and no signal. Perform one-hot encoding on the fault types of the ECG signal instance.
[0046] Step S615: Summarize the fault type of the ECG signal instance, ECG signal instance, actual local noise time series, multivariate signal time series instance, ECG signal instance graph, instance low-frequency sub-band graph, instance reconstructed sub-band graph, and instance high-frequency sub-band graph into an ECG dataset.
[0047] The beneficial effects achieved by the present invention using the above solution are as follows:
[0048] (1) This invention provides an automatic identification and classification method for electrocardiogram (ECG) signal quality. In view of the problems in the prior art, it proposes to perform discrete wavelet decomposition on ECG signals to obtain low-frequency sub-bands, reconstructed sub-bands and high-frequency sub-bands, and to extract time-domain features from the low-frequency sub-bands, reconstructed sub-bands and high-frequency sub-bands. Based on the results of time-domain feature extraction, global noise classification and local noise classification are performed. This invention organically combines wavelet analysis, time-domain feature extraction and fault diagnosis technology, and realizes automatic identification and classification of ECG signal quality without relying on event features such as QRS complex and RR interval.
[0049] (2) The method for global and local noise classification based on the results of time-domain feature extraction proposed in this invention analyzes the key time-domain features of various types of noise. No effective signal is generally represented by a flat line or only fluctuations caused by noise; therefore, the maximum absolute amplitude is used as the criterion. Abrupt changes are characterized by drastic amplitude variations between segments; therefore, the difference between adjacent amplitudes is used as the criterion. If the low-frequency subband shows sufficiently significant changes but no abrupt changes, it indicates baseline drift. Since high-frequency noise usually has rapidly changing waveforms, this results in many zero-crossing points. Using a zero-crossing envelope can quickly extract this feature. The distribution of white noise is often approximated by a Gaussian distribution, and the expected kurtosis of a Gaussian distribution is 3. Therefore, kurtosis is chosen as the criterion for Gaussian distribution. The difference between electric field interference and electromyographic artifacts is that electric field interference has a stronger periodicity than electromyographic artifacts. The method for global noise classification and local noise classification based on the results of time-domain feature extraction proposed in this invention generally captures the key time-domain features of various types of noise. Compared with existing technologies, it saves more computing resources and can further classify local noise types. It solves the problem that existing technologies rely on event features such as QRS complex waves and RR intervals, which are difficult to cope with external interference.
[0050] (3) The average Hamming total difference formula proposed in this invention innovatively applies Hamming distance to comprehensively evaluate the difference between two local noise time series, providing a clear basis for the process of optimizing the adjustable parameter group using Bayesian optimization method, making the results of global noise classification and local noise classification closer to the real situation. Attached Figure Description
[0051] Figure 1 A flowchart of an automatic identification and classification method for electrocardiogram signal quality provided by the present invention;
[0052] Figure 2 This is a schematic diagram of a neural network for diagnosing electrocardiogram (ECG) faults.
[0053] Figure 3 A schematic diagram of the image feature extraction branch;
[0054] Figure 4 A schematic diagram of the signal feature extraction branch;
[0055] Figure 5 This is a schematic diagram for comprehensive analysis of the branches.
[0056] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof. Detailed Implementation
[0057] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0058] Example 1, see Figure 1 This invention provides a method for automatic identification and classification of electrocardiogram signal quality, the method comprising the following steps:
[0059] Step S1: Acquire electrocardiogram (ECG) signals and perform discrete wavelet decomposition on the ECG signals to obtain ECG sub-bands. In this embodiment, the Mahlert algorithm is used to implement discrete wavelet decomposition, and the sampling frequency of the ECG signals is 360 Hz.
[0060] Step S2: Summarize the low-frequency sub-band, reconstructed sub-band, and high-frequency sub-band from the ECG sub-bands. In this embodiment, the frequency range of the reconstructed sub-band is 2.8 Hz to 22.5 Hz, the frequency range of the low-frequency sub-band is below 1 Hz, and the frequency range of the high-frequency sub-band is above 40 Hz.
[0061] Step S3: Set the adjustable parameter group;
[0062] Step S4: Extract time-domain features from the low-frequency subband, reconstructed subband, and high-frequency subband;
[0063] Step S5: Perform global noise classification and local noise classification based on the results of temporal feature extraction;
[0064] Step S6: Construct an ECG dataset and tune the adjustable parameter group.
[0065] Example 2: This example is based on the above example. The adjustable parameter group includes a threshold for no effective signal, a baseline drift amplitude threshold, an adjacent amplitude difference threshold, a white noise kurtosis center point, a white noise kurtosis radius, a high-frequency noise amplitude threshold, an envelope peak width threshold, an envelope peak height threshold, and an autocovariance threshold.
[0066] Example 3: This example is based on the above examples, and step S4 specifically includes the following steps:
[0067] Step S41: Extract the maximum absolute amplitude of low frequency from the low frequency sub-band, and extract the maximum absolute amplitude of the reconstructed electrocardiogram from the reconstructed sub-band;
[0068] Step S42: Divide the low-frequency subband into equal intervals to obtain low-frequency segments, and summarize them into a low-frequency segment set. Divide the reconstructed subband into equal intervals to obtain reconstructed ECG image segments, and summarize them into a reconstructed ECG image segment set. Divide the high-frequency subband into equal intervals to obtain high-frequency segments, and summarize them into a high-frequency segment set. In this embodiment, the length of a low-frequency segment is 500 milliseconds, the length of a reconstructed ECG image segment is 1 second, and the length of a high-frequency segment is 50 milliseconds.
[0069] Step S43: Extract the local average amplitude, autocovariance, and kurtosis of each high-frequency segment in the high-frequency segment set; extract the local maximum absolute amplitude of each reconstructed ECG segment in the reconstructed ECG segment set; extract the local maximum absolute amplitude of each low-frequency segment in the low-frequency segment set; calculate the adjacent amplitude difference of each low-frequency segment in the low-frequency segment set. The formula for the adjacent amplitude difference is as follows:
[0070] D n =A n+1 -A n ;
[0071] Among them, D n Let A be the amplitude difference between adjacent low-frequency segments in the low-frequency segment set. n Let A be the local maximum absolute amplitude of the nth low-frequency segment in the low-frequency segment set. n+1 It represents the local maximum absolute amplitude of the (n+1)th low-frequency segment in the low-frequency segment set;
[0072] Step S44: Calculate the number of zero-crossings for each high-frequency segment in the high-frequency segment set. The formula for the number of zero-crossings is as follows:
[0073]
[0074] Where ZC represents the number of zero-crossings, sign represents the sign function, S represents the total number of sampling points in the high-frequency segment, and HS i This represents the amplitude of the i-th sampling point in the high-frequency segment. The amplitude of the i-th sampling point in the high-frequency segment has the opposite sign to the amplitude of the i-th sampling point in the high-frequency segment. |sign(HS) i )-sign(HS i-1 | takes a value of 1, and the amplitude of the i-th sampling point in the high-frequency segment has the same sign as the amplitude of the i-th sampling point in the high-frequency segment. |sign(HS) i )-sign(HSi-1 The value is 0.
[0075] Step S45: Generate the zero-crossing envelope of the high-frequency sub-band based on the number of zero-crossing points of each high-frequency segment, extract the width and height of each peak in the zero-crossing envelope of the high-frequency sub-band, and label the envelope peak width and envelope peak height corresponding to each high-frequency segment.
[0076] Example 4: This example is based on the above examples. Step S5 specifically includes the following steps:
[0077] S51: Perform global noise classification based on the results of temporal feature extraction;
[0078] S52: Classify local noise based on the results of temporal feature extraction;
[0079] S53: Summarize the results of local noise classification into a local noise time series.
[0080] Example 5: This example is based on the above examples. Step S51 specifically includes the following steps:
[0081] S511: When the maximum absolute amplitude of the reconstructed ECG is less than the threshold for no effective signal, the global noise type is marked as no effective signal.
[0082] S512: The maximum absolute amplitude of low frequency is greater than the baseline drift amplitude threshold, but the maximum value of the adjacent amplitude difference is less than the adjacent amplitude difference threshold. The global noise type is marked as baseline drift.
[0083] S513: The maximum absolute amplitude of low frequency is greater than the baseline drift amplitude threshold and the maximum value of the difference between adjacent amplitudes is greater than the difference between adjacent amplitudes threshold. The global noise type is marked as a mutation.
[0084] Example 6: This example is based on the above examples. Step S52 specifically includes the following steps:
[0085] S521: The local noise type of a reconstructed electrocardiogram segment whose local maximum absolute amplitude is less than the threshold of no effective signal is marked as no effective signal;
[0086] S522: Local noise type of low-frequency segments where the difference between adjacent amplitudes is greater than the threshold between adjacent amplitudes is marked as abrupt change;
[0087] S523: Extract high-frequency segments from the high-frequency segment set whose local average amplitude is greater than the high-frequency noise amplitude threshold, whose envelope peak width is greater than the envelope peak width threshold, and whose envelope peak height is greater than the envelope peak height threshold, and summarize them into a high-frequency noise segment set;
[0088] S524: Determine the white noise kurtosis interval based on the white noise kurtosis radius and the white noise kurtosis center point, and label the local noise type of high-frequency noise segments whose concentrated kurtosis is within the white noise kurtosis interval as white noise;
[0089] S525: High-frequency segments with kurtosis outside the white noise kurtosis range and autocovariance higher than the autocovariance threshold are identified as power line interference.
[0090] S526: Local noise types of high-frequency segments with kurtosis outside the white noise kurtosis range and autocovariance below the autocovariance threshold are labeled as electromyographic artifacts.
[0091] Example 7: This example is based on the above examples. Step S53 specifically includes the following steps:
[0092] Step S531: Construct the one-hot encoding of local noise for each sampling point in the electrocardiogram signal. The format of the one-hot encoding of local noise is as follows:
[0093] <B1,B2,B3,B4,B5> ;
[0094] Among them, B1 to B5 are all Boolean variables. B1 represents whether the local noise type of this sampling point is no effective signal, B2 represents whether the local noise type of this sampling point is a sudden change, B3 represents whether the local noise type of this sampling point is white noise, B4 represents whether the local noise type of this sampling point is power line interference, and B5 represents whether the local noise type of this sampling point is electromyography artifact.
[0095] Step S532: Summarize the one-hot encoding of local noise into a local noise time series.
[0096] Example 8: This example is based on the above examples. Step S6 specifically includes the following steps:
[0097] Step S61: Collect ECG database and construct ECG dataset. In this embodiment, the ECG database is the MIT-BIH ECG database.
[0098] Step S62: Extract the ECG signal instances and the corresponding actual local noise time series from the ECG dataset, and extract the theoretical local noise time series of the ECG signal instances based on the adjustable parameter group;
[0099] Step S63: Optimize the adjustable parameter set using Bayesian optimization with the objective of minimizing the average total Hamming difference. The formula for the average total Hamming difference is as follows:
[0100]
[0101] Where AHTD represents the mean Hamming total difference, M represents the total number of actual local noise time series in the ECG dataset, and HTD k The ALNOH value represents the k-th Hamming total difference in the ECG dataset, where T represents the total number of sampling points. t TLNOH represents the one-hot encoding of the local noise at the t-th sampling point in the actual local noise time series. t represents the one-hot encoding of the local noise at the t-th sampling point in the theoretical local noise time series, and HD represents the calculation of the Hamming distance.
[0102] Example 9: This example is based on the above examples. Step S61 specifically includes the following steps:
[0103] Step S611: Extract ECG signal instances and ECG signal annotations from the ECG database;
[0104] Step S612: Construct the actual local noise time series of the ECG signal instance based on the ECG signal annotation;
[0105] Step S613: Perform discrete wavelet decomposition on the ECG signal instance and summarize to obtain the instance low-frequency sub-band, instance reconstructed sub-band, and instance high-frequency sub-band;
[0106] Step S614: Stack the actual local noise time series, ECG signal instance, instance low-frequency sub-band, instance reconstructed sub-band, and instance high-frequency sub-band to obtain a multivariate signal time series instance. Visualize the ECG signal instance, instance low-frequency sub-band, instance reconstructed sub-band, and instance high-frequency sub-band to obtain ECG signal instance diagram, instance low-frequency sub-band diagram, instance reconstructed sub-band diagram, and instance high-frequency sub-band diagram. According to the ECG signal annotation, label the fault type of the ECG signal instance, including: no significant noise, patient muscle movement, amplifier fault, filter fault, internal circuit open circuit, internal circuit short circuit, wire damage, wire connection error, poor electrode contact, and no signal. Perform one-hot encoding on the fault type of the ECG signal instance. In this embodiment, matplotlib.pyplot is used for visualization, and keras.utils.to_categorical is used for one-hot encoding.
[0107] Step S615: Summarize the fault type of the ECG signal instance, ECG signal instance, actual local noise time series, multivariate signal time series instance, ECG signal instance graph, instance low-frequency sub-band graph, instance reconstructed sub-band graph, and instance high-frequency sub-band graph into an ECG dataset.
[0108] Example 10, see Figure 2 , Figure 3 , Figure 4 and Figure 5This embodiment, based on the above embodiments, constructs an electrocardiogram (ECG) fault diagnosis neural network, trains the ECG fault diagnosis neural network using an ECG dataset, and the process of the ECG fault diagnosis neural network performing ECG signal quality fault analysis based on the results of global noise classification and local noise classification specifically includes the following steps:
[0109] Step T1: Construct an ECG fault diagnosis neural network. The ECG fault diagnosis neural network includes an image feature extraction branch, a signal feature extraction branch, and a comprehensive analysis branch. The image feature extraction branch includes a first stitching layer, a multi-scale convolutional block, and a flattening layer. The signal feature extraction branch includes a ConvLSTM1D layer and a first attention layer. The comprehensive analysis branch includes a second attention layer and a fully connected layer. The multi-scale convolutional block includes a first convolutional layer, a second convolutional layer, a third convolutional layer, and a second stitching layer. In this embodiment, the kernel size of the first convolutional layer is 3×3, the kernel size of the second convolutional layer is 5×5, and the kernel size of the third convolutional layer is 7×7. The second stitching layer stitches the outputs of the first convolutional layer, the second convolutional layer, and the third convolutional layer.
[0110] Step T2: Train an ECG fault diagnosis neural network using an ECG dataset;
[0111] Step T3: Stack the local noise time series, ECG signal, low-frequency sub-band, reconstructed sub-band and high-frequency sub-band to obtain a multivariate signal time series. Visualize the ECG signal, low-frequency sub-band, reconstructed sub-band and high-frequency sub-band to obtain ECG signal map, low-frequency sub-band map, reconstructed sub-band map and high-frequency sub-band map;
[0112] Step T4: Input the ECG signal image, low-frequency sub-band image, reconstructed sub-band image and high-frequency sub-band image into the first stitching layer. The first stitching layer stitches the ECG signal image, low-frequency sub-band image, reconstructed sub-band image and high-frequency sub-band image into a multi-frequency comprehensive image and outputs it to the multi-scale convolutional block.
[0113] Step T5: The multi-scale convolutional block performs multi-scale convolution on the multi-band comprehensive map to obtain a multi-scale convolutional feature map. The multi-scale convolutional block outputs the multi-scale convolutional feature map to the flattening layer for flattening to obtain a multi-scale convolutional feature vector, which is then output to the second attention layer.
[0114] Step T6: Input the multivariate signal time series into the ConvLSTM1D layer. The ConvLSTM1D layer outputs the multivariate signal feature sequence to the first attention layer. The first attention layer processes the multivariate signal feature sequence with a self-attention mechanism to obtain a self-attention feature sequence, which is then output to the second attention layer.
[0115] Step T7: The second attention layer uses the multi-scale convolutional feature vector as the query vector and the self-attention feature sequence as the value vector for attention processing to obtain a comprehensive feature vector, which is then output to the fully connected layer.
[0116] Step T8: The fully connected layer remaps the synthesized feature vector to obtain the fault type;
[0117] In this embodiment, the ECG fault diagnosis neural network combines multivariate signal time series analysis with multi-scale convolution. By stitching together the ECG signal map, low-frequency sub-band map, reconstructed sub-band map, and high-frequency sub-band map into a multi-band composite map, and performing multi-scale convolution on the multi-band composite map, more comprehensive and integrated features are extracted. The ConvLSTM1D layer combines convolution operations with LSTM, using convolution operations in the calculation of each gate. Compared with the conventional LSTM1D layer, it is more suitable for processing multivariate signal time series. The self-attention mechanism captures the internal dependencies of the multivariate signal time series, and the attention mechanism captures the dependencies between the multi-scale convolution feature vector and the self-attention feature sequence. Through comprehensive analysis of the multivariate signal time series and the multi-band composite map, a comprehensive and accurate ECG fault diagnosis is finally achieved.
[0118] Example 10: This example is based on the above examples. Step T2 specifically includes the following steps:
[0119] Step T21: Specify the loss function of the fully connected layer as categorical_crossentropy, and specify the optimizer of the ECG fault diagnosis neural network as Adam;
[0120] Step T22: Specify the ECG signal instance image, instance low-frequency sub-band image, instance reconstructed sub-band image, and instance high-frequency sub-band image as the input of the first splicing layer, specify the multivariate signal time series as the input of the ConvLSTM1D layer, and specify the fault type of the ECG signal instance as the target output of the fully connected layer.
[0121] Example 11: This example is based on the above examples. The present invention runs in the Windows operating system environment, relies on Anaconda3, and uses Keras as the framework for the ECG fault diagnosis neural network. The Pandas and Numpy libraries are used to complete the construction of the ECG dataset.
[0122] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0123] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
[0124] The present invention and its embodiments have been described above. This description is not restrictive. The accompanying drawings are only one embodiment of the present invention. The actual structure is not limited to this. In short, if a person skilled in the art is inspired by this description and designs a similar structure and embodiment without departing from the spirit of the present invention, such design should fall within the protection scope of the present invention.
Claims
1. A method for automatic identification and classification of electrocardiogram signal quality, characterized in that: The method includes the following steps: Step S1: Acquire electrocardiogram (ECG) signals, perform discrete wavelet decomposition on the ECG signals, and obtain ECG sub-bands; Step S2: Summarize the low-frequency sub-band, reconstructed sub-band, and high-frequency sub-band from the ECG sub-bands; Step S3: Set the adjustable parameter group; Step S4: Extract time-domain features from the low-frequency subband, reconstructed subband, and high-frequency subband; Step S5: Perform global noise classification and local noise classification based on the results of temporal feature extraction; Step S6: Construct an ECG dataset and tune the adjustable parameter group; Step S4 specifically includes the following steps: Step S41: Extract the maximum absolute amplitude of low frequency from the low frequency sub-band, and extract the maximum absolute amplitude of the reconstructed electrocardiogram from the reconstructed sub-band; Step S42: Divide the low-frequency subband into equal intervals to obtain low-frequency segments, and summarize them into a low-frequency segment set. Divide the reconstructed subband into equal intervals to obtain reconstructed ECG image segments, and summarize them into a reconstructed ECG image segment set. Divide the high-frequency subband into equal intervals to obtain high-frequency segments, and summarize them into a high-frequency segment set. Step S43: Extract the local average amplitude, autocovariance, and kurtosis of each high-frequency segment in the high-frequency segment set; extract the local maximum absolute amplitude of each reconstructed ECG segment in the reconstructed ECG segment set; extract the local maximum absolute amplitude of each low-frequency segment in the low-frequency segment set; and calculate the adjacent amplitude difference of each low-frequency segment in the low-frequency segment set. Step S44: Calculate the number of zero-crossings for each high-frequency segment in the high-frequency segment set; Step S45: Generate the zero-crossing envelope of the high-frequency sub-band based on the number of zero-crossing points of each high-frequency segment, extract the width and height of each peak in the zero-crossing envelope of the high-frequency sub-band, and label the envelope peak width and envelope peak height corresponding to each high-frequency segment.
2. The method for automatic identification and classification of electrocardiogram signal quality according to claim 1, wherein the adjustable parameter group includes a threshold for no effective signal, a baseline drift amplitude threshold, an adjacent amplitude difference threshold, a white noise kurtosis center point, a white noise kurtosis radius, a high-frequency noise amplitude threshold, an envelope peak width threshold, an envelope peak height threshold, and an autocovariance threshold.
3. The method for automatic identification and classification of electrocardiogram signal quality according to claim 2, wherein step S5 specifically includes the following steps: S51: Perform global noise classification based on the results of temporal feature extraction; S52: Classify local noise based on the results of temporal feature extraction; S53: Summarize the results of local noise classification into a local noise time series.
4. The method for automatic identification and classification of electrocardiogram signal quality according to claim 3, wherein step S51 specifically includes the following steps: S511: When the maximum absolute amplitude of the reconstructed ECG is less than the threshold for no effective signal, the global noise type is marked as no effective signal. S512: The maximum absolute amplitude of low frequency is greater than the baseline drift amplitude threshold, but the maximum value of the adjacent amplitude difference is less than the adjacent amplitude difference threshold. The global noise type is marked as baseline drift. S513: The maximum absolute amplitude of low frequency is greater than the baseline drift amplitude threshold and the maximum value of the difference between adjacent amplitudes is greater than the difference between adjacent amplitudes threshold. The global noise type is marked as a mutation.
5. The method for automatic identification and classification of electrocardiogram signal quality according to claim 4, wherein step S52 specifically includes the following steps: S521: The local noise type of a reconstructed electrocardiogram segment whose local maximum absolute amplitude is less than the threshold of no effective signal is marked as no effective signal; S522: Local noise type of low-frequency segments where the difference between adjacent amplitudes is greater than the threshold between adjacent amplitudes is marked as abrupt change; S523: Extract high-frequency segments from the high-frequency segment set whose local average amplitude is greater than the high-frequency noise amplitude threshold, whose envelope peak width is greater than the envelope peak width threshold, and whose envelope peak height is greater than the envelope peak height threshold, and summarize them into a high-frequency noise segment set; S524: Determine the white noise kurtosis interval based on the white noise kurtosis radius and the white noise kurtosis center point, and label the local noise type of high-frequency noise segments whose concentrated kurtosis is within the white noise kurtosis interval as white noise; S525: High-frequency segments with kurtosis outside the white noise kurtosis range and autocovariance higher than the autocovariance threshold are identified as power line interference. S526: Local noise types of high-frequency segments with kurtosis outside the white noise kurtosis range and autocovariance below the autocovariance threshold are labeled as electromyographic artifacts.
Citation Information
Patent Citations
Electrocardiogram abnormal degree detection method based on artificial intelligence
CN119577657A
Realtime ECG signal quality estimation
US20240000393A1