CIRCUIT SYSTEM WHICH EXECUTES A METHOD FOR PREDICTING SLEEP APNEA FROM NEURAL NETWORKS
20220409126 · 2022-12-29
Assignee
Inventors
- Tsung-Wei Huang (Taipei City, TW)
- Duan-Yu Chen (Taoyuan City, TW)
- Sheng-Yen Chen (Changhua County, TW)
Cpc classification
A61B5/7282
HUMAN NECESSITIES
G16H50/20
PHYSICS
A61B5/7246
HUMAN NECESSITIES
G16H20/40
PHYSICS
A61B5/7264
HUMAN NECESSITIES
A61B5/7275
HUMAN NECESSITIES
G16H50/70
PHYSICS
International classification
Abstract
A method for predicting sleep apnea from neural networks that mainly includes the following steps: a) retrieving an original signal; b) retrieving at least one snoring signal from the original signal by a snoring signal segmentation algorithm and converting the snoring signal into one with one-dimensional vector; c) applying a feature extraction algorithm to process the snoring signal with one-dimensional vector and transform the snoring signal into a feature matrix of two-dimensional vectors; and d) classifying the feature matrix by a neural network algorithm to obtain the number of times of sleep apnea and sleep hypopnea from the snoring signal. The method thereby is able to decide whether the snoring signal has revealed indications of sleep apnea or sleep hypopnea or not.
Claims
1. A circuit system which executes a method for predicting sleep apnea from neural networks, comprising: a microphone for retrieving an original signal; an artificial intelligence (AI) device; a development board, wherein the microphone and the AI device are electrically connected to the development board; and a display; wherein the AI device segments the original signal based on a first threshold value and a second threshold value, utilizes a sliding window to linearly inspect the original signal and calculating a maximum value of the original signal, upon said maximum value being greater than said second threshold value, recognizes a snoring signal and a position thereof, keeps inspecting the original signal toward a right direction and obtains a sum value of an absolute value of the snoring signal, upon the sum value being less than the first threshold value, sets a stop position, keeps inspecting the original signal toward a left direction and obtains a sum value of an absolute value of the snoring signal, upon the sum value being less than the first threshold value, sets a start position, segments the signal fell between said start position and said stop position and recognizes as a snoring signal vector with one dimension, applies a feature extraction algorithm to said snoring signal vector with one-dimension to transform the snoring signal into a feature matrix of two-dimensional vector, and applies a neural network algorithm to said feature matrix of two-dimensional vector for classifying and then provides a result indicating a number of times of sleep apnea and sleep hypopnea within the snoring signal to the display.
2. The circuit system as claimed in claim 1, wherein a formula for calculation of the first threshold value is M=mean(f(Y.sub.i>0)), where M representing the first threshold value, mean representing an average value, f( ) representing a down sampling formula and Y.sub.i representing a frame vector of the original signal, and a formula for calculation of the second threshold value is X=mean(N)+std(N), where X representing the second threshold value, mean representing an average value, std representing a standard deviation and N representing a natural number calculated by a formula: N=sort(abs(
3. The circuit system as claimed in claim 1, wherein a length of the snoring signal vector is defined to be 25000 frames.
4. The circuit system as claimed in claim 1, wherein the sliding window has window size of 1000.
5. The circuit system as claimed in claim 1, wherein the feature extraction algorithm has the Mel-Frequency Cepstral Coefficients for the feature extraction process, including procedures of pre-emphasis, framing and windowing, fast Fourier transform, Mel filter bank, nonlinear conversion and discrete cosine transform.
6. The circuit system as claimed in claim 1, wherein the neural network algorithm is a convolutional neural network algorithm, having a dense convolutional network model as a decision model.
7. The circuit system as claimed in claim 6, wherein the dense convolutional network model includes a plurality of dense blocks, a plurality of transition layers and a classification layer.
8. The circuit system as claimed in claim 7, wherein the plurality of transition layers includes a convolution process and a pooling process, and the classification layer is a softmax layer.
9. The circuit system as claimed in claim 7, wherein the plurality of dense blocks includes a dense layer, a batch normalization-rectified linear units-convolution layer and a growth rate.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The patent or application file contains at least one drawing executed in color. Copies of this patent or patent application publication with color drawing (s) will be provided by the Office upon request and payment of the necessary fee.
[0019]
[0020]
[0021]
[0022]
[0023]
[0024]
[0025]
[0026]
[0027]
[0028]
[0029]
[0030]
[0031]
[0032]
[0033]
[0034]
[0035]
[0036]
[0037]
[0038]
DETAILED DESCRIPTION
[0039] Referring to
[0040] Step a: retrieving an original signal Y. In this embodiment, polysomnography (PSG) has been performed on multiple subjects. The variables include the apnea-hypopnea index (AHI), snoring index and minimum oxygen saturation (MOS). The AHI is the number of times obstructive apnea and hypopnea happened per hour of sleep. Apnea is defined when the inhalation and exhalation stops for at least 10 seconds and hypopnea is defined when the baseline ventilator value is decreased by 50% or more and the oxygen saturation is decreased by 4% or more, and such reduction lasts more than 10 seconds. When performing PSG, the sound of snoring is recorded by a mini-microphone placed on a position above the suprasternal notch. But the present invention is not limited to such application.
[0041] Step b: applying a snoring signal segmentation algorithm G.sub.1 to the original signal Y to further retrieve at least one snoring signal B for segmentation and output the segmented snoring signals with one-dimensional vector S. Since the original signal Y is the audio file recorded all night, the data has to be processed in advance. The snoring signal segmentation algorithm G.sub.1 is applied to automatically sort out and segment the snoring signals from the original signal Y. But the present invention is not limited to such application.
[0042] With reference to
[0043] In addition, the formula for calculation of the first threshold value M is
M=mean(f(Y.sub.i>0)),
[0044] where M represents the first threshold value M; mean represents an average value; f( ) represents a downsampling formula; K represents a frame vector Yi of the original signal Y every 2 minutes downsampled to a dimension of 400. The downsampling process has the frame vectors Yi equally segmented to the same dimension and retrieves a maximum value of each segment. The frame vectors Yi are downsampled to a vector of 1*400, thereby producing a more reliable value of the first threshold value M.
[0045] The formula for calculation of the second threshold value X is
X=mean(N)+std(N),
[0046] where X represents the second threshold value X; mean represents an average value; std represents a standard deviation; N represents a natural number calculated by a formula of
N=sort(abs(
[0047] where sort represents a sorting by numerical order; abs represents an absolute value;
[0048] Step c: applying a feature extraction algorithm G.sub.2 to the snoring signal vector S with one dimension to transform the snoring signal vector S into a feature matrix A of two-dimensional vector. Thereby the original signal Y is segmented into the plurality of single snoring signals S.sub.1, S.sub.2, S.sub.3, S.sub.4, S.sub.5, S.sub.6, S.sub.7 for further processing of the feature extraction algorithm G.sub.2. The feature extraction algorithm G.sub.2 has the Mel-Frequency Cepstral Coefficients (MFCC) for the feature extraction process, including procedures of pre-emphasis G.sub.21, framing and windowing G.sub.22, fast Fourier transform G.sub.23, Mel filter bank G.sub.24, nonlinear conversion G.sub.25 and discrete cosine transform G.sub.26 as illustrated in
[0049] The pre-emphasis G.sub.21 aims to compensate for the attenuated portion of the single snoring signals S.sub.1, S.sub.2, S.sub.3, S.sub.4, S.sub.5, S.sub.6, S.sub.7 by a process defined as:
H.sub.preem(z)=.sup.1−α.sub.preemz.sup.−1,
[0050] where H.sub.preem represents the result after the pre-emphasis process G.sub.21 and α.sub.preem represents the input signal of sounds.
[0051] The framing and windowing G.sub.22 has the single snoring signals S.sub.1, S.sub.2, S.sub.3, S.sub.4, S.sub.5, S.sub.6, S.sub.7 divided into shorter frames, each of which has a length of 20-40 milliseconds. In order to avoid significant changes between two frames, there is an overlapping area of 10 milliseconds between each frames and each frame is multiplied by the Hamming window to enhance the continuity between the borders of the frames. The signals close to the borders of the frames are slowly faded out to avoid the discontinuity and the energy spectrum of noise would be weakened, thereby the peak of the sine wave of the signals would be relatively prominent as well. If there is obvious discontinuity between each frames, there will be other misguiding energy distribution in the next fast Fourier transform process, causing misjudgment of the analysis in the process. Therefore, the signals have to be multiplied by the Hamming window during this step.
[0052] The fast Fourier transform G.sub.23 is applied to convert the signals from the time domain to the frequency domain, and fast Fourier transform is the fast algorithm of discrete Fourier transform.
[0053] The Mel filter bank G.sub.24 is a band-pass filter that overlaps with each other. Based on the Mel scale, it is linear under the frequency of 1 Hz and logarithmic thereon. The Mel scaling process is defined as:
[0054] where mel represents the result of the Mel filter bank; f represents the input of the filter bank; and the numbers 2595 and 700 are fixed numbers that have been widely used in the filter process in many researches. The energy spectrum is multiplied by a set of 16 triangular band-pass filters and thus we use the Mel Frequency as the spectrum of the 16 filters.
[0055] The discrete cosine transform G.sub.26 is applied for calculation of the MFCCs in each frame, and the conversion is based on the following equation:
Σ.sub.k=1.sup.N log(y(i))*cos[mx(k−0.5)xπ÷N]
[0056] Thereby the snoring signal B can be converted into the MFCCs feature matrix A.
[0057] Step d: applying a neural network algorithm G.sub.3 to the feature matrix A of two-dimensional vector for classifying and then providing a result indicating a number of times of sleep apnea and sleep hypopnea within the snoring signal B. After the feature extraction process, the snoring signal B is converted into a two-dimensional vector, and, as most image classification process are performed by the neural network algorithm. G.sub.3, we can also apply the neural network algorithm G.sub.3 for classifying the feature matrix A. But the present invention is not limited to such application.
[0058] In this embodiment, the neural network algorithm G.sub.3 is a convolutional neural network algorithm which has a dense convolutional network (DN) model as a decision model. As illustrated in
[0059] Further referring to
[0060] Within the dense blocks D, any two layers are directly connected; therefore, the input of each layer in the network is the output of its previous layer, and the feature map of each layer is also transmitted directly to all the descendent layers. Such approach employs the DN model to make efficient use of all-level features. The transition layers T are designed to reduce the size of the feature matrix. Since the final layer of the output from the dense blocks D, the model can be very large. Therefore, the transition layers T are employed to reduce the amount of the parameters greatly. With such structures, the DN model solves the problem of gradient vanishing occurred when the network architecture is too deep and has the resistance to over-fitting.
[0061] Further referring to
[0062] Finally, please refer to
[0063] In addition, for example, the development board 806 can be a Raspberry Pi 4 development board, wherein an algorithm corresponding to the method shown in
[0064] In addition, as shown in
[0065] Those skilled in the art will readily observe that numerous modifications and alterations of the device and method may be made while retaining the teachings of the invention. Accordingly, the above disclosure should be construed as limited only by the metes and bounds of the appended claims.