Snore recognition method and system based on non-contact sensor
Through the snoring recognition method based on non-contact sensors, the extraction and classifier model of time domain, frequency domain and time frequency features are used to solve the problem of insufficient security of snoring detection data in the prior art, and efficient snoring recognition and Privacy protection.
Patent Information
- Application Number
- CN202411747931.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-12-02
AI Technical Summary
Existing snoring detection products are detected through recording signals, which poses data security challenges and cannot effectively ensure the privacy and security of sleeping places.
Using the snoring recognition method based on non-contact sensors, by acquiring and preprocessing vibration data, extracting time domain, frequency domain and time frequency features, establishing weak classifier and strong classifier models, performing snoring recognition, and combining predicted probability values The result is corrected to realize snoring recognition.
Effectively ensure the privacy and security of sleeping places, while achieving a high snoring recognition rate, providing support for snoring detection and intervention.
Smart Images

Figure CN119226959A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of snoring signal recognition, and in particular to a snoring recognition method and system based on a non-contact sensor. Background Art
[0002] Snoring is a sign of current physiological phenomena. During sleep, factors such as relaxation of throat muscles cause the airway to collapse, and in severe cases, even become blocked. When the respiratory airflow passes through the narrow airway, its vibration frequency accelerates, forming snoring. During sleep, snoring can disturb the companions around. When the snoring level intensifies, respiratory arrest occurs, and it can even affect the patient's life and health. Therefore, sometimes, it is necessary to detect the patient's snoring.
[0003] However, sleeping places are private places with a high degree of privacy. Currently, many products on the market that identify snoring of patients use recorded signals to detect snoring, which undoubtedly poses a challenge to data security. When data leaks occur, the privacy of users will not be guaranteed. Summary of the invention
[0004] In view of the problems existing in the prior art, the embodiments of the present invention provide a snoring recognition method and system based on a non-contact sensor.
[0005] An embodiment of the present invention provides a snoring recognition method based on a non-contact sensor, the method comprising: Acquire historical vibration data collected by a non-contact sensor, and pre-process the historical vibration data to obtain vibration signals of multiple time windows; The time domain characteristics of the vibration signal are obtained by calculation, and the frequency domain characteristics of the vibration signal are obtained by Fourier transforming the vibration signal, and the time-frequency characteristics of the vibration signal are obtained by short-time Fourier transforming the vibration signal; Based on the time domain features, frequency domain features, and time-frequency features, corresponding data sets are established respectively, and weak classifier model training is performed according to the data sets, and the prediction results of the weak classifier are used as input features to train a strong classifier; Collecting the real-time vibration signal of the non-contact sensor, obtaining the real-time time domain features, real-time frequency domain features, and real-time frequency features of the real-time vibration signal, inputting the real-time time domain features, real-time frequency domain features, and real-time frequency features into the weak classifier to obtain an output prediction probability value, inputting the prediction probability value into the strong classifier to obtain an output snoring recognition result; The snoring recognition result is detected, and based on the detection result and in combination with the predicted probability value, the snoring recognition result is corrected, and a corrected final snoring result is output.
[0006] In one embodiment, the method further comprises: When the snoring recognition result is 1, a specific detection is performed on the snoring recognition result, and the specific detection includes: Obtaining a specificity threshold, comparing the predicted probability of the snoring recognition result with the specificity threshold, and when the predicted probability of the snoring recognition result is less than the specificity threshold, correcting the snoring recognition result to 0; When the snoring recognition result is 0, a sensitivity test is performed on the snoring recognition result, and the sensitivity test includes: A sensitivity threshold is obtained, and the predicted probability of the snoring recognition result is compared with the sensitivity threshold. When the predicted probability of the snoring recognition result is greater than the sensitivity threshold, the snoring recognition result is corrected to 1.
[0007] In one embodiment, the method further comprises: Constructing a two-level model based on three weak classifier models and a strong classifier model, specifically, the three weak classifier models construct a first-level model, and the strong classifier model constructs a second-level model; The step of inputting the real-time time domain features, the real-time frequency domain features, and the real-time time-frequency features into the weak classifier to obtain an output prediction probability value includes: Input the time domain feature into a first weak classifier and output a first probability; Input the first probability and the frequency domain feature into the second weak classifier, and output a second probability; The first probability, the second probability and the time-frequency feature are output to the third weak classifier, and the third probability is output.
[0008] In one embodiment, the weak classifier comprises: Random Forest, Support Vector Machine, or LightGBM.
[0009] In one embodiment, the preprocessing comprises: Data segmentation and slicing, missing value filling, denoising, normalization and feature enhancement.
[0010] An embodiment of the present invention provides a snoring recognition system based on a non-contact sensor, the system comprising: A preprocessing module, used to obtain historical vibration data collected by the non-contact sensor, and preprocess the historical vibration data to obtain vibration signals of multiple time windows; A calculation module, used to obtain the time domain characteristics of the vibration signal by calculation, perform Fourier transform on the vibration signal to obtain the frequency domain characteristics of the vibration signal, and perform short-time Fourier transform on the vibration signal to obtain the time-frequency characteristics of the vibration signal; A training module, used to establish corresponding data sets based on the time domain features, frequency domain features, and time-frequency features, respectively, and perform weak classifier model training according to the data sets, and use the prediction results of the weak classifier as input features to train a strong classifier; an identification module, used for collecting the real-time vibration signal of the non-contact sensor, obtaining the real-time time domain features, real-time frequency domain features, and real-time frequency features of the real-time vibration signal, inputting the real-time time domain features, real-time frequency domain features, and real-time frequency features into the weak classifier to obtain an output prediction probability value, inputting the prediction probability value into the strong classifier to obtain an output snoring recognition result; The correction module is used to detect the snoring recognition result, correct the snoring recognition result based on the detection result and the predicted probability value, and output the corrected final snoring result.
[0011] In one embodiment, the system further comprises: a specificity detection module, configured to perform specificity detection on the snoring recognition result when the snoring recognition result is 1, wherein the specificity detection comprises: obtaining a specificity threshold, comparing the predicted probability of the snoring recognition result with the specificity threshold, and correcting the snoring recognition result to 0 when the predicted probability of the snoring recognition result is less than the specificity threshold; The sensitivity detection module is used to perform sensitivity detection on the snoring recognition result when the snoring recognition result is 0, and the sensitivity detection includes: obtaining a sensitivity threshold, comparing the predicted probability of the snoring recognition result with the sensitivity threshold, and when the predicted probability of the snoring recognition result is greater than the sensitivity threshold, correcting the snoring recognition result to 1.
[0012] In one embodiment, the system further comprises: A two-level model module, used to construct a two-level model based on three weak classifier models and a strong classifier model, wherein the three weak classifier models construct a first-level model and the strong classifier model constructs a second-level model; The weak classifier module is used to input the time domain feature into the first weak classifier and output the first probability; input the first probability and the frequency domain feature into the second weak classifier and output the second probability; output the first probability, the second probability and the time-frequency feature into the third weak classifier and output the third probability.
[0013] An embodiment of the present invention provides an electronic device, including a processor and a memory; The processor is connected to the memory; The memory is used to store executable program code; The processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the method described in one or more embodiments.
[0014] An embodiment of the present invention provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned snoring recognition method based on a non-contact sensor are implemented.
[0015] In view of the above, in one or more embodiments of the present specification, vibration data collected by a non-contact sensor is obtained, and the vibration data is preprocessed to obtain vibration signals of multiple time windows; the time domain features of the vibration signal are calculated, and the vibration signal is Fourier transformed, the frequency domain features are calculated, and the vibration signal is short-time Fourier transformed to extract the time-frequency features; corresponding data sets are established based on the time domain features, frequency domain features, and time-frequency features, respectively, and weak classifier models are trained according to the data sets, and the prediction results of the weak classifier are used as input features to train a strong classifier; the real-time vibration signal of the non-contact sensor is collected, and the real-time time domain features, real-time frequency domain features, and real-time time-frequency features of the real-time vibration signal are obtained, and the real-time time domain features, real-time frequency domain features, and real-time time-frequency features are input into the weak classifier to obtain an output prediction probability value, and the prediction probability value is input into the strong classifier to obtain an output snoring recognition result; the snoring recognition result is detected, and the snoring recognition result is corrected based on the detection result and combined with the prediction probability value, and the corrected final snoring result is output. This can effectively protect the privacy and security of sleeping places, while achieving a high snoring recognition rate, providing effective support for snoring detection and snoring intervention. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. 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.
[0017] Figure 1 This is a flowchart of a snoring recognition method based on a non-contact sensor provided in one embodiment of this specification.
[0018] Figure 2 It is a structural diagram of a two-level model provided by an embodiment of this specification.
[0019] Figure 3 It is a waveform diagram of a vibration signal provided by an embodiment of this specification.
[0020] Figure 4It is a waveform diagram of another vibration signal provided by an embodiment of this specification.
[0021] Figure 5 It is a structural schematic diagram of a snoring recognition system based on a non-contact sensor provided in one embodiment of this specification.
[0022] Figure 6 It is a structural schematic diagram of an electronic device provided by an embodiment of this specification. DETAILED DESCRIPTION
[0023] The subject matter described herein will now be discussed with reference to example embodiments. It should be understood that the discussion of these embodiments is only to enable those skilled in the art to better understand and implement the subject matter described herein, and is not a limitation of the scope of protection, applicability or examples set forth in the claims. The functions and arrangements of the elements discussed can be changed without departing from the scope of protection of the contents of this specification. Various examples can omit, replace or add various processes or components as needed. For example, the described method can be performed in an order different from the described order, and various steps can be added, omitted or combined. In addition, the features described relative to some examples can also be combined in other examples.
[0024] As used herein, the term "including" and its variations represent open terms, meaning "including but not limited to". The term "based on" means "based at least in part on". The terms "one embodiment" and "an embodiment" mean "at least one embodiment". The term "another embodiment" means "at least one other embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other definitions may be included below, whether explicit or implicit. Unless the context clearly indicates otherwise, the definition of a term is consistent throughout the specification.
[0025] like Figure 1 As shown, an embodiment of the present invention provides a snoring recognition method based on a non-contact sensor, comprising: Step S101 : acquiring historical vibration data collected by a non-contact sensor, and preprocessing the historical vibration data to obtain vibration signals of multiple time windows.
[0026] Specifically, the vibration data collected by the non-contact sensor is obtained, wherein the vibration data is the historical vibration data collected by the non-contact sensor, including the vibration data in the case of snoring and the vibration data in the case of no snoring. The non-contact sensor may include a piezoelectric sensor, an optical fiber sensor, a capacitive sensor, etc. The sensor may be placed in a mattress, and the activities on the bed may be transmitted to the data acquisition device through the mattress in the form of a vibration signal. The acquisition system of the sensor may be a DSP (Digital Signal Processing) device, and the software of the data acquisition system is configured to set a suitable sampling rate and trigger conditions. Generally, the sampling rate should not be less than 100 Hz to capture high-frequency vibration signals. After the vibration data is obtained, the vibration data is preprocessed, and the preprocessing steps may include data segmentation and slicing, missing value filling, denoising, normalization, feature enhancement, etc. Among them, the data segmentation and slicing can divide the continuous vibration data into time windows of fixed length, for example, every 30 seconds or 1 minute can be selected as a time window. In addition, in order to capture more subtle changes, overlapping windows can be used. For example, each new window can be moved forward 10 seconds from the end of the previous window, and the data in each time window can be sliced to form independent data segments, which is convenient for subsequent feature extraction and analysis. For missing value filling, firstly, the mean method, interpolation method and other methods are used to detect whether there are missing values in the vibration signal. When missing values are detected, the missing values can be filled by the mean filling, linear interpolation, spline interpolation and other methods. Denoising can use digital filters to remove environmental noise and other interference signals. Normalization processing unifies the data standards. Feature enhancement includes smoothing, trend removal, etc. Then the vibration signals of multiple time windows after preprocessing are obtained.
[0027] Step S102, obtaining the time domain characteristics of the vibration signal by calculation, performing Fourier transform on the vibration signal to obtain the frequency domain characteristics of the vibration signal, and performing short-time Fourier transform on the vibration signal to obtain the time-frequency characteristics of the vibration signal.
[0028] Specifically, the features of the vibration signal are extracted, including time domain features, frequency domain features, and time-frequency features. Among them, the time domain features are statistics directly extracted from the original vibration signal, which can reflect the basic characteristics of the signal, including mean, variance, standard deviation, maximum value, minimum value, peak value, etc. The above time domain features are calculated for the vibration signal in each time window, and the calculation results are saved as feature vectors. The frequency domain features convert the time domain signal into the frequency domain signal through Fourier transform (FFT), which can reflect the frequency components of the signal, including spectrum, main frequency, power spectrum density, frequency band energy, spectrum entropy, etc. The time-frequency feature converts the time domain signal into the time-frequency domain signal through the time-frequency analysis method (such as short-time Fourier transform STFT, wavelet transform WT), which can reflect the time-frequency characteristics of the signal. For example, the short-time Fourier transform calculates the STFT of the signal in each time window to obtain the time-frequency diagram, and then extracts the key features in the time-frequency diagram, such as the maximum value, mean, variance, etc.; for example, the wavelet transform selects the appropriate wavelet basis function (such as Morlet, Mexican Hat), calculates the wavelet transform of the signal in each time window, extracts the modulus maximum of the wavelet coefficient, represents the mutation point of the signal, and calculates the wavelet energy distribution. Then draw the time-frequency diagram to intuitively display the changes of the signal in the time-frequency domain, and extract the local features in the time-frequency diagram, such as peaks, valleys, edges, etc.
[0029] Step S103, establishing corresponding data sets based on the time domain features, frequency domain features, and time-frequency features, respectively, and training weak classifier models according to the data sets, and using the prediction results of the weak classifiers as input features to train strong classifiers.
[0030] Specifically, the extracted time domain features, frequency domain features and time-frequency features are organized into three independent data sets, each of which contains feature vectors and corresponding labels (snoring or non-snoring). Weak classifier models are trained according to the data sets, where the weak classification models can be Random Forest, Support Vector Machine (SVM), and LightGBM. Weak classifier model training can be, for example: using the time domain feature data set to train the random forest model, evaluate the performance of the model on the validation set, and record indicators such as accuracy, recall, and F1 score; using the frequency domain feature data set to train the SVM model, evaluate the performance of the model on the validation set, and record indicators such as accuracy, recall, and F1 score; using the time-frequency feature data set to train the LightGBM model, evaluate the performance of the model on the validation set, and record indicators such as accuracy, recall, and F1 score. After the weak classifier model is trained, the three trained weak classifier models are used to predict the test set to obtain the predicted probability or category label of each sample, and the prediction results of the three weak classifier models are used as new features to construct a new data set. For example, assuming that each model outputs a probability value, the feature dimension of the new data set is 3 (one feature for each model). Determine a strong classifier model, such as logistic regression, neural network, etc., and then train the strong classifier model with the new data set, evaluate the performance of the strong classifier on the validation set, record indicators such as accuracy, recall, and F1 score, and adjust the parameters of the strong classifier based on the evaluation results to optimize the model performance of the strong classifier model.
[0031] Step S104, collecting the real-time vibration signal of the non-contact sensor, obtaining the real-time time domain features, real-time frequency domain features, and real-time time-frequency features of the real-time vibration signal, inputting the real-time time domain features, real-time frequency domain features, and real-time time-frequency features into the weak classifier to obtain an output prediction probability value, inputting the prediction probability value into the strong classifier to obtain an output snoring recognition result.
[0032] Specifically, a non-contact pressure sensor is used to collect the vibration signal on the mattress in real time. After preprocessing the real-time vibration signal, the vibration features are extracted, including real-time time domain features, real-time frequency domain features, and real-time time-frequency features. The vibration features are input into the trained weak classifier model, for example, the real-time time domain features are input into the trained random forest model to obtain the predicted probability value; the real-time frequency domain features are input into the trained support vector machine model to obtain the predicted probability value; the real-time time-frequency features are input into the trained LightGBM model to obtain the predicted probability value. After obtaining the predicted probability values output by the three weak classifiers, the predicted probability values are input into the strong classifier, where the predicted probability values of the three weak classifiers are combined into a new feature vector before input. For example, assuming that the prediction probability of random forest is 0.8, the prediction probability of support vector machine is 0.7, and the prediction probability of LightGBM is 0.9, then the new feature vector is [0.8, 0.7, 0.9]. The new feature vector is input into the trained strong classifier to predict the snoring result. The strong classifier outputs a preliminary snoring result, which is usually 0 (non-snoring) or 1 (snoring).
[0033] In addition, when training the real-time vibration signal through the trained weak classifier and strong classifier, the weak classifier and the strong classifier can be fused to form a new model architecture. Figure 2As shown in the figure, the model architecture is divided into two levels. The first level consists of three weak classifiers, and the second level is a strong classifier. In the actual processing process, the time window can be set to 20s. Every time 20s of real-time vibration signal data is collected, feature extraction will be performed to obtain time domain features, frequency domain features, and time-frequency features. These three types of features can form independent one-dimensional sequences. First, in the first level of the model fusion architecture, the time domain features are input into the first weak classifier that has been trained, and a value is generated. This value indicates that the first weak classifier believes that the probability of a snoring event occurs in the current 20s segment. The second weak classifier that has been trained takes the value output by the first weak classifier and the frequency domain features as input features. The second weak classifier also generates a value. This value indicates that the second weak classifier believes that the probability of a snoring event occurs in the current 20s segment. The third weak classifier that has been trained can take the value output by the first weak classifier, the value output by the second weak classifier, and the time-frequency features as input features, and output a value. This value indicates that the third weak classifier believes that the probability of a snoring event occurs in the current 20s segment. In the second-level strong classifier, the trained strong classifier will use the values of the three weak classifiers in the first level as input features, and then output a value, which represents the probability that the strong classifier believes that a snoring event occurs in the current 20s segment. Set a threshold (such as 0.5) in advance. When the value output by the strong classifier is greater than the threshold, the current 20s segment is marked as a snoring segment, and the label is recorded as 1. When the value output by the strong classifier is less than the threshold, the current 20s segment is marked as a non-snoring segment, and the label is recorded as 0.
[0034] Step S105 , detecting the snoring recognition result, correcting the snoring recognition result based on the detection result and the predicted probability value, and outputting the corrected final snoring result.
[0035] Specifically, based on the preliminary snoring recognition results, the snoring recognition results are further corrected for accuracy, including specificity detection and sensitivity detection. Among them, the specificity detection is to reduce false positives (FP), that is, the model mistakenly identifies non-snoring segments as snoring segments. Set the specificity threshold to 0.9. If the preliminary prediction result is 1 (snoring), but the prediction probability is lower than 0.9, it is corrected to 0 (non-snoring). Perform upper and lower time window analysis. If the prediction result of the current segment is 1, but the previous and next segments are all 0, the result of the current segment is re-evaluated. Sensitivity detection is to reduce false negatives (FN), that is, the model mistakenly identifies snoring segments as non-snoring segments. Set the sensitivity threshold to 0.2. If the preliminary prediction result is 0 (non-snoring), but the prediction probability is higher than the sensitivity threshold of 0.2, it is corrected to 1 (snoring). Perform upper and lower time window analysis. If the prediction result of the current segment is 0, but the previous and next segments are all 1, the result of the current segment is re-evaluated. After specificity detection and sensitivity correction, the final snoring result is obtained.
[0036] Further, in Figure 2 Based on the model architecture, the specific correction process for the snoring recognition result output by the model architecture includes: when the preliminary snoring result is 1, the model believes that a snoring event has occurred in this segment and specific detection is required. Figure 3 As shown, Figure 3 Figure (a) is the original vibration signal waveform. Figure 3 The middle (b) figure is the breathing waveform obtained by low-pass filtering. Figure 3 The middle (c) figure is the time-frequency diagram obtained by short-time Fourier transform. Figure 3 Figure (d) shows Figure 3 The waveform obtained by summing up all the frequency amplitudes at the same time in Figure (c). When a snoring event occurs, Figure 3 Figure (b) and Figure 3 There is coupling at the peak position in the middle (d). Figure 3 The waveform in (b) is Figure 3 The correlation coefficient of the waveform in Figure (d) can be used to obtain the correlation between the two waveforms, such as the Pearson correlation coefficient. The calculation formula of the Pearson correlation coefficient is: Among them, r represents the Pearson correlation coefficient, and y represents Figure 3 In (c), the value of each point in the waveform is represented by x. Figure 3 The values of the waveform points in (b) are: represents the mean of x, represents the mean of y.
[0037] The calculated Pearson coefficient is then compared with a preset threshold. When it is greater than the threshold, the preliminary classification result of the current segment is not corrected; when it is less than the threshold, the preliminary classification result of the current segment is corrected to 0, that is, it is finally considered that no snoring event occurs in the current segment.
[0038] When the preliminary snoring result is 0, the model believes that no snoring event has occurred in this segment, and sensitivity detection is required. Some snoring events are not reflected in the frequency domain features or time-frequency features, but can be distinguished in the original waveform. Figure 4 As shown in the original waveform Figure 4 In the middle (a), we can see an abnormal bulge. After playing the audio, we confirmed that the abnormal bulge is a periodic snoring event. However, this snoring event Figure 4 The respiratory waveform in the middle (b) is Figure 4 (c) Time-frequency diagram and Figure 4 The time-frequency waveform in the middle (d) is not reflected. By detecting the special waveform in this type of original signal, the preliminary snoring recognition results can be corrected.
[0039] First, find all the peaks in the original waveform and the troughs on the left and right. Then calculate the absolute value of the slope between each peak and the trough on the left, and then calculate the absolute value of the slope between each peak and the trough on the right. Calculate the ratio of the absolute values of the above two slopes and determine whether it is within the pre-set range. Count the number of all peaks that meet the conditions in the current segment. When the number is greater than the threshold, the final result is corrected to 1, which means that a snoring event has occurred in the current segment. When the number is less than the threshold, the preliminary snoring prediction result will not be corrected, which means that it is ultimately considered that no snoring event has occurred in the current segment.
[0040] The embodiment of the present invention provides a snoring recognition method based on a non-contact sensor, which obtains vibration data collected by the non-contact sensor, and pre-processes the vibration data to obtain vibration signals of multiple time windows; calculates the time domain features of the vibration signal, performs Fourier transform on the vibration signal, calculates the frequency domain features, and performs short-time Fourier transform on the vibration signal to extract time-frequency features; establishes corresponding data sets based on the time domain features, frequency domain features, and time-frequency features, respectively, and trains a weak classifier model according to the data set, and uses the prediction results of the weak classifier as input features to train a strong classifier; collects real-time vibration signals of the non-contact sensor, obtains real-time time domain features, real-time frequency domain features, and real-time time-frequency features of the real-time vibration signal, inputs the real-time time domain features, real-time frequency domain features, and real-time time-frequency features into the weak classifier, obtains an output prediction probability value, and inputs the prediction probability value into the strong classifier to obtain an output snoring recognition result; detects the snoring recognition result, corrects the snoring recognition result based on the detection result and in combination with the prediction probability value, and outputs the corrected final snoring result. This can effectively protect the privacy and security of sleeping places, while achieving a high snoring recognition rate, providing effective support for snoring detection and snoring intervention.
[0041] See also Figure 5 , Figure 5 FIG. 1 is a schematic diagram of a snoring recognition system based on a non-contact sensor provided in an embodiment of the present application. Figure 5 As shown, the system comprises: The preprocessing module S501 is used to obtain vibration data collected by the non-contact sensor and preprocess the vibration data to obtain vibration signals of multiple time windows; The calculation module S502 is used to calculate the time domain characteristics of the vibration signal, perform Fourier transform on the vibration signal, calculate the frequency domain characteristics, and perform short-time Fourier transform on the vibration signal to extract the time-frequency characteristics; The training module S503 is used to establish corresponding data sets based on the time domain features, frequency domain features, and time-frequency features, respectively, and perform weak classifier model training according to the data sets, and use the prediction results of the weak classifier as input features to train a strong classifier; The recognition module S504 is used to collect the real-time vibration signal of the non-contact sensor, obtain the real-time time domain features, real-time frequency domain features, and real-time frequency features of the real-time vibration signal, input the real-time time domain features, real-time frequency domain features, and real-time frequency features into the weak classifier to obtain an output prediction probability value, input the prediction probability value into the strong classifier, and obtain an output snoring recognition result; The correction module S505 is used to detect the snoring recognition result, correct the snoring recognition result based on the detection result and the predicted probability value, and output the corrected final snoring result.
[0042] In another embodiment, a snoring recognition system based on a non-contact sensor further includes: a specificity detection module, configured to perform specificity detection on the snoring recognition result when the snoring recognition result is 1, wherein the specificity detection comprises: obtaining a specificity threshold, comparing the predicted probability of the snoring recognition result with the specificity threshold, and correcting the snoring recognition result to 0 when the predicted probability of the snoring recognition result is less than the specificity threshold; The sensitivity detection module is used to perform sensitivity detection on the snoring recognition result when the snoring recognition result is 0, and the sensitivity detection includes: obtaining a sensitivity threshold, comparing the predicted probability of the snoring recognition result with the sensitivity threshold, and when the predicted probability of the snoring recognition result is greater than the sensitivity threshold, correcting the snoring recognition result to 1.
[0043] In another embodiment, a snoring recognition system based on a non-contact sensor further includes: A two-level model module, used to construct a two-level model based on three weak classifier models and a strong classifier model, wherein the three weak classifier models construct a first-level model and the strong classifier model constructs a second-level model; The weak classifier module is used to input the time domain feature into the first weak classifier and output the first probability; input the first probability and the frequency domain feature into the second weak classifier and output the second probability; output the first probability, the second probability and the time-frequency feature into the third weak classifier and output the third probability.
[0044] Those skilled in the art can clearly understand that the technical solutions of the embodiments of the present application can be implemented with the help of software and / or hardware. The "unit" and "module" in this specification refer to software and / or hardware that can independently complete or cooperate with other components to complete specific functions, where the hardware can be, for example, a field programmable gate array (Field-Programmable Gate Array, FPGA), an integrated circuit (Integrated Circuit, IC), etc.
[0045] Each processing unit and / or module of the embodiments of the present application may be implemented by an analog circuit that implements the functions described in the embodiments of the present application, or may be implemented by software that executes the functions described in the embodiments of the present application.
[0046] See also Figure 6 , which shows a schematic diagram of the structure of an electronic device involved in an embodiment of the present application, the electronic device can be used to implement Figure 1 The method in the embodiment shown. Figure 6As shown, the electronic device 600 may include: at least one processor 601 , at least one network interface 604 , a user interface 603 , a memory 605 , and at least one communication bus 602 .
[0047] The communication bus 602 is used to realize the connection and communication between these components.
[0048] The user interface 603 may include a display screen (Display) and a camera (Camera). The optional user interface 603 may also include a standard wired interface and a wireless interface.
[0049] The network interface 604 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0050] Among them, the processor 601 may include one or more processing cores. The processor 601 uses various interfaces and lines to connect various parts of the entire electronic device 600, and executes various functions and processes data of the electronic device 600 by running or executing instructions, programs, code sets or instruction sets stored in the memory 605, and calling data stored in the memory 605. Optionally, the processor 601 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 601 can integrate one or a combination of a processor (Central Processing Unit, CPU), an image processor (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 601, and it can be implemented separately through a chip.
[0051] Among them, the memory 605 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 605 includes a non-transitory computer-readable storage medium. The memory 605 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 605 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 605 may also be optionally at least one storage device located away from the aforementioned processor 601. As Figure 6 As shown, the memory 605 as a computer storage medium may include an operating system, a network communication module, a user interface module, and program instructions.
[0052] exist Figure 6 In the electronic device 600 shown, the user interface 603 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 601 can be used to call the interactive application based on image generation stored in the memory 605, and specifically perform the following operations: obtain the vibration data collected by the non-contact sensor, and pre-process the vibration data to obtain vibration signals of multiple time windows; calculate the time domain features of the vibration signal, perform Fourier transform on the vibration signal, calculate the frequency domain features, and perform short-time Fourier transform on the vibration signal to extract the time-frequency features; establish the time domain features, frequency domain features, and time-frequency features respectively based on the time domain features, the frequency domain features, and the time-frequency features. A corresponding data set is obtained, and a weak classifier model is trained according to the data set, and the prediction result of the weak classifier is used as an input feature to train a strong classifier; the real-time vibration signal of the contactless sensor is collected, and the real-time time domain feature, real-time frequency domain feature, and real-time time-frequency feature of the real-time vibration signal are obtained, and the real-time time domain feature, real-time frequency domain feature, and real-time time-frequency feature are input into the weak classifier to obtain an output prediction probability value, and the prediction probability value is input into the strong classifier to obtain an output snoring recognition result; the snoring recognition result is detected, and the snoring recognition result is corrected based on the detection result and the prediction probability value, and the corrected final snoring result is output.
[0053] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the above method are implemented. The computer-readable storage medium may include, but is not limited to, any type of disk, including a floppy disk, an optical disk, a DVD, a CD-ROM, a micro drive, and a magneto-optical disk, a ROM, a RAM, an EPROM, an EEPROM, a DRAM, a VRAM, a flash memory device, a magnetic card or an optical card, a nanosystem (including a molecular memory IC), or any type of medium or device suitable for storing instructions and / or data.
[0054] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0055] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0056] In the several embodiments provided in the present application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0057] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0058] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0059] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, disk or optical disk and other media that can store program codes.
[0060] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by entering a program to instruct related hardware, and the program may be stored in a computer-readable memory, which may include a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0061] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
Claims
1. A snoring recognition method based on a non-contact sensor, the method comprising: Acquire historical vibration data collected by a non-contact sensor, and pre-process the historical vibration data to obtain vibration signals of multiple time windows; The time domain characteristics of the vibration signal are obtained by calculation, and the frequency domain characteristics of the vibration signal are obtained by Fourier transforming the vibration signal, and the time-frequency characteristics of the vibration signal are obtained by short-time Fourier transforming the vibration signal; Based on the time domain features, frequency domain features, and time-frequency features, corresponding data sets are established respectively, and weak classifier model training is performed according to the data sets, and the prediction results of the weak classifier are used as input features to train a strong classifier; Collecting the real-time vibration signal of the non-contact sensor, obtaining the real-time time domain features, real-time frequency domain features, and real-time frequency features of the real-time vibration signal, inputting the real-time time domain features, real-time frequency domain features, and real-time frequency features into the weak classifier to obtain an output prediction probability value, inputting the prediction probability value into the strong classifier to obtain an output snoring recognition result; The snoring recognition result is detected, and based on the detection result and in combination with the predicted probability value, the snoring recognition result is corrected, and a corrected final snoring result is output.
2. The method according to claim 1, characterized in that The step of modifying the snoring recognition result based on the detection result and in combination with the predicted probability value includes: When the snoring recognition result is 1, a specific detection is performed on the snoring recognition result, and the specific detection includes: Obtaining a specificity threshold, comparing the predicted probability of the snoring recognition result with the specificity threshold, and when the predicted probability of the snoring recognition result is less than the specificity threshold, correcting the snoring recognition result to 0; When the snoring recognition result is 0, a sensitivity test is performed on the snoring recognition result, and the sensitivity test includes: A sensitivity threshold is obtained, and the predicted probability of the snoring recognition result is compared with the sensitivity threshold. When the predicted probability of the snoring recognition result is greater than the sensitivity threshold, the snoring recognition result is corrected to 1.
3. The method according to claim 1, characterized in that The method further comprises: Constructing a two-level model based on three weak classifier models and a strong classifier model, specifically, the three weak classifier models construct a first-level model, and the strong classifier model constructs a second-level model; The step of inputting the real-time time domain features, the real-time frequency domain features, and the real-time time-frequency features into the weak classifier to obtain an output prediction probability value includes: Input the time domain feature into a first weak classifier and output a first probability; Input the first probability and the frequency domain feature into the second weak classifier, and output a second probability; The first probability, the second probability and the time-frequency feature are output to the third weak classifier, and the third probability is output.
4. The method according to claim 1, characterized in that The weak classifier comprises: Random Forest, Support Vector Machine, or LightGBM.
5. The method according to claim 1, characterized in that The preprocessing comprises: Data segmentation and slicing, missing value filling, denoising, normalization and feature enhancement.
6. A snoring recognition system based on a non-contact sensor, characterized in that: The system comprises: A preprocessing module, used to obtain historical vibration data collected by the non-contact sensor, and preprocess the historical vibration data to obtain vibration signals of multiple time windows; A calculation module, used to obtain the time domain characteristics of the vibration signal by calculation, perform Fourier transform on the vibration signal to obtain the frequency domain characteristics of the vibration signal, and perform short-time Fourier transform on the vibration signal to obtain the time-frequency characteristics of the vibration signal; A training module, used to establish corresponding data sets based on the time domain features, frequency domain features, and time-frequency features, respectively, and perform weak classifier model training according to the data sets, and use the prediction results of the weak classifier as input features to train a strong classifier; an identification module, used for collecting the real-time vibration signal of the non-contact sensor, obtaining the real-time time domain features, real-time frequency domain features, and real-time frequency features of the real-time vibration signal, inputting the real-time time domain features, real-time frequency domain features, and real-time frequency features into the weak classifier to obtain an output prediction probability value, inputting the prediction probability value into the strong classifier to obtain an output snoring recognition result; The correction module is used to detect the snoring recognition result, correct the snoring recognition result based on the detection result and the predicted probability value, and output the corrected final snoring result.
7. The system according to claim 6, characterized in that The system further comprises: a specificity detection module, configured to perform specificity detection on the snoring recognition result when the snoring recognition result is 1, wherein the specificity detection comprises: obtaining a specificity threshold, comparing the predicted probability of the snoring recognition result with the specificity threshold, and correcting the snoring recognition result to 0 when the predicted probability of the snoring recognition result is less than the specificity threshold; The sensitivity detection module is used to perform sensitivity detection on the snoring recognition result when the snoring recognition result is 0, and the sensitivity detection includes: obtaining a sensitivity threshold, comparing the predicted probability of the snoring recognition result with the sensitivity threshold, and when the predicted probability of the snoring recognition result is greater than the sensitivity threshold, correcting the snoring recognition result to 1.
8. The system according to claim 6, characterized in that The system further comprises: A two-level model module, used to construct a two-level model based on three weak classifier models and a strong classifier model, wherein the three weak classifier models construct a first-level model and the strong classifier model constructs a second-level model; The weak classifier module is used to input the time domain feature into the first weak classifier and output the first probability; input the first probability and the frequency domain feature into the second weak classifier and output the second probability; output the first probability, the second probability and the time-frequency feature into the third weak classifier and output the third probability.
9. An electronic device comprising a processor and a memory; The processor is connected to the memory; The memory is used to store executable program code; The processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the method according to any one of claims 1 to 5.
10. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Short-time and long-time feature modeling fusion-based environmental sound recognition method and device
CN105654944A
Sleep snoring sound classification detecting method and system based on depth learning
CN108670200A
A support vector machine integrated learning method based on AdaBoost
CN109472302A
Noise diagnosis algorithm for rolling bearing faults of rotary equipment
CN110132598A
Optical fiber sensing vibration signal mode recognition method based on AdaBoost-ESN algorithm
CN111209853A
Cited By
Snore detection method and system based on intelligent bed
CN119867667A
A Snoring Detection Method and System Based on an Intelligent Bed
CN119867667B
