Recognition and classification method based on short-time peak-to-peak interval signal and deep learning
Through a recognition and classification method based on short-term peak-to-peak interval signals and deep learning, using the residual UNet3+ feature extraction network and deep supervision structure, the problem of insufficient accuracy in ECG signal recognition in the existing technology is solved, and the detection of hyperemia and Efficient discrimination and detection of non-congestive heart failure signals.
Patent Information
- Application Number
- CN202410348554.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-26
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-03-26
AI Technical Summary
Existing ECG signal recognition models based on deep learning fail to effectively mine shallow information from the perspective of multi-scale features, and cannot effectively distinguish congestive heart failure and non-congestive heart failure signals, especially other types of abnormal heart rhythm signals, resulting in The detection and recognition accuracy is insufficient.
Using a recognition and classification method based on short-term peak-to-peak interval signals and deep learning, feature extraction and classification of ECG signals are carried out through the residual UNet3+ feature extraction network and deep supervision structure to distinguish congestive heart failure and non-congestive heart disease. Exhaustion category.
It improves the detection and identification accuracy of ECG signals, can effectively distinguish congestive and non-congestive heart failure signals, and meets the detection and identification needs of ECG signals.
Smart Images

Figure CN118236070B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a detection and recognition method, in particular to a recognition and classification method based on short-time peak-to-peak interval signals and deep learning. Background Art
[0002] As people's pace of life and work continues to accelerate, cardiovascular diseases have developed in the direction of multiple incidence and younger age, becoming the leading cause of death among adults worldwide, and the number of patients is increasing year by year. Among them, heart failure, as a complex group of clinical symptoms, is currently an important cause of death in patients with cardiovascular diseases.
[0003] As a visual means of objectively reflecting the activities of the cardiac system, the electrocardiogram contains a wealth of information related to cardiac function. However, wearing an ECG signal detector for a long time will bring many inconveniences to the patient's life and is not conducive to people's heart health observation at home.
[0004] The existing ECG signal recognition model based on deep learning aims to utilize the deep semantic information extracted by the neural network, but does not further mine the shallow information from the perspective of multi-scale features, and the model performance still needs to be improved. In addition, the existing ECG-based congestive heart failure diagnosis model aims to distinguish the ECG signals of congestive heart failure from those of normal patients, but ignores many types of non-congestive heart failure signals, especially other types of abnormal heart rhythm signals, which means that it cannot meet the existing needs for effective detection and recognition of ECG signals. Summary of the invention
[0005] The purpose of the present invention is to overcome the deficiencies in the prior art and to provide a recognition and classification method based on short-time peak-to-peak interval signals and deep learning, which can effectively detect and identify electrocardiogram signals with high detection and identification accuracy.
[0006] According to the technical solution provided by the present invention, a recognition and classification method based on short-time peak-to-peak interval signals and deep learning, the electrocardiogram signal recognition and classification method comprises:
[0007] Provide an ECG signal to be identified and classified, and use a pre-built ECG signal recognition and classification model to perform recognition and classification, where:
[0008] Extracting short-time peak-to-peak interval signals from the provided ECG signals, and loading the extracted short-time peak-to-peak interval signals into an ECG signal recognition and classification model;
[0009] The ECG signal recognition and classification model includes a feature extraction network based on residual UNet3+ and a deep supervision structure adaptively connected to the feature extraction network;
[0010] The feature extraction network is used to extract features of the loaded short-time peak-to-peak interval signal, and the extracted features are classified and weighted using a deep supervision structure to output classification information of the ECG signal after classification and weighted processing;
[0011] The classification information of the electrocardiogram signal is congestive heart failure or non-congestive heart failure.
[0012] The short-time peak-to-peak interval signal includes a plurality of peak-to-peak interval sub-signals arranged in sequence. When extracting the short-time peak-to-peak interval signal of the electrocardiogram signal, the method includes:
[0013] filtering the electrocardiogram signal to generate a filtered electrocardiogram signal after filtering;
[0014] Configure a signal sampling recognition threshold, and extract peak-to-peak intervals of the filtered ECG signal in sequence based on the configured signal sampling recognition threshold, wherein a peak-to-peak interval sub-signal is generated based on two adjacent peak-to-peak interval signals;
[0015] When extracting any peak-to-peak interval, include:
[0016] Sampling and identifying the electrocardiogram signal, after identifying the first R wave based on the signal sampling and identification threshold, sequentially configuring to form a first preset sampling and identification interval, a second preset sampling and identification interval, and a third preset sampling and identification interval according to the sampling and identification direction, until the second R wave is sampled and identified in the first preset sampling and identification interval, the second preset sampling and identification interval, or the third preset sampling and identification interval, wherein the peak-to-peak interval is formed based on the region extraction between the first R wave and the second R wave;
[0017] In the first preset sampling and identification interval, when sampling and identifying in sequence, the current sampling point is detected and identified based on the current signal sampling and identification threshold value. If the current sampling point is not identified as the second R wave, the current signal sampling and identification threshold value is generated based on the position of the current sampling point. After performing sampling and identification m times in succession and updating the signal sampling and identification threshold value m times, the current signal sampling and identification threshold value is generated based on the signal sampling and identification threshold value of m times.
[0018] In the second preset sampling and identification interval, when sampling and identifying in sequence, if the current sampling point is not identified as the second R wave, the current signal sampling and identification threshold is updated and generated, wherein when the current signal sampling and identification threshold is updated and generated, the final signal sampling and identification threshold of the first preset sampling and identification interval is used as the reference threshold, and all updated signal sampling and identification thresholds are in a linear attenuation state with the reference threshold;
[0019] In the third preset sampling identification interval, the signal sampling identification threshold finally updated in the second preset sampling identification interval is used as the current signal sampling identification threshold and maintained, and sampling identification is performed sequentially based on the signal sampling identification threshold;
[0020] Based on any two adjacent peak-to-peak intervals, the region between the first R wave of the first-order peak-to-peak interval and the first R wave of the second-order peak-to-peak interval is configured to form a peak-to-peak interval sub-signal.
[0021] A feature extraction network based on residual UNet3+ includes an encoder network and a decoder network adaptively connected to the encoder network, wherein:
[0022] The encoder network includes n encoders, and the encoder network is adaptively connected to the decoder network to form a U-shaped network with n layers;
[0023] In the U-shaped network, the encoders and decoders are numbered in sequence along the direction from the U-shaped opening to the bottom of the U-shaped network, where:
[0024] The encoder and decoder with the same number position form a network layer, so as to form n-1 network layers and a transition connection layer with only one encoder in the U-shaped network, and the encoder in the transition connection layer is connected to an adjacent decoder in the decoder network;
[0025] According to the numbering direction of the encoders, for any encoder, the output of the encoder is transmitted to the next adjacent encoder after maximum pooling processing;
[0026] For encoders and decoders in the same network layer, the output of the encoder is transmitted to the decoder after intra-layer convolution processing, and for encoders in the network layer above the current network layer, the outputs of all encoders are loaded into the decoder after downsampling processing;
[0027] Along the direction from the bottom of the U-shape to the opening of the U-shape, upsampling is performed based on the decoder network, where:
[0028] During the upsampling process, for any decoder, the decoder performs upsampling process on the output of the encoder in the transition connection layer and the output of the decoder between the current decoder and the transition connection layer;
[0029] For any decoder, the decoder concatenates all upsampled and downsampled data after unifying the scale, and performs feature fusion and extraction based on the intra-layer convolutional processing data in the same network layer.
[0030] All encoders in the encoder network are configured with a residual structure, where
[0031] For any encoder, it includes the first convolution layer of the encoder, the first GELU function of the encoder, the first batch of normalization layers of the encoder, the second convolution layer of the encoder, the second GELU function of the encoder, the second batch of normalization layers of the encoder, the addition layer, and the third batch of normalization layers of the encoder, which are connected in sequence;
[0032] The output of the first GELU function of the encoder is connected to the addition layer to form a residual structure. The output of the first GELU function of the encoder is added to the output of the second batch normalization layer of the encoder by the addition layer, and then outputted through the third batch normalization layer.
[0033] For any decoder, it includes a concatenation layer of the decoder, a convolution layer of the decoder, a GELU function of the decoder, and a batch normalization layer of the decoder connected in sequence, wherein,
[0034] The decoder utilizes the batch normalization layer output of the decoder.
[0035] During upsampling, for any decoder, the kernel size of upsampling for different upsampling objects is: K 1 =2 η , where K 1 is the kernel size during upsampling processing, η is the layer difference between the decoder and the upsampling processing object, and the upsampling processing object is the decoder or the encoder in the transition connection layer;
[0036] During downsampling, for any decoder, the kernel size of the decoder for downsampling different encoders is: K 2 =2 ξ , where K 2 is the kernel size during downsampling, and ξ is the layer difference between the decoder and the encoder during downsampling.
[0037] The deep supervision structure includes a classifier unit and a weighted average block adaptively connected to the classifier unit, wherein:
[0038] The classifier unit includes at least n classifiers, and the classifiers in the classifier unit are connected to the network layers and transition connection layers in the U-shaped network in a one-to-one correspondence;
[0039] The output of the corresponding connected network layer or transition connection layer is classified by the classifier, and the classification information output by all classifiers is weighted by the weighted average block to output the classification information after weighting.
[0040] When the electrocardiogram signal recognition and classification model is pre-built, a training step of the electrocardiogram signal recognition and classification model is also included, wherein the electrocardiogram signal recognition and classification is obtained through training, including:
[0041] Constructing a training data set, wherein the training data set includes a congestive heart failure ECG signal data set and a non-congestive heart failure ECG signal data set, the congestive heart failure ECG signal data set includes a number of short-time peak-to-peak ECG signals of congestive heart failure, and the non-congestive heart failure ECG signal data set includes a number of short-time peak-to-peak ECG signals other than congestive heart failure;
[0042] Performing a ten-fold nested cross validation using the training data set constructed above, wherein the ten-fold nested cross validation includes an inner nine-fold cross validation and an outer ten-fold cross validation performed sequentially;
[0043] After internal nine-fold cross validation, the learning attenuation strategy D is obtained;
[0044] The learning decay strategy D obtained above is used as the learning rate adjustment strategy for the external ten-fold cross validation, and after training for a preset iteration cycle based on the learning rate adjustment strategy, an electrocardiogram signal recognition and classification model is constructed.
[0045] The constructed training data set is divided into ten parts, and one of the folds is selected as the test set for external cross-validation, and the remaining nine folds are used for internal nine-fold cross-validation;
[0046] When performing internal 9-fold cross validation, select one fold from the nine folds of the internal 9-fold cross validation as the internal validation set, and the remaining eight folds as the training set;
[0047] After training with the training set, if the loss function of the internal validation set does not decrease after t consecutive iterations, multiply the learning rate by 0.1 and record the number of iterations at this time;
[0048] Generate the basic learning decay strategy for the current training based on the recorded number of iterations;
[0049] After the internal nine-fold cross-validation is completed, all the basic learning decay strategies are averaged to obtain the learning decay strategy D.
[0050] In the 10-fold nested cross validation, the loss function is:
[0051] loss = y _true *(1-y _pred )+(1-y _true )*(1+y _pred )
[0052] Among them, loss is the loss value of the loss function, y _true is the true value of the sample data in the data set, y _pred is the output value of the model, y _pred ∈(0,1).
[0053] Advantages of the present invention: The constructed ECG signal recognition and classification model includes a feature extraction network based on residual UNet3+ and a deep supervision structure adaptively connected to the feature extraction network. When classifying and identifying ECG signals, it is necessary to first extract the short-time peak-to-peak interval signal of the ECG signals. Thereafter, the ECG signal recognition and classification model is used for recognition and classification, and finally the category of the ECG signal can be obtained. The classification information of the ECG signal is congestive heart failure or non-congestive heart failure, so that the ECG signal can be effectively detected and identified with high detection and identification accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 The present invention is a flowchart of an embodiment of identifying and classifying electrocardiogram signals.
[0055] Figure 2 A flow chart of an embodiment of the present invention for training and generating an electrocardiogram signal recognition and classification model.
[0056] Figure 3 It is a schematic diagram of an embodiment of a short-time peak-to-peak interval signal of the present invention.
[0057] Figure 4 The present invention is a schematic diagram of an embodiment of a single peak-to-peak interval signal of congestive heart failure and a single peak-to-peak interval signal of normal sinus rhythm.
[0058] Figure 5 A schematic diagram of an embodiment of an electrocardiogram signal recognition and classification model of the present invention.
[0059] Figure 6 FIG. 1 is a schematic diagram of an embodiment of the ten-fold nested cross validation of the present invention.
[0060] Figure 7 This is the accuracy and loss value change curve of the training set and the test set during the external ten-fold nested cross-validation training process of the present invention. DETAILED DESCRIPTION
[0061] The present invention will be further described below in conjunction with specific drawings and embodiments.
[0062] In order to effectively detect and identify ECG signals with high detection and identification accuracy, an identification and classification method based on short-time peak-to-peak interval signals and deep learning is provided. In one embodiment of the present invention, the ECG signal identification and classification method includes:
[0063] Provide an ECG signal to be identified and classified, and use a pre-built ECG signal recognition and classification model to perform recognition and classification, where:
[0064] Extracting short-time peak-to-peak interval signals from the provided ECG signals, and loading the extracted short-time peak-to-peak interval signals into an ECG signal recognition and classification model;
[0065] The ECG signal recognition and classification model includes a feature extraction network based on residual UNet3+ and a deep supervision structure adaptively connected to the feature extraction network;
[0066] The feature extraction network is used to extract features of the loaded short-time peak-to-peak interval signal, and the extracted features are classified and weighted using a deep supervision structure to output classification information of the ECG signal after classification and weighted processing;
[0067] The classification information of the electrocardiogram signal is congestive heart failure or non-congestive heart failure.
[0068] It can be seen from the above description that the recognition and classification of ECG signals specifically includes identifying whether the ECG signal is an ECG signal of congestive heart failure, that is, judging whether the current ECG signal is an ECG signal of congestive heart failure or an ECG signal of non-congestive heart failure. The recognition and classification of ECG signals can also be selected according to the actual application scenario, so as to meet the actual application scenario requirements. The following takes the recognition and classification of ECG signals as congestive heart failure or non-congestive heart failure as an example to specifically explain the specific recognition and classification process.
[0069] In order to identify and classify ECG signals, in one embodiment of the present invention, an ECG signal recognition and classification model for identifying and classifying ECG signals needs to be pre-built. Figure 5 An embodiment of the constructed ECG signal recognition and classification model is shown in the figure. In the figure, the ECG signal recognition and classification model includes a feature extraction network based on residual UNet3+ and a deep supervision structure adaptively connected to the feature extraction network. The specific circumstances of the feature extraction network based on residual UNet3+, the deep supervision structure, and the process of constructing the ECG signal recognition and classification model will be described in detail below.
[0070] In specific implementation, the ECG signal may be in the form of an ECG signal obtained by an existing ECG monitoring device, such as an ECG signal may be an ECG, wherein an ECG is a graphical representation of an ECG signal, and the form of the ECG monitoring device may be an ECG monitor that can obtain an ECG. Of course, the ECG signal may also be in other forms. In this case, the form of the ECG monitoring device is based on the ability to obtain the corresponding ECG signal, and will not be listed here one by one. Regardless of the ECG signal obtained by the ECG monitoring device, when identifying and classifying the ECG signal, it is necessary to first extract the short-time peak-to-peak interval signal of the ECG signal, and then the ECG signal recognition and classification model performs recognition and classification based on the extracted short-time peak-to-peak interval signal.
[0071] It should be noted that the ECG signal to be identified can be called the original ECG signal, which can generally be obtained through a relatively long period of collection, such as 24 hours of collection; and the short-time peak-to-peak interval signal is obtained by processing the original ECG signal. The time for processing the short-time peak-to-peak interval signal (about half an hour) is generally much shorter than the time for collecting and forming the original ECG signal (about 24 hours). Therefore, the short-time in the present invention is relative to the original ECG signal.
[0072] It is known to those skilled in the art that congestive heart failure and no disease can be understood as mutually exclusive events, while congestive heart failure and non-congestive heart failure are opposing events, and no disease belongs to a subset of non-congestive heart failure that is easier to distinguish. When recognizing ECG signals, previous methods can only distinguish mutually exclusive events, but cannot distinguish opposing events, that is, it is easy to confuse ECG signals of other diseases with ECG signals of congestive heart failure and cannot accurately recognize them.
[0073] Heart rate variability refers to the phenomenon of peak-to-peak interval fluctuations. Its physiological mechanism is the coordinated action of the sympathetic nerve and the vagus nerve to control the pacemaking of the sinoatrial node, which is manifested as irregular changes in the duration of each cardiac cycle. Heart rate variability can be used as a biomarker for diagnosing cardiovascular diseases and is also an important feature for distinguishing patients with congestive heart failure from normal subjects. Therefore, the short-term peak-to-peak interval signal of the original ECG signal can be used to identify and classify the category of the ECG signal.
[0074] When the ECG signal recognition and classification model is adopted Figure 5 In the form shown, in one embodiment of the present invention, feature extraction is performed on the loaded short-time peak-to-peak interval signal through a feature extraction network, and the extracted features are classified and weighted using a deep supervision structure to output classification information of the ECG signal after the classification and weighted processing; from the above description, it can be seen that the classification information of the ECG signal output by the ECG signal recognition and classification model should be congestive heart failure type or non-congestive heart failure type, that is, the present invention can distinguish and identify the ECG signal type of congestive heart failure and the ECG signal type of non-congestive heart failure. In addition, the specific category of the non-congestive heart failure class will be described in detail below.
[0075] In one embodiment of the present invention, the short-time peak-to-peak interval signal includes a plurality of peak-to-peak interval sub-signals arranged in sequence, and when extracting the short-time peak-to-peak interval signal of the electrocardiogram signal, the method includes:
[0076] filtering the electrocardiogram signal to generate a filtered electrocardiogram signal after filtering;
[0077] Configure a signal sampling recognition threshold, and extract peak-to-peak intervals of the filtered ECG signal in sequence based on the configured signal sampling recognition threshold, wherein a peak-to-peak interval sub-signal is generated based on two adjacent peak-to-peak interval signals;
[0078] When extracting any peak-to-peak interval, include:
[0079] Sampling and identifying the electrocardiogram signal, after identifying the first R wave based on the signal sampling and identification threshold, sequentially configuring to form a first preset sampling and identification interval, a second preset sampling and identification interval, and a third preset sampling and identification interval according to the sampling and identification direction, until the second R wave is sampled and identified in the first preset sampling and identification interval, the second preset sampling and identification interval, or the third preset sampling and identification interval, wherein the peak-to-peak interval is formed based on the region extraction between the first R wave and the second R wave;
[0080] In the first preset sampling and identification interval, when sampling and identifying in sequence, the current sampling point is detected and identified based on the current signal sampling and identification threshold value. If the current sampling point is not identified as the second R wave, the current signal sampling and identification threshold value is generated based on the position of the current sampling point. After performing sampling and identification m times in succession and updating the signal sampling and identification threshold value m times, the current signal sampling and identification threshold value is generated based on the signal sampling and identification threshold value of m times.
[0081] In the second preset sampling and identification interval, when sampling and identifying in sequence, if the current sampling point is not identified as the second R wave, the current signal sampling and identification threshold is updated and generated, wherein when the current signal sampling and identification threshold is updated and generated, the final signal sampling and identification threshold of the first preset sampling and identification interval is used as the reference threshold, and all updated signal sampling and identification thresholds are in a linear attenuation state with the reference threshold;
[0082] In the third preset sampling identification interval, the signal sampling identification threshold finally updated in the second preset sampling identification interval is used as the current signal sampling identification threshold and maintained, and sampling identification is performed sequentially based on the signal sampling identification threshold;
[0083] Based on any two adjacent peak-to-peak intervals, the region between the first R wave of the first-order peak-to-peak interval and the first R wave of the second-order peak-to-peak interval is configured to form a peak-to-peak interval sub-signal.
[0084] In specific implementation, when the ECG signal is filtered by a moving average filter, the power line interference in the ECG signal can be filtered out and the electromyographic signal noise can be suppressed after filtering. When the moving average filter is used for filtering, it generally includes two filtering processes performed in sequence. For example, it can be considered to filter out the power line interference first, and then filter out the electromyographic signal noise. The specific filtering process is described below by taking the example of first filtering out the power line interference and then filtering out the electromyographic signal noise. When filtering, it is necessary to know the sampling frequency of the original ECG signal. The sampling frequency of the original ECG signal can be obtained by existing commonly used methods, such as by calculation or by sampling and tracing the original ECG signal.
[0085] During the first filtering, the filter window length of the filter is the sampling frequency of the original ECG signal divided by 50. Here, since a moving average filter is used for filtering, and the frequency of power line interference usually occurs at 50Hz (i.e., the frequency of alternating current), the sampling frequency divided by 50 refers to the size of the filter window length divided by 50. At this time, the filter window length of the moving average filter can be obtained, and thereafter, filtering can be performed in a manner commonly used in the technical field. Similarly, since the spectrum of the electromyographic signal is usually located in a lower frequency range, generally 35Hz, during the second filtering, when a moving average filter is used for filtering, the filter window length of the moving average filter can be set to the sampling frequency of the original ECG signal divided by 35. Thereafter, the signal after the first filtering is filtered for the second time. After the ECG signal is filtered twice as described above, a filtered ECG signal can be generated.
[0086] Generally, a short-time peak-to-peak interval signal includes several peak-to-peak interval sub-signals, and the number of peak-to-peak interval sub-signals can be selected as needed. As can be seen from the following description, a short-time peak-to-peak interval signal can include 2000 peak-to-peak interval sub-signals, wherein the 2000 peak-to-peak interval sub-signals are arranged in sequence. In order to obtain a short-time peak-to-peak interval signal, it is necessary to sample and identify the filtered ECG signal to obtain several peak-to-peak intervals after sampling and identification, wherein a peak-to-peak interval sub-signal can be generated based on two adjacent peak-to-peak intervals. Generally, each peak-to-peak interval can be sampled and identified in the same manner. The following is an explanation of the manner in which the peak-to-peak interval is obtained by sampling and identifying, and a peak-to-peak interval sub-signal is generated.
[0087] In order to extract the short-time peak-to-peak interval signal of the ECG signal, it is generally necessary to configure the signal sampling recognition threshold first. The initially configured signal sampling recognition threshold is generally a constant, such as the signal sampling recognition threshold can be set to 0.4. ECG signals can generally be considered as a time-amplitude sequence. Therefore, after setting the signal sampling recognition threshold, sampling recognition can be performed according to the timing of ECG signal generation. During sampling recognition, the amplitude of the filtered ECG signal is compared with the signal sampling recognition threshold. When the amplitude of the filtered ECG signal is greater than the signal sampling recognition threshold, it can be considered that the first R wave has been recognized.
[0088] After the first R wave is identified, the first preset sampling identification interval, the second preset sampling identification interval and the third preset sampling identification interval are configured in sequence according to the sampling identification direction. For example, the interval from the first R wave to 200ms is configured as the first preset sampling identification interval, the interval from 200ms to 1200ms is configured as the second preset sampling identification interval, and all intervals after 1200ms are configured as the third preset sampling identification interval. Of course, in specific implementation, other methods can also be used to configure the first preset sampling identification interval, the second preset sampling identification interval and the third preset sampling identification interval. They will not be listed one by one here, and the extraction of short-time peak-to-peak interval signals shall prevail.
[0089] In specific implementation, the configuration forms the first preset sampling identification interval, the second preset sampling identification interval and the third preset sampling identification interval, the main purpose of which is to more effectively sample and identify the second R wave. Therefore, after the second R wave is identified in the first preset sampling identification interval, it is not necessary to perform sampling and identification in the second preset sampling identification interval, otherwise, it is necessary to perform sampling and identification in the second preset sampling identification interval. After the second R wave is identified in the second preset sampling identification interval, it is not necessary to perform sampling and identification in the third preset sampling identification interval, otherwise, it is necessary to perform sampling and identification in the third preset sampling identification interval. Thus, after the first R wave is sampled and identified, until the second R wave is sampled and identified in the first preset sampling identification interval, the second preset sampling identification interval or the third preset sampling identification interval, the peak-peak interval can be extracted based on the area between the first R wave and the second R wave, wherein when extracting and forming a short-time peak-peak interval signal, the area between the first R wave and the second R wave can be directly intercepted to form a short-time peak-peak interval.
[0090] In one embodiment of the present invention, within a first preset sampling and identification interval, sampling and identification are performed sequentially, specifically referring to successive sampling along the direction of sampling and identification mentioned above. The interval or period of sampling and identification can generally be selected according to actual needs, such as being consistent with the sampling period for collecting and forming an electrocardiogram signal; the sampling and identification conditions within the second preset sampling and identification interval and the third preset sampling and identification interval are consistent with the first preset sampling and identification interval.
[0091] In the first preset sampling identification interval, during the first sampling identification, the amplitude of the current sampling point is compared with the current signal sampling identification threshold. It can be seen from the above description that the current signal sampling identification threshold can be the above-mentioned setting of 0.4. When the sampling point of the first sampling is not identified as the second R wave, the signal sampling identification threshold is updated based on the position of the current sampling point and used as the current signal sampling identification threshold for the next sampling point, so as to obtain the current signal sampling identification threshold for the second sampling point sampling identification. Here, the sampling point is not identified as the second R wave, which specifically means that the amplitude of the current sampling point is less than the current signal sampling identification threshold. In the subsequent description, when it is not identified as the second R wave, it means the same meaning, and you can refer to the description here.
[0092] In specific implementation, when the signal sampling recognition threshold is updated based on the position of the current sampling point, a feasible updating method may be: new =X 2 [ξ]-X[ξ-k]×X[ξ+k], ξ is the distance between the current sampling point and the first R wave, k is generally 1. If the first sampling point is not identified as the second R wave, the signal sampling recognition threshold is updated, then: M new =X 2 [1]-X[0]×X[2],M new is the updated signal sampling recognition threshold, X[0] is the amplitude of the first R wave, X[1] is the amplitude of the first sampling point, and X[2] is the amplitude of the second sampling point. For other cases, please refer to the description here and so on. The specific process will not be described in detail. When the signal sampling recognition threshold is updated in the above manner, the peak-to-peak signal can be strengthened and the unnecessary noise components can be suppressed. Generally, the updated signal sampling recognition threshold M new It should not be greater than 1.5 times the signal sampling recognition threshold before updating. When it is greater than 1.5 times the signal sampling recognition threshold before updating, the signal sampling recognition threshold will not be updated after sampling and identifying the current sampling point. At this time, the signal sampling recognition threshold before updating will be used as the current signal sampling recognition threshold, and the sampling recognition of the next sampling point will be performed.
[0093] Within the first preset sampling identification interval, when sampling and identifying subsequent sampling points, refer to the above description. For example, for the third sampling point, the signal sampling identification threshold after the position information of the second sampling point is updated is used as the current signal sampling identification threshold, and compared with the amplitude of the third sampling point. If the third sampling point is not identified as the second R wave, the signal sampling identification threshold is updated and the sampling identification process of the next sampling point is repeated until the second R wave is identified or the sampling identification of the first preset sampling identification interval is completed.
[0094] In order to improve the accuracy and reliability of the second R wave sampling and identification, after performing sampling and identification m times in succession and updating the signal sampling and identification threshold m times, the current signal sampling and identification threshold is generated based on the signal sampling and identification threshold m times; generally, m is preferably set to 5. Of course, m can also take other values. For example, when m is 5, that is, after the signal sampling and identification threshold is updated 5 times in succession, the current signal sampling and identification threshold is generated based on the signal sampling and identification threshold updated 5 times. For example, the signal sampling and identification thresholds updated 5 times can be averaged to generate the current signal sampling and identification threshold.
[0095] It can be seen from the above description that when m is 5, then within the first preset sampling identification interval, after sampling and identifying 5 sampling points, the signal sampling identification thresholds updated 5 times are averaged, and the average value generated is the current signal sampling identification threshold. At this time, the current signal sampling identification threshold is used as the sixth sampling point for sampling identification. Thereafter, the above-mentioned sampling identification and updating signal sampling identification threshold process are repeated until the sampling and identification of all sampling points within the first preset sampling identification interval is completed. Generally, after the sampling and identification of all sampling points within the first preset sampling identification interval is completed, the updated current signal sampling identification threshold can be used as the reference threshold of the second preset sampling identification interval, that is, the initial signal sampling identification threshold of the second preset sampling identification interval.
[0096] It can be seen from the above description that when the second R wave is not identified in the first preset sampling identification interval, it is necessary to enter the second preset sampling identification interval for sampling identification. In specific implementation, the sampling identification process in the second preset sampling identification interval can be the same as that in the first preset sampling identification interval. The difference is that the method of updating the signal sampling identification threshold is different, which is described in detail below. When the first sampling identification is performed in the first preset sampling identification interval, the signal sampling identification threshold can be the initial setting of 0.4, and when the first sampling identification is performed in the second preset sampling identification interval, it can be the signal sampling identification threshold at the end of sampling identification in the first preset sampling identification interval. The signal sampling identification threshold can be updated with reference to the above method, which is specifically related to the sampling identification process in the first preset sampling identification interval, and can be specifically referred to the above description.
[0097] In one embodiment of the present invention, the final signal sampling identification threshold value of the first preset sampling identification interval is used as the reference threshold value, and all updated signal sampling identification threshold values are in a linear attenuation state with the reference threshold value, that is, all updated signal sampling identification threshold values are in a linearly decreasing state. In specific implementation, the linear attenuation state can be obtained by linear fitting, such as setting the signal sampling identification threshold value of the last sampling point to 0.6 times the reference threshold value, and thereafter, the linear fitting can be achieved by the commonly used technical means in the technical field. In addition, the number of required sampling points can be determined according to the interval or period of sampling identification, that is, according to the number of sampling points and the linear fitting method, the specific method of updating the signal sampling identification threshold value after each sampling point is compared can be obtained.
[0098] If the second R wave is not identified in the second preset sampling and identification interval, it is necessary to enter the third preset sampling and identification interval for sampling and identification. Figure 3 An embodiment when the second R wave is identified is shown in FIG. 1 . Different from the first preset sampling identification interval and the second preset sampling identification interval, the signal sampling identification threshold in the third preset identification interval remains unchanged, that is, the above-mentioned updating process of the signal sampling identification threshold is not required. The signal sampling identification threshold in the third preset sampling identification interval can generally be the signal sampling identification threshold finally formed after sampling identification in the second preset sampling identification interval, such as the signal sampling identification threshold used when sampling identification is performed at the last sampling point in the second preset sampling identification interval, or the signal sampling identification threshold updated after sampling identification at the last sampling point.
[0099] During specific implementation, the above-mentioned sampling and recognition process can also be fine-tuned, such as adjusting the setting or updating method of the sampling and recognition thresholds of different signals during the above-mentioned sampling and recognition. Of course, other sampling and recognition forms can also be used, so as to effectively realize the recognition and extract the peak-to-peak interval.
[0100] After identifying and extracting the peak-to-peak interval, the above sampling and identification process is repeated, so that multiple peak-to-peak intervals that are identified and extracted in sequence can be obtained in sequence; for example, after identifying and extracting the first peak-to-peak interval, the initially configured signal sampling and identification threshold (such as the 0.4 mentioned above) is used to identify the first R wave of the next peak-to-peak interval. Thereafter, the second R wave is sampled and identified to obtain the second peak-to-peak interval. The sampling and identification process is repeated until the required short-time peak-to-peak interval can be formed.
[0101] After the peak-to-peak interval is identified, for two adjacent peak-to-peak intervals, the area between the first R wave of the first-order peak-to-peak interval and the first R wave of the second-order peak-to-peak interval is configured to form a peak-to-peak interval sub-signal in the sampling and identification order, wherein the first order specifically refers to the sampling and identification order that is adjacent to the second order and before the sampling and identification of the second order, such as for the first peak-to-peak interval and the second peak-to-peak interval, the first peak-to-peak interval is the first-order peak-to-peak interval, and the second peak-to-peak interval is the second-order peak-to-peak interval; similarly, for the second peak-to-peak interval and the third peak-to-peak interval, the second peak-to-peak interval is the first-order peak-to-peak interval, and the third peak-to-peak interval is the second-order peak-to-peak interval. For other situations, please refer to the description here and will not be listed one by one.
[0102] Based on the above sampling recognition order, a corresponding peak-to-peak interval sub-signal can be generated based on the corresponding peak-to-peak interval, and a plurality of sequentially arranged peak-to-peak interval sub-signals can form a short-time peak-to-peak signal.
[0103] In one embodiment of the present invention, a feature extraction network based on residual UNet3+ includes an encoder network and a decoder network adaptively connected to the encoder network, wherein:
[0104] The encoder network includes n encoders, and the encoder network is adaptively connected to the decoder network to form a U-shaped network with n layers;
[0105] In the U-shaped network, the encoders and decoders are numbered in sequence along the direction from the U-shaped opening to the bottom of the U-shaped network, where:
[0106] The encoder and decoder with the same number position form a network layer, so as to form n-1 network layers and a transition connection layer with only one encoder in the U-shaped network, and the encoder in the transition connection layer is connected to an adjacent decoder in the decoder network;
[0107] According to the numbering direction of the encoders, for any encoder, the output of the encoder is transmitted to the next adjacent encoder after maximum pooling processing;
[0108] For encoders and decoders in the same network layer, the output of the encoder is transmitted to the decoder after intra-layer convolution processing, and for encoders in the network layer above the current network layer, the outputs of all encoders are loaded into the decoder after downsampling processing;
[0109] Along the direction from the bottom of the U-shape to the opening of the U-shape, upsampling is performed based on the decoder network, where:
[0110] During the upsampling process, for any decoder, the decoder performs upsampling process on the output of the encoder in the transition connection layer and the output of the decoder between the current decoder and the transition connection layer;
[0111] For any decoder, the decoder concatenates all upsampled and downsampled data after unifying the scale, and performs feature fusion and extraction based on the intra-layer convolutional processing data in the same network layer.
[0112] Figure 5 An embodiment of the ECG signal recognition and classification model is shown in FIG. 1 , and an embodiment of the feature extraction network and the deep supervision structure are shown in FIG. Figure 5 The specifics of the feature extraction network and the deep supervision structure are explained in detail.
[0113] In one embodiment of the present invention, the feature extraction network includes an encoder network and a decoder network. A U-shaped network can be formed by the encoder network and the decoder network, wherein the encoder network includes n encoders. When the encoder network includes n encoders, the entire U-shaped network forms an n-layer form, that is, the number of layers of the U-shaped network is generally consistent with the number of encoders in the encoder network. In specific implementation, the number n of encoders in the encoder network is preferably 5, such as Figure 5 As shown in the figure, in the decoder network, the number of decoders is one less than the number of encoders. In the figure, the number of decoders is 4. At this time, a 5-layer U-shaped network can be formed based on the 5 encoder networks and the 4 decoder networks.
[0114] right Figure 5 The U-shaped network in the figure has a U-shaped opening and a U-shaped bottom. In the figure, there is only one encoder at the bottom of the U. At this time, a transition connection layer can be formed. The remaining encoders are arranged in sequence to form one side of the U, and all decoders are arranged in sequence to form the other side of the U. An encoder on the side of the U corresponds to a decoder to form a network layer. Figure 5 There are 4 network layers in it.
[0115] Figure 5 In the figure, along the direction from the U-shaped opening to the bottom of the U-shaped, the 5 encoders are numbered En0 to En4, and the 4 decoders are numbered De0 to De3. Encoder En0 and decoder DE0 form a network layer and are located at the opening of the U-shaped network. Encoder En1 and decoder De1 form a network layer, and a transition connection layer is formed based on encoder En4. For other situations, please refer to Figure 5 and instructions here.
[0116] In the encoder network, data is transmitted sequentially along the direction from the U-shaped opening to the bottom of the U-shape, such as from encoder En0 to encoder En4. During transmission, the output of each encoder is subjected to maximum pooling processing. For example, the output of encoder En0 is transmitted to encoder En1 after maximum pooling processing, and the output of encoder En1 is transmitted to encoder En2 after maximum pooling processing, and finally transmitted to encoder En4. That is, in the encoder network, the output of one encoder is transmitted to the next adjacent encoder after maximum pooling processing.
[0117] In specific implementation, the maximum pooling process can be implemented by using the commonly used technical methods in the technical field. The maximum pooling process can be used to achieve downsampling between encoders. At this time, the spatial size of the feature map can be reduced, key features can be extracted, and the computational efficiency and generalization ability of the ECG signal recognition and classification model can be improved. The feature map is a short-term peak-to-peak signal extracted from the original ECG signal.
[0118] For the encoder and decoder of the same network layer, the output of the encoder is transmitted to the decoder after intra-layer convolution. Through the intra-layer convolution processing, on the one hand, the required features can be further extracted, and on the other hand, the size of the feature channel can be unified. Figure 5 The convolution block in can realize intra-layer convolution processing. In the figure, the convolution block includes the convolution layer of the convolution block, the GELU function of the convolution block and the batch normalization layer of the convolution block. When performing intra-layer convolution processing, the output of the encoder passes through the convolution layer of the convolution block, the GELU function of the convolution block and the batch normalization layer of the convolution block in turn for corresponding calculation processing, and is finally loaded into the corresponding decoder through the batch normalization layer of the convolution block.
[0119] In addition, the U-type network also includes upsampling processing and downsampling processing, wherein the downsampling processing specifically refers to the decoder downsampling the encoder; the upsampling processing specifically refers to the decoder upsampling the decoder and / or the encoder; specifically, when the decoder downsamples the encoder, the network layer where the decoder is located is located below the network layer where the encoder is located, such as Figure 5 In the example, decoder De3 can downsample encoders En0 to En2, decoder De2 can downsample encoders En0 to En1, decoder De1 can only downsample encoder En0, and decoder De0 does not downsample any encoder.
[0120] In specific implementation, a downsampling processing block may be used to perform downsampling processing. Through the downsampling processing, on the one hand, the required features can be further extracted, and on the other hand, the feature channel sizes can be unified. Figure 5An embodiment of a downsampling processing block is shown in the figure. In the figure, the downsampling processing block includes a maximum pooling layer of the downsampling block, a convolutional layer of the downsampling block, a GELU function of the downsampling block, and a batch normalization layer of the downsampling block. All downsampling processing blocks that perform downsampling processing can adopt the same structural form. Of course, different structural forms can also be adopted. It is preferred to adopt the same structural form to perform downsampling processing.
[0121] Although the same structural form of downsampling processing blocks can be used, since one decoder performs downsampling on different encoders through different downsampling processing blocks, and since each layer of features of the encoder part is passed down through the maximum pooling process, in order to unify the features of the input decoder, it is necessary to perform downsampling operations on features of different sizes. Therefore, when different downsampling processing blocks perform downsampling processing, the kernel sizes used must be different. In one embodiment of the present invention, during downsampling processing, for any decoder, the kernel size of the decoder for downsampling processing on different encoders is: K 2 =2 ξ , where K 2 is the kernel size during downsampling processing, ξ is the layer difference between the decoder and the encoder during downsampling processing. Specifically, the kernel sizes of the downsampling processing are different, specifically referring to the different kernel sizes of the maximum pooling layer of the downsampling blocks in different downsampling processing blocks.
[0122] like Figure 5 In the example, when decoder De3 performs downsampling, the layer difference when decoder De3 performs downsampling processing on encoder En2 is 1. At this time, the kernel size of the maximum pooling layer of the corresponding downsampling block is K 2 =2 1 ; The layer difference when decoder De3 downsamples encoder En1 is 2. At this time, the kernel size of the maximum pooling layer of the corresponding downsampling block is K 2 =2 2 ; The layer difference when decoder De3 downsamples encoder En0 is 3. At this time, the kernel size of the maximum pooling layer of the corresponding downsampling block is K 2 =2 3 The situations when other decoders perform downsampling processing on the encoder can refer to the description of the downsampling processing performed by decoder De3, and examples will not be given here one by one.
[0123] Similar to the above downsampling, in the U-type network, upsampling is used to further extract the required features and unify the feature channel size. When upsampling, the decoder upsamples the output of the encoder in the transition connection layer and the output of the decoder between the current decoder and the transition connection layer, such as Figure 5In the figure, there is only encoder En4 between decoder De3 and the transition connection layer, so decoder En3 can only upsample encoder En4; decoder De3 is included between decoder De2 and the transition connection layer, so for decoder De2, when upsampling, encoder En4 and decoder De3 in the transition connection layer are upsampled at the same time; similarly, for decoder De1, encoder En4, decoder De3 and decoder De2 in the transition connection layer can be upsampled at the same time; for decoder De0, encoder En4, decoder De3, decoder De2 and decoder De1 in the transition connection layer can be upsampled at the same time.
[0124] In specific implementation, the downsampling processing block can be used to perform downsampling processing. Figure 5 An embodiment of an upsampling processing block is shown in the figure. In the figure, the upsampling processing block includes an upsampling layer, a convolution layer of the upsampling block, a GELU function of the upsampling block and a batch normalization layer of the upsampling block. All upsampling processing blocks that perform upsampling processing can adopt the same structural form. Of course, different structural forms can also be adopted. It is preferred to adopt the same structural form to perform upsampling processing.
[0125] Although the upsampling processing blocks of the same structure can be used, since the objects when each upsampling processing block performs upsampling processing are different, it can be seen from the above description that different kernel sizes need to be used, that is, the kernel sizes of the upsampling layers in different upsampling processing blocks are different.
[0126] In one embodiment of the present invention, during upsampling processing, for any decoder, the kernel size of the decoder for upsampling different upsampling processing objects is: K 1 =2 η , where K 1 is the kernel size during upsampling processing, η is the layer difference between the decoder and the upsampling processing object, and the upsampling processing object is the decoder or the encoder in the transition connection layer; Figure 5 In the example, for decoder De3, the layer difference when decoder De3 performs upsampling processing on encoder En4 through the upsampling processing block is 1. At this time, the kernel size of the upsampling layer in the corresponding upsampling processing block is K 2 =2 1 ; The layer difference when decoder De2 performs downsampling processing on encoder En4 is 2. At this time, the kernel size of the upsampling layer in the corresponding upsampling processing block is K 2 =2 2 , the layer difference when decoder De2 performs upsampling processing on decoder De1 is 1. At this time, the kernel size of the upsampling layer in the corresponding upsampling processing block is K 2 =2 1; The layer difference when decoder De1 downsamples encoder En4 is 3. At this time, the kernel size of the upsampling layer in the corresponding upsampling processing block is K 2 =2 3 , the other decoders can refer to the upsampling process Figure 5 As well as the above description, no further examples will be given here.
[0127] From the above description, we can see that the encoder and decoder in the same network layer neither perform downsampling nor upsampling, but only perform intra-layer convolution. Figure 5 In the example, for encoder En0 and decoder De0, the output of encoder En0 is transmitted to decoder De0 after intra-layer convolution. The situations of other network layers can be referred to here.
[0128] In one embodiment of the present invention, all encoders in the encoder network are configured with a residual structure, wherein:
[0129] For any encoder, it includes the first convolution layer of the encoder, the first GELU function of the encoder, the first batch of normalization layers of the encoder, the second convolution layer of the encoder, the second GELU function of the encoder, the second batch of normalization layers of the encoder, the addition layer, and the third batch of normalization layers of the encoder, which are connected in sequence;
[0130] The output of the first GELU function of the encoder is connected to the addition layer to form a residual structure. The output of the first GELU function of the encoder is added to the output of the second batch normalization layer of the encoder by the addition layer, and then outputted through the third batch normalization layer of the encoder.
[0131] In specific implementation, the encoders in the encoder network can generally adopt the same structure. Figure 5 An embodiment of the encoder is shown in , and for the first convolution layer of the encoder and the second convolution layer of the encoder in the encoder, the corresponding convolution kernel can be set to 3, the step size is 1, and the padding is 1; of course, the corresponding convolution layer parameters can also select other parameters according to actual needs. The first GELU function of the encoder, the first batch of normalization layers of the encoder, the second GELU function of the encoder, the second batch of normalization layers of the encoder, the addition operation layer, and the third batch of normalization layers of the encoder can directly use the default parameters, that is, no setting steps such as parameter modification are required.
[0132] In order to avoid the disappearance of gradients, a skip connection is added in the encoder to form a residual structure, that is, the output of the first GELU function of the encoder in the encoder is directly added to the output of the second batch normalization layer of the encoder, and the result of the addition is output through the third batch normalization layer of the encoder, wherein the addition operation is performed through the addition operation layer.
[0133] In specific implementation, for any encoder, the forward calculation process is: En i =Conv res [(En i-1 ) ↓2 ], where Eni refers to the output of the i-th layer encoder, Conv res is the residual block, i.e. the encoder module, ↓2 is 2 times downsampling, Figure 5 As shown in the figure, the value of i ranges from 1 to 4. As can be seen from the above description, the 2x downsampling here is the downsampling based on the maximum pooling layer between encoders.
[0134] As can be seen from the above description, the output of the encoder is generally transmitted to the next encoder through the maximum pooling process, and the maximum pooling process can be performed through the maximum pooling layer. The method and process of performing the maximum pooling process using the maximum pooling layer are consistent with the existing method. For the maximum pooling layer, the kernel size of the maximum pooling layer can be set to 2. In addition, Figure 5 The encoder network shown in , includes four maximum pooling layers, that is, four maximum pooling processes are performed respectively using four maximum pooling layers, and at the same time, four downsamplings are achieved.
[0135] In specific implementation, the short-time peak-to-peak interval signal is extracted from the original ECG signal. The characteristic size of the short-time peak-to-peak interval signal is generally 2000, that is, there are 2000 peak-to-peak intervals in the short-time peak-to-peak interval signal. Figure 5 In the embodiment, when four maximum pooling layers are used to perform four maximum pooling processes, the feature size gradually decreases from 2000 to 125 (because the maximum pooling layer achieves 2-fold downsampling each time the maximum pooling process is performed, that is, the feature size is divided by 2 for each next layer, so 2000 / 16=125), and the number of feature channels is increased from 1 channel to 384 channels, thereby obtaining richer global features, so as to comprehensively diagnose congestive heart failure with full-scale features.
[0136] Since the initial short-time peak-to-peak interval signal is a one-dimensional signal, that is, the number of channels is 1, the number of channels can be increased to 24 by convolution of the first layer of encoder, and then the number of channels in each next layer is multiplied by 2, and finally 24*16=384, that is, Figure 5 In the example, the feature size of the data output by encoder En4 is 125, and the number of channels is 384. Therefore, in the encoder network, the number of channels of encoder En0 is 24, and the number of channels of encoders En1 to En4 is configured to be multiplied by 2 after convolution processing.
[0137] In one embodiment of the present invention, for any decoder, a concatenation layer of the decoder, a convolution layer of the decoder, a GELU function of the decoder, and a batch normalization layer of the decoder are connected in sequence, wherein:
[0138] The decoder utilizes the batch normalization layer output of the decoder.
[0139] In specific implementation, the decoders in the decoder network can generally adopt the same structure. Figure 5 An embodiment of a decoder is shown in FIG. 1 , in which the decoder includes a concatenation layer of the decoder, a convolution layer of the decoder, a GELU function of the decoder, and a batch normalization layer of the decoder. The convolution layer of the decoder can use a convolution layer with a kernel size of 3, a step size of 1, and a padding of 1; the concatenation layer of the decoder, the GELU function of the decoder, and the batch normalization layer of the decoder can use existing default parameters. Figure 5 It can be seen that for any decoder, there are 5 inputs. The decoder performs feature fusion and extraction on the 5 inputs through the concatenation layer of the decoder. The output of each decoder is unified to have 24 channels and a feature size of L = 2. 1-i ×10 3 , where i ranges from 0 to 3, such as Figure 5 In the figure, for decoder De0, the feature size of its output is 2000, while the feature size of decoder De1 is 1000, the feature size of decoder De2 is 500, and the feature size of decoder De3 is 250.
[0140] From the above description, it can be seen that for any decoder, the forward calculation process of the decoder is: Among them, De i Refers to the output of the i-th layer decoder, Conv ori It is a convolution block, Cat refers to the concatenation operation, and ↑2 means 2x upsampling.
[0141] In one embodiment of the present invention, the deep supervision structure includes a classifier unit and a weighted average block adaptively connected to the classifier unit, wherein:
[0142] The classifier unit includes at least n classifiers, and the classifiers in the classifier unit are connected to the network layers and transition connection layers in the U-shaped network in a one-to-one correspondence;
[0143] The output of the corresponding connected network layer or transition connection layer is classified by the classifier, and the classification information output by all classifiers is weighted by the weighted average block to output the classification information after weighting.
[0144] In order to integrate low-level details with high-level pathology-related information, make full use of input information, enrich pathology-related information, and effectively improve detection performance, in one embodiment of the present invention, a deep supervision structure is added on the basis of the feature extraction network based on residual UNet3+. The deep supervision structure is based on the features after each layer of decoder splicing (the number of channels is 120 and the feature size is L=2 1-i ×10 3 ), and pass it through the global average pooling layer to obtain the average value of the eigenvalues of each channel, and obtain features with 120 channels and a length of 1, which efficiently aggregates the information of the entire feature map, reduces the number of parameters and the amount of calculation of the subsequent model, and has good generalization ability.
[0145] In specific implementation, all classifiers in the classifier unit can adopt the same structural form, and one classifier is connected to a layer in the U-shaped network. Figure 5 In the figure, an embodiment of setting 5 classifiers in the classifier unit is shown. In the figure, the 5 classifiers are classifier 0 to classifier 4, wherein classifier 4 is connected to encoder En4 in the transition connection layer, and classifier 0 to classifier 3 are connected to decoder De0 to decoder De3 respectively.
[0146] Further, Figure 5 An embodiment of a classifier is shown in , in which the classifier includes a global average pooling layer of the classifier, a first linear layer of the classifier, a GELU function of the classifier, a second linear layer of the classifier, and a Sigmoid activation function connected in sequence; wherein the global average pooling layer of the classifier converts the final feature map into a vector with a fixed size so that the classifier can perform the final classification; the first linear layer of the classifier and the second linear layer of the classifier are responsible for classification; the output range of the Sigmoid activation function is between (0,1). The global average pooling layer of the classifier, the first linear layer of the classifier, the GELU function of the classifier, the second linear layer of the classifier, and the Sigmoid activation function can be configured to use default parameters. Therefore, the five features pooled by the global average pooling layer are respectively passed through five layers of two linear layers (the final output length of the linear layer is 2, representing the probability of congestive heart failure), a GELU function of the classifier, and a Sigmoid activation function, thereby obtaining classification results based on different depth features.
[0147] Finally, the classification results of different layers are weighted (that is, weighted by weighted average blocks, and the weight decreases with depth) to obtain the final recognition and classification results. Compared with the inherent jump connection of the residual UNet3+ feature extraction network, the addition of deep supervision can fully integrate the features of different depths of the residual UNet3+ feature extraction network, improve the ability to share features at different levels, and also provide more comprehensive feedback on the weights during the network back propagation process.
[0148] From the above description, the positive output of the deep supervision structure can be obtained as: Among them, FC i It refers to the fully connected layer with Sigmoid activation function in the i-th layer, and GAP refers to Global Average Pooling.
[0149] In one embodiment of the present invention, when the ECG signal recognition and classification model is pre-built, a training step for the ECG signal recognition and classification model is also included, wherein the training to obtain the ECG signal recognition and classification includes:
[0150] Constructing a training data set, wherein the training data set includes a congestive heart failure ECG signal data set and a non-congestive heart failure ECG signal data set, the congestive heart failure ECG signal data set includes a number of short-time peak-to-peak ECG signals of congestive heart failure, and the non-congestive heart failure ECG signal data set includes a number of short-time peak-to-peak ECG signals other than congestive heart failure;
[0151] Performing a ten-fold nested cross validation using the training data set constructed above, wherein the ten-fold nested cross validation includes an inner nine-fold cross validation and an outer ten-fold cross validation performed sequentially;
[0152] After internal nine-fold cross validation, the learning attenuation strategy D is obtained;
[0153] The learning decay strategy D obtained above is used as the learning rate adjustment strategy for the external ten-fold cross validation, and after training for a preset iteration cycle based on the learning rate adjustment strategy, an electrocardiogram signal recognition and classification model is constructed.
[0154] In order to obtain the ECG signal recognition and classification model, it is necessary to build the model first. Figure 5 After building the model according to the above description, generally only an ECG signal recognition and classification basic model that is consistent with the ECG signal recognition and classification model structure can be obtained. The ECG signal recognition and classification basic model needs to be trained. When the training reaches the target state, the ECG signal recognition and classification model can be constructed. When training the ECG signal recognition and classification basic model, it is generally necessary to construct a training data set. The following describes the situation of the constructed training data set.
[0155] The present invention is based on short-time peak-to-peak interval signals. Therefore, data from the MIT-BIH database of PhysioBank can be used to construct a training data set. The MIT-BIH database includes a peak-to-peak interval data set of patients with congestive heart failure (https: / / physionet.org / content / chf2db / 1.0.0 / ) and a peak-to-peak interval data set of subjects with normal sinus rhythm (https: / / physionet.org / content / nsr2db / 1.0.0 / ). Therefore, it can be seen that the short-time peak-to-peak interval ECG signal of congestive heart failure in the training data set can be obtained through the MIT-BIH database.
[0156] Figure 4 An embodiment of a short-time peak-to-peak interval signal of an ECG signal of a patient with congestive heart failure and a short-time peak-to-peak interval signal of an ECG signal of a patient with normal sinus rhythm is shown in FIG. In specific implementation, the peak-to-peak interval data set of patients with congestive heart failure and the peak-to-peak interval data set of subjects with normal sinus rhythm in the MIT-BIH database are peak-to-peak interval data obtained based on existing commonly used methods. Of course, the above method of extracting short-time peak-to-peak interval signals from the original ECG signal can also be used to obtain peak-to-peak interval data, which can be selected according to needs.
[0157] To improve robustness and distinguish congestive heart failure from other cardiovascular diseases, we can also construct an ECG signal dataset for non-congestive heart failure within the training dataset based on other original ECG signal datasets of cardiovascular diseases in the MIT-BIH database of PhysioBank, such as the paroxysmal or persistent atrial fibrillation dataset (https: / / physionet.org / content / ltafdb / 1.0.0 / ) and the apnea dataset (https: / / physionet.org / content / apnea-ecg / 1.0.0 / ).
[0158] Suppose the congestive heart failure dataset, normal sinus rhythm dataset, paroxysmal or persistent atrial fibrillation dataset, and apnea dataset from the MIT-BIH database of PhysioBank are S C1 , S N1 , S AF1 and S AP1 , where for the data set S AF1 , Dataset S AP1 The corresponding short-time peak-to-peak interval signal can be extracted from the corresponding electrocardiogram signal using the above-mentioned short-time peak-to-peak interval signal extraction method to obtain the corresponding short-time peak-to-peak interval signal.
[0159] From the above description, we can know that based on the data set S C1 Construct a congestive heart failure ECG signal dataset based on the dataset S N1 , Dataset S AF1 and / or dataset S AP1 A non-congestive heart failure ECG signal data set can be formed. In specific implementation, when constructing a training data set, the amount of data in the congestive heart failure ECG signal data set is preferably equal to the amount of data in the non-congestive heart failure ECG signal data set. When a normal sinus rhythm data set, a paroxysmal or persistent atrial fibrillation data set, and an apnea data set are used simultaneously, the category of the non-congestive heart failure class is normal sinus rhythm, paroxysmal or persistent atrial fibrillation, or apnea; when working, the present invention distinguishes and identifies the ECG signal type of congestive heart failure and the ECG signal type of non-congestive heart failure, but does not further subdivide, identify, and classify the ECG signal type of non-congestive heart failure.
[0160] Figure 2 In the process of constructing the training data set, the abnormal samples are also removed. A feasible method for removing abnormal samples is to: C1 , Dataset S N1 The heartbeat data marked as abnormal in the peak-to-peak interval record of each subject in the dataset S are directly deleted, and the dataset S is deleted at the same time. C1 , Dataset S N1 , Dataset S AF1 And the dataset S AP1 Any data with a peak-to-peak interval greater than 2 seconds. C1 , Dataset S N1 The peak-to-peak interval signal is directly included, and the abnormalities have been marked. Therefore, the common methods used by people in this technical field can be used to identify and delete the abnormal types.
[0161] After the above abnormal samples are removed, the data sets S C2 , Dataset S N2 , Dataset S AF2 And the dataset S AP2 At this time, according to the data set S C2 , Dataset S N2 , Dataset S AF2 And the dataset S AP2 Form a training data set.
[0162] From the above description, it can be seen that the characteristic size of the short-time peak-to-peak interval signal extracted from the original ECG signal is 2000, that is, it has 2000 peak-to-peak interval sub-signals. Therefore, the data set S C2 , Dataset S N2 , Dataset S AF2And the dataset S AP2 Each corresponding sample also has 2000 peak-to-peak interval sub-signals. In addition, since the short-time peak-to-peak interval signal has 2000 peak-to-peak interval sub-signals, it is necessary to repeat the peak-to-peak interval extraction 2001 times for the original ECG signal. The specific extraction process can refer to the above description. In addition, according to the information of the MIT-BIH database, the samples are divided into positive samples or negative samples based on the situation of each subject. For example, when the subject suffers from heart failure, the corresponding sample of the subject is a positive sample, otherwise it is a negative sample.
[0163] Since the choice of learning rate directly affects the model convergence speed and model detection performance during model training, in order to ensure that a suitable learning rate is used during training and to objectively evaluate the model, in one embodiment of the present invention, the following is used: Figure 2 The model training is performed using the ten-fold nested cross validation shown in the figure. The process of model training based on the ten-fold nested cross validation is described in detail below.
[0164] In one embodiment of the present invention, the constructed training data set is divided into ten parts, and one of the folds is selected in turn as a test set for external cross-validation, and the remaining nine folds are used for internal nine-fold cross-validation;
[0165] When performing internal 9-fold cross validation, select one fold from the nine folds of the internal 9-fold cross validation as the internal validation set, and the remaining eight folds as the training set;
[0166] After training with the training set, if the loss function of the internal validation set does not decrease after t consecutive iterations, multiply the learning rate by 0.1 and record the number of iterations at this time;
[0167] Generate the basic learning decay strategy for the current training based on the recorded number of iterations;
[0168] After the internal nine-fold cross-validation is completed, all the basic learning decay strategies are averaged to obtain the learning decay strategy D.
[0169] The training data set obtained by the above method is set as sample set S, where the sample set S is first divided into ten parts, that is, S = {S i , i=1,2,…,N}, N=10, at this time, ten folds of sample data can be formed, and each fold of sample data contains short-time peak-to-peak ECG signals of congestive heart failure and short-time peak-to-peak ECG signals of non-congestive heart failure, and the data volume of the two is consistent. Figure 6 , a schematic diagram of an embodiment of ten-fold nested cross validation is shown in FIG. 1 , where folds one to ten in the figure are sample data obtained by division.
[0170] Based on the above division, select one of the folds S in turn. a As the test set for external cross-validation, the remaining nine-fold S' is used for internal nine-fold cross-validation, that is, S' = {S i , i=1,2,…,N}, where i≠a, where the test set S a The internal 9-fold cross validation is used to select the appropriate learning rate and the model training is performed based on the selected learning decay strategy D during the external 10-fold cross validation. The learning decay strategy D is Figure 6 The learning decay cycle in .
[0171] In the internal nine-fold cross validation, select one fold S in turn b As the internal validation set, the other eight copies of S" are used as the internal training set, that is, S" = {S j , j = 1, 2, ..., N}, where j ≠ a and b, the internal validation set S b If the loss does not decrease for t consecutive iterations, multiply the learning rate by 0.1 and record the number of iterations at this time to obtain the basic strategy for learning rate decay.
[0172] In the specific implementation, the ECG signal recognition and classification basic model is trained through the training set. During the training, it is generally necessary to train for at least 60 generations, that is, each training set trains the ECG signal recognition and classification basic model for 60 generations. After each generation of training, the ECG signal recognition and classification basic model needs to be tested on the internal validation set S b On the internal validation set S b When verifying the loss, you need to configure the loss function, so the internal validation set S b If the loss of the loss function does not decrease for t consecutive iterations, it means that after t consecutive iterations of training, and the internal validation set S b The loss value of the loss function does not decrease after t consecutive iterations of the loss function, wherein the loss value of the loss function does not decrease, means that the loss values of the loss function are consistent or the difference in the loss values of the loss function is within the allowable numerical range. The allowable numerical range can be selected as needed to meet the training requirements of the model.
[0173] t can generally be selected as 5. Of course, t can also be other values, which can be selected according to needs. Of course, the number of iterations for training using the internal training set can also be other times. The following takes the number of training iterations as 60 and t as 5 as an example for specific explanation.
[0174] In one embodiment of the present invention, in ten-fold nested cross validation, the loss function is:
[0175] loss = y _true *(1-y _pred)+(1-y _true )*(1+y _pred )
[0176] Among them, loss is the loss value of the loss function, y _true is the true value of the sample data in the data set, y _pred is the output value of the model, y _pred ∈(0,1).
[0177] In specific implementation, based on the above loss function, we can calculate the internal validation set S b The loss function loss value on y is used to determine whether it has decreased for 5 consecutive iterations. The output value y of the model _pred That is, the output value of the basic model for ECG signal recognition and classification. The true value y of the sample data in the data set _true , that is, the label of each sample in the dataset, y _true is 0 or 1, where when the sample is a sample label of congestive heart failure, the true value y _true is 1, otherwise, the true value y _true is 0.
[0178] In addition, when using the trained ECG signal recognition and classification model to classify ECG signals, the output value y of the model is _pred To judge, generally, if the output value y _pred When it is greater than 0.5, it can be considered as a congestive heart failure category, otherwise, it is considered as a non-congestive heart failure category.
[0179] For example, for a training set, after training from the 10th generation to the 15th generation, in the internal validation set S b If the loss on the training set does not decrease, the current number of iterations is recorded as 15, and the current learning rate is multiplied by 0.1. After updating the learning rate, the current training set is continued to be used for the ECG signal recognition and classification basic model. If the loss still does not decrease after 5 consecutive iterations, the current number of iterations is continued to be recorded, such as 30, and the learning rate is continued to be multiplied by 0.1. Repeat the training of the training set until 60 iterations are completed. At this time, there can be multiple recorded numbers of iterations for a training set, such as 15, 30, 40, 50, 58, etc. The situation of recording the number of iterations is related to the actual training process of the training set. Based on the recorded number of iterations, the basic learning attenuation strategy of the current training set is generated.
[0180] Similarly, during the internal nine-fold cross validation, the corresponding fold data is selected in turn as the internal validation set S b, and repeat the above judgment, recording and learning rate multiplication by 0.1. Therefore, there is a basic learning decay strategy for each training set, and thus, there are nine basic learning decay strategies for the internal nine-fold cross validation. For the nine basic learning decay strategies, the learning rate adjustment strategy D can be obtained by averaging.
[0181] In specific implementation, when any training set is used for 60 iterative trainings, the initial value of the learning rate is 0.0001, that is, the iterative training process of each training set is independent of each other, mainly to obtain the basic strategy of learning attenuation.
[0182] When performing averaging operations, the average is generally performed according to the position within the learning decay basic strategy. For example, the number of iterations of all the first records in the nine learning decay basic strategies is averaged, and the other averaging operations are performed in the same way. As a result, the learning rate adjustment strategy D has multiple numbers of iterations after averaging operations.
[0183] Since the learning rate in the internal nine-fold cross validation is based on the internal validation set S b The results are adjusted based on the above, and there is information leakage, so it is necessary to perform an external 10-fold cross-validation. During the internal 9-fold cross-validation, the internal nine parts S' are used as the training set, and the one fold S taken out before is used as the training set. a As the test set. After the learning rate adjustment strategy D is obtained through the internal nine-fold cross-validation, the test set results are no longer used as the benchmark during the external ten-fold cross-validation. The final model performance is obtained by taking the average of the ten results of the test set of the external ten-fold cross-validation.
[0184] It should be noted that in the process of ten-fold nested cross-validation, ECG data from different subjects must be divided into the same fold to avoid over-optimization results due to the data of the same subject being assigned to the training and test sets. If the ECG data of the same subject is divided into both the training set and the test set, the network may learn the relevant features of the subject instead of the relevant features of the ECG signal. In specific implementation, since the source subjects of different ECG signals can be known, the commonly used technical means in this technical field can be used to divide the ECG data from different subjects into the same fold.
[0185] Based on the learning rate decay strategy D obtained by the internal nine-fold cross-validation, an external ten-fold cross-validation is performed on the ECG signal recognition and classification basic model. During the external ten-fold cross-validation, one fold is selected as the test set Sa, and the other nine folds are selected as the external training set. The ECG signal recognition and classification basic model is trained for 60 generations using the external training set. During the 60 generations of training, the learning rate is decayed based on the learning rate decay strategy D. For example, when the learning rate decay strategy D is {10, 20, 30}, after 10 generations of training, the initial learning rate 0.0001 is multiplied by 0.1 to obtain the current learning rate. After 20 generations of training, the current learning rate is multiplied by 0.1 again. After 30 generations of training, the current learning rate is multiplied by 0.1 again until 60 generations of training are completed.
[0186] For each external training set, after 60 generations of training, the trained ECG signal recognition and classification basic model can be tested based on the test set Sa to observe the training results. After that, the test set Sa and the external training set are reselected, and the above training and testing process is repeated until all folds of data are used as the test set Sa, that is, in the entire external ten-fold cross-validation, 10 times of 60 generations of training are required. The difference in each 60-generation training is that the external training set and the test set Sa are different, and the way and process of learning rate decay are exactly the same.
[0187] After external ten-fold cross validation, 10 trained ECG signal recognition and classification basic models are obtained. At this time, the model parameters of the 10 ECG signal recognition and classification basic models can be exported, and each model parameter can be averaged. After the averaged parameters are configured in the model, the ECG signal recognition and classification model can be obtained, and the training process after model building is completed. In specific implementation, the model parameters refer specifically to the network parameters generated after the above training. The existing commonly used technical means can be used to realize the export of model parameters and the parameter configuration of the model, which is consistent with the existing ones and will not be repeated here.
[0188] Furthermore, the training set and test set curves of the external ten-fold cross validation are as follows Figure 7 As shown in the figure, the changes of the ten-fold average loss value and the ten-fold average accuracy of the external training set and the test set Sa over 60 iterations are respectively shown. It can be seen that the basic model of ECG signal recognition and classification converges rapidly on the external training set, with an accuracy rate close to 95%, while the model accuracy and loss of the test set Sa begin to converge and tend to be stable after about 23 iterations, with an accuracy rate of about 89%.
[0189] After the ECG signal classification and recognition model is trained, the prediction results can be analyzed through a series of evaluation indicators. Among them, the present invention mainly uses common indicators such as accuracy, recall, precision and F1 score to evaluate the model effect. Specifically, the accuracy rate can most intuitively reflect the model prediction ability, the recall rate focuses on the statistics of real positive samples, and the precision rate focuses on the statistics of data judged as positive by the classifier. The F1 score is the harmonic mean of the precision rate and the recall rate, which takes into account both the accuracy rate and the recall rate. The larger the above indicators are, the better the model performance is.
[0190] The specific analysis and evaluation formula can be found in the following description.
[0191]
[0192] Among them, congestive heart failure is correctly classified as true positive (True Positive, TP), non-congestive heart failure is correctly classified as true negative (True Negative, TN), non-congestive heart failure is misclassified as false positive (False Positive, FP), and congestive heart failure is misclassified as false negative (False Negative, FN). Table 1 shows an embodiment of average analysis, wherein, during analysis, congestive heart failure data and non-congestive heart failure data are distinguished.
[0193] Table 1 Comparison of the accuracy of the method of the present invention and the accuracy of related work
[0194]
[0195] Table 1 uses accuracy as the evaluation indicator to compare the model with various machine learning-based congestive heart failure diagnosis methods, including Inception-V4, LS-SVM, Ensemble classifier, and LSTM based on Inception module.
[0196] The Inception-v4 method first uses sample entropy, fuzzy local metric entropy and fuzzy global metric entropy to generate a distribution matrix from the RR interval, and then uses Inception-v4 (Inception-v4 is a proprietary neural network structure) network selection to learn the data distribution pattern hidden in the distribution matrix, and finally diagnose congestive heart failure.
[0197] LS-SVM uses the Hankel matrix eigenvalue decomposition method to decompose the RR signal and extract the low-frequency and high-frequency components from it, and uses the least squares support vector machine with a radial basis function kernel to diagnose heart failure.
[0198] Ensemble classifier combines expert features and deep learning features and inputs them into the ensemble classifier for classification.
[0199] A feature extractor based on the long short-term memory convolutional neural network was constructed based on the LSTM of the Inception module based on the deep learning method, using the RR interval as input to finally diagnose congestive heart failure.
[0200] In specific implementation, when comparing the methods in Table 1, the data used are congestive heart failure data and normal sinus rhythm data. Compared with the above methods, the accuracy of the method provided by the present invention is improved by 7.31%, 2.01%, 1.62% and 1.61%, respectively. This result proves that the method provided by the present invention is effective in diagnosing congestive heart failure and has higher detection accuracy than other methods.
[0201] Considering that in real scenarios, it is necessary to distinguish between congestive heart failure data and non-congestive heart failure data (i.e., including normal heart rhythm and other cardiovascular disease data as negative samples), the present invention also verifies the robustness of the model based on paroxysmal or persistent atrial fibrillation data and apnea data. Considering that the data of patients with congestive heart failure are relatively small, the present invention only randomly extracts part of the paroxysmal or persistent atrial fibrillation and apnea data sets to replace the original normal sinus rhythm data, but still maintains its original length and data volume. Afterwards, a ten-fold nested cross-validation is also performed on the two types of data to explore whether the model can distinguish congestive heart failure from other peak-to-peak interval signals. Table 2 shows the classification results of the present invention in different non-congestive heart failure data sets. It can be seen from the table that the classification results of the three non-congestive heart failure data sets are generally close and the differences are small, which proves the robustness of the model in processing a variety of non-congestive heart failure signals.
[0202] Table 2 Classification results of the present invention in different non-congestive heart failure data sets
[0203]
[0204] In order to further verify the effectiveness of the proposed method, the present invention conducted ablation experiments on UNet++, UNet3+ and networks with added residual structure or deep supervision, and the results are shown in Table 3. It can be seen that the accuracy of the UNet3+ network is 1.6% higher than that of the UNet++ network, and 0.54% higher than that of the feature extraction network with residual structure and deep supervision, proving that changing the basic network to a network based on UNet3+ can improve the overall performance. The UNet3+ with added residual structure and deep supervision has an accuracy improvement of 0.62% and 0.17% respectively compared with the original UNet3+ (wherein the recall rate, precision rate and F1 score have also been improved to varying degrees). The performance of the UNet3+ network with both residual structure and deep supervision is 0.57% and 0.72% higher than that of the two networks, respectively, which illustrates the effectiveness of the residual structure and deep supervision added in this article for the overall task.
[0205] Table 3 Ablation experimental results of deep supervised residual UNet3+ network structure
[0206]
[0207]
[0208] The above schematically describes the invention and its implementation methods, which is not restrictive. Without departing from the spirit or basic features of the invention, the invention can be implemented in other specific forms. What is shown in the accompanying drawings is only one of the implementation methods of the invention. The actual structure is not limited to this, and any figure mark in the claims should not limit the claims involved. Therefore, if a person of ordinary skill in the art is inspired by it, without departing from the purpose of the invention, a structural method and an embodiment similar to the technical solution are designed without creativity, which should all fall within the scope of protection of this patent. In addition, the word "including" does not exclude other elements or steps, and the word "one" before the element does not exclude the inclusion of "multiple" elements. The multiple elements stated in the product claim can also be implemented by one element through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any specific order.
Claims
1. A method for identifying and classifying electrocardiogram signals based on short-time peak-to-peak interval signals and deep learning, characterized in that: The electrocardiogram signal recognition and classification method comprises: Provide an ECG signal to be identified and classified, and use a pre-built ECG signal recognition and classification model to perform recognition and classification, where: Extracting short-time peak-to-peak interval signals from the provided ECG signals, and loading the extracted short-time peak-to-peak interval signals into an ECG signal recognition and classification model; The ECG signal recognition and classification model includes a feature extraction network based on residual UNet3+ and a deep supervision structure adaptively connected to the feature extraction network; The feature extraction network is used to extract features of the loaded short-time peak-to-peak interval signal, and the extracted features are classified and weighted using a deep supervision structure to output classification information of the ECG signal after classification and weighted processing; The classification information of the electrocardiogram signal is congestive heart failure or non-congestive heart failure; The short-time peak-to-peak interval signal includes a plurality of peak-to-peak interval sub-signals arranged in sequence. When extracting the short-time peak-to-peak interval signal of the electrocardiogram signal, the method includes: filtering the electrocardiogram signal to generate a filtered electrocardiogram signal after filtering; Configure a signal sampling recognition threshold, and extract peak-to-peak intervals of the filtered ECG signal in sequence based on the configured signal sampling recognition threshold, wherein a peak-to-peak interval sub-signal is generated based on two adjacent peak-to-peak interval signals; When extracting any peak-to-peak interval, include: Sampling and identifying the electrocardiogram signal, after identifying the first R wave based on the signal sampling and identification threshold, sequentially configuring to form a first preset sampling and identification interval, a second preset sampling and identification interval, and a third preset sampling and identification interval according to the sampling and identification direction, until the second R wave is sampled and identified in the first preset sampling and identification interval, the second preset sampling and identification interval, or the third preset sampling and identification interval, wherein the peak-to-peak interval is formed based on the region extraction between the first R wave and the second R wave; In the first preset sampling and identification interval, when sampling and identifying in sequence, the current sampling point is detected and identified based on the current signal sampling and identification threshold value. If the current sampling point is not identified as the second R wave, the current signal sampling and identification threshold value is generated based on the position of the current sampling point. After performing sampling and identification m times in succession and updating the signal sampling and identification threshold value m times, the current signal sampling and identification threshold value is generated based on the signal sampling and identification threshold value of m times. In the second preset sampling and identification interval, when sampling and identifying in sequence, if the current sampling point is not identified as the second R wave, the current signal sampling and identification threshold is updated and generated, wherein when the current signal sampling and identification threshold is updated and generated, the final signal sampling and identification threshold of the first preset sampling and identification interval is used as the reference threshold, and all updated signal sampling and identification thresholds are in a linear attenuation state with the reference threshold; In the third preset sampling identification interval, the signal sampling identification threshold finally updated in the second preset sampling identification interval is used as the current signal sampling identification threshold and maintained, and sampling identification is performed sequentially based on the signal sampling identification threshold; Based on any two adjacent peak-to-peak intervals, a region between a first R wave of a first-order peak-to-peak interval and a first R wave of a second-order peak-to-peak interval is configured to form a peak-to-peak interval sub-signal; A feature extraction network based on residual UNet3+ includes an encoder network and a decoder network adaptively connected to the encoder network, wherein: The encoder network includes n encoders, and the encoder network is adaptively connected to the decoder network to form a U-shaped network with n layers; In the U-shaped network, the encoders and decoders are numbered in sequence along the direction from the U-shaped opening to the bottom of the U-shaped network, where: The encoder and decoder with the same number position form a network layer, so as to form n-1 network layers and a transition connection layer with only one encoder in the U-shaped network, and the encoder in the transition connection layer is connected to an adjacent decoder in the decoder network; According to the numbering direction of the encoders, for any encoder, the output of the encoder is transmitted to the next adjacent encoder after maximum pooling processing; For encoders and decoders in the same network layer, the output of the encoder is transmitted to the decoder after intra-layer convolution processing, and for encoders in the network layer above the current network layer, the outputs of all encoders are loaded into the decoder after downsampling processing; From the bottom of the U-shape to the direction of the U-shape opening, upsampling is performed based on the decoder network, where: During upsampling, for any decoder, the decoder performs upsampling on the output of the encoder in the transition connection layer and the output of the decoder between the current decoder and the transition connection layer; For any decoder, the decoder concatenates all upsampled and downsampled data after unifying the scale, and performs feature fusion and extraction based on the intra-layer convolutional processing data in the same network layer; The deep supervision structure includes a classifier unit and a weighted average block adaptively connected to the classifier unit, wherein: The classifier unit includes at least n classifiers, and the classifiers in the classifier unit are connected to the network layers and transition connection layers in the U-shaped network in a one-to-one correspondence; The output of the corresponding connected network layer or transition connection layer is classified by the classifier, and the classification information output by all classifiers is weighted by the weighted average block to output the classification information after weighting.
2. The electrocardiogram signal recognition and classification method based on short-time peak-to-peak interval signals and deep learning according to claim 1 is characterized in that: All encoders in the encoder network are configured with a residual structure, where For any encoder, it includes the first convolution layer of the encoder, the first GELU function of the encoder, the first batch of normalization layers of the encoder, the second convolution layer of the encoder, the second GELU function of the encoder, the second batch of normalization layers of the encoder, the addition layer, and the third batch of normalization layers of the encoder, which are connected in sequence; The output of the first GELU function of the encoder is connected to the addition layer to form a residual structure. The output of the first GELU function of the encoder is added to the output of the second batch normalization layer of the encoder by the addition layer, and the output is output through the third batch normalization layer.
3. The electrocardiogram signal recognition and classification method based on short-time peak-to-peak interval signals and deep learning according to claim 1, characterized in that: For any decoder, it includes a concatenation layer of the decoder, a convolution layer of the decoder, a GELU function of the decoder, and a batch normalization layer of the decoder connected in sequence, wherein, The decoder utilizes the batch normalization layer output of the decoder.
4. The electrocardiogram signal recognition and classification method based on short-time peak-to-peak interval signals and deep learning according to claim 1, characterized in that: During upsampling, for any decoder, the kernel size of the upsampling process performed by the decoder on different upsampling processing objects is: K1=2η, wherein K1 is the kernel size during upsampling, η is the layer difference between the decoder and the upsampling processing object, and the upsampling processing object is the decoder or the encoder in the transition connection layer; During downsampling, for any decoder, the kernel size of the decoder for downsampling different encoders is: K2 = 2 ξ , where K2 is the kernel size during downsampling, and ξ is the layer difference between the decoder and the encoder during downsampling.
5. The electrocardiogram signal recognition and classification method based on short-time peak-to-peak interval signals and deep learning according to any one of claims 1 to 4, characterized in that: When the electrocardiogram signal recognition and classification model is pre-built, a training step of the electrocardiogram signal recognition and classification model is also included, wherein the electrocardiogram signal recognition and classification is obtained through training, including: Constructing a training data set, wherein the training data set includes a congestive heart failure ECG signal data set and a non-congestive heart failure ECG signal data set, the congestive heart failure ECG signal data set includes a number of short-time peak-to-peak ECG signals of congestive heart failure, and the non-congestive heart failure ECG signal data set includes a number of short-time peak-to-peak ECG signals other than congestive heart failure; Performing a ten-fold nested cross validation using the training data set constructed above, wherein the ten-fold nested cross validation includes an inner nine-fold cross validation and an outer ten-fold cross validation performed sequentially; After internal nine-fold cross validation, the learning attenuation strategy D is obtained; The learning decay strategy D obtained above is used as the learning rate adjustment strategy for the external ten-fold cross validation, and after training for a preset iteration cycle based on the learning rate adjustment strategy, an electrocardiogram signal recognition and classification model is constructed.
6. The electrocardiogram signal recognition and classification method based on short-time peak-to-peak interval signals and deep learning according to claim 5, characterized in that: The constructed training data set is divided into ten parts, and one of the folds is selected as the test set for external cross-validation, and the remaining nine folds are used for internal nine-fold cross-validation; When performing internal 9-fold cross validation, select one fold from the nine folds of the internal 9-fold cross validation as the internal validation set, and the remaining eight folds as the training set; After training with the training set, if the loss function of the internal validation set does not decrease after t consecutive iterations, multiply the learning rate by 0.1 and record the number of iterations at this time; Generate the basic learning decay strategy for the current training based on the recorded number of iterations; After the internal nine-fold cross-validation is completed, all the basic learning decay strategies are averaged to obtain the learning decay strategy D.
7. The electrocardiogram signal recognition and classification method based on short-time peak-to-peak interval signals and deep learning according to claim 6 is characterized in that For ten-fold nested cross validation, the loss function is: lossy _true *(1-and _pred )+(1-and _true )*(1+y _pred ) Among them, loss is the loss value of the loss function, y _true is the true value of the sample data in the data set, y _pred is the output value of the model, y _pred ∈(0,1).
Citation Information
Patent Citations
Atrial fibrillation signal identification method and system based on machine learning
CN110840402A
Machine-learning-based electrocardiosignal classification method, machine-learning-based electrocardiosignal classification system, terminal and storage medium
CN111657925A
Electrocardiosignal-oriented semi-supervised atrial fibrillation automatic detection system
CN113876331A
Electrocardiosignal waveform segmentation method and system based on deep learning
CN115905969A
Atrial fibrillation detection method, device and equipment
CN116058849A
