A respiratory event detection method and device
By pre-processing and slicing the sleep monitoring PSG signal, combining the feature extraction network and the respiratory event detection network, the problem of low accuracy of respiratory event detection in the prior art is solved, and rapid and automatic respiratory event detection and classification are achieved, which improves detection efficiency and accuracy.
Patent Information
- Application Number
- CN202210411311.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-19
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2042-04-19
AI Technical Summary
In the prior art, the accuracy of respiratory event detection is low and difficult to classify, resulting in insufficient processing efficiency and accuracy.
By obtaining a set of sleep monitoring PSG signals of the subject, pre-processing and slice processing, inputting them to the trained feature extraction network and the respiratory event detection network, obtaining the occurrence time and duration of the respiratory event, and inputting them to the respiratory event classification network through time domain extension processing, realizing fast and automatic respiratory event detection and classification.
It improves the processing efficiency and accuracy of respiratory event detection, can effectively detect the location and duration of respiratory events, and automatically determine the degree and type of OSAHS disease of the subject, providing more convenient auxiliary diagnosis methods.
Smart Images

Figure CN114831604B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of deep learning technology, and in particular to a respiratory event detection method and device. Background Art
[0002] OSAHS (obstructive sleep apnea-hypopnea syndrome) is clinically characterized by repeated respiratory events caused by upper airway collapse during sleep. The severity of the disease can be assessed by the apnea-hypopnea index (AHI), which is the number of respiratory events per hour. Some studies have shown that the prevalence of moderate to severe OSAHS (AHI>15) in women is 23.4%, and in men it is 49.7%. In addition, the risk of stroke, depression, heart failure, and diabetes in untreated OSAHS patients is several times higher than that of ordinary people. Therefore, individuals with a certain risk of OSAHS should visit the sleep department as soon as possible.
[0003] At present, the respiratory event detection method currently used in sleep departments is based on polysomnography (PSG) monitoring, which requires patients to undergo all-night PSG monitoring in a professional sleep laboratory to obtain all-night PSG signals. After obtaining the PSG signal, the physician needs to manually mark the respiratory events in the PSG signal in combination with the oral and nasal airflow, chest and abdominal belt, and blood oxygen signals in the PSG signal. In addition, it is necessary not only to mark the starting point and duration of the respiratory event, but also to judge the type of respiratory event based on multi-channel signals. It takes more than an hour for a skilled sleep technician to analyze a case of data, and it is difficult to train technicians and the label variation rate is high. Therefore, there is an urgent need for an automatic auxiliary diagnosis method that can provide technicians with a stable reference for the location and type of respiratory events.
[0004] Typically, most deep learning-based respiratory event detection methods are performed by fixing the frames and then directly classifying them frame by frame. This method has low accuracy, poor interpretability, and cannot obtain the exact area and range of the respiratory event. Summary of the invention
[0005] The present invention provides a respiratory event detection method and device, which are used to solve the problems of low accuracy and difficulty in classification in the prior art of respiratory event detection, realize rapid and automatic respiratory event detection and classification, and improve the processing efficiency and accuracy of respiratory event detection.
[0006] The present invention provides a respiratory event detection method, comprising: obtaining a group of sleep monitoring PSG signals of a subject in a preset time period, checking the availability of the PSG signals, and if the PSG signals are available, preprocessing the PSG signals to obtain preprocessed PSG signals; slicing the preprocessed PSG signals according to a first preset time length to obtain at least one first slice signal; inputting the at least one first slice signal into a trained feature extraction network to obtain a one-dimensional feature vector corresponding to each first slice signal, inputting the one-dimensional feature vector corresponding to each first slice signal into a trained respiratory event detection network to obtain a respiratory event occurrence time and duration corresponding to each first slice signal; performing time domain extension processing on each first slice signal according to the respiratory event occurrence time and duration corresponding to each first slice signal to obtain a corresponding second slice signal, inputting each second slice signal into a trained respiratory event classification network to obtain a respiratory event type and probability corresponding to each second slice signal; and determining the obstructive sleep apnea hypopnea syndrome (OSAHS) morbidity level and OSAHS type of the subject according to the respiratory event type and probability corresponding to each second slice signal.
[0007] According to a respiratory event detection method provided by the present invention, the method also includes: obtaining multiple groups of PSG signal samples, checking the availability of each group of PSG signal samples, and when each group of PSG signal samples is available, preprocessing each group of PSG signal samples, and dividing the preprocessed PSG signal samples into a training set, a validation set, and a test set according to a preset ratio; slicing each group of PSG signal samples in the training set to obtain at least one first slice signal sample corresponding to each group of PSG signal samples, and by annotating the respiratory event occurrence time and duration of each first slice signal sample, obtaining a labeling file corresponding to each first slice signal, wherein all first slice signal samples corresponding to the multiple groups of PSG signal samples in the training set and the labeling file corresponding to each first slice signal sample constitute a first data set; using the first data set to train the feature extraction network and the respiratory event detection network. testing network; after the training of the feature extraction network and the respiratory event detection network is completed, each first slice signal sample in the first data set is input into the trained feature extraction network, and the feature vector of each first slice signal sample output by the feature extraction network is input into the respiratory event detection network to obtain the respiratory event occurrence time and duration corresponding to each first slice signal sample; according to the respiratory event occurrence time and duration corresponding to each first slice signal sample, each first slice signal sample is subjected to time domain extension processing to obtain a second slice signal sample, and by marking the respiratory event type of each second slice signal sample, a labeling file corresponding to each second slice signal sample is obtained, wherein all the second slice signal samples and the labeling file corresponding to each second slice signal sample constitute a second data set; using the second data set, the respiratory event classification network is trained.
[0008] According to a respiratory event detection method provided by the present invention, the first data set is used to train the feature extraction network and the respiratory event detection network, including: constructing a feature extraction network and a respiratory event detection network; inputting the first slice signal samples in the first data set one by one into the one-dimensional convolution layer and the one-dimensional pooling layer in the feature extraction network to obtain a one-dimensional feature vector corresponding to each segment of the first slice signal sample; inputting all the one-dimensional feature vectors into the stacked convolution layers in the respiratory event detection network in sequence to obtain three different feature vectors corresponding to each one-dimensional feature vector, and setting corresponding preset frames on the three different feature vectors respectively; according to A labeling file for each segment of the first slice signal sample is used to determine the labeling box corresponding to each segment of the first slice signal sample; confidence estimation and output position regression are performed on the preset boxes corresponding to the three different feature vectors to obtain the confidence estimation and position offset estimation corresponding to each one-dimensional feature vector, and a prediction box corresponding to each one-dimensional feature vector is obtained according to the confidence estimation and position offset estimation; loss values of the feature extraction network and the respiratory event detection network are calculated according to the parameters of the preset box, the parameters of the prediction box and the parameters of the labeling box; and according to the loss value, the parameters of the feature extraction network and the respiratory event detection network are updated using a back propagation algorithm.
[0009] According to a respiratory event detection method provided by the present invention, the loss values of the feature extraction network and the respiratory event detection network are calculated according to the parameters of the preset box, the parameters of the prediction box and the parameters of the labeling box, including: according to the parameters of the preset box, the parameters of the prediction box and the parameters of the labeling box, the losses of the feature extraction network and the respiratory event detection network are calculated using a first loss function; wherein the first loss function is determined according to a position loss function and a confidence loss function; wherein the position loss function is determined by the parameters of the preset box, the parameters of the labeling box and the parameters of the prediction box, and the confidence loss function is determined by the parameters of the preset box and the parameters of the labeling box.
[0010] According to a respiratory event detection method provided by the present invention, the respiratory event classification network is trained using the second data set, including: constructing a respiratory event classification network; inputting the second slice signal samples in the second data set one by one into the one-dimensional convolution layer, one-dimensional pooling layer, Relu activation function and SoftMax layer in the respiratory event classification network to obtain the respiratory event type and probability corresponding to each segment of the second slice signal sample; calculating the loss value of the respiratory event classification network according to the respiratory event type corresponding to each segment of the second slice signal sample and the annotation file corresponding to each segment of the second slice signal sample; and updating the parameters of the respiratory event classification network according to the loss value using a back propagation algorithm.
[0011] According to a respiratory event detection method provided by the present invention, the checking the availability of the PSG signal includes: determining that the PSG signal is available when the PSG signal includes PSG signals from at least two signal channels and the PSG signal of each of the signal channels lasts for at least a second preset time length.
[0012] According to a respiratory event detection method provided by the present invention, the preprocessing of the PSG signal includes: filtering and normalizing the PSG signal.
[0013] The present invention also provides a respiratory event detection device, comprising:
[0014] A PSG signal acquisition module, used to acquire a set of sleep monitoring PSG signals of the subject in a preset time period, check the availability of the PSG signals, and if the PSG signals are available, pre-process the PSG signals to obtain pre-processed PSG signals;
[0015] A slice processing module, configured to perform slice processing on the preprocessed PSG signal according to a first preset time length to obtain at least one first slice signal;
[0016] A first input module is used to input the at least one segment of the first slice signal into a trained feature extraction network to obtain a one-dimensional feature vector corresponding to each segment of the first slice signal, and input the one-dimensional feature vector corresponding to each segment of the first slice signal into a trained respiratory event detection network to obtain the occurrence time and duration of the respiratory event corresponding to each segment of the first slice signal;
[0017] A second input module is used to perform time domain extension processing on each segment of the first slice signal according to the occurrence time and duration of the respiratory event corresponding to each segment of the first slice signal to obtain a corresponding second slice signal, and input each segment of the second slice signal into a trained respiratory event classification network to obtain a respiratory event type and probability corresponding to each segment of the second slice signal;
[0018] The OSAHS severity determination module is used to determine the obstructive sleep apnea hypopnea syndrome (OSAHS) severity and OSAHS type of the subject according to the respiratory event type and probability corresponding to each segment of the second slice signal.
[0019] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any one of the respiratory event detection methods described above is implemented.
[0020] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the respiratory event detection method as described in any one of the above is implemented.
[0021] The respiratory event detection method and device provided by the present invention obtain a group of PSG signals of the subject, pre-process the PSG signals when the PSG signals are available, slice the pre-processed PSG signals to obtain at least one first slice signal, input the at least one first slice signal into a trained feature extraction network and a respiratory event detection network, obtain the respiratory event occurrence time and duration corresponding to each first slice signal, and can effectively and relatively accurately detect the location and duration of the respiratory event in the PSG signal, and provide a usable respiratory event detection result for the sleep technician; then, each first slice signal is subjected to time domain extension processing , the processed second slice signal is input into the respiratory event classification network to obtain the respiratory event type and probability corresponding to each second signal slice, thereby realizing rapid and automatic respiratory event detection and classification, and improving the processing efficiency of respiratory event detection and classification; finally, according to the respiratory event type and probability corresponding to the second signal slice, the severity and type of OSAHS of the subject can be automatically determined, providing a more convenient auxiliary diagnosis method for doctors. Due to the use of the trained feature extraction network, respiratory event detection network and respiratory event classification network, excessive human intervention in the respiratory event detection process is reduced, making the detection results of respiratory events relatively stable. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0023] Figure 1 It is a flow chart of the respiratory event detection method provided by the present invention;
[0024] Figure 2 It is a schematic diagram of the training process of the feature extraction network, the respiratory event detection network and the respiratory event classification network provided by the present invention;
[0025] Figure 3 It is a flow chart of training feature extraction network and respiratory event detection network provided by the present invention;
[0026] Figure 4 is a schematic diagram of a flow chart of training a respiratory event classification network provided by the present invention;
[0027] Figure 5 It is a schematic diagram of a process of staging sleep by using EEG signals provided by the present invention;
[0028] Figure 6 is a schematic structural diagram of a respiratory event detection device provided by the present invention;
[0029] Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0031] The terms "first", "second", etc. in the specification and claims of the present invention are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0032] It should be understood that the reference to "one embodiment" or "an embodiment" in the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present invention. Therefore, the "in one embodiment" or "in an embodiment" appearing in various places throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner.
[0033] Combine the following Figure 1-Figure 4 The respiratory event detection method of the present invention is described.
[0034] Figure 1 Schematic diagram of the respiratory event detection method provided by the present invention. Figure 1 As shown, the method includes:
[0035] Step 101, obtaining a set of sleep monitoring PSG signals of the subject in a preset time period, checking the availability of the PSG signals, and if the PSG signals are available, preprocessing the PSG signals to obtain preprocessed PSG signals.
[0036] It should be noted that the preset time period can be determined according to actual needs. For example, the preset time period can be determined as 23:00 pm to 8:00 am, and the PSG signal of the person being measured within this time period is obtained, and respiratory event detection is performed.
[0037] It should be noted that PSG (Polysomnography) is the most important test for diagnosing snoring during sleep. By continuously monitoring breathing, arterial oxygen saturation, electroencephalogram, electrocardiogram, heart rate and other indicators at night, it is possible to understand whether the snorer has respiratory arrest, the number of pauses, the duration of the pauses, the lowest arterial oxygen value when the pause occurs, and the degree of impact on physical health.
[0038] The set of sleep monitoring PSG signals in the present invention includes but is not limited to the following signals: oral airflow signal, nasal airflow signal, chest belt signal, abdominal belt signal and blood oxygen signal. These signals can be collected by PSG equipment, and these signals are all one-dimensional signals.
[0039] Optionally, the checking the availability of the PSG signal includes:
[0040] In a case where the PSG signal includes PSG signals from at least two signal channels and the PSG signal of each of the signal channels lasts for at least a second preset time period, it is determined that the PSG signal is available.
[0041] It should be noted that the second preset duration can be determined according to actual needs.
[0042] In one implementation, the second preset time length is four hours, that is, when the PSG signal of a signal channel lasts for at least four hours, it can be considered that the PSG signal of the signal channel is complete.
[0043] The embodiment of the present invention evaluates the availability of the signal by detecting the integrity of each PSG signal channel and the signal integrity, that is, when a group of PSG signals includes PSG signals from at least two signal channels, the signal channels can be considered to be complete; when the PSG signal of a signal channel can last for at least a second preset time length, the PSG signal of the signal channel can be considered to be complete; when each PSG signal channel is complete and the signal is complete, the PSG signal is available.
[0044] When an unusable PSG signal appears, the unusable PSG signal may be filtered out.
[0045] Optionally, the preprocessing the PSG signal includes:
[0046] The PSG signal is filtered and normalized.
[0047] It can be understood that the purpose of filtering the PSG signal is to filter out the interference of irrelevant frequency band noise on the signal, improve the signal-to-noise ratio of the PSG signal, and improve the reliability of the PSG signal, thereby improving the accuracy of the detection result to a certain extent.
[0048] When filtering the PSG signal, the present invention adopts methods including but not limited to any one of the following methods: bandpass filter filtering, LMS adaptive filtering, Wiener filtering, filtering method based on statistical model, and filtering method based on neural network.
[0049] In one implementation, a Butterworth filter is used to filter the PSG signal.
[0050] In the present invention, the PSG signal can be normalized using an existing normalization method, such as maximum-minimum normalization or sigmoid normalization.
[0051] It can be understood that the electronic device obtains a set of PSG signals of the subject in a preset time period, and evaluates the availability of this set of signals by checking the integrity of each PSG signal channel and the signal integrity. When this set of PSG signals is available, the PSG signals therein are filtered and normalized to obtain processed PSG signals.
[0052] Step 102: Slice the preprocessed PSG signal according to a first preset time length to obtain at least one first slice signal.
[0053] It should be noted that the first preset duration can be determined according to actual needs, and the present invention does not impose any limitation on this.
[0054] In one embodiment, the first preset duration is determined to be 5 minutes, and the method for slicing the preprocessed PSG signal is to move the cutting point forward by 30 seconds each time and cut 5 minutes of signal each time. For example, a signal segment with a duration of 5 minutes is cut from the signal starting point on a PSG signal as the first first slice signal, and then a signal segment with a duration of 5 minutes is cut from the position where the cutting point on the first first slice signal is moved forward by 30 seconds as the starting point, and then a signal segment with a duration of 5 minutes is cut as the second first slice signal, and so on, a PSG signal is cut into at least one signal segment with a duration of 5 minutes.
[0055] It can be understood that the electronic device slices the preprocessed PSG signal according to the first preset time length to obtain at least one first slice signal.
[0056] Step 103: input the at least one segment of the first slice signal into a trained feature extraction network to obtain a one-dimensional feature vector corresponding to each segment of the first slice signal; input the one-dimensional feature vector corresponding to each segment of the first slice signal into a trained respiratory event detection network to obtain the occurrence time and duration of the respiratory event corresponding to each segment of the first slice signal.
[0057] Among them, the input of the feature extraction network is the first slice signal, and the output is the one-dimensional feature vector corresponding to the first slice signal; its function is to extract the effective information in the one-dimensional PSG signal and map it into a one-dimensional vector.
[0058] Optionally, 1D-VGG, 1D-ResNet or 1D-SKNet can be used as a feature extraction network to perform feature extraction on the first slice signal.
[0059] The feature extraction network of the present invention is different from the feature extraction network in the existing image detection network in that the neural network module used in the feature extraction network of the present invention is a one-dimensional convolutional layer and a one-dimensional pooling layer.
[0060] It can be understood that the electronic device inputs all the first slice signals obtained after the slice processing into the trained feature extraction network, and can obtain a one-dimensional feature vector corresponding to each first slice signal.
[0061] The input of the respiratory event detection network is the one-dimensional feature vector output by the feature extraction network, and the output is the occurrence time and duration of the respiratory event corresponding to each first slice signal.
[0062] In one embodiment, 1D-RFB can be used as a respiratory event detection network to extract the time and duration of the respiratory event in the first slice signal. According to the respiratory event occurrence time, the position of the respiratory event in the PSG signal can be determined.
[0063] It can be understood that the electronic device inputs all one-dimensional feature vectors output by the feature extraction network into the trained respiratory event detection network, and can obtain the occurrence time and duration of the respiratory event corresponding to each first slice signal.
[0064] Step 104, according to the occurrence time and duration of the respiratory event corresponding to each segment of the first slice signal, perform time domain extension processing on each segment of the first slice signal to obtain the corresponding second slice signal, input each segment of the second slice signal into the trained respiratory event classification network to obtain the respiratory event type and probability corresponding to each segment of the second slice signal.
[0065] It should be noted that the method of time domain extension processing is to determine the position where the respiratory event occurs on the first slice signal based on the occurrence time and duration of the respiratory event corresponding to the first slice signal output from the respiratory event detection network, and then perform time domain extension to the left and right at this position to obtain a signal with a third preset duration (such as 90 seconds). At this time, this 90-second signal is the second slice signal.
[0066] It can be understood that when a first slice signal has a respiratory event, the first slice signal having the respiratory event corresponds one to one with a second slice signal.
[0067] It can be understood that the input of the respiratory event classification network is the second slice signal, and the output is the respiratory event type and probability corresponding to the second slice signal.
[0068] Among them, respiratory event types include but are not limited to the following types: obstructive apnea, central apnea, mixed apnea and hypopnea.
[0069] It can be understood that the electronic device can perform time domain extension processing on the first slice signal according to the occurrence time and duration of the respiratory event corresponding to each first slice signal to obtain the corresponding second slice signal, and then input each second slice signal into the trained respiratory event classification network to finally obtain the respiratory event type and probability corresponding to each second slice signal.
[0070] Step 105: Determine the severity and type of obstructive sleep apnea hypopnea syndrome (OSAHS) of the subject according to the type and probability of the respiratory event corresponding to each segment of the second slice signal.
[0071] It should be noted that the severity of OSAHS can be assessed by the Apnea-Hypopnea Index (AHI), which is the number of respiratory events occurring per hour.
[0072] By statistically analyzing the respiratory event types and probabilities corresponding to the second slice signals, the AHI of the subject can be calculated. Based on the AHI of the subject, the severity of the OSAHS of the subject can be determined. By statistically analyzing the respiratory event types that appear most frequently in all second slice signals, the OSAHS type of the subject can be determined.
[0073] In an embodiment of the present invention, a group of PSG signals of the subject are obtained, and when the PSG signals are available, the PSG signals are preprocessed, and the preprocessed PSG signals are sliced to obtain at least one first slice signal, and at least one first slice signal is input into a trained feature extraction network and a respiratory event detection network to obtain the respiratory event occurrence time and duration corresponding to each first slice signal, so that the position and duration of the respiratory event in the PSG signal can be effectively and relatively accurately detected, and a usable respiratory event detection result can be provided to the sleep technician; then, each first slice signal is subjected to time domain extension processing, and the second slice signal obtained after the processing is input into the respiratory event classification network to obtain the respiratory event type and probability corresponding to each second signal slice, thereby realizing rapid and automatic respiratory event detection and classification, and improving the processing efficiency of respiratory event detection and classification; finally, according to the respiratory event type and probability corresponding to the second signal slice, the OSAHS disease degree and type of the subject can be automatically determined, providing a more convenient auxiliary diagnosis method for the physician, and due to the use of a trained deep learning network, excessive human intervention in the respiratory event detection process is reduced, so that the respiratory event detection result is relatively stable.
[0074] Optionally, Figure 2 : is a schematic diagram of the training process of the feature extraction network, the respiratory event detection network and the respiratory event classification network provided by the present invention, such as Figure 2 As shown, the method further includes steps 201 to 205:
[0075] Step 201, obtain multiple groups of PSG signal samples, check the availability of each group of PSG signal samples, preprocess each group of PSG signal samples if each group of PSG signal samples is available, and divide the preprocessed PSG signal samples into a training set, a validation set, and a test set according to a preset ratio.
[0076] It should be noted that the multiple groups of PSG signals can be understood as obtaining a group of PSG signals for each subject for multiple subjects.
[0077] It can be understood that the signal availability is evaluated by checking the integrity of each PSG signal channel and the signal integrity, while filtering out unusable signals;
[0078] The preprocessing of each group of PSG signals is to perform filtering and normalization processing on each group of PSG signals.
[0079] The preset ratio of the present invention can be determined according to actual needs.
[0080] In one implementation, a set of preprocessed PSG signals is divided into a training set, a validation set, and a test set in a ratio of 6:3:1.
[0081] Step 202, slice each group of PSG signal samples in the training set to obtain at least one first slice signal sample corresponding to each group of PSG signal samples, and obtain a labeling file corresponding to each first slice signal by labeling the respiratory event occurrence time and duration of each first slice signal sample.
[0082] Among them, all the first slice signal samples corresponding to the multiple groups of PSG signal samples in the training set and the annotation files corresponding to each segment of the first slice signal samples constitute the first data set.
[0083] It should be noted that when slicing each group of PSG signal samples in the training set, it is also necessary to cut according to the first preset time length. The purpose of slicing is to provide more training data for the training set and increase the breadth of the data in the training set.
[0084] It can be understood that each first slice signal corresponds to a labeling file one by one.
[0085] The annotation file corresponding to the first slice signal includes the actual occurrence time and duration of the respiratory event in the first slice signal.
[0086] Step 203: Using the first data set, train the feature extraction network and the respiratory event detection network.
[0087] It can be understood that the first data set is used to train the feature extraction network and the respiratory event detection network; the trained feature extraction network and the respiratory event detection network can predict the occurrence time and duration of respiratory events.
[0088] Step 204, after the training of the feature extraction network and the respiratory event detection network is completed, each first slice signal sample in the first data set is input into the trained feature extraction network, and the feature vector of each first slice signal sample output by the feature extraction network is input into the respiratory event detection network to obtain the respiratory event occurrence time and duration corresponding to each first slice signal sample.
[0089] Step 205, according to the occurrence time and duration of the respiratory event corresponding to each segment of the first slice signal sample, time domain extension processing is performed on each segment of the first slice signal sample to obtain a second slice signal sample, and by marking the respiratory event type of each segment of the second slice signal sample, a labeling file corresponding to each segment of the second slice signal sample is obtained.
[0090] Among them, all the second slice signal samples and the annotation files corresponding to each second slice signal sample constitute a second data set.
[0091] Optionally, after all the second slice samples are obtained, filtering and resampling processing may be performed on each segment of the second slice samples;
[0092] When filtering the second slice signal, the present invention uses methods including but not limited to the following methods: bandpass filter filtering, LMS adaptive filtering, Wiener filtering, filtering methods based on statistical models or filtering methods based on neural networks.
[0093] In one implementation, each second slice signal may be resampled to 10 Hz.
[0094] The purpose of resampling is to prevent overfitting problems during subsequent training of the respiratory event classification network, thereby improving the accuracy of the prediction results.
[0095] It is understandable that the second dataset can only be constructed after the feature extraction network and the respiratory event detection network are successfully trained;
[0096] The second slice signal sample is obtained by performing time domain extension on the first slice signal sample at a signal position corresponding to the time when the respiratory event occurs.
[0097] It should be noted that each second slice signal corresponds to a labeling file one by one.
[0098] The annotation file corresponding to the second slice file includes the actual respiratory event type in the second slice signal.
[0099] Step 206: train the respiratory event classification network using the second data set.
[0100] It can be understood that the second data set is used to train the respiratory event classification network; the trained respiratory event classification network can predict the type of respiratory events.
[0101] In an embodiment of the present invention, multiple groups of PSG signal samples are obtained, and the available PSG samples are preprocessed to improve the reliability of the samples, and then the preprocessed PSG signal samples are divided into a training set, a validation set and a test set to provide input data support for subsequent neural network training, and at the same time provide input data support for subsequent neural network performance testing. Then, at least one segment of the first slice signal sample and the annotation file corresponding to each segment of the first slice signal are used to construct a first data set for training a feature extraction network and a respiratory event detection network. The trained feature extraction network and respiratory event detection network can predict the occurrence time and duration of respiratory events, and provide available respiratory event detection results for sleep technicians; when the feature extraction network and the respiratory event detection network are successfully trained, according to the occurrence time and duration of respiratory events corresponding to each segment of the first slice signal sample, each segment of the first slice signal sample is subjected to time domain extension processing to obtain the corresponding second slice signal sample, and at least one segment of the second slice signal sample and the annotation file corresponding to each segment of the second slice signal are used to construct a second data set for training a respiratory event classification network. The trained respiratory event classification network can predict the type of respiratory events.
[0102] Optionally, Figure 3 is a flow chart of the training feature extraction network and the respiratory event detection network provided by the present invention, such as Figure 3 As shown, step 203 uses the first data set to train the feature extraction network and the respiratory event detection network, including steps 2031 to 2037:
[0103] Step 2031, constructing a feature extraction network and a respiratory event detection network.
[0104] It should be noted that the feature extraction network is constructed using one-dimensional convolutional layers and one-dimensional pooling layers;
[0105] A respiratory event detection network is constructed using multiple convolutional layers of different depths.
[0106] Step 2032: input the first slice signal samples in the first data set into the one-dimensional convolution layer and the one-dimensional pooling layer in the feature extraction network one by one, and obtain a one-dimensional feature vector corresponding to each segment of the first slice signal sample.
[0107] It can be understood that the feature extraction network includes a one-dimensional convolution layer and a one-dimensional pooling layer, which can extract features from the first slice signal to obtain a one-dimensional feature vector corresponding to each segment of the first slice signal.
[0108] Step 2033, input all the one-dimensional feature vectors into the stacked convolutional layers in the respiratory event detection network in sequence, obtain three different feature vectors corresponding to each of the one-dimensional feature vectors, and set corresponding preset boxes on the three different feature vectors respectively.
[0109] It should be noted that the respiratory event detection network adds multi-scale detection based on the different characteristics of the visual fields of convolutional layers with different network depths;
[0110] The stacked convolutional layers can be understood as three different convolutional layers.
[0111] It can be understood that more feature vectors can be obtained by inputting a one-dimensional feature vector into a respiratory event detection network.
[0112] It should be understood that after the one-dimensional feature vector is input into the respiratory event detection network, three layers are extracted as feature layers. Since the step size of the convolutional layer in the convolutional neural network is sometimes greater than 1, the length of the feature vector output by the shallow feature layer is longer than the feature vector output by the deep feature layer, thereby obtaining three different feature vectors.
[0113] It should be understood that each convolutional layer in the respiratory event detection network can extract a feature vector, set a preset box for the feature point corresponding to the feature vector extracted by each convolutional layer, and make a confidence estimate for whether each preset box belongs to a respiratory event. Then, the position regression is output for the preset box. The position regression includes two parts, namely, the offset of the center position and the offset of the length. The length offset in the position regression can be understood as the offset of the duration.
[0114] Since the preset boxes are set on the feature points, one feature vector corresponds to multiple preset boxes.
[0115] Step 2034: determine a labeling box corresponding to each segment of the first slice signal sample according to the labeling file of each segment of the first slice signal sample.
[0116] It should be noted that the annotation box can reflect the actual occurrence time and duration of the respiratory event of each first slice signal image.
[0117] Step 2035, by performing confidence estimation and output position regression on the preset boxes corresponding to the three different feature vectors, the confidence estimation and position offset estimation corresponding to each one-dimensional feature vector are obtained, and the prediction box corresponding to each one-dimensional feature vector is obtained based on the confidence estimation and position offset estimation.
[0118] It should be noted that the prediction frame is obtained by adjusting the output of multiple convolutional layers of the preset frame, and the prediction frame can reflect the occurrence time and duration of the respiratory event of the first signal slice predicted by the respiratory event detection network.
[0119] Step 2036, calculating the loss values of the feature extraction network and the respiratory event detection network according to the parameters of the preset box, the parameters of the prediction box and the parameters of the annotation box.
[0120] Optionally, the calculating the loss values of the feature extraction network and the respiratory event detection network according to the parameters of the preset frame, the parameters of the prediction frame and the parameters of the annotation frame includes:
[0121] Calculating the loss of the feature extraction network and the respiratory event detection network using a first loss function according to the parameters of the preset frame, the parameters of the prediction frame, and the parameters of the annotation frame;
[0122] Wherein, the first loss function is determined according to the position loss function and the confidence loss function; wherein, the position loss function is determined by the parameters of the preset box, the parameters of the annotation box and the parameters of the prediction box, and the confidence loss function is determined by the parameters of the preset box and the parameters of the annotation box.
[0123] It should be noted that after the respiratory event detection network estimates the confidence parameter c and position regression parameter for each preset frame, where the position regression parameter includes the center position ct and the duration d, each preset frame is divided into positive and negative samples, where the selection of the positive sample Pos requires the IoU (Intersection-over-Union) between the preset frame and the annotated frame to be greater than 0.5. Among them, IoU calculates the ratio of the intersection and union of the predicted frame and the annotated frame, which can reflect the accuracy of the prediction result. The most ideal IoU ratio is 1, that is, the predicted frame and the annotated frame completely overlap, indicating that the predicted result is completely consistent with the actual result;
[0124] After selecting the positive samples, randomly select 3 times the number of positive samples from the remaining samples as negative samples Neg. It can be understood that the selection of negative samples requires that the IoU between the preset box and the labeled box is less than or equal to 0.5. To represent the correspondence between the i-th preset frame and the j-th annotation frame, when When , it means that the i-th preset frame and the j-th annotation frame do not correspond. , it means that the i-th preset box corresponds to the j-th annotation box.
[0125] It should be noted that the first loss function L includes a confidence loss function and a position loss function;
[0126] The calculation method of the first loss function L is as follows:
[0127]
[0128] Among them, L conf (x,cl) represents the confidence loss function, L loc (x,l,g) represents the position loss function, α is the weight parameter used to adjust L conf and L loc The weight distribution of the preset box and the label box; X represents the correspondence between the preset box and the label box; cl represents the category of the respiratory event, that is, whether a respiratory event occurs; N represents the number of positive samples, and the position loss function can use Smooth L1 Loss function, l is the parameter of the prediction box, and g is the parameter of the annotation box.
[0129] Among them, L loc The calculation method of (x,l,g) is:
[0130]
[0131]
[0132]
[0133] Among them, N represents the number of positive samples (Pos), Smooth L1 is the existing loss function, ct and d are two bias parameters of the preset box, ct is the center position in the position regression parameter, d is the duration in the position regression parameter, represents the center position of the jth annotation box, represents the center position of the i-th confidence box, represents the duration of the i-th preset frame, represents the duration of the jth annotation box, Indicates the correspondence between the positions of the i-th preset frame and the j-th marked frame;
[0134]
[0135]
[0136] Among them, Neg represents negative samples, Pos represents positive samples, and N represents the number of positive samples (Pos); represents the confidence of the respiratory event category cl of the i-th preset frame, where It indicates the confidence level when there is no respiratory event in the i-th preset frame. Indicates the correspondence between the respiratory event categories of the i-th preset box and the j-th labeled box.
[0137] Step 2037: Based on the loss value, the back propagation algorithm is used to update the parameters of the feature extraction network and the respiratory event detection network.
[0138] It should be noted that the back propagation algorithm is as follows:
[0139]
[0140] Where ω is the parameter of the feature extraction network and the respiratory event detection network before updating, ω′ represents the parameter after updating, L can be considered as the first loss function at this time, η is the learning rate, and the learning rate η can be set according to actual needs.
[0141] In one implementation, n is set to 0.00001.
[0142] It can be understood that the feature extraction network and the respiratory event detection network are trained together, and ultimately the parameters of the feature extraction network and the respiratory event detection network can be adjusted simultaneously through a loss value.
[0143] In an embodiment of the present invention, the first slice signal samples in the first data set are firstly input one by one into the one-dimensional convolution layer and the one-dimensional pooling layer in the feature extraction network to obtain the one-dimensional feature vector corresponding to each segment of the first slice signal sample, thereby extracting the one-dimensional feature vector for the first slice signal, and then all the one-dimensional feature vectors are input into the respiratory event detection network to obtain three different feature vectors, and a corresponding preset frame is set on each different feature vector, and then the labeling frame and the prediction frame corresponding to the first slice signal sample are determined, and finally the parameters of the preset frame, the parameters of the prediction frame and the parameters of the labeling frame are used to calculate the loss value and update the feature extraction network and the respiratory event detection network, thereby training the feature extraction network and the respiratory event detection network.
[0144] Optionally, Figure 4 FIG. 1 is a flow chart of the training respiratory event classification network provided by the present invention. Figure 4 As shown, step 206 uses the second data set to train the respiratory event classification network, including steps 2061 to 2064:
[0145] Step 2061, construct a respiratory event classification network.
[0146] A respiratory event classification network is constructed using one-dimensional convolutional layer, one-dimensional pooling layer, Relu activation function and SoftMax layer.
[0147] Step 2062, input the second slice signal samples in the second data set one by one into the one-dimensional convolution layer, one-dimensional pooling layer, Relu activation function and SoftMax layer in the respiratory event classification network to obtain the respiratory event type and probability corresponding to each segment of the second slice signal sample.
[0148] Step 2063: Calculate the loss value of the respiratory event classification network according to the respiratory event type corresponding to each segment of the second slice signal sample and the annotation file corresponding to each segment of the second slice signal sample.
[0149] Optionally, calculating the loss value of the respiratory event classification network according to the respiratory event type corresponding to each segment of the second slice signal sample and the annotation file corresponding to each segment of the second slice signal sample includes:
[0150] Calculating the loss of the feature extraction network and the respiratory event detection network using a second loss function;
[0151] Among them, the calculation of the second loss function is as follows:
[0152]
[0153] M is the number of respiratory event types, and the types of respiratory events can be determined according to actual needs;
[0154] In one embodiment, the value of M is 4, that is, there are 4 types of respiratory events, including obstructive apnea, central apnea, mixed apnea and hypopnea.
[0155] N1 represents the number of samples of the second slice signal, y ic It means that if the respiratory event type of the second slice signal sample i is c, then y ic The value is 1, otherwise y ic The value is 0. ic It refers to the probability that the respiratory event type of sample i belongs to category c.
[0156] Step 2064: Based on the loss value, update the parameters of the respiratory event classification network using a back propagation algorithm.
[0157] It should be noted that the back propagation algorithm is as follows:
[0158]
[0159] Where ω is the parameter of the respiratory event classification network before updating, ω′ is the parameter of the respiratory event classification network after updating, L can be considered as the second loss function at this time, η is the learning rate, and the learning rate η can be set according to actual needs;
[0160] In one implementation, n is set to 0.00001.
[0161] When the precision and recall of the respiratory event classification network are basically the same, the respiratory event classification network is successfully trained;
[0162] In one implementation, when the precision and recall of the respiratory event classification network are equal, the respiratory event classification network is successfully trained.
[0163] In an embodiment of the present invention, the second slice signal samples in the second data set are input one by one into the one-dimensional convolution layer, the one-dimensional pooling layer, the Relu activation function and the SoftMax layer in the respiratory event classification network to obtain the respiratory event type and probability corresponding to each segment of the second slice signal sample, and then the loss value is calculated using the output result and the annotation file, and the loss value is used to update the parameters of the respiratory event classification network to realize the training of the feature extraction network and the respiratory event detection network.
[0164] Optionally, the present invention can also use a method that is completely consistent with the respiratory event detection method to identify characteristic waves in the EEG signal during a person's sleep, so as to achieve sleep staging of the subject through the EEG signal.
[0165] Figure 5 FIG. 1 is a flow chart of the sleep stage classification by EEG signals provided by the present invention. Figure 5 As shown:
[0166] Step 501, obtaining a set of EEG signals of the subject in a preset time period, checking the availability of the EEG signals, and if the EEG signals are available, preprocessing the EEG signals to obtain preprocessed EEG signals;
[0167] Step 502, slicing the preprocessed EEG signal according to a first preset time length to obtain at least one third slice signal;
[0168] Step 503, inputting the at least one segment of the third slice signal into a trained EEG characteristic waveform feature extraction network to obtain a one-dimensional feature vector corresponding to each segment of the third slice signal, and inputting the one-dimensional feature vector corresponding to each segment of the third slice signal into a trained EEG characteristic waveform detection network to obtain the occurrence time and duration of the EEG characteristic waveform corresponding to each segment of the third slice signal;
[0169] Step 504, according to the occurrence time and duration of the EEG characteristic waveform corresponding to each segment of the third slice signal, perform time domain extension processing on each segment of the third slice signal to obtain the corresponding fourth slice signal, input each segment of the fourth slice signal into the trained EEG characteristic waveform classification network to obtain the EEG characteristic waveform type and probability corresponding to each segment of the fourth slice signal;
[0170] Step 505: Determine the sleep state of the subject according to the type and probability of the characteristic EEG waveform corresponding to each segment of the fourth slice signal.
[0171] It should be noted that the preset time period is determined according to actual needs. The method for checking the availability of EEG signals is consistent with that for checking the availability of PSG signals. Both methods evaluate the availability of EEG signals by checking channel integrity and signal integrity.
[0172] The preprocessing and slicing of EEG signals are consistent with the preprocessing and slicing of PSG signals.
[0173] The structure and training process of the EEG characteristic waveform feature extraction network are completely consistent with the feature extraction network in the respiratory event detection method, but the input of the EEG characteristic waveform feature extraction network is the third slice signal corresponding to the EEG signal, and the output is the one-dimensional feature vector corresponding to the third slice signal.
[0174] The structure and training process of the EEG characteristic waveform detection network are exactly the same as those of the respiratory event detection network, but the input of the EEG characteristic waveform detection network is the one-dimensional feature vector corresponding to the third slice signal, and the output is the occurrence time and duration of the EEG characteristic waveform corresponding to the third slice signal.
[0175] The structure and training process of the EEG feature waveform classification network are exactly the same as those of the respiratory event classification network, but the input of the EEG feature waveform classification network is the fourth slice signal corresponding to the EEG signal, and the output is the EEG feature waveform type and probability corresponding to the fourth slice signal. The effect of the EEG feature waveform classification network can be evaluated using indicators such as precision, recall, AP, and mAP.
[0176] It should be noted that there are many kinds of characteristic EEG waveforms, including α waves, β waves, etc., and ultimately the sleep state of the subject can be determined based on the characteristic EEG waveforms.
[0177] The respiratory event detection device provided by the present invention is described below. The respiratory event detection device described below and the respiratory event detection method described above can be referenced to each other.
[0178] Figure 6 A schematic diagram of the structure of a respiratory event detection device provided by an embodiment of the present invention is shown in FIG. Figure 6As shown, an embodiment of the present invention provides a respiratory event detection device, comprising:
[0179] A PSG signal acquisition module 601 is used to acquire a set of sleep monitoring PSG signals of the subject in a preset time period, check the availability of the PSG signals, and if the PSG signals are available, pre-process the PSG signals to obtain pre-processed PSG signals;
[0180] A slice processing module 602 is used to perform slice processing on the pre-processed PSG signal according to a first preset time length to obtain at least one first slice signal;
[0181] A first input module 603 is used to input the at least one segment of the first slice signal into a trained feature extraction network to obtain a one-dimensional feature vector corresponding to each segment of the first slice signal, and input the one-dimensional feature vector corresponding to each segment of the first slice signal into a trained respiratory event detection network to obtain the occurrence time and duration of the respiratory event corresponding to each segment of the first slice signal;
[0182] A second input module 604 is used to perform time domain extension processing on each segment of the first slice signal according to the occurrence time and duration of the respiratory event corresponding to each segment of the first slice signal to obtain a corresponding second slice signal, and input each segment of the second slice signal into a trained respiratory event classification network to obtain a respiratory event type and probability corresponding to each segment of the second slice signal;
[0183] The OSAHS severity determination module 605 is used to determine the obstructive sleep apnea hypopnea syndrome (OSAHS) severity and OSAHS type of the subject according to the respiratory event type and probability corresponding to each segment of the second slice signal.
[0184] The respiratory event detection device provided by the present invention obtains a group of PSG signals of the subject, and when the PSG signals are available, pre-processes the PSG signals, slices the pre-processed PSG signals to obtain at least one first slice signal, inputs at least one first slice signal into a trained feature extraction network and a respiratory event detection network, obtains the respiratory event occurrence time and duration corresponding to each first slice signal, can effectively and relatively accurately detect the location and duration of the respiratory event in the PSG signal, and provides a usable respiratory event detection result for a sleep technician; then, time domain extension processing is performed on each first slice signal, and the second slice signal obtained after the processing is input into a respiratory event classification network to obtain the respiratory event type and probability corresponding to each second signal slice, thereby realizing rapid and automatic respiratory event detection and classification, and improving the processing efficiency of respiratory event detection and classification; finally, according to the respiratory event type and probability corresponding to the second signal slice, the OSAHS disease degree and type of the subject can be automatically determined, providing a more convenient auxiliary diagnosis method for doctors, and due to the use of a trained deep learning network, excessive human intervention in the respiratory event detection process is reduced, so that the respiratory event detection result is relatively stable.
[0185] Optionally, the device further comprises:
[0186] A PSG signal sample processing module is used to obtain multiple groups of PSG signal samples, check the availability of each group of PSG signal samples, pre-process each group of PSG signal samples when each group of PSG signal samples is available, and divide the pre-processed PSG signal samples into a training set, a validation set, and a test set according to a preset ratio;
[0187] A first data set construction module is used to perform slicing processing on each group of PSG signal samples in the training set to obtain at least one first slice signal sample corresponding to each group of PSG signal samples, and obtain a labeling file corresponding to each first slice signal by labeling the respiratory event occurrence time and duration of each first slice signal sample, wherein all first slice signal samples corresponding to the multiple groups of PSG signal samples in the training set and the labeling file corresponding to each first slice signal sample constitute a first data set;
[0188] A first network training module, used for training the feature extraction network and the respiratory event detection network using the first data set;
[0189] A first sample result acquisition module is used to input each first slice signal sample in the first data set into the trained feature extraction network after the feature extraction network and the respiratory event detection network are trained, and input the feature vector of each first slice signal sample output by the feature extraction network into the respiratory event detection network to obtain the respiratory event occurrence time and duration corresponding to each first slice signal sample;
[0190] A second data set construction module is used to perform time domain extension processing on each segment of the first slice signal sample according to the respiratory event occurrence time and duration corresponding to each segment of the first slice signal sample to obtain a second slice signal sample, and obtain a labeling file corresponding to each segment of the second slice signal sample by labeling the respiratory event type of each segment of the second slice signal sample, wherein all the second slice signal samples and the labeling file corresponding to each segment of the second slice signal sample constitute a second data set;
[0191] The second network training module is used to train the respiratory event classification network using the second data set.
[0192] Optionally, the first network training module is used to:
[0193] Construct feature extraction network and respiratory event detection network;
[0194] Inputting the first slice signal samples in the first data set into the one-dimensional convolution layer and the one-dimensional pooling layer in the feature extraction network one by one, to obtain a one-dimensional feature vector corresponding to each segment of the first slice signal sample;
[0195] Inputting all the one-dimensional feature vectors into the stacked convolutional layers in the respiratory event detection network in sequence, obtaining three different feature vectors corresponding to each of the one-dimensional feature vectors, and setting corresponding preset frames on the three different feature vectors respectively;
[0196] Determining a labeling box corresponding to each segment of the first slice signal sample according to the labeling file of each segment of the first slice signal sample;
[0197] By performing confidence estimation and output position regression on the preset boxes corresponding to the three different feature vectors, a confidence estimation and a position offset estimation corresponding to each one-dimensional feature vector are obtained, and a prediction box corresponding to each one-dimensional feature vector is obtained according to the confidence estimation and the position offset estimation;
[0198] Calculating loss values of the feature extraction network and the respiratory event detection network according to the parameters of the preset frame, the parameters of the prediction frame, and the parameters of the annotation frame;
[0199] According to the loss value, the parameters of the feature extraction network and the respiratory event detection network are updated using a back propagation algorithm.
[0200] Optionally, the calculating the loss values of the feature extraction network and the respiratory event detection network according to the parameters of the preset frame, the parameters of the prediction frame and the parameters of the annotation frame includes:
[0201] Calculating the loss of the feature extraction network and the respiratory event detection network using a first loss function according to the parameters of the preset frame, the parameters of the prediction frame, and the parameters of the annotation frame;
[0202] Wherein, the first loss function is determined according to the position loss function and the confidence loss function; wherein, the position loss function is determined by the parameters of the preset box, the parameters of the annotation box and the parameters of the prediction box, and the confidence loss function is determined by the parameters of the preset box and the parameters of the annotation box.
[0203] Optionally, the second network training module is used to:
[0204] Construct a respiratory event classification network;
[0205] Input the second slice signal samples in the second data set one by one into the one-dimensional convolution layer, the one-dimensional pooling layer, the Relu activation function and the SoftMax layer in the respiratory event classification network to obtain the respiratory event type and probability corresponding to each segment of the second slice signal sample;
[0206] Calculating the loss value of the respiratory event classification network according to the respiratory event type corresponding to each segment of the second slice signal sample and the annotation file corresponding to each segment of the second slice signal sample;
[0207] According to the loss value, the parameters of the respiratory event classification network are updated using a back propagation algorithm.
[0208] It should be noted here that the above-mentioned respiratory event detection device provided in the embodiment of the present invention can implement all the method steps implemented in the above-mentioned respiratory event detection method embodiment, and can achieve the same technical effect. The parts and beneficial effects that are the same as the method embodiment in this embodiment will not be specifically repeated here.
[0209] Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute the respiratory event detection method, which includes: obtaining a set of sleep monitoring PSG signals of the subject in a preset time period, checking the availability of the PSG signals, and if the PSG signals are available, preprocessing the PSG signals to obtain preprocessed PSG signals; slicing the preprocessed PSG signals according to a first preset time length to obtain at least one first slice signal; inputting the at least one first slice signal into a trained feature extraction network to obtain a one-dimensional feature vector corresponding to each segment of the first slice signal, and extracting the one-dimensional feature vector corresponding to each segment of the first slice signal. The eigenvector is input into a trained respiratory event detection network to obtain the respiratory event occurrence time and duration corresponding to each segment of the first slice signal; according to the respiratory event occurrence time and duration corresponding to each segment of the first slice signal, each segment of the first slice signal is subjected to time domain extension processing to obtain the corresponding second slice signal, and each segment of the second slice signal is input into a trained respiratory event classification network to obtain the respiratory event type and probability corresponding to each segment of the second slice signal; according to the respiratory event type and probability corresponding to each segment of the second slice signal, the obstructive sleep apnea hypopnea syndrome (OSAHS) morbidity level and OSAHS type of the subject are determined.
[0210] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0211] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the respiratory event detection method provided by the above-mentioned methods, the method comprising: obtaining a set of sleep monitoring PSG signals of the subject in a preset time period, checking the availability of the PSG signals, and if the PSG signals are available, preprocessing the PSG signals to obtain preprocessed PSG signals; slicing the preprocessed PSG signals according to a first preset time length to obtain at least one first slice signal; inputting the at least one first slice signal into a trained feature extraction network to obtain a one-dimensional feature vector corresponding to each segment of the first slice signal; The one-dimensional feature vector corresponding to each segment of the first slice signal is input into the trained respiratory event detection network to obtain the occurrence time and duration of the respiratory event corresponding to each segment of the first slice signal; according to the occurrence time and duration of the respiratory event corresponding to each segment of the first slice signal, each segment of the first slice signal is subjected to time domain extension processing to obtain the corresponding second slice signal, and each segment of the second slice signal is input into the trained respiratory event classification network to obtain the type and probability of the respiratory event corresponding to each segment of the second slice signal; according to the type and probability of the respiratory event corresponding to each segment of the second slice signal, the obstructive sleep apnea hypopnea syndrome (OSAHS) morbidity level and OSAHS type of the subject are determined.
[0212] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0213] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0214] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A respiratory event detection method, characterized in that: include: Acquire a set of sleep monitoring PSG signals of the subject in a preset time period, check the availability of the PSG signals, and if the PSG signals are available, preprocess the PSG signals to obtain preprocessed PSG signals; Slice the preprocessed PSG signal according to a first preset time length to obtain at least one first slice signal; Inputting the at least one segment of the first slice signal into a trained feature extraction network to obtain a one-dimensional feature vector corresponding to each segment of the first slice signal, and inputting the one-dimensional feature vector corresponding to each segment of the first slice signal into a trained respiratory event detection network to obtain the occurrence time and duration of the respiratory event corresponding to each segment of the first slice signal; According to the occurrence time and duration of the respiratory event corresponding to each segment of the first slice signal, each segment of the first slice signal is subjected to time domain extension processing to obtain a corresponding second slice signal, and each segment of the second slice signal is input into a trained respiratory event classification network to obtain a respiratory event type and probability corresponding to each segment of the second slice signal; Determine the severity and type of obstructive sleep apnea hypopnea syndrome (OSAHS) of the subject according to the type and probability of the respiratory event corresponding to each segment of the second slice signal; According to the occurrence time and duration of the respiratory event corresponding to each segment of the first slice signal, each segment of the first slice signal is subjected to time domain extension processing to obtain the corresponding second slice signal, including: According to the occurrence time and duration of the respiratory event corresponding to the first slice signal, the position where the respiratory event occurs on the first slice signal is determined, and the time domain is extended to the left and right at the position to obtain a second slice signal of a third preset duration.
2. The respiratory event detection method according to claim 1, characterized in that: The method further comprises: Acquire multiple groups of PSG signal samples, check the availability of each group of PSG signal samples, preprocess each group of PSG signal samples if each group of PSG signal samples is available, and divide the preprocessed PSG signal samples into a training set, a validation set, and a test set according to a preset ratio; Slicing each group of PSG signal samples in the training set to obtain at least one first slice signal sample corresponding to each group of PSG signal samples, and by marking the occurrence time and duration of the respiratory event of each first slice signal sample, obtaining a labeling file corresponding to each first slice signal, wherein all first slice signal samples corresponding to the multiple groups of PSG signal samples in the training set and the labeling file corresponding to each first slice signal sample constitute a first data set; Using the first data set, training the feature extraction network and the respiratory event detection network; After the training of the feature extraction network and the respiratory event detection network is completed, each first slice signal sample in the first data set is input into the trained feature extraction network, and the feature vector of each first slice signal sample output by the feature extraction network is input into the respiratory event detection network to obtain the respiratory event occurrence time and duration corresponding to each first slice signal sample; According to the occurrence time and duration of the respiratory event corresponding to each segment of the first slice signal sample, each segment of the first slice signal sample is subjected to time domain extension processing to obtain a second slice signal sample, and by marking the respiratory event type of each segment of the second slice signal sample, a labeling file corresponding to each segment of the second slice signal sample is obtained, wherein all the second slice signal samples and the labeling file corresponding to each segment of the second slice signal sample constitute a second data set; The respiratory event classification network is trained using the second data set.
3. The respiratory event detection method according to claim 2, characterized in that: The step of training the feature extraction network and the respiratory event detection network by using the first data set includes: Construct feature extraction network and respiratory event detection network; Inputting the first slice signal samples in the first data set into the one-dimensional convolution layer and the one-dimensional pooling layer in the feature extraction network one by one, to obtain a one-dimensional feature vector corresponding to each segment of the first slice signal sample; Inputting all the one-dimensional feature vectors into the stacked convolutional layers in the respiratory event detection network in sequence, obtaining three different feature vectors corresponding to each of the one-dimensional feature vectors, and setting corresponding preset frames on the three different feature vectors respectively; Determine, according to the annotation file of each segment of the first slice signal sample, an annotation box corresponding to each segment of the first slice signal sample; By performing confidence estimation and output position regression on the preset boxes corresponding to the three different feature vectors, a confidence estimation and a position offset estimation corresponding to each one-dimensional feature vector are obtained, and a prediction box corresponding to each one-dimensional feature vector is obtained according to the confidence estimation and the position offset estimation; Calculating loss values of the feature extraction network and the respiratory event detection network according to the parameters of the preset frame, the parameters of the prediction frame, and the parameters of the annotation frame; According to the loss value, the parameters of the feature extraction network and the respiratory event detection network are updated using a back propagation algorithm.
4. The respiratory event detection method according to claim 3, characterized in that: The calculating the loss values of the feature extraction network and the respiratory event detection network according to the parameters of the preset frame, the parameters of the prediction frame and the parameters of the annotation frame comprises: Calculating the loss of the feature extraction network and the respiratory event detection network using a first loss function according to the parameters of the preset frame, the parameters of the prediction frame, and the parameters of the annotation frame; Wherein, the first loss function is determined according to the position loss function and the confidence loss function; wherein, the position loss function is determined by the parameters of the preset box, the parameters of the annotation box and the parameters of the prediction box, and the confidence loss function is determined by the parameters of the preset box and the parameters of the annotation box.
5. The respiratory event detection method according to claim 2, characterized in that: The step of training the respiratory event classification network using the second data set includes: Construct a respiratory event classification network; Input the second slice signal samples in the second data set one by one into the one-dimensional convolution layer, the one-dimensional pooling layer, the Relu activation function and the SoftMax layer in the respiratory event classification network to obtain the respiratory event type and probability corresponding to each segment of the second slice signal sample; Calculating the loss value of the respiratory event classification network according to the respiratory event type corresponding to each segment of the second slice signal sample and the annotation file corresponding to each segment of the second slice signal sample; According to the loss value, the parameters of the respiratory event classification network are updated using a back propagation algorithm.
6. The respiratory event detection method according to claim 1, characterized in that: The checking the availability of the PSG signal comprises: In a case where the PSG signal includes PSG signals from at least two signal channels and the PSG signal of each of the signal channels lasts for at least a second preset time period, it is determined that the PSG signal is available.
7. The respiratory event detection method according to claim 1, characterized in that: The preprocessing of the PSG signal comprises: The PSG signal is filtered and normalized.
8. A respiratory event detection device, characterized in that: include: A PSG signal acquisition module, used to acquire a set of sleep monitoring PSG signals of the subject in a preset time period, check the availability of the PSG signals, and if the PSG signals are available, pre-process the PSG signals to obtain pre-processed PSG signals; A slice processing module, configured to perform slice processing on the preprocessed PSG signal according to a first preset time length to obtain at least one first slice signal; A first input module is used to input the at least one segment of the first slice signal into a trained feature extraction network to obtain a one-dimensional feature vector corresponding to each segment of the first slice signal, and input the one-dimensional feature vector corresponding to each segment of the first slice signal into a trained respiratory event detection network to obtain the occurrence time and duration of the respiratory event corresponding to each segment of the first slice signal; A second input module is used to perform time domain extension processing on each segment of the first slice signal according to the occurrence time and duration of the respiratory event corresponding to each segment of the first slice signal to obtain a corresponding second slice signal, and input each segment of the second slice signal into a trained respiratory event classification network to obtain a respiratory event type and probability corresponding to each segment of the second slice signal; An OSAHS severity determination module is used to determine the severity of obstructive sleep apnea hypopnea syndrome (OSAHS) and the type of OSAHS of the subject according to the type and probability of respiratory events corresponding to each segment of the second slice signal; According to the occurrence time and duration of the respiratory event corresponding to each segment of the first slice signal, each segment of the first slice signal is subjected to time domain extension processing to obtain the corresponding second slice signal, including: According to the occurrence time and duration of the respiratory event corresponding to the first slice signal, the position where the respiratory event occurs on the first slice signal is determined, and the time domain is extended to the left and right at the position to obtain a second slice signal of a third preset duration.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the respiratory event detection method according to any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the respiratory event detection method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Sleep breathing monitoring method and device
CN109431470A
Sleep quality detecting method and device and computer readable storage medium
CN109464128A