A kind of intelligent breathing signal processing method and device

By combining the respiratory flow sensor and sleep breathing audio data, and using data processing and classification algorithms, the problem of inability to comprehensively detect and warn sleep apnea in the existing technology is solved, realizing intelligent evaluation and early warning of sleep quality, and improving sleep quality. Monitoring accuracy.

CN115804568BActive Publication Date: 2024-10-15HUNAN VENTMED MEDICAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210478307.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-05
Publication Date
2024-10-15
Estimated Expiration
2042-05-05

AI Technical Summary

Technical Problem

Existing technology cannot comprehensively detect and warn of sleep apnea syndrome, especially before apnea, and cannot accurately judge sleep quality.

Method used

By combining respiratory flow sensor data and sleep breathing audio data, data processing and classification algorithms are used to achieve intelligent evaluation of the entire sleep quality. Specific steps include obtaining and processing flow sensor data and audio data, performing data fusion, and using convolutional neural networks and random forest algorithms for sleep state identification and quality assessment.

Benefits of technology

It achieves detailed segmentation and accurate evaluation of sleep quality, can provide early warning of sleep apnea, and improve the accuracy and effectiveness of sleep monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115804568B_ABST
    Figure CN115804568B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for processing intelligent respiratory signals. The method refines and segments sleep segments by fusing flow sensor data and sleep breathing audio data, obtains more detailed features, and intelligently classifies sleep quality based on the random forest algorithm and the above-mentioned multiple features. The respiratory tidal volume and respiratory frequency are detected by a respiratory flow sensor, and then a respiratory waveform is generated to accurately obtain respiratory quantitative data. For audio data, a noise reduction algorithm based on wavelet transform is used for noise reduction processing, and a compromise function of hard and soft thresholds is used for threshold function determination, which has good flexibility; based on a convolutional neural network, breathing sounds, snoring sounds and sleep talking are identified, and based on the identification results, the respiratory audio is segmented and segmented. The present invention also provides a device for intelligent respiratory signals. Intelligent monitoring of sleep breathing is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of medical equipment, and in particular to an intelligent respiratory signal processing method and device. Background Art

[0002] The prevalence of sleep apnea syndrome in patients over 65 years old in my country is as high as 20% to 40%. Its clinical manifestations are repeated apnea, hypoxemia, sleep structure disorder and intermittent snoring during sleep at night, which often lead to mental, neurological and behavioral abnormalities and multi-organ system disorders. In severe cases, death may occur. As an important medical support device for the treatment of respiratory diseases, many studies have shown that ventilators can effectively improve the sleep quality of sleep apnea syndrome, correct its hypoxia and hypercapnia, and gradually restore blood rheology to normal levels.

[0003] The existing method of measuring breathing is based on the flow sensor in the ventilator, which only detects the tidal volume of breathing, or simply recognizes snoring through audio. The measurement data of the two breathing monitoring methods are not comprehensive. The flow sensor measurement cannot detect the situation where the user is snoring without apnea, and cannot provide an early warning before the user's apnea syndrome becomes serious enough to cause apnea. The detection of sleep snoring is not combined with specific respiratory flow data, and it is impossible to accurately detect and predict breathing, as well as judge the sleep state. Summary of the invention

[0004] 1. Technical issues to be resolved

[0005] In order to solve the above technical problems, the present invention provides an intelligent respiratory signal processing method and device. The method combines respiratory flow sensor data and sleep breathing audio data to fuse the two data, thereby realizing intelligent evaluation of the quality of the entire sleep period.

[0006] (II) Technical solution

[0007] In order to solve the above-mentioned technical problems and achieve the purpose of the invention, the present invention is implemented by the following technical solutions:

[0008] An intelligent respiratory signal processing method comprises the following steps:

[0009] Step 1: Obtain flow sensor data and microphone audio data;

[0010] Step 2: Processing the respiratory flow data obtained by the flow sensor;

[0011] Step 3: Process the audio signal to obtain breathing-related data and snoring and sleep talking recognition;

[0012] Step 4: Combine the above data and perform fusion processing, and use a classification algorithm to assess the quality of the entire sleep period.

[0013] Furthermore, the flow sensor in step 1 includes a pressure differential flow sensor, a hot wire flow sensor, a pressure strain flow sensor or an ultrasonic flow sensor;

[0014] Furthermore, step 2 also includes:

[0015] The digitization of analog signals includes anti-aliasing filtering of the collected analog signals and then A / D conversion into digital signals.

[0016] Calculate the flow rate of the digital signal obtained above;

[0017] The respiratory tidal volume, respiratory frequency and respiratory waveform are calculated based on the flow rate. The tidal volume calculation process determines whether the current respiratory state is inhalation or exhalation by detecting the flow data. If it is inhalation, the flow data is stored in the inhalation storage space, and then the next data is read. If it is still inhalation, the flow data is added to the total flow data of the inhalation storage space and stored in the inhalation storage space to calculate the total inhalation volume. If the next data is exhalation, the flow stored in the inhalation storage space is output as the tidal volume, and the storage space data is cleared to wait for the next inhalation process. The calculation method is as follows:

[0018]

[0019] Among them, C is the tidal volume, n is the amount of data collected during one inhalation process, and x i is the collected inspiratory data value.

[0020] To calculate the respiratory frequency, we first need to obtain the time required for a respiratory cycle, that is, by calculating the number of respiratory data in a respiratory cycle and combining the sampling time interval to obtain the time occupied by a respiratory cycle, and then calculate the respiratory frequency, that is:

[0021]

[0022] Among them, n1 and n2 are the number of data collected in one exhalation and inhalation process respectively, T c is the time interval for a sampling.

[0023] Furthermore, step three also includes: performing noise reduction processing on the audio signal based on wavelet transform;

[0024] Audio feature extraction: For the audio clip dataset obtained through audio preprocessing, typical feature parameters in the audio time domain and frequency domain are calculated, namely, short-time zero-crossing rate, resonance peak and Mel spectrum coefficient, which are used as feature vectors for recognition model construction;

[0025] (1) As a classic characteristic parameter in the time domain, the short-time zero-crossing rate refers to the number of times the sound signal crosses the horizontal axis per unit time (N sampling points per frame). The calculation formula for the short-time zero-crossing rate per frame is:

[0026]

[0027] in,

[0028] x v (n) is an audio signal;

[0029] (2) Resonant peaks are the areas where the energy of the audio spectrum is most concentrated. The present invention is based on a method for extracting and describing dynamic differential features of resonance peaks based on the cepstrum method. The calculation steps are as follows:

[0030] a. Framing: The speech signal is essentially a non-stationary signal, but it is approximately considered to be a linear time-invariant signal within 10-30ms. The pre-emphasized sound signal is framed, the frame length is selected as 20ms, and the frame shift between adjacent frames is 40%. b. Windowing: In order to eliminate the influence of the Gibbs effect in Fourier transform, the speech signal is windowed, and the window function is selected as the Hamming window.

[0031] c. Discrete Fourier transform: Perform fast Fourier transform on the signal to get the spectrum, and then square the modulus to get the signal power spectrum. The discrete Fourier transform formula is:

[0032]

[0033] Among them, x(n) is the time domain input signal, X(k) is the frequency domain output signal, and k is the corresponding point of Fourier transform.

[0034] d. Calculate the cepstrum sequence as follows:

[0035] X′(k)=lg|X(k)|

[0036] Perform inverse Fourier transform on X′(k) to obtain the cepstrum sequence x′(n):

[0037]

[0038] The cepstrum sequence x′(n) is windowed to obtain w(n), and the envelope W(k) is obtained through Fourier transform. The first three maximum values ​​of the envelope are taken as resonance peaks.

[0039] (3) Mel spectrum coefficients are parameters that simulate the process of human ear perceiving sound signals based on the nonlinear perception and processing of speech signals by the auditory system. The calculation steps of Mel spectrum coefficients are as follows:

[0040] Preprocessing: audio framing, windowing, discrete Fourier transform. Mel scale transform: the auditory system's perceptual resolution decreases as the frequency increases. Mel frequency is mapped to the real frequency through the Mel scale. Discrete cosine transform: the frequency domain information of speech signals is mainly composed of phonemes and pitches. Calculate the output signal of each Mel filter and take the logarithm to obtain the logarithm of the power spectrum in each frequency band, and perform discrete cosine transform on the spectrum envelope to obtain the 12-dimensional Mel spectrum coefficients.

[0041] Recognize breathing sounds, snoring and sleep talking based on convolutional neural networks, including model establishment and training:

[0042] (1) Convolutional neural network model is established, and the length of 1 frame is used as the length of input vector. The network structure consists of input layer, convolution layer and fully connected layer. The convolution layer includes convolution, batch normalization, activation function and pooling layer. The activation function uses rectified linear unit, and the pooling layer uses average pooling. The number of features in each layer of the subsequent 3 layers of full connection decreases, and the difference between the two categories is fully reflected with fewer features and overfitting is prevented. Assuming that the input of the neural network is 1-dimensional feature X, the network parameter is P, and n represents the total number of hidden layers. Then the predicted value is:

[0043] Y=F(X|P)=f n (f n-1 ...(f2(f1(X|P1)|P2)...|P n-1 )|P n )

[0044] Among them, the calculation formulas of the kth convolutional layer and the fully connected layer are as follows:

[0045]

[0046] f k (X k |P k )=A(WX k +b)

[0047] Among them, W represents the 1-dimensional convolution kernel or weighting coefficient, X k is the input feature, b is the bias, and A is the activation function.

[0048] (2) Collect sleep breathing audio of people of different ages and genders, including different types of breathing audio clips such as normal breathing, apnea, bradypnea, snoring, and sleep talking, and annotate the audio clips. Use the training set to train the neural network model and obtain the optimal model parameters.

[0049] The amplitude and frequency of normal breathing are relatively stable, and the depth and duration of each breath are basically equal. Normally, an adult breathes 12-20 times in a quiet state in one minute.

[0050] Respiratory arrest: If the breathing stops for more than 20 seconds during the breathing process, it is respiratory arrest. Respiratory arrest is also accompanied by breathing difficulties, nasal congestion and drooling, or cyanosis, decreased blood oxygen saturation and low muscle tone. If respiratory arrest is more serious, it can lead to cerebral infarction and even endanger life.

[0051] Bradypnea is similar to normal breathing, with a regular breathing rhythm but a frequency of less than 10 breaths per minute.

[0052] Snoring is the snoring sound produced during sleep due to the vibration of the uvula (uvula) caused by the narrowing of the upper airway. Enlarged tonsils, an enlarged tongue, and excessive drinking can cause snoring. Snoring can cause daytime sleepiness, fatigue, lack of concentration, headaches, and decreased work ability. Snoring is an independent risk factor for hypertension, and severe snoring is often accompanied by sleep apnea syndrome.

[0053] Sleep talking refers to talking or making some kind of sound other than snoring during sleep, which cannot be recalled after waking up. It is a kind of sleep disorder. Modern medicine believes that it is related to mental factors and often occurs in combination with nightmares and sleepwalking.

[0054] (3) Based on the established convolutional neural network model, different types of sleep breathing states are identified, the duration of each state is recorded, and the breathing frequency is determined based on the breathing in each stage; for the snoring state, the decibel of the snoring sound is obtained.

[0055] Step four also includes: based on the respiratory tidal volume and respiratory rate obtained in step two, the sleep process is divided into normal breathing, apnea, Cheyne-Stokes breathing, and bradypnea segments; based on the normal breathing, apnea, snoring, and sleep talking sleep segments obtained in step three, new segmented segments are further obtained by temporal fusion, and the whole sleep segment is scored using a random forest algorithm based on the obtained new fused segmented segments, and the quality grade assessment divides the whole sleep quality into four grades: excellent, good, fair, and poor.

[0056] The present invention also provides an intelligent respiratory signal processing device, which specifically comprises:

[0057] Sensor data acquisition module: It is used to obtain flow sensor data and microphone audio data.

[0058] Respiratory flow sensor data processing module: It is used to process the respiratory flow sensor data to obtain the measured airway pressure and respiratory flow rate, and then calculate the respiratory tidal volume, respiratory frequency and respiratory waveform.

[0059] Audio data processing module: It is used to process the audio data obtained by the microphone to obtain breathing-related data and identify snoring and sleep talking.

[0060] Sleep quality grade assessment module: The new fused segmentation fragment obtained by fusing the results obtained by the respiratory flow sensor data processing module and the audio data processing module is used to score the entire sleep period. The quality grade assessment divides the entire sleep quality into four levels: excellent, good, medium, and poor.

[0061] (III) Beneficial effects

[0062] Compared with the prior art, the present invention has the following beneficial effects:

[0063] (1) The present invention refines the sleep segments by fusing the flow sensor data and the sleep breathing audio data, obtains more detailed features, and intelligently classifies the sleep quality based on the random forest algorithm combined with the above-mentioned multiple features.

[0064] (2) The respiratory tidal volume and respiratory frequency are detected by the respiratory flow sensor, and then a respiratory waveform is generated, which can accurately obtain respiratory quantitative data and provide a guarantee for subsequent classification.

[0065] (3) For audio data, a denoising algorithm based on wavelet transform is used for denoising. A compromise function between hard and soft thresholds is used to determine the threshold function, and an adjustment factor is added. This not only reduces the deviation of the wavelet coefficients, but also makes them continuous in the wavelet space domain and highly differentiable, making them convenient for various mathematical processing and having good flexibility. Breathing sounds, snoring and sleep talking are identified based on a convolutional neural network, and respiratory audio is segmented based on the recognition results. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0067] Figure 1 is a flow chart of an intelligent respiratory signal processing method according to an embodiment of the present application;

[0068] Figure 2 is a schematic diagram of a wavelet denoising process according to an embodiment of the present application;

[0069] Figure 3 It is a schematic diagram of a fusion segmentation method according to an embodiment of the present application. DETAILED DESCRIPTION

[0070] The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.

[0071] The following describes the embodiments of the present disclosure through specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present disclosure.

[0072] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present disclosure. The drawings only show components related to the present disclosure rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0073] The prevalence of sleep apnea syndrome in patients over 65 years old in my country is as high as 20% to 40%. Its clinical manifestations are repeated apnea, hypoxemia, sleep structure disorder and intermittent snoring during sleep at night, which often lead to mental, neurological and behavioral abnormalities and multi-organ system disorders. In severe cases, death may occur. As an important medical support device for the treatment of respiratory diseases, many studies have shown that ventilators can effectively improve the sleep quality of sleep apnea syndrome, correct its hypoxia and hypercapnia, and gradually restore blood rheology to normal levels.

[0074] The flow sensor is an important component in the ventilator gas circuit system. It converts the inhaled and exhaled gas flow into electrical signals and sends them to the signal processing circuit to complete the monitoring of the inhaled and exhaled tidal volume, minute ventilation, and flow rate. Depending on the function and design of the ventilator, the monitoring value of the flow sensor also plays a decisive role in the control and alarm of the ventilator. For example, the flow sensor feeds the measured actual value to the electronic control part to compare with the panel setting value, and uses the error between the two to control the servo valve to adjust the inhaled and exhaled gas flow; the detection value of flow rate and flow also directly affects the switching of the exhalation and inhalation phases, the alarm of the upper and lower limits of the minute ventilation, the flow trigger sensitivity, the monitoring and display of the real-time waveform of the airflow, etc.

[0075] The advantage of using a flow sensor to measure respiratory flow is that it has high measurement accuracy and can accurately determine the tidal volume, ventilation volume and flow rate of the patient's breathing. However, it cannot detect other sleep breathing states of the patient, such as whether the patient is snoring. Obstructive sleep apnea syndrome causes irregular changes in acoustic signals due to airway collapse during sleep, and snoring is a hallmark clinical symptom that appears in the early stages of the disease. Therefore, audio respiratory signal processing based on snoring is also an important part of respiratory monitoring, and it is very easy to use a microphone to collect respiratory audio signals during sleep. The audio can be acquired using a mobile phone or a microphone of a commonly used household appliance. The respiratory signal processing method combined with a flow sensor and audio can improve the accuracy of sleep respiratory monitoring at a very low cost.

[0076] See also Figure 1 , the intelligent breathing signal processing method comprises the following steps:

[0077] S1: Acquire flow sensor data and microphone audio data. The respiratory flow sensor may be a pressure differential flow sensor, a hot wire flow sensor, a pressure strain flow sensor, or an ultrasonic flow sensor.

[0078] S2: Processing the flow sensor measurement data. The following takes a differential pressure flow sensor as an example to introduce a method for processing the flow sensor measurement data.

[0079] A differential pressure flowmeter is an instrument that measures flow based on the differential pressure generated by a flow detection element installed in a pipeline, known fluid conditions, and the geometric dimensions of the detection element and the pipeline. A differential pressure flowmeter consists of a primary device (detection element) and a secondary device (differential pressure conversion and flow display instrument). Differential pressure flowmeters are usually classified by the type of detection element, such as orifice flowmeters, venturi tube flowmeters, and average velocity tube flowmeters.

[0080] When the fluid that fills the pipe flows through the throttling device in the pipe, the flow velocity will form a local contraction at the throttling device, so the flow velocity increases and the static pressure decreases, so a pressure difference is generated before and after the throttling device. The larger the fluid flow rate, the greater the pressure difference generated, so the flow rate can be measured based on the pressure difference.

[0081] Its flow equation is:

[0082]

[0083]

[0084] Among them, q m is the mass flow rate, q v is the volume flow rate, c is the discharge coefficient, β is the diameter ratio, d is the aperture of the throttling device under working conditions, D is the inner diameter of the pipe under working conditions, ε is the expandability coefficient, Δp is the pressure difference, and ρ1 is the upstream fluid density.

[0085] Detection of respiratory signals in the entire system Respiratory signals are mainly used to reflect a type of information on the patient's vital signs, including a series of important clinical parameters such as airway pressure, respiratory flow rate, peak flow rate, tidal volume, platform value, minute ventilation, respiratory rate, respiratory ratio, etc. From the perspective of the type of respiratory signals and their transformation, the detection of respiratory signals can ultimately be achieved by measuring airway pressure and respiratory flow rate. Flow detection is the basis of the entire ventilator system. Only with accurate measurement of flow can a series of quantities such as tidal volume, minute ventilation, and respiratory waveform be accurately measured and displayed.

[0086] Taking the differential pressure flow sensor as an example, the signal processing steps are divided into:

[0087] S21: Analog signal digitization, including anti-aliasing filtering of the collected analog signal and then A / D conversion into a digital signal. The reason for the aliasing error is that the sampling rate of the continuous time signal is too low, or the sampling interval △t is too large. In this case, the frequency components outside [-1 / 2△t, 1 / 2△t] will be folded into the analysis frequency band, causing spectrum distortion in this interval. Therefore, when actually processing the signal, an anti-aliasing filter is often used in advance to suppress the frequency components outside the interval, so as to minimize the aliasing error caused by frequency folding.

[0088] S22: Calculate the flow rate of the digital signal obtained in step S21, specifically, calculate the flow rate according to the flow sensor pressure-flow rate relationship. The relationship between the sensor pressure and flow rate can be obtained from the sensor manual or by inputting different reference flow rates and calculating the relationship between the two from the sensor output value.

[0089] S23: Calculate the respiratory tidal volume, respiratory frequency and respiratory waveform.

[0090] The amount of air a normal person exhales after each inhalation at rest is called tidal volume. Tidal volume varies with age, gender, body surface area, breathing habits, etc. In a resting state, tidal volume is generally relatively stable, but every certain period of time, that is, after every 30-40 breaths, there will be an involuntary deep exhalation action, this process is called sighing, and the ventilation volume at this time is about twice that of resting.

[0091] (1) The tidal volume calculation process is designed to convert the data obtained during the inhalation process into flow based on the first and last flow during the inhalation process, and integrate the flow according to the sampling interval.

[0092] By detecting the flow data, it is determined whether the current breathing state is inhalation or exhalation. If it is inhalation, the flow data is stored in the inhalation storage space, and then the next data is read. If it is still inhalation, the flow data is added to the total flow data of the inhalation storage space and stored in the inhalation storage space to calculate the total inhalation volume. If the next data is exhalation, the flow stored in the inhalation storage space is output as the tidal volume, and the storage space data is cleared to wait for the next inhalation process. The calculation method is as follows:

[0093]

[0094] Among them, C is the tidal volume, n is the amount of data collected during one inhalation process, and x i is the collected inspiratory data value.

[0095] (2) Calculation of respiratory rate

[0096] To calculate the respiratory frequency, we first need to obtain the time required for a respiratory cycle, that is, by calculating the number of respiratory data in a respiratory cycle and combining the sampling time interval to obtain the time occupied by a respiratory cycle, and then calculate the respiratory frequency, that is:

[0097]

[0098] Among them, n1 and n2 are the number of data collected in one exhalation and inhalation process respectively, T c is the time interval for a sampling.

[0099] According to actual needs, parameters such as peak flow rate, platform value, minute ventilation, and respiratory ratio can also be calculated.

[0100] S3: Process the audio signal to obtain breathing-related data and snoring and sleep talking recognition. Audio signal processing includes:

[0101] S31: Audio signal noise reduction processing

[0102] The denoising algorithm based on wavelet transform is adopted. Wavelet transform has excellent time-frequency localization and multi-resolution analysis characteristics. The audio signal denoising technology based on wavelet transform has gradually become one of the main means to analyze the noise signal from the time-frequency domain and then perform denoising. The main process of audio denoising technology based on wavelet transform is as follows: Figure 2 As shown:

[0103] The wavelet transform denoising algorithm includes the following steps:

[0104] S311: Wavelet decomposition of the signal

[0105] Select an appropriate wavelet and determine a decomposition level N, then perform wavelet packet decomposition on the audio signal to obtain wavelet packet coefficients in a tree structure.

[0106] The wavelet packet decomposition algorithm is:

[0107]

[0108] Starting from the root of the wavelet packet tree, all wavelet packet coefficients can be calculated by iterative calculation along the branches of the binary tree according to the above formula.

[0109] S312: Determine the best wavelet packet basis:

[0110] For a given entropy criterion, a bottom-up approach can be used to search for the best wavelet packet basis that can provide an efficient representation of the analyzed signal. The appropriate entropy criterion is selected through experimental comparison.

[0111] S313: Processing high frequency coefficients of wavelet transform

[0112] (1) Determination of threshold function:

[0113] Traditional wavelet threshold processing includes hard threshold method and soft threshold method. The wavelet coefficients obtained by soft threshold processing have good overall continuity, which makes the signal smoother after noise reduction, but some features will be lost; while the hard threshold method is better than the soft threshold method in terms of mean square error, and can retain the characteristics of the signal, but the signal after noise reduction will produce additional oscillations. In order to retain as many original audio signal features as possible, the present invention adopts a compromise function of hard and soft thresholds.

[0114]

[0115] Among them, a and b are adjustment factors.

[0116] When |W j,k |=T, The threshold function is continuous at T, and there is no step phenomenon. j,k >0, When W j,k <0, Therefore, the threshold function is W j,k As the asymptote, as W j,k Gradually increasing, W j,kThe closer to the threshold function, the threshold function adopted in the present invention is similar to the hard threshold function, but is continuous at the threshold point, thereby reducing the deviation in the soft threshold function and improving the reconstruction accuracy. Moreover, the adjustment factor can be freely adjusted according to different signal noise reduction requirements, making the function model more flexible, which not only reduces the deviation of the wavelet coefficients, is continuous in the wavelet space domain, but also is high-order differentiable, which is convenient for various mathematical processing and has good flexibility, providing more possibilities for adaptive selection of wavelet thresholds.

[0117] (2) Selection of threshold:

[0118] The present invention adopts a threshold calculation method based on Bayesian estimation, assuming that the noise signal model is

[0119] y(i)=x(i)+n(i)

[0120] Let x(i) be the i-th point value of the pure signal, n(i) be the noise value of the i-th point in the noisy signal, and assume that n(i) obeys independent and identically distributed Gaussian white noise, and y(i) is the i-th point value of the noisy signal. Therefore, the minimum unbiased estimate of x(i) can be obtained based on the measured y(i), that is, the estimated value x′(i) of x(i) is obtained based on y(i) and the mean square error MSE of the two is minimized. The threshold value based on Bayesian estimation is It is expressed as:

[0121]

[0122] Among them, r(T) is the optimized value, which can be obtained as follows:

[0123] r(T)=E(x′-x)=E x E y|x (x′-x) 2

[0124] in,

[0125] in,

[0126] in, in, is the variance estimate of the noisy signal.

[0127] By estimating the absolute variance of the median of each terminal node of the wavelet packet tree, we can get σ 2 In this way, the wavelet threshold of each terminal node can be obtained.

[0128] S314: Wavelet Reconstruction

[0129] The wavelet packet reconstruction algorithm is used to reconstruct the wavelet packet coefficients after threshold processing to obtain the reconstructed signal. The reconstruction formula is:

[0130]

[0131] Since the optimal threshold of each terminal node of the wavelet packet optimal decomposition tree is calculated, this threshold is locally better than the global threshold; and the threshold calculation method used is nearly optimal in terms of mean square error.

[0132] S32: Audio Feature Extraction

[0133] For the audio clip dataset obtained by audio preprocessing, the typical feature parameters of the audio time domain and frequency domain are calculated, namely the short-time zero-crossing rate, resonance peak and Mel spectrum coefficient, which are used as feature vectors for recognition model construction.

[0134] (1) As a classic characteristic parameter in the time domain, the short-time zero-crossing rate refers to the number of times the sound signal crosses the horizontal axis per unit time (N sampling points per frame). The calculation formula for the short-time zero-crossing rate per frame is:

[0135]

[0136] in,

[0137] x v (n) is an audio signal;

[0138] (2) Resonant peaks are the areas where the energy of the audio spectrum is most concentrated. The present invention is based on a method for extracting and describing dynamic differential features of resonance peaks based on the cepstrum method. The calculation steps are as follows:

[0139] a. Framing: The speech signal is essentially a non-stationary signal, but it is approximately considered to be a linear time-invariant signal within 10-30ms. The pre-emphasized sound signal is framed, the frame length is selected as 20ms, and the frame shift between adjacent frames is 40%.

[0140] b. Windowing: To eliminate the influence of Gibbs effect in Fourier transform, the speech signal is windowed and the Hamming window is used as the window function.

[0141] c. Discrete Fourier transform: Perform fast Fourier transform on the signal to get the spectrum, and then square the modulus to get the signal power spectrum. The discrete Fourier transform formula is:

[0142]

[0143] Among them, x(n) is the time domain input signal, X(k) is the frequency domain output signal, and k is the corresponding point of Fourier transform.

[0144] d. Calculate the cepstrum sequence as follows:

[0145] X′(k)=lg|X(k)|

[0146] Perform inverse Fourier transform on X′(k) to obtain the cepstrum sequence x′(n):

[0147]

[0148] The cepstrum sequence x′(n) is windowed to obtain w(n), and the envelope W(k) is obtained through Fourier transform. The first three maximum values ​​of the envelope are taken as resonance peaks.

[0149] (3) Mel spectrum coefficients are parameters that simulate the process of human ear perceiving sound signals based on the nonlinear perception and processing of speech signals by the auditory system. The calculation steps of Mel spectrum coefficients are as follows:

[0150] Preprocessing: audio framing, windowing, discrete Fourier transform. Mel scale transform: the auditory system's perceptual resolution decreases as the frequency increases. Mel frequency is mapped to the real frequency through the Mel scale. Discrete cosine transform: the frequency domain information of speech signals is mainly composed of phonemes and pitches. Calculate the output signal of each Mel filter and take the logarithm to obtain the logarithm of the power spectrum in each frequency band, and perform discrete cosine transform on the spectrum envelope to obtain the 12-dimensional Mel spectrum coefficients.

[0151] S33: audio feature recognition and classification, identifying the features extracted in the above steps, dividing the audio segments into segments with different features, and using a classification algorithm for classification and recognition.

[0152] Recognize breathing sounds, snoring and sleep talking based on convolutional neural networks, including model establishment and training.

[0153] (1) Convolutional neural network model is established, and the length of 1 frame is used as the length of input vector. The network structure consists of input layer, convolution layer and fully connected layer. The convolution layer includes convolution, batch normalization, activation function and pooling layer. The activation function uses rectified linear unit, and the pooling layer uses average pooling. The number of features in each layer of the subsequent 3 layers of full connection decreases, and the difference between the two categories is fully reflected with fewer features and overfitting is prevented. Assuming that the input of the neural network is 1-dimensional feature X, the network parameter is P, and n represents the total number of hidden layers. Then the predicted value is:

[0154] Y=F(X|P)=f n (f n-1 ...(f2(f1(X|P1)|P2)...|P n-1 )|P n )

[0155] Among them, the calculation formulas of the kth convolutional layer and the fully connected layer are as follows:

[0156]

[0157] f k (X k |P k )=A(WX k +b)

[0158] Among them, W represents the 1-dimensional convolution kernel or weighting coefficient, X k is the input feature, b is the bias, and A is the activation function.

[0159] (2) Collect sleep breathing audio of people of different ages and genders, including different types of breathing audio clips such as normal breathing, apnea, bradypnea, snoring, and sleep talking, and annotate the audio clips. Use the training set to train the neural network model and obtain the optimal model parameters.

[0160] The amplitude and frequency of normal breathing are relatively stable, and the depth and duration of each breath are basically equal. Normally, an adult breathes 12-20 times in a quiet state in one minute.

[0161] Respiratory arrest: If the breathing stops for more than 20 seconds during the breathing process, it is respiratory arrest. Respiratory arrest is also accompanied by breathing difficulties, nasal congestion and drooling, or cyanosis, decreased blood oxygen saturation and low muscle tone. If respiratory arrest is more serious, it can lead to cerebral infarction and even endanger life.

[0162] Bradypnea is similar to normal breathing, with a regular breathing rhythm but a frequency of less than 10 breaths per minute.

[0163] Snoring is the snoring sound produced during sleep due to the vibration of the uvula (uvula) caused by the narrowing of the upper airway. Enlarged tonsils, an enlarged tongue, and excessive drinking can cause snoring. Snoring can cause daytime sleepiness, fatigue, lack of concentration, headaches, and decreased work ability. Snoring is an independent risk factor for hypertension, and severe snoring is often accompanied by sleep apnea syndrome.

[0164] Sleep talking refers to talking or making some kind of sound other than snoring during sleep, which cannot be recalled after waking up. It is a kind of sleep disorder. Modern medicine believes that it is related to mental factors and often occurs in combination with nightmares and sleepwalking.

[0165] (3) Based on the established convolutional neural network model, different types of sleep breathing states are identified, the duration of each state is recorded, and the breathing frequency is determined based on the breathing in each stage; for the snoring state, the decibel of the snoring sound is obtained.

[0166] S4: The data obtained in steps S2 and S3 are combined and processed, and the quality level of the entire sleep period is assessed through a classification algorithm, wherein the categories include normal breathing, apnea, Cheyne-Stokes breathing, bradypnea, snoring, and sleep talking.

[0167] S41: Perform data fusion processing. Based on the respiratory tidal volume and respiratory frequency obtained in step S2, the sleep process is divided into normal breathing, apnea, Cheyne-Stokes breathing, and bradypnea segments; based on the normal breathing, apnea, snoring, and sleep talking sleep segments obtained in step S3, the time fusion is performed to further obtain new segmented segments, such as Figure 3 As shown in the figure, the fusion segmentation method is as follows:

[0168] If the segment obtained based on steps S2 and S3 is normal breathing, mark the segment as normal breathing;

[0169] If the segment obtained based on one of steps S2 and S3 is normal breathing, and the other judgment result is one of apnea, Cheyne-Stokes respiration, bradypnea, snoring, and sleep talking, then the segment is marked as the latter;

[0170] If the judgment results obtained based on steps S2 and S3 are two different results among apnea, Cheyne-Stokes respiration, bradypnea, snoring, and sleep talking, if they are in different time periods in the same segment, the segment is intercepted, otherwise both results are marked at the same time.

[0171] S42: Score the entire sleep period based on the new fused segmented segments obtained in step S41, and the quality rating of the entire sleep period is divided into four levels: excellent, good, medium, and poor.

[0172] The basic principle of random forest is to generate multiple different data subsets by sampling the data set, and train a classification tree on each data subset. Finally, the prediction results of the random forest are determined by majority voting based on the prediction results of each classification tree. The random forest classifier has fast classification speed, strong discrimination ability and certain robustness in the case of high-dimensional features. For a variety of data, it can produce high-precision classifiers with good performance; when building the forest, the generalization error uses an unbiased estimate, and the model has strong generalization ability; usually, the construction of the random forest does not require pruning to achieve good results.

[0173] The present invention uses a classification algorithm based on random forest to classify the quality of the entire sleep period into four levels: excellent, good, medium, and poor. The specific steps are as follows:

[0174] The features of the random forest classification model are based on the following features: average respiratory rate; average respiratory tidal volume; the number and duration of apnea, Cheyne-Stokes respiration, bradypnea, snoring, and sleep talking.

[0175] Training a Random Forest Model:

[0176] (1) Given a training set S, a test set T, and a feature dimension F. Determine the parameters: the number t of decision trees to be used, the depth d of each tree, the number f of features used for each node, and the termination conditions: the minimum number s of samples on a node and the minimum information gain m on a node. For the 1 - tth tree, i = 1 - t:

[0177] (2) Draw a training set S(i) with the same size as S from S with replacement as the samples of the root node, and start training from the root node;

[0178] (3) If the termination condition is reached on the current node, set the current node as a leaf node.

[0179] If the termination condition is not reached on the current node, randomly select f features without replacement from the F - dimensional features. Using these f features, find the one - dimensional feature k with the best classification effect and its threshold th. The samples on the current node whose k - th feature is less than th are assigned to the left node, and the rest are assigned to the right node. Continue to train other nodes.

[0180] (4) Repeat steps (2) and (3) until all nodes have been trained or are marked as leaf nodes.

[0181] (5) Repeat steps (2), (3), and (4) until all decision trees have been trained.

[0182] The classification prediction process using the random forest is as follows:

[0183] For the 1 - tth tree, i = 1 - t:

[0184] (1) Starting from the root node of the current tree, according to the threshold th of the current node, determine whether to enter the left node (<th) or the right node (>=th) until reaching a certain leaf node and output the prediction value.

[0185] (2) Repeat step (1) until all t trees have output prediction values.

[0186] In this embodiment, by combining the respiratory flow sensor data and the sleep breathing audio data to obtain the evaluation result of sleep quality, the intelligent evaluation of sleep quality is realized.

[0187] The embodiment of the present invention also proposes an intelligent breathing signal processing device, which specifically includes:

[0188] A sensor data acquisition module: which is used to acquire flow sensor data and microphone audio data.

[0189] Respiratory flow sensor data processing module: It is used to process the respiratory flow sensor data to obtain the measured airway pressure and respiratory flow rate, and then calculate the respiratory tidal volume, respiratory frequency and respiratory waveform.

[0190] Audio data processing module: It is used to process the audio data obtained by the microphone to obtain breathing-related data and identify snoring and sleep talking.

[0191] Sleep quality grade assessment module: The new fused segmentation fragment obtained by fusing the results obtained by the respiratory flow sensor data processing module and the audio data processing module is used to score the entire sleep period. The quality grade assessment divides the entire sleep quality into four levels: excellent, good, medium, and poor.

[0192] The embodiments described above are only descriptions of the preferred implementation modes of the present invention, and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.

Claims

1. An intelligent respiratory signal processing method, characterized in that: The following steps are involved: Step 1: Obtain flow sensor data and microphone audio data; Step 2: Process the respiratory flow data obtained by the flow sensor; measure the airway pressure and respiratory flow rate, and calculate the tidal volume, respiratory frequency, and respiratory waveform based on the airway pressure and respiratory flow rate; Step 3: Process the audio signal to obtain breathing-related data and snoring and sleep talking recognition; Step 4: Combine the data obtained in step 2 and step 3 for fusion processing, and use a classification algorithm to assess the quality of the entire sleep period; The step three comprises: S31: audio signal noise reduction processing, performing noise reduction processing on the audio based on a noise reduction algorithm based on wavelet transform; S32: Audio feature extraction: for the audio clip data set obtained by audio preprocessing, typical feature parameters of the audio time domain and frequency domain are calculated, namely, short-time zero-crossing rate, resonance peak and Mel spectrum coefficient, which are used as feature vectors for recognition model construction; S33: audio feature recognition and classification, identifying the features extracted in the above step, segmenting the audio segments into segments with different features, and using a classification algorithm to perform classification and recognition, and classifying the audio into different types such as normal breathing, apnea, bradypnea, snoring, and sleep talking; Step S31 includes: Perform wavelet decomposition on the signal; determine the best wavelet packet basis; process the high-frequency coefficients of the wavelet transform; wavelet reconstruction; The wavelet packet decomposition algorithm is: Starting from the root of the wavelet packet tree, all wavelet packet coefficients can be calculated by iterative calculation along the branches of the binary tree according to the above formula; The method for determining the best wavelet packet basis is as follows: for a given entropy standard, the best wavelet packet basis is searched from bottom to top, and the appropriate entropy standard is selected through experimental comparison; The processing of the high frequency coefficients of the wavelet transform includes: determining the threshold function: Among them, a, b are adjustment factors; T is the threshold; Threshold selection: The threshold calculation method based on Bayesian estimation is adopted, and the noisy signal model is assumed to be y(i)=x(i)+n(i) Let x(i) be the i-th value of the pure signal, n(i) be the noise value of the i-th point in the noisy signal, and assume that n(i) obeys independent and identically distributed Gaussian white noise, and y(i) is the i-th value of the noisy signal; therefore, the minimum unbiased estimate of x(i) can be obtained based on the measured y(i), that is, the estimated value x′(i) of x(i) is obtained based on y(i) and the mean square error MSE of the two is minimized, based on the threshold of Bayesian estimation It is expressed as: Among them, r(T) is the optimized value, which can be obtained as follows: r(T)=E(x ′ -x)=E x E y|x (x ′ -x) 2 in, in, in, in, is the variance estimate of the noisy signal; By estimating the absolute variance of the median of each terminal node of the wavelet packet tree, we can get σ 2 In this way, the wavelet threshold of each terminal node can be obtained.

2. The intelligent respiratory signal processing method according to claim 1, characterized in that: The second step comprises: S21: digitizing analog signals, including performing anti-aliasing filtering on the collected analog signals and then performing A / D conversion to convert them into digital signals; S22: Calculate the flow rate of the digital signal obtained in step S21, specifically, calculate the flow rate according to the relationship between the output value of the flow sensor and the flow rate; S23: Calculate the respiratory tidal volume, respiratory frequency and respiratory waveform.

3. The intelligent respiratory signal processing method according to claim 2, characterized in that: in, The tidal volume is calculated as follows: Among them, C is the tidal volume, n is the amount of data collected during one inhalation process, and x i is the collected inhalation data value; The respiratory rate is calculated as follows: Among them, n1 and n2 are the number of data collected in one exhalation and inhalation process respectively, T c is the time interval for a sampling.

4. The intelligent respiratory signal processing method according to claim 1, characterized in that: Step S32 includes: The calculation steps of the resonance peak dynamic difference feature extraction method based on the cepstrum method are as follows: a. Framing: Framing the pre-emphasized sound signal, the frame length is selected as 20ms, and the frame shift between adjacent frames is 30%; b. Windowing: To eliminate the influence of Gibbs effect in Fourier transform, the speech signal is windowed, and the window function is Hamming window; c. Discrete Fourier transform: Perform fast Fourier transform on the signal to get the spectrum, and then square the modulus to get the signal power spectrum. The discrete Fourier transform formula is: Among them, x(n) is the time domain input signal, X(k) is the frequency domain output signal, and k is the corresponding point of Fourier transform. d. Calculate the cepstrum sequence as follows: X ′ (k)=lg|X(k)| X ′ (k) Perform inverse Fourier transform to obtain the cepstrum sequence x ′ (n): For the cepstrum sequence x ′ (n) is windowed to get w(n), and the envelope W(k) is obtained through Fourier transform. The first three maximum values ​​of the envelope are taken as resonance peaks.

5. The intelligent respiratory signal processing method according to claim 1, characterized in that: Step S33 includes: identifying breathing sounds, snoring sounds and sleep talking based on a convolutional neural network, including model establishment and training.

6. The intelligent respiratory signal processing method according to claim 5, characterized in that: The convolutional neural network model uses the length of 1 frame as the length of the input vector. The network structure consists of an input layer, a convolutional layer, and a fully connected layer; the convolutional layer includes convolution, batch normalization, activation function, and pooling layer. The activation function uses a rectified linear unit, and the pooling layer uses average pooling.

7. A device using the intelligent respiratory signal processing method according to any one of claims 1 to 6, characterized in that: The device comprises: Sensor data acquisition module: used to obtain flow sensor data and microphone audio data; Respiratory flow sensor data processing module: It is used to process the respiratory flow sensor data to obtain the measured airway pressure and respiratory flow rate, and then calculate the respiratory tidal volume, respiratory frequency and respiratory waveform; Audio data processing module: It is used to process the audio data obtained by the microphone to obtain breathing-related data and snoring and sleep talking recognition; Sleep quality grade assessment module: The new fused segmentation fragment obtained by fusing the results obtained by the respiratory flow sensor data processing module and the audio data processing module is used to score the entire sleep period. The quality grade assessment divides the entire sleep quality into four levels: excellent, good, medium, and poor.