CN112641451B - Multi-scale residual error network sleep staging method and system based on single-channel electroencephalogram signal - Google Patents
Multi-scale residual error network sleep staging method and system based on single-channel electroencephalogram signal Download PDFInfo
- Publication number
- CN112641451B CN112641451B CN202011509796.5A CN202011509796A CN112641451B CN 112641451 B CN112641451 B CN 112641451B CN 202011509796 A CN202011509796 A CN 202011509796A CN 112641451 B CN112641451 B CN 112641451B
- Authority
- CN
- China
- Prior art keywords
- sleep
- residual
- signal
- network
- input
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 56
- 238000012549 training Methods 0.000 claims abstract description 27
- 230000008667 sleep stage Effects 0.000 claims abstract description 23
- 238000013507 mapping Methods 0.000 claims abstract description 11
- 238000012545 processing Methods 0.000 claims description 17
- 208000037170 Delayed Emergence from Anesthesia Diseases 0.000 claims description 15
- 230000004913 activation Effects 0.000 claims description 10
- 239000013598 vector Substances 0.000 claims description 10
- 238000010606 normalization Methods 0.000 claims description 8
- 108010076504 Protein Sorting Signals Proteins 0.000 claims description 7
- 238000011176 pooling Methods 0.000 claims description 5
- 238000005096 rolling process Methods 0.000 claims description 5
- 238000013135 deep learning Methods 0.000 abstract description 9
- 230000015556 catabolic process Effects 0.000 abstract description 5
- 238000006731 degradation reaction Methods 0.000 abstract description 5
- 238000012512 characterization method Methods 0.000 abstract description 2
- 230000006870 function Effects 0.000 description 14
- 230000008569 process Effects 0.000 description 9
- 238000007781 pre-processing Methods 0.000 description 8
- 208000019116 sleep disease Diseases 0.000 description 7
- 238000004422 calculation algorithm Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 6
- 210000004556 brain Anatomy 0.000 description 4
- 238000011156 evaluation Methods 0.000 description 4
- 239000000284 extract Substances 0.000 description 4
- 238000000605 extraction Methods 0.000 description 4
- 238000001914 filtration Methods 0.000 description 4
- 238000005070 sampling Methods 0.000 description 4
- 238000012360 testing method Methods 0.000 description 4
- 238000010200 validation analysis Methods 0.000 description 4
- 238000013528 artificial neural network Methods 0.000 description 3
- 238000003745 diagnosis Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 230000005611 electricity Effects 0.000 description 3
- 238000002474 experimental method Methods 0.000 description 3
- 238000010801 machine learning Methods 0.000 description 3
- 239000011159 matrix material Substances 0.000 description 3
- 208000013738 Sleep Initiation and Maintenance disease Diseases 0.000 description 2
- HCHKCACWOHOZIP-UHFFFAOYSA-N Zinc Chemical compound [Zn] HCHKCACWOHOZIP-UHFFFAOYSA-N 0.000 description 2
- 238000002790 cross-validation Methods 0.000 description 2
- 201000010099 disease Diseases 0.000 description 2
- 208000037265 diseases, disorders, signs and symptoms Diseases 0.000 description 2
- 230000036039 immunity Effects 0.000 description 2
- 206010022437 insomnia Diseases 0.000 description 2
- 238000012800 visualization Methods 0.000 description 2
- 208000000044 Amnesia Diseases 0.000 description 1
- 208000031091 Amnestic disease Diseases 0.000 description 1
- 208000024172 Cardiovascular disease Diseases 0.000 description 1
- 208000007590 Disorders of Excessive Somnolence Diseases 0.000 description 1
- 230000006986 amnesia Effects 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 208000008784 apnea Diseases 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 208000026106 cerebrovascular disease Diseases 0.000 description 1
- 238000013145 classification model Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013527 convolutional neural network Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 239000003814 drug Substances 0.000 description 1
- 230000002526 effect on cardiovascular system Effects 0.000 description 1
- 238000004880 explosion Methods 0.000 description 1
- 230000036541 health Effects 0.000 description 1
- 206010020765 hypersomnia Diseases 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000036403 neuro physiology Effects 0.000 description 1
- 210000002569 neuron Anatomy 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 230000009323 psychological health Effects 0.000 description 1
- 238000007637 random forest analysis Methods 0.000 description 1
- 230000003860 sleep quality Effects 0.000 description 1
- 238000000638 solvent extraction Methods 0.000 description 1
- 101150000003 subB gene Proteins 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
- 238000012418 validation experiment Methods 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Images
Classifications
-
- A—HUMAN NECESSITIES
- A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
- A61B—DIAGNOSIS; SURGERY; IDENTIFICATION
- A61B5/00—Measuring for diagnostic purposes; Identification of persons
- A61B5/48—Other medical applications
- A61B5/4806—Sleep evaluation
- A61B5/4812—Detecting sleep stages or cycles
-
- A—HUMAN NECESSITIES
- A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
- A61B—DIAGNOSIS; SURGERY; IDENTIFICATION
- A61B5/00—Measuring for diagnostic purposes; Identification of persons
- A61B5/72—Signal processing specially adapted for physiological signals or for diagnostic purposes
- A61B5/7235—Details of waveform analysis
- A61B5/7264—Classification of physiological signals or data, e.g. using neural networks, statistical classifiers, expert systems or fuzzy systems
- A61B5/7267—Classification of physiological signals or data, e.g. using neural networks, statistical classifiers, expert systems or fuzzy systems involving training the classification device
Landscapes
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Engineering & Computer Science (AREA)
- Artificial Intelligence (AREA)
- Physics & Mathematics (AREA)
- Biophysics (AREA)
- Surgery (AREA)
- Veterinary Medicine (AREA)
- Public Health (AREA)
- General Health & Medical Sciences (AREA)
- Animal Behavior & Ethology (AREA)
- Molecular Biology (AREA)
- Medical Informatics (AREA)
- Pathology (AREA)
- Biomedical Technology (AREA)
- Heart & Thoracic Surgery (AREA)
- Evolutionary Computation (AREA)
- Fuzzy Systems (AREA)
- Mathematical Physics (AREA)
- Signal Processing (AREA)
- Psychiatry (AREA)
- Physiology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Measurement And Recording Of Electrical Phenomena And Electrical Characteristics Of The Living Body (AREA)
Abstract
The invention discloses a multi-scale residual error network sleep staging method and a system based on a single-channel electroencephalogram signal, which comprises the following steps: step S1: collecting an original single-channel electroencephalogram signal as an input signal; step S2: constructing a multi-scale residual sleep automatic staging network, inputting an input signal into the multi-scale residual sleep automatic staging network for training, and outputting a sleep staging result; and step S3: and evaluating the output result. The multiscale residual error network sleep stage method based on the single-channel electroencephalogram signal, disclosed by the invention, can be used for automatically extracting the characteristics from the original single-channel electroencephalogram signal by adopting convolution kernels with various scales, and the robustness of a model and the characterization capability of the signal characteristics can be improved even under a non-stationary condition. In addition, the invention utilizes the identity mapping and the residual mapping in the residual network, so that the network can effectively learn the characteristics of the single-channel electroencephalogram signal, and the degradation problem in the traditional deep learning network is solved.
Description
Technical Field
The invention relates to the field of electroencephalogram signal processing, in particular to a single-channel electroencephalogram signal multi-scale residual error network sleep staging method and system.
Background
The World Health Organization (WHO) has been studying at 2104 that 27% of people worldwide have sleep disorders, of which nearly 3 million have insomnia problems and 5000 million have over-apneas during sleep. The long-term sleep is insufficient, the sleep quality is low, the physiological and psychological health of people is harmed, the immunity is reduced, a series of physiological diseases such as cardiovascular and cerebrovascular diseases, amnesia and the like can be caused seriously even if the immunity is seriously reduced, and the life activities of the human body are seriously threatened. In order to improve the sleep problem, the first thing to do is to diagnose the sleep problem, and the sleep classification is the most critical step in the sleep analysis. Therefore, sleep staging has become an important tool for diagnosing sleep disorders such as insomnia and hypersomnia.
At present, the main sleep staging method is mostly based on multi-lead physiological signals of people during sleep, which comprise various signals such as brain electricity, myoelectricity, eye electricity and the like. However, the acquisition of the multi-lead physiological signal requires the subject to wear a plurality of electrodes, which not only causes physical discomfort but also causes psychological stress to the subject. Furthermore, the multi-electrode device is expensive, and therefore, requires higher cost. Therefore, the mainstream method at present focuses on using a single-channel electroencephalogram signal to automatically stage sleep. At present, an electroencephalogram-based sleep automatic staging algorithm can be mainly divided into two types, namely a traditional machine learning algorithm; the second is a method based on deep learning. However, the following drawbacks still exist in the two types of methods:
1. machine learning is a traditional shallow learning model and cannot extract complex features, so a traditional machine learning method generally adopts a method of combining a feature extractor and the shallow learning model to construct a sleep classification model. The performance of such conventional shallow learning models depends largely on the quality of extracting features from the acquired signal, i.e., the performance of the feature extractor. The construction of the feature extractor requires a priori knowledge about it and is applied to specific data, with a certain degree of subjectivity. However, the electroencephalogram data have the characteristics of nonlinearity, stationarity and the like, and the data are individual and diversified, so that the method for constructing the feature extractor for the specific crowd is very time-consuming.
2. Although methods based on deep learning have been proposed in large numbers in recent years, many methods have not been sufficiently effective and have many drawbacks. From the aspect of overall accuracy, the overall accuracy of the sleep classification of the model obtained by a plurality of methods at present is 80% -90%, and the method has a larger improvement space. Many algorithms do not exhibit sufficient robustness, as demonstrated by the fact that both the training data and the validation data are all subject data, and such cross-validation does not demonstrate that the system still performs identically on the data of unknown subjects. In addition, many sleep automatic classification methods have very poor classification effect in the N1 stage. All these problems are that the end-to-end deep learning sleep automatic staging algorithm is a data classification problem belonging to class imbalance, so the classification effect after most models are learned is not ideal.
The application of Chongqing post and electronic university Wangqiang, zhao De Chun and the like has the publication number CN108742517A, is published in 2018 on 11 and 6 months, and is named as a Chinese invention patent application of 'a Stacking single-lead-connection electroencephalogram sleep automatic staging method', and classification is carried out by using an IIR filter function and an ensemble learning algorithm. In the Chinese invention patent application with the invention name of 'a single-lead brain electrical automatic sleep staging method', which is published in 2019 in 26.4.18, the application of the application number of Liu Rong, liang Hongyu and the like of the university of great continuousness is CN109674468A, a random forest model is used as a classifier, and a large number of complex signal processing methods are used for extracting the characteristics of the brain electrical signals in the time domain, the frequency domain and the nonlinear field. The two methods firstly need to artificially design an electroencephalogram signal feature extraction process, have high subjectivity, and in addition, training and testing data sets used by the two methods are small, so when the method meets unknown subjects, the performance of the method can have high errors.
In the Chinese invention patent application of the invention, which is published in 2019 on 11/12 th of month and 12 th of Zhao De Chun, wang Yi, etc. of Chongqing post and Electricity university, and is named as an 'automatic sleep signal staging method based on 1D CNN-LSTM', the characteristics of electroencephalogram signals and electrooculogram signals during sleep learning are extracted by combining a convolution kernel long-short memory network, so that the automatic sleep staging is realized. However, this method requires an additional signal preprocessing process, i.e., preprocessing the two sleep signals using wavelet transform. In addition, the method uses various signals, which greatly increases the difficulty of acquiring physiological signals during sleep.
Therefore, how to efficiently and simply acquire the electroencephalogram signals and effectively and accurately solve the problem of automatic sleep staging of the electroencephalogram signals becomes a problem to be solved urgently.
Disclosure of Invention
In order to solve the technical problem, the invention provides a multi-scale residual error network sleep staging method based on a single-channel electroencephalogram signal. The method constructs the residual error network, effectively solves the gradient explosion phenomenon caused by the over-depth of the network, and improves the sleep staging efficiency of the model.
The technical solution of the invention is as follows: a multi-scale residual error network sleep staging method based on a single-channel electroencephalogram signal comprises the following steps:
step S1: collecting an original single-channel electroencephalogram signal as an input signal;
step S2: constructing a multi-scale residual sleep automatic staging network, inputting the input signal into the multi-scale residual sleep automatic staging network for training, and outputting a sleep staging result;
and step S3: and evaluating the output result.
Compared with the prior art, the invention has the following advantages:
1. the invention selects the single-channel electroencephalogram signal to automatically stage the sleep, the single-channel signal acquisition is relatively simple, the single-channel signal acquisition has almost no influence on the sleep of people, the signal acquisition efficiency is high, and the cost is low;
2. the method provided by the invention is an end-to-end deep learning method, any additional digital signal filtering processing process is not needed, and the complicated process of artificially participating in sleep electroencephalogram signal feature extraction is avoided;
3. the invention discloses a multiscale residual error sleep automatic classification network which has the characteristics of strong generalization capability and high accuracy. The convolution kernels with various scales are adopted to automatically extract the characteristics from the original single-channel electroencephalogram signal, and the robustness of the model and the characterization capability of the signal characteristics can be improved even under the non-stationary condition. In addition, the invention utilizes the identity mapping and the residual mapping in the residual network, so that the network can effectively learn the characteristics of the single-channel electroencephalogram signal, and the degradation problem in the traditional deep learning network is solved.
Drawings
FIG. 1 is a flowchart of a multi-scale residual error network sleep staging method based on a single-channel electroencephalogram signal according to an embodiment of the present invention;
fig. 2 is a step S2 in a multi-scale residual error network sleep staging method based on a single-channel electroencephalogram signal in the embodiment of the present invention: constructing a multi-scale residual sleep automatic staging network, inputting an input signal into the multi-scale residual sleep automatic staging network for training, and outputting a flow chart of a sleep staging result;
fig. 3 is a step S21 in the multi-scale residual error network sleep staging method based on the single-channel electroencephalogram signal in the embodiment of the present invention: sampling and data processing are carried out on input signals, and a flow chart of training data is constructed;
FIG. 4 is a schematic structural diagram of a multi-scale residual sleep automatic staging network according to an embodiment of the present invention;
FIG. 5 is a diagram illustrating a structure of a rolling block in a multi-scale residual sleep auto-staging network according to an embodiment of the present invention;
FIG. 6 is a diagram of a channel and residual connections in a multi-scale residual sleep auto-staging network in an embodiment of the present invention;
fig. 7a is a visualization diagram of a sleep staging result before multi-scale residual sleep automatic staging network processing in an embodiment of the present invention;
fig. 7b is a visualization diagram of a sleep staging result after multi-scale residual sleep automatic staging network processing in an embodiment of the present invention;
fig. 8 is a structural block diagram of a multi-scale residual error network sleep staging system based on a single-channel electroencephalogram signal in the embodiment of the present invention.
Detailed Description
The invention provides a single-channel electroencephalogram multi-scale residual error network sleep staging method and system, wherein single-channel electroencephalograms are selected for sleep automatic staging, single-channel signal acquisition is relatively simple, almost no influence is caused on human sleep, signal acquisition efficiency is high, and cost is low; the method provided by the invention is an end-to-end deep learning method, any additional digital signal filtering processing process is not needed, and the complicated process of artificially participating in sleep electroencephalogram signal feature extraction is avoided; the invention discloses a multi-scale residual sleep automatic classification network which has the characteristics of strong generalization capability and high accuracy. In addition, the invention utilizes the identity mapping and the residual mapping in the residual network, so that the network can effectively learn the characteristics of the single-channel electroencephalogram signal, and the degradation problem in the traditional deep learning network is solved.
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings.
Example one
As shown in fig. 1, the multi-scale residual error network sleep staging method based on a single-channel electroencephalogram signal provided by the embodiment of the present invention includes the following steps:
step S1: collecting an original single-channel electroencephalogram signal as an input signal;
the Sleep data sets used by the embodiment of the invention comprise Sleep-EDF, sleep-EDFX and CinC Challenge 2018. In the embodiment of the invention, the sleep is divided into five stages of W, N1, N2, N3 and R according to the sleep score manual of the American sleep Association.
Sleep-EDF data were derived from 8 caucasian males and females (21-35 years old) divided into two subsets (named sc x and st x, respectively), where the four records named sc x are the 24-hour electroencephalographic signals of healthy subjects in normal life, and the four records named st x are the signals from subjects who had a night Sleep test in the hospital and had slight Sleep disorders. All data contains both Fpz-Cz and Pz-Oz channels, sampled at 100 Hz. The data included sleep stages W, R, S1, S2, S3, S4, M and "unscored", which were manually scored by well-trained technicians. To accommodate practical applications, the few M and "not ordered" stages are eliminated in the present invention, while S3 and S4 are combined to N3 according to the latest American society for sleep medicine' S sleep scoring manual.
The second dataset was a Sleep-EDF, an expanded version of the Sleep-EDF dataset, containing 153 SC files and 44 ST files, all processed similarly to the Sleep-EDF dataset.
The third data set was CinC Challenge 2018 (CC 2018), which was provided by the computational clinical neurophysiology laboratory and clinical data laboratory at general hospital, massachusetts, usa. The data set included 1,985 subjects who were monitored in a sleep laboratory to diagnose sleep disorders. In the present invention, 200 subjects' data were randomly extracted as a data set, and the data of their C4-M1 channels were used and a few undefined periods were deleted. Sleep stage statistics for the three data sets are shown in table 1.
TABLE 1 statistics of sleep stages in three data sets
In the embodiment of the invention, the leave-out method validation and the 5-fold cross validation are used, and the proportion of a training set to a validation set is divided into 8:2. since the Sleep-EDF dataset contains only 8 subjects and the sample size is too small, the present invention does not use the Sleep-EDF dataset for performing the leave-out validation experiment. The division of the training set and the validation set in the remaining two data sets is shown in table 2.
TABLE 2 training Sum and test set partitioning
In the step, in order to reduce the influence of electroencephalogram signal acquisition on the sleep of the subject to the maximum extent, fpz-Cz or Pz-Oz channel data are used in the embodiment of the invention. The brain electrical signals are collected at a sampling rate of 100Hz and cut in segments of 30 seconds, i.e. 3000 sample points per sleep stage. Each segment corresponds to a sleep stage tag.
Step S2: constructing a multi-scale residual sleep automatic staging network, inputting an input signal into the multi-scale residual sleep automatic staging network for training, and outputting a sleep staging result;
and step S3: and evaluating the sleep staging result.
As shown in fig. 2, in one embodiment, the step S2: constructing a multi-scale residual sleep automatic staging network, inputting an input signal into the multi-scale residual sleep automatic staging network for training, and outputting a sleep staging result, wherein the method comprises the following steps:
step S21: sampling and data processing are carried out on input signals, and training data are constructed;
step S22: preprocessing training data by a preprocessing convolutional layer to obtain a characteristic signal sequence;
step S23: processing the characteristic signal sequence through at least one path, and obtaining at least one characteristic vector through average pooling, wherein the path comprises at least one residual block, and the at least one residual block comprises at least two rolling blocks;
step S24: and merging at least one feature vector, connecting to a full connection layer, and outputting a sleep stage result.
As shown in fig. 3, in one embodiment, the step S21: sampling and data processing are carried out on input signals, and training data are constructed, wherein the training data comprise:
step S211: turning over an input signal, and adding random noise;
for the purpose of increasing the training data, each input signal is inverted with a probability of 0.5, adding 1% random noise. In addition, in order to accommodate individual differences among different electroencephalogram acquisition apparatuses and different subjects, normalization processing as the following step S212 is employed.
Step S212: normalization processing is performed on the 5 th quantile and 95 th quantile data of the input signal according to the following formula (1):
wherein x is an input signal; s 0.95 (x) Is the 95 th sub-bit signal in the signal; s 0.05 (x) The signal is the 5 th sub-bit of the signal; x is the number of n o rm Is normalized training data with values in the range of [ -1,1 [ ]]. After the above processing, an input signal of 1 × 3000 size is constructedDirectly as input of the multiscale residual sleep automatic staging network without any other filtering process. The single-channel signal acquisition in the embodiment of the invention is relatively simple, has almost no influence on the sleep of people, and has high signal acquisition efficiency and low cost.
In one embodiment, the step S22: preprocessing training data by a preprocessing convolution layer to obtain a characteristic signal sequence, comprising: and performing convolution operation, batch standardization operation, activation function and pooling operation on the training data.
As shown in FIG. 4, the training data in this embodiment of the invention is first passed through a preprocessed convolutional layer consisting of convolution of size 1 × 15, batch normalization, reLU activation function, and maximal pooling of size 1 × 3. After the training data is processed by the preprocessing convolutional layer, a 64-channel characteristic signal sequence is output, and is represented as 64 × 750.
As shown in fig. 5, in an embodiment, the convolution block in step S23 includes: a convolution operation as shown in the following equation (2), a batch normalization operation as shown in the following equation (3), and an activation function as shown in the following equation (4);
s=BN(y) (3)
wherein BN is batch standardization operation; s is the output vector after batch normalization operation;
h=ReLU(s) (4)
where h is the output vector of the volume block after the activation function ReLU calculation.
Since neural networks can degrade from stacking. Therefore, the embodiment of the invention enables the internal structure of the network to have the capability of identity mapping by using the residual error network, so as to ensure that the neural network is degraded due to continuous stacking in the process of stacking the network.
The input to the residual network is x and one of the participating network layers is H, then the output of that layer will be H (x). A general convolutional neural network can directly learn the expression of the parameter function H through training, so that X- > H (X) is directly learned. The residual network learns the residual between the input and the output by using a plurality of network layers with parameters, i.e., F (x) = H (x) -x, where F (x) is a residual function. If the residual value F (x) is 0, the current network layer is only an identity map and has no influence on the network. If the residual value is not 0, the performance of the network can be improved by increasing the number of layers in the network. Therefore, the residual error network can avoid the occurrence of the degradation phenomenon under the condition that the network hierarchy is deepened.
In one embodiment, the residual block in step S23 includes at least two convolution blocks, where each residual block is represented by the following formulas (5) to (8):
h 1 =B(x) (5)
h 2 =B(h 1 ) (6)
y=h 2 +x (7)
Each sub-residual block is defined as subB. In the embodiment of the present invention, a structure of one path is configured using four sub-residual blocks. The residual block is expressed in one path by the following equations (9) to (11)
In an embodiment, the residual block in step S23 further includes: the shortcut connection is used as a residual connection, as shown in the following equation (13):
wherein x is an input; y is output through shortcut connection; w i Is a convolution operation; linear mapping W s Dimensions for the specification of x and y; f (x, W) i ) As a residual function, it is expressed by the following equation (14):
F=W i σ(W i x) (14)
where σ is the activation function.
As shown in fig. 6, the solid line shortcut indicates that the dimensions x and y are consistent, the data are directly added, and the dashed line shortcut indicates that the dimensions x and y are inconsistent, and the data need to be added after being added to the same dimension through a convolution operation of 1 × 1.
In the embodiment of the present invention, as shown in fig. 4, the feature signal sequence after being processed by the preprocessing convolutional layer is processed through three paths R1, R2, and R3, the sizes of convolution kernels in convolution blocks of the three paths are 1 × 3, 1 × 5, and 1 × 7, each path is composed of four residual blocks, and the signal sizes of the feature signal after passing through each residual block in each path are 64 × 750, 128 × 375, 256 × 188, and 512 × 94 in sequence; wherein each residual block is composed of 2 convolution blocks. Each path is finally averaged and pooled to obtain 512 eigenvectors with the size of 512 × 1.
In one embodiment, the step S24: and merging at least one feature vector, connecting to a full connection layer, and outputting a sleep stage result.
As shown in fig. 4, the 3 feature vectors of 512 output by the 3 paths in the above step are merged, and then connected to a fully-connected layer having 1536 neurons, and finally a one-dimensional array input is obtained by a Softmax function, where the array input includes the predicted probability value of each sleep stage label.
In this step, the method also includes calculating input by using a cross entropy function as a loss function, and finally outputting a sleep staging result. Wherein the cross entropy function is defined as the following equation (15):
loss(input,target)=weight[target]×(-input[target]+log(∑ j e input[j] ) (15)
wherein input is a one-dimensional array processed by a Softmax function, and contains a probability value of each predicted sleep stage label, input [ j ] represents an element with an index of j in the input array, target is an actual sleep stage label, weight [ target ] is a weight of the actual label, and weight [ target ] defines the following formula (16):
wherein p (target) is the proportion of the label target to the total label. Therefore, the data quantity difference of all sleep tags is balanced.
In one embodiment, the step S3: and evaluating the output result, including evaluating the system performance by adopting various indexes.
For each sleep stage, there are three evaluation indexes, i.e., recall rate, accuracy rate, specificity, and F1 score. The overall evaluation indexes of the sleep stages and the model are calculated at the same time, and are shown in the following formulas (17) to (24):
wherein Acc nk Indicating the classification accuracy, acc, of each stage n Representing the overall stage accuracy, re, of the model nk Indicating the recall ratio, re, of each stage n Representing the overall recall, sp, of the model nk Representing the classification accuracy, sp, of each stage n Representing the overall stage accuracy of the model, F1 nk Representing the classification accuracy of each stage, F1 n Representing the overall staging accuracy of the model. TP, TN, FP and FN respectively represent a true positive case, a true negative case, a false positive case and a false negative case formed by the classifier judging the category. In an embodiment of the present invention, n =5,k =1,2,3,4,5, representing 5 different sleep stages. Meanwhile, for the evaluation of the overall performance of the system, the error rate error and kappa coefficients are also calculated by the following equations (23) to (24):
wherein, Y i An authentic tag, PY, indicating the ith sample i Representing a prediction label of the representation model for the ith sample;
wherein,po =1-err; ai is the ith actual sample number, bi is the ith predicted sample number, and n is the total sample number.
The kappa coefficient is used for measuring the coincidence degree of the classification result of the model and the real result, and when the value of the kappa coefficient is closer to 1, the coincidence of the two results is more, which indicates that the performance of the model is better. The staging results for the model are shown in table 3 below:
TABLE 3 results of the experiment
As shown in table 3 above, the accuracy of the sleep automatic classifier in the single-channel signal of the three data sets of the model provided by the embodiment of the present invention reaches more than 90%, and meets the standard of manual diagnosis of medical experts in sleep disease diagnosis; the recall rate is better expressed on the Fpz-Cz channel, which indicates that the model has very strong capability of identifying positive samples; the specificity is an important index for disease diagnosis in the field of biomedical engineering, and is used for measuring the misdiagnosis rate of the model, when the specificity is high, the misdiagnosis rate is low, and the specificity of the model reaches more than 95% except on a CC2018 data set; in addition, the error rate, kappa coefficient and F1 score of the model all meet the requirements of the expert manual classification standard. Tables 4 and 5 below are the results of the test confusion matrix on the Fpz-Cz and Pz-Oz channels, respectively, on the Sleep-EDFX dataset.
TABLE 4 sleep-EDFX data set Fpz-Cz channel experiment confusion matrix
TABLE 5 sleep-EDFX data set Pz-Oz channel experiment confusion matrix
As can be seen from tables 4 and 5, the sleep staging accuracy of the method in all stages is above 90%, wherein the staging accuracy of the W stage and the N3 stage is about 97%, the accuracy of the R stage is 94-95%, and the accuracy of the N1 and the N2 is between 90-91%. This is because the N1 phase is a transition period between the awake state and the sleep state, and both of the phases include an α wave and a β wave, which makes determination difficult.
Fig. 7a and 7b show the distribution of sleep EEG signal characteristics before and after the multi-scale residual sleep automatic staging network processing is visualized by using a t-sne algorithm, wherein W, N1, N2, N3 and R in fig. 7a represent sleep stages respectively. In fig. 7a and fig. 7b, a subject data including 930 sleep stages is selected, and the original sleep electroencephalogram signal data and the characteristic data obtained by the model full-link layer are respectively processed in a visualized manner. As can be seen from fig. 7a, before the network extracts features, the sleep stages are randomly distributed in space; as can be seen from fig. 7b, after the multi-scale residual error network processing, the same sleep stage is divided into the same regions, and a boundary appears between different sleep stages, that is, after the features are extracted by the model, the distinctiveness between different sleep stages is greatly enhanced. Meanwhile, the information in the graph is observed, so that the N1 stage and the R, N2 and W stages have partial overlapping parts, which is consistent with the conclusion that the staging accuracy of the N1 stage is low.
The multi-scale residual sleep automatic classification network disclosed by the invention can automatically acquire effective information from an original single-channel electroencephalogram signal and classify sleep stages, and can obtain good system performance in different data sets, different electroencephalogram channels and different verification methods, and the result shows that a model meets the requirement of an artificial classification sleep standard, and the performance of the N1 stage is greatly improved, so that the multi-scale residual sleep automatic classification network disclosed by the invention has the characteristics of strong generalization capability and high accuracy.
The multi-scale residual error network sleep staging method based on the single-channel electroencephalogram signal does not need any additional digital signal filtering processing process, avoids the complicated process of artificially participating in sleep electroencephalogram signal feature extraction, adopts convolution kernels with various scales to automatically extract features from the original single-channel electroencephalogram signal, and can improve the robustness of a model and the representation capability of signal features even under the non-stationary condition. In addition, the invention utilizes the identity mapping and the residual mapping in the residual network, so that the network can effectively learn the characteristics of the single-channel electroencephalogram signal, and the degradation problem in the traditional deep learning network is solved.
Example two
As shown in fig. 8, the multi-scale residual error network sleep staging system based on a single-channel electroencephalogram provided by the embodiment of the present invention includes the following modules:
an input signal collecting module 31, configured to collect an original single-channel electroencephalogram signal as an input signal;
the neural network training module 32: constructing a multi-scale residual sleep automatic staging network, inputting an input signal into the multi-scale residual sleep automatic staging network for training, and outputting a sleep staging result;
the evaluation module 33: for evaluating the output result.
The above examples are provided only for the purpose of describing the present invention, and are not intended to limit the scope of the present invention. The scope of the invention is defined by the appended claims. Various equivalent substitutions and modifications can be made without departing from the spirit and principles of the invention, and are intended to be within the scope of the invention.
Claims (5)
1. A multi-scale residual error network sleep staging method based on a single-channel electroencephalogram signal is characterized by comprising the following steps:
step S1: collecting an original single-channel electroencephalogram signal as an input signal;
step S2: the input signal is inverted, random noise is added, and then the input signal is invertedPerforming normalization processingBuilding training data;
and step S3: carrying out convolution operation, batch standardization operation, activation function and pooling operation on the training data through a preprocessed convolutional layer to obtain a characteristic signal sequence;
and step S4: processing the characteristic signal sequence through at least one path, and obtaining at least one characteristic vector through average pooling, wherein the path comprises at least one residual block, and the at least one residual block comprises at least two rolling blocks;
step S5: merging the at least one characteristic vector, connecting to a full connection layer, and outputting the sleep staging result;
step S6: constructing a self-adaptive loss function by using the weighted data, and training a multi-scale sleep staging result;
step S7: and evaluating the output result.
2. The multi-scale residual error network sleep staging method based on the single-channel electroencephalogram signal, characterized in that the convolution block in the step S4 comprises: a convolution operation as shown in the following formula (2), a batch normalization operation as shown in the following formula (3), and an activation function as shown in the following formula (4);
s=BN(y) (3)
wherein BN is batch standardization operation; s is the output vector after batch normalization operation;
h=ReLU(s) (4)
where h is the output vector of the volume block after computation by the activation function ReLU.
3. The multi-scale residual error network sleep staging method based on the single-channel electroencephalogram signal, characterized in that, in the step S4, the residual error block includes at least two convolution blocks, wherein each residual error block is as shown in the following formulas (5) to (8):
h 1 =B(x) (5)
h 2 =B(h 1 ) (6)
y=h 2 +x (7)
∧
h=ReLU(y) (8)
4. The multi-scale residual error network sleep staging method based on the single-channel electroencephalogram signal, characterized in that the residual error block in the step S4 further comprises: the shortcut connection is used as a residual connection, as shown in the following equation (13):
wherein x is an input; y is output through shortcut connection; w i Is a convolution operation; linear mapping W s Dimensions for the specification of x and y; f (x, W) i ) As a residual function, it is expressed by the following equation (10):
F=W i σ(W i x) (14)
where σ is the activation function.
5. The multi-scale residual error network sleep staging method based on the single-channel electroencephalogram signal, characterized in that the loss function in the step S6 is as shown in the following formula (15):
loss(input,target)=weight[target]×(-input[target]+log(∑ j e input[j] ) (15)
wherein, input is a one-dimensional array processed by an activation function, the array comprises a probability value of each predicted sleep stage label, input [ j ] represents an element with an index of j in the input array, target is an actual sleep stage label, and weight [ target ] is the weight of the actual label; weight [ target ] is defined as shown in the following equation (16):
wherein p (target) is the proportion of the label target to the total label.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011509796.5A CN112641451B (en) | 2020-12-18 | 2020-12-18 | Multi-scale residual error network sleep staging method and system based on single-channel electroencephalogram signal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011509796.5A CN112641451B (en) | 2020-12-18 | 2020-12-18 | Multi-scale residual error network sleep staging method and system based on single-channel electroencephalogram signal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112641451A CN112641451A (en) | 2021-04-13 |
CN112641451B true CN112641451B (en) | 2023-03-21 |
Family
ID=75355167
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011509796.5A Active CN112641451B (en) | 2020-12-18 | 2020-12-18 | Multi-scale residual error network sleep staging method and system based on single-channel electroencephalogram signal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112641451B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113158964B (en) * | 2021-05-07 | 2024-05-28 | 北京工业大学 | Sleep stage method based on residual error learning and multi-granularity feature fusion |
CN114366038B (en) * | 2022-02-17 | 2024-01-23 | 重庆邮电大学 | Sleep signal automatic staging method based on improved deep learning algorithm model |
CN115607170B (en) * | 2022-11-18 | 2023-04-25 | 中国科学技术大学 | Lightweight sleep staging method based on single-channel electroencephalogram signals and application |
CN116808391B (en) * | 2023-06-29 | 2023-12-26 | 北京理工大学 | Sleep awakening method and system based on physiological signal decoding |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106821318A (en) * | 2016-08-31 | 2017-06-13 | 天津市人民医院 | A kind of multiple dimensioned quantitative analysis method of EEG signals |
CN106503799B (en) * | 2016-10-11 | 2018-11-30 | 天津大学 | Deep learning model based on multiple dimensioned network and the application in brain status monitoring |
CN108542386B (en) * | 2018-04-23 | 2020-07-31 | 长沙学院 | Sleep state detection method and system based on single-channel EEG signal |
EP3637432B1 (en) * | 2018-09-21 | 2022-03-23 | Tata Consultancy Services Limited | System and method for non-apnea sleep arousal detection |
CN110897639A (en) * | 2020-01-02 | 2020-03-24 | 清华大学深圳国际研究生院 | Electroencephalogram sleep staging method based on deep convolutional neural network |
CN111202517B (en) * | 2020-02-03 | 2022-06-24 | 山东师范大学 | Sleep automatic staging method, system, medium and electronic equipment |
CN111783534B (en) * | 2020-05-28 | 2024-05-10 | 东南大学 | Sleep stage method based on deep learning |
-
2020
- 2020-12-18 CN CN202011509796.5A patent/CN112641451B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN112641451A (en) | 2021-04-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112641451B (en) | Multi-scale residual error network sleep staging method and system based on single-channel electroencephalogram signal | |
Acharya et al. | Automated diagnosis of epileptic EEG using entropies | |
US7818131B2 (en) | Non-parametric modeling apparatus and method for classification, especially of activity state | |
CN111956221B (en) | Temporal lobe epilepsy classification method based on wavelet scattering factor and LSTM neural network model | |
CN109009017B (en) | Intelligent health monitoring system and data processing method thereof | |
CN108959895B (en) | Electroencephalogram EEG (electroencephalogram) identity recognition method based on convolutional neural network | |
CN109009102B (en) | Electroencephalogram deep learning-based auxiliary diagnosis method and system | |
CN112043252B (en) | Emotion recognition system and method based on respiratory component in pulse signal | |
CN116344050B (en) | Evaluation method based on multidimensional health management model | |
CN112932501B (en) | Method for automatically identifying insomnia based on one-dimensional convolutional neural network | |
CN113974655A (en) | Epileptic seizure prediction method based on electroencephalogram signals | |
CN114595725A (en) | Electroencephalogram signal classification method based on addition network and supervised contrast learning | |
CN117133464B (en) | Intelligent monitoring system and monitoring method for health of old people | |
CN114550932A (en) | Sleep apnea risk assessment method, device, equipment and storage medium | |
CN117116475A (en) | Method, system, terminal and storage medium for predicting risk of ischemic cerebral apoplexy | |
Sukaria et al. | Epileptic seizure detection using convolution neural networks | |
CN116484290A (en) | Depression recognition model construction method based on Stacking integration | |
Luo et al. | Exploring adaptive graph topologies and temporal graph networks for EEG-based depression detection | |
CN115399735A (en) | Multi-head attention mechanism sleep staging method based on time-frequency double-current enhancement | |
Geng et al. | Identification of major depression patients using machine learning models based on heart rate variability during sleep stages for pre-hospital screening | |
CN115270847A (en) | Design decision electroencephalogram recognition method based on wavelet packet decomposition and convolutional neural network | |
CN117637154B (en) | Nerve internal department severe index prediction method and system based on optimization algorithm | |
CN116369941B (en) | Sleep quality judging method based on EEG physiological information | |
CN117877736B (en) | Intelligent ring abnormal health data early warning method based on machine learning | |
Jadhao et al. | Prediction of Early Stage Alzheimer’s using Machine Learning Algorithm |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |