A model training method and device for sleep staging

By constructing a competitive student model and a teacher model for knowledge transfer training, and using knowledge distillation technology, the problem of decreased accuracy when inputting a single channel is solved, and high-precision sleep staging under single-channel input is achieved, utilizing information from multi-channel data sets.

CN112149541BActive Publication Date: 2024-10-29TSINGHUA UNIVERSITY
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202010963626.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-14
Publication Date
2024-10-29
Estimated Expiration
2040-09-14

AI Technical Summary

Technical Problem

Existing sleep staging models need to discard other channel signals when inputting a single channel, resulting in reduced accuracy and inability to effectively utilize the information in multi-channel data sets.

Method used

By building a single-channel input competitive student model and a multi-channel input teacher model, we perform knowledge transfer training, optimize model loss, build a cooperative student model, and use knowledge distillation technology to transfer the knowledge of the teacher model to the cooperative student model to achieve single-channel input. Highly accurate sleep staging.

Benefits of technology

It improves the accuracy of the teacher model, avoids the loss of accuracy caused by discarding other channel data, enables the use of information from multi-channel data sets under single-channel input, and improves the accuracy of sleep staging.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112149541B_ABST
    Figure CN112149541B_ABST
Patent Text Reader

Abstract

The present invention discloses a model training method for sleep staging, which includes: constructing a single-channel input competitive student model and a multi-channel input teacher model for sleep staging; inputting a multi-channel signal into the teacher model, and obtaining the teacher model loss according to the output of the teacher model, and inputting a single-channel signal into the competitive student model, and obtaining the competitive student model loss according to the output of the competitive student model; determining the knowledge transfer loss according to the output of the hidden layer in the teacher model and the output of the hidden layer in the competitive student model; optimizing the teacher model and the competitive student model according to the competitive student model loss, the teacher model loss and the knowledge transfer loss until a stop condition is met; constructing a single-channel input cooperative student model for sleep staging according to the trained teacher model and the trained competitive student model, and training the cooperative student model based on the knowledge distillation technology, and finally obtaining the teacher model and the cooperative student model with improved accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of sleep staging, and in particular to a model training method and device for sleep staging. Background Art

[0002] One of the application areas of multi-channel PSG (polysomnography) is sleep staging. PSG signals include electroencephalogram (EEG), electrooculogram (EOG), electromyography (EMG) and electrocardiogram (ECG).

[0003] Currently, commonly used sleep staging models include SeqSleepNet based on sequence-to-sequence multi-channel input and DeepSleepNet based on single-channel input including CNN and Bi-LSTM (bidirectional upper short-term memory network).

[0004] However, SeqSleepNet requires input of signals from multiple channels, which limits the application scenarios of a single channel. In actual testing, for the convenience of patients, a single-channel wearable EEG signal acquisition device is generally used; DeepSleepNet only selects the signal input of one channel, and the signals of other channels are discarded, sacrificing the accuracy of the model. Summary of the invention

[0005] The purpose of the present invention is to propose a model training method and device for sleep staging in view of the deficiencies of the above-mentioned prior art, and this purpose is achieved through the following technical solutions.

[0006] A first aspect of the present invention provides a model training method for sleep staging, the method comprising:

[0007] Construct a single-channel input competitive student model and a multi-channel input teacher model for sleep staging;

[0008] Inputting a multi-channel signal into the teacher model, and obtaining the teacher model loss according to the output of the teacher model, inputting a preset channel signal in the multi-channel signal into the competitive student model, and obtaining the competitive student model loss according to the output of the competitive student model; determining the knowledge transfer loss according to the output of the hidden layer in the teacher model and the output of the hidden layer in the competitive student model; optimizing the teacher model and the competitive student model according to the competitive student model loss, the teacher model loss and the knowledge transfer loss until a stop condition is met;

[0009] A single-channel input cooperative student model for sleep staging is constructed according to the trained teacher model and the trained competitive student model, and the cooperative student model is trained based on the knowledge distillation technology to transfer the knowledge of the trained teacher model to the cooperative student model.

[0010] A second aspect of the present invention provides a model training device for sleep staging, the device comprising:

[0011] The first building module is used to build a single-channel input competitive student model and a multi-channel input teacher model for sleep staging;

[0012] The first training module is used to input the multi-channel signal into the teacher model, and obtain the teacher model loss according to the output of the teacher model, input the preset channel signal in the multi-channel signal into the competitive student model, and obtain the competitive student model loss according to the output of the competitive student model; determine the knowledge transfer loss according to the output of the hidden layer in the teacher model and the output of the hidden layer in the competitive student model; optimize the teacher model and the competitive student model according to the competitive student model loss, the teacher model loss and the knowledge transfer loss until the stop condition is met;

[0013] A second building module is used to build a single-channel input cooperative student model for sleep staging based on the trained teacher model and the trained competitive student model;

[0014] The second training module is used to train the collaborative student model based on the knowledge distillation technology to transfer the knowledge of the trained teacher model to the collaborative student model.

[0015] The technical solution based on the first aspect has the following beneficial effects:

[0016] During the competitive training process between the teacher model and the competing student model, the model is optimized according to the respective losses of the two models and the knowledge transfer loss between the two models, so as to improve the accuracy of the teacher model in the competition, and then the cooperative student model constructed based on parameter sharing can learn useful knowledge from the behavior of the trained teacher model, so that the accuracy of the cooperative student model is well improved. In addition, the teacher model input is a multi-channel signal, and the two student models use a single channel input, so the present invention can use all the information of the original multi-channel training data set to avoid the accuracy loss caused by discarding other channel data. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0018] Figure 1 This is a flow chart of an embodiment of a model training method for sleep staging according to an exemplary embodiment of the present invention;

[0019] Figure 2 The present invention is based on Figure 1 A schematic diagram of the structure of a cooperative competition teacher-student model shown in the illustrated embodiment;

[0020] Figure 3 is the teacher model M during training T Schematic diagram of the accuracy change curve;

[0021] Figure 4 Schematic diagram of the accuracy change curve of the two student models during the training process;

[0022] Figure 5 The present invention is a flowchart of an embodiment of a model training device for sleep staging according to an exemplary embodiment of the present invention. DETAILED DESCRIPTION

[0023] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.

[0024] The terms used in the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The singular forms "a", "the" and "the" used in the present invention and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0025] It should be understood that although the terms first, second, third, etc. may be used in the present invention to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present invention, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0026] Sleep staging is essentially a time-domain sequence labeling problem. Although the collection of EEG data is not difficult, the acquisition of labeled data requires manual inspection and proofreading by experts based on the automatic sleep staging results of PSG signals to obtain the sleep state labeling. Therefore, the data sets in the field of sleep staging are very small, and the development of deep learning is inseparable from massive data. When the amount of data is too small, overfitting will occur when the model parameters are too large. Small data sets themselves contain limited information and are prone to model overfitting.

[0027] Therefore, some people have proposed a knowledge distillation concept for knowledge transfer between teacher and student models. The teacher model usually has the characteristics of high accuracy but high complexity, while the student model usually has the characteristics of low accuracy and lightweight structure. The student model learns from the teacher model and achieves satisfactory accuracy and appropriate complexity, so that similar model accuracy can be obtained with less model complexity. Based on the above model, some people have proposed a rocket launch model for the model compression problem of the online click-through rate (CTR) prediction model. In order to enable the lightweight model to learn knowledge from the complex model, it enables the two models to be trained simultaneously on the same task, forcing the complex model to supervise the entire training process of the lightweight model. In addition, there is parameter sharing between the complex model and the lightweight model, so that the lightweight model can directly obtain low-level feature expressions from the complex model.

[0028] However, the above method is applied in the field of model compression, which requires that the complex model and the lightweight model are trained based on the same task, and the inputs of the two models must be the same. If applied to a sleep staging algorithm based on a single channel, both the teacher model and the student model must have a single channel input, and it is impossible to complete the data migration between channels to use the electrooculogram and electromyography data in the data set to improve the accuracy of the single-channel EEG sleep staging algorithm. In addition, this method only realizes the unilateral learning of the lightweight model from the complex model, and the complex model is not improved from the training.

[0029] To solve the above technical problems, the present invention proposes a model training method for sleep staging, by first constructing a single-channel input competitive student model and a multi-channel input teacher model for sleep staging. During the competitive training process, the teacher model input is a multi-channel signal, while the competitive student model input is a single-channel signal. The model is optimized according to the loss of the competitive student model, the loss of the teacher model, and the knowledge transfer loss between the teacher model and the competitive student model, so that the performance of the teacher model is improved during the competitive training process. Then, based on the parameter sharing method, a single-channel input cooperative student model for sleep staging is constructed according to the trained teacher model and the trained competitive student model, and the knowledge of the trained teacher model is transferred to the cooperative student model based on the knowledge distillation technology, thereby obtaining both a multi-channel input teacher model and a single-channel input cooperative student model. These two models are suitable for sleep staging in different scenarios.

[0030] Based on the above description, it can be known that during the competitive training process between the teacher model and the competing student model, the model is optimized according to the respective losses of the two models and the knowledge transfer loss between the two models, so as to improve the accuracy of the teacher model in the competition, and then the cooperative student model constructed based on parameter sharing can learn useful knowledge from the behavior of the trained teacher model, so that the accuracy of the cooperative student model is well improved. In addition, the teacher model input is a multi-channel signal, and the two student models use a single channel input, so the present invention can use all the information of the original multi-channel training data set to avoid the accuracy sacrifice caused by discarding other channel data.

[0031] The model training process for sleep staging proposed by the present invention is described in detail below with reference to a specific embodiment.

[0032] Figure 1 This is a flow chart of an embodiment of a model training method for sleep staging according to an exemplary embodiment of the present invention. In this embodiment, the multi-channel signal input to the teacher model may include four channels: two EEG signals at different scalp locations, a horizontal electrooculogram signal, and a mandibular electromyography signal; the single-channel signal input to the two student models may be an EEG signal at one of the four scalp locations. The EEG signals of the two channels are usually and The single-channel signal input to the two student models is

[0033] Next, the teacher model inputs the above four channel signals and the two student models input The channel signal is used as an example for explanation. Of course, the teacher model can also input more channel signals, and the student model can also input other single channel signals. The present invention is not limited to this.

[0034] like Figure 1 As shown, the model training method for sleep staging includes the following steps:

[0035] Step 101: Construct a single-channel input competitive student model and a multi-channel input teacher model for sleep staging.

[0036] In one embodiment, in order to enable the model to run in real time on a mobile terminal, the present invention does not use a complex time domain structure based on Bi-LSTM and sequence-to-sequence, but divides the model into two parts: a low-level CNN and a high-level CNN.

[0037] like Figure 2 As shown, the constructed teacher model M T It includes a low-level CNN for each input channel and a high-level CNN obtained by splicing the outputs of each low-level CNN, and the low-level CNN for each input channel is implemented by grouped convolution.

[0038] Among them, the teacher model M T Using 30 seconds of multi-channel signal x multiple As input, there is a softmax activation layer behind the high-level CNN to convert the output of the high-level CNN into a probability output.

[0039] It should be noted that due to the cooperative student model M S Need to share teacher model M T The low-level feature representation of the signal in the first few layers makes M S The feature information in the multi-channel signal can be directly obtained, and the inputs of the two models are different. Therefore, by grouping the low-level CNN, each channel can be calculated independently, reducing the interference from other channels, and the information of different channels will still intersect in the high-level CNN. The gradient brought by the multi-channel information will further update the low-level CNN through back propagation, and ultimately different groups of the low-level CNN will also get better feature expression.

[0040] For example Figure 2 As shown in Figure 2, in order to achieve competition between the teacher model and the competitive student model, it is necessary to obtain shared parameters full of different channel information in the competitive student model. Therefore, the constructed competitive student model Including low-level CNN and high-level CNN for single input channel. The low-level CNN for single input channel shares the parameters of each low-level CNN in the teacher model based on channel shuffling. in,

[0041] The competitive student model uses a single-channel EEG signal (EEG) pz -C z as input.

[0042] When implementing, the competitive student model It can be composed of five layers of one-dimensional CNN, a global average pooling layer (GAP), and a fully connected layer for classification. The first two layers belong to low-level CNN, and the rest of the layers belong to high-level CNN.

[0043] Step 102: Input the multi-channel signal into the teacher model, and obtain the teacher model loss according to the output of the teacher model.

[0044] Among them, the teacher model loss is obtained by the cross entropy loss function, and the formula is as follows:

[0045]

[0046] Among them, N b represents the number of samples in a batch, i represents the five types of sleep stages (wakefulness, rapid eye movement, non-rapid eye movement (N1, N2, N3)), q = soft max (v (x multiple )) represents the prediction result output after softmax activation, and y represents the classification result annotated by the expert.

[0047] Step 103: Input a preset channel signal in the multi-channel signal into the competitive student model, and obtain the competitive student model loss according to the output of the competitive student model.

[0048] The preset channel is the EEG signal Channel, cooperative competition student model loss is obtained by the cross entropy loss function, the formula is as follows:

[0049]

[0050] Among them, N b represents the number of samples in a batch, i represents the five types of sleep stages, represents the prediction result output after softmax activation, and y represents the classification result annotated by the expert.

[0051] Step 104: Determine the knowledge transfer loss based on the output of the hidden layer in the teacher model and the output of the hidden layer in the competitive student model.

[0052] Among them, the hidden layer refers to the last layer in the high-level CNN, that is, the fully connected layer, which contains the posterior probability distribution of sleep stages and is not interfered by the EMG channel and the EOG channel. The knowledge transfer loss uses the L2 norm formula to express the gap between the two models:

[0053]

[0054] in, represents the output of the hidden layer in the competitive student model, v(x multiple ) represents the output of the hidden layer in the teacher model.

[0055] Step 105: Optimize the teacher model and the competitive student model according to the competitive student model loss, the teacher model loss and the knowledge transfer loss until the stopping condition is met.

[0056] The training process from step 103 to step 105 can be divided into two training phases, competition and exploration. The competition training phase performs a first preset number of training times, and the exploration training phase performs a second preset number of training times. The number of training times is in epochs.

[0057] 1. Competitive training phase, teacher model M T By competing with student models Competition is optimized, M T and Simultaneous training optimization, The middle and low-level CNNs share M T Parameters of low- and medium-level CNN channels after shuffling Therefore, there is implicit multi-task learning during competition, defined as follows:

[0058]

[0059] Among them, L S and L T They represent the competitive student model loss and the teacher model loss, that is, two different tasks. γ1 is the first coefficient of the knowledge transfer loss, which serves as a compromise between the teacher model knowledge transfer and its own training.

[0060] In L S and L T There is a competition between these two tasks, and as a result of the competition, one of the tasks will always be sacrificed, resulting in a greater loss. T Lower, then will contain more multi-channel information, which will also lead to higher L S Since the teacher model M T Has more than competing student models Larger model capacity and more input data, so in most cases the teacher model M T Will win the competition and achieve lower L T and higher L S .

[0061] if Overfitting to multi-channel tasks, then L S will increase dramatically, and vice versa.S and L T It can prevent overfitting. In fact, the two models are regular terms for each other in multi-task learning.

[0062] According to the above formula (4), if the first coefficient γ1 of knowledge transfer loss is set too large, then γ1L mimic will dominate the loss function so that the two models generate the same output. If the first coefficient γ1 is zero, there is no direct knowledge transfer in training. Therefore, setting a suitable γ1 is the key to training the teacher model.

[0063] In the embodiment of the present invention, the value of the first coefficient γ1 should be set smaller to ensure that the knowledge transfer loss will affect the training only when there is a significant difference between the two models.

[0064] In order to speed up the convergence of training, the present invention also adopts a learning rate planner to dynamically adjust the learning rate according to the loss in the validation data set.

[0065] It can be seen that in most cases, the teacher model M T Winning against competing student models in implicit multi-task learning Competition based on shared parameters The impact of M T and There is a mutually constrained relationship. In fact, L S Became L T In addition, the knowledge transfer loss L mimic Under the appropriate setting of the first coefficient γ1, it also becomes L T The regular term prevents the teacher model from overfitting and improves the robustness of the teacher model.

[0066] 2. Exploration training phase, using knowledge transfer loss L in the competitive training phase mimic Improved teacher model M T Robustness to overfitting, but there are risks in this process, M T It may fall into a local optimal solution. Because some M T The solution may not be overfitting, but due to Therefore, the exploration training phase enables M T Comprehensively review the knowledge gained in the competition and retrieve solutions that were abandoned in the competition.

[0067] In order to make M T Free to explore without being restricted Constraints, this stage uses the unidirectional gradient module to eliminate L mimic To M TThe main purpose is to optimize the parameters in the teacher model, and according to the above formula (4), in the exploration training stage, the following formula is used for training:

[0068]

[0069] Among them, γ2 is the second coefficient of knowledge transfer loss. In order to make the subsequent cooperative student model to M T To learn more knowledge, in the exploration and training phase, a larger coefficient γ2 of the knowledge transfer loss is set, that is, γ2>γ1.

[0070] Since the learning rate planner in the previous stage will reduce the learning rate to a smaller value, M T It will only search freely near the convergence platform without being affected by There is no need to worry about overfitting.

[0071] Step 106: Construct a single-channel input collaborative student model for sleep staging based on the trained teacher model and the trained competitive student model.

[0072] In one embodiment, based on the training process from step 103 to step 105, the competition between the competitive student model and the teacher model results in a high-precision teacher model, but the competitive student model falls into a low-precision state due to the failure of the competition. In order to simultaneously obtain a teacher model and a cooperative student model with satisfactory accuracy, the cooperative student model will obtain the shared parameters W from the trained teacher model. share and high-level CNN parameters inherited from the trained competitive student model Combined to get.

[0073] Based on this, Figure 2 As shown, the cooperative student model M S The construction process is: the parameters W in the low-level CNN for the preset channel in the trained teacher model are share As the initial parameters of the low-level CNN for a single input channel in the cooperative student model, the parameters of the high-level CNN in the trained competitive student model are As the initial parameters W of the high-level CNN in the collaborative student model S .

[0074] Among them, the cooperative student model M S Competing with student models The specific structure of is similar to that of , which consists of five layers of one-dimensional CNN, a global average pooling layer and a fully connected layer for classification. The first two layers belong to low-level CNN, and the rest belong to high-level CNN.

[0075] It can be seen that the teacher model is composed of the cooperative student model MS The number of channels is quadrupled, so the complexity of the two models is at the same level. Since the low-level CNN in the teacher model uses group convolution technology, the characteristic expression of the single-channel EEG in the four-channel sleep staging model in the teacher model can be losslessly transferred to the cooperative student model. Since there is no interference from other channel information, the cooperative student model and the teacher model can cooperate to achieve higher accuracy.

[0076] Step 107: Train the collaborative student model based on knowledge distillation technology to transfer the knowledge of the trained teacher model to the collaborative student model.

[0077] In one embodiment, a multi-channel signal is input into a trained teacher model, and the teacher model loss is obtained according to the output of the trained teacher model, a preset channel signal in the multi-channel signal is input into a collaborative student model, and the collaborative student model loss is obtained according to the output of the collaborative student model, and the knowledge transfer loss is determined according to the output of the hidden layer in the trained teacher model and the output of the hidden layer in the collaborative student model, and finally, the high-level CNN in the collaborative student model is optimized according to the collaborative student model loss, the teacher model loss, the knowledge transfer loss and the third coefficient of the knowledge transfer loss until the stopping condition is met.

[0078] The teacher model loss can be obtained by the cross entropy loss function in the above formula (1). The cooperative student model can also be obtained based on the same principle as the competitive student model loss in the above formula (2), as follows:

[0079]

[0080] Among them, N b represents the number of samples in a batch, i represents the five types of sleep stages, represents the prediction result output after softmax activation, and y represents the classification result annotated by the expert.

[0081] The knowledge transfer loss between the teacher model and the cooperative student model can also adopt the L2 norm formula:

[0082]

[0083] in, represents the output of the hidden layer in the collaborative student model, v(x multiple ) represents the output of the hidden layer in the teacher model.

[0084] Based on the above description, the loss function of cooperative training is defined as follows:

[0085] L(M T ,M S )=L S(W share ,W S )+L T (W LOW ,W high )+γ3L mimic (M T ,M S ) (8)

[0086] Among them, γ3 is the third coefficient of knowledge transfer loss. In the cooperative training stage of the teacher model and the cooperative student model, the shared parameter W share Without channel shuffling, it is only responsible for the first channel in the teacher model. In order to allow the cooperative student model to fully learn the knowledge in the teacher model, a larger learning rate is used in this stage, and the teacher model and the shared parameter W share The learning rate of is kept constant to maintain the local optimal solution obtained previously. In order to avoid the negative impact of knowledge transfer loss on the teacher model, a unidirectional gradient module is also used in this stage, which mainly optimizes the parameters of the high-level CNN in the cooperative student model and sets a larger third coefficient to maximize the knowledge transfer from the teacher model to the cooperative student model. That is, γ3>γ1.

[0087] According to the entire training process described above, the following Table 1 gives the hyperparameter settings for different training stages. It can be seen that 50 rounds of training are required for each of the three training stages. In the competitive training stage, in order to play the role of the regularization term of knowledge transfer loss, γ1 is selected as a small value of 0.03, and bidirectional gradient is used to affect the teacher model. Due to the need for competition, the shared parameters need to be obtained after channel shuffling. At this time, the initial learning rate of the two models is 2×10 -4 In the exploration training phase, in order to protect the teacher model from the influence of knowledge transfer loss, it is set to a unidirectional gradient, and the learning rate is kept at the value of the automatic decay of the learning rate at the end of the competitive training phase, generally at 2×10 -6 So the teacher model can freely explore near the convergence platform without worrying about overfitting. In the cooperative training stage, in order to obtain the cooperative student model, the shared parameters are directly obtained through group convolution. In order to allow the cooperative student model to learn as much knowledge as possible from the teacher model, γ3 is selected as a large value of 0.3, hoping that the knowledge transfer loss will play a dominant role in training. In order to allow the cooperative student model to get out of the previous local optimal solution as soon as possible, its learning rate is reset to 2×10 -4 In order to prevent the performance of the teacher model from being affected by the cooperative student model, a unidirectional gradient knowledge transfer loss was used.

[0088] stage coefficient Learning Rate Epochs Competition training phase 0.03 <![CDATA[Both models are 2×10 -4 > 50 Exploration training phase 0.3 constant 50 Cooperation training phase 0.3 <![CDATA[2×10 -4 ]]> 50

[0089] Table 1

[0090] In this paper, the Sleep-EDF dataset is divided into three sets: training set, validation set and test set, and the scheme is evaluated. Figure 3 and Figure 4 As shown in the figure, during the competition training phase, as the teacher model competes with the competing student model, although the accuracy of the teacher model using the training set is steadily increasing, the accuracy using the test set and the accuracy using the validation set are both drastically fluctuating. In the end, the teacher model wins the competition, and the accuracy stabilizes at 81.5% at the end of the competition training phase, while the competing student model fails in the competition, and the accuracy remains at 75.66%. After the second stage of exploration, the test set accuracy of the teacher model rises to 82.3% and remains until the end. The test set progress of the competing student model has almost no change. Since there is no competition at this time, the training set accuracy of the two models remains stable. In the third stage, knowledge is gradually transferred from the teacher model to the cooperative student model, and the test set accuracy of the cooperative student model rises from 75.66% to 79.0%, while the accuracy of the teacher model remains unchanged.

[0091] It is important to note that as the accuracy of the cooperative student model on the test set increases, its accuracy on the training and validation sets decreases. The accuracy of the training set drops to a trough within one or two rounds of training, and then returns to a stable value after ten rounds of training. However, the stable value of the training set accuracy is also lower than the previous value. This is unlikely to happen in a standard training process, because traditional algorithms always reduce the loss on the test set by reducing the training loss. This shows that the overfitting in the cooperative student model is alleviated through cooperation. It can be noticed that after the cooperative training stage, the accuracy curves in the training set and the validation set overlap. Since the training set and the validation set are randomly divided, it means that the cooperative student model has achieved good generalization performance at this time.

[0092] Table 2 below shows the ablation experiment results in cooperative competition training, which gives the accuracy of the teacher model and the cooperative student model under different settings in three training stages. The experiment shows that the accuracy of the teacher model and the cooperative student model are 79.60% and 77.41% respectively when trained alone. Compared with individual training, the cooperative competition training algorithm brings 2.7% and 1.6 accuracy improvements to the teacher model and the cooperative student model respectively.

[0093]

[0094]

[0095] Table 2

[0096] In order to prove that the present invention can solve the problem of small data sets, the following Table 3 conducts a 20-fold cross-validation experiment based on the Sleep-EDF data set composed of 20 patient data, and compares the results of the teacher model and the cooperative student model with the results reported in existing literature. The experimental results show that the present invention uses a five-layer CNN to achieve an accuracy of 83.7% in single-channel sleep staging and an accuracy of 85.9% in multi-channel sleep staging.

[0097] method Dataset Input Channels Accuracy The present invention Sleep-EDF <![CDATA[F pz -C z ]]> 83.7 Existing Literature1 Sleep-EDF <![CDATA[F pz -C z ]]> 82.0 The present invention Sleep-EDF <![CDATA[F pz -C z ,Pz-Cz,EMG,EOG]]> 85.9 Existing Literature2 Sleep-EDF <![CDATA[F pz -C z ,EOG]]> 82.3

[0098] Table 3

[0099] At this point, the above Figure 1 The training process shown in the figure shows that, through the above training process, the teacher model optimizes the model according to the respective losses of the two models and the knowledge transfer loss between the two models during the competition training with the competing student model, so as to improve the accuracy of the teacher model in the competition, and then the cooperative student model constructed based on the parameter sharing method can learn useful knowledge from the behavior of the trained teacher model, so that the accuracy of the cooperative student model is well improved. In addition, the teacher model input is a multi-channel signal, and the two student models use a single channel input, so the present invention can use all the information of the original multi-channel training data set to avoid the accuracy loss caused by discarding other channel data.

[0100] Corresponding to the aforementioned embodiment of the model training method for sleep staging, the present invention also provides an embodiment of a model training device for sleep staging.

[0101] Figure 5 This is a flow chart of an embodiment of a model training device for sleep staging according to an exemplary embodiment of the present invention, the device comprising:

[0102] A first construction module 310 is used to construct a single-channel input competitive student model and a multi-channel input teacher model for sleep staging;

[0103] The first training module 320 is used to input the multi-channel signal into the teacher model, and obtain the teacher model loss according to the output of the teacher model, input the preset channel signal in the multi-channel signal into the competitive student model, and obtain the competitive student model loss according to the output of the competitive student model; determine the knowledge transfer loss according to the output of the hidden layer in the teacher model and the output of the hidden layer in the competitive student model; optimize the teacher model and the competitive student model according to the competitive student model loss, the teacher model loss and the knowledge transfer loss until the stop condition is met;

[0104] A second construction module 330, for constructing a single-channel input cooperative student model for sleep staging based on the trained teacher model and the trained competitive student model;

[0105] The second training module 340 is used to train the collaborative student model based on the knowledge distillation technology to transfer the knowledge of the trained teacher model to the collaborative student model.

[0106] In an optional implementation, the teacher model includes a low-level CNN for each input channel and a high-level CNN obtained by splicing the outputs of each low-level CNN, and the low-level CNN for each input channel is implemented by grouped convolution; the competitive student model includes a low-level CNN and a high-level CNN for a single input channel, and the low-level CNN for a single input channel shares the parameters of the low-level CNNs in the teacher model obtained based on channel shuffling.

[0107] In an optional implementation, the collaborative student model includes a low-level CNN and a high-level CNN for a single input channel;

[0108] The second construction module 330 is specifically used to use the parameters of the low-level CNN for the preset channel in the trained teacher model as the initial parameters of the low-level CNN for the single input channel in the cooperative student model; and use the parameters of the high-level CNN in the trained competitive student model as the initial parameters of the high-level CNN in the cooperative student model.

[0109] In an optional implementation, the first training module 320 is specifically used to optimize the teacher model and the competitive student model according to the competitive student model loss, the teacher model loss, the knowledge transfer loss and the first coefficient of the knowledge transfer loss during the execution of a first preset number of training times; and to optimize the teacher model and the competitive student model according to the competitive student model loss, the teacher model loss, the knowledge transfer loss and the second coefficient of the knowledge transfer loss during the execution of a second preset number of training times; wherein the first coefficient is smaller than the second coefficient.

[0110] In an optional implementation, the second training module 340 is specifically used to input a multi-channel signal into a trained teacher model, and obtain a teacher model loss based on the output of the trained teacher model, input a preset channel signal in the multi-channel signal into the collaborative student model, and obtain a collaborative student model loss based on the output of the collaborative student model; determine the knowledge transfer loss based on the output of the trained teacher model and the output of the collaborative student model; optimize the high-level CNN in the collaborative student model based on the collaborative student model loss, the teacher model loss, the knowledge transfer loss and a third coefficient of the knowledge transfer loss until a stopping condition is met; wherein the third coefficient is greater than the first coefficient.

[0111] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

[0112] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of the present invention. Ordinary technicians in this field can understand and implement it without paying creative work.

[0113] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art not disclosed by the present invention. The description and examples are to be regarded as exemplary only, and the true scope and spirit of the present invention is indicated by the following claims.

[0114] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0115] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A model training method for sleep staging, characterized in that: The method comprises: Construct a single-channel input competitive student model and a multi-channel input teacher model for sleep staging; Input a multi-channel signal into the teacher model, and obtain the teacher model loss according to the output of the teacher model, input a preset channel signal in the multi-channel signal into the competitive student model, and obtain the competitive student model loss according to the output of the competitive student model; determine the knowledge transfer loss according to the output of the hidden layer in the teacher model and the output of the hidden layer in the competitive student model; optimize the teacher model and the competitive student model according to the competitive student model loss, the teacher model loss and the knowledge transfer loss until the stop condition is met; wherein the multi-channel signal includes EEG signals at two different scalp positions, a horizontal electrooculogram signal and an electromyogram signal at the jaw, and the competitive student model uses a single-channel EEG signal as input; A single-channel input cooperative student model for sleep staging is constructed according to the trained teacher model and the trained competitive student model, and the cooperative student model is trained based on the knowledge distillation technology to transfer the knowledge of the trained teacher model to the cooperative student model.

2. The method according to claim 1, characterized in that: The teacher model includes a low-level CNN for each input channel and a high-level CNN obtained by splicing the outputs of each low-level CNN, and the low-level CNN for each input channel is implemented by grouped convolution; The competitive student model includes a low-level CNN and a high-level CNN for a single input channel, and the low-level CNN for the single input channel shares parameters obtained by each low-level CNN in the teacher model based on channel shuffling.

3. The method according to claim 2, characterized in that The collaborative student model includes a low-level CNN and a high-level CNN for a single input channel; A single-channel input cooperative student model for sleep staging is constructed based on the trained teacher model and the trained competitive student model, including: Using the parameters of the low-level CNN for the preset channel in the trained teacher model as the initial parameters of the low-level CNN for the single input channel in the cooperative student model; The parameters of the high-level CNN in the trained competitive student model are used as the initial parameters of the high-level CNN in the cooperative student model.

4. The method according to claim 1, characterized in that: Optimizing the teacher model and the competitive student model according to the competitive student model loss, the teacher model loss, and the knowledge transfer loss, including: During the execution of the first preset number of training times, the teacher model and the competitive student model are optimized according to the competitive student model loss, the teacher model loss, the knowledge transfer loss, and a first coefficient of the knowledge transfer loss; During the second preset number of training times, the teacher model and the competitive student model are optimized according to the competitive student model loss, the teacher model loss, the knowledge transfer loss, and a second coefficient of the knowledge transfer loss; The first coefficient is smaller than the second coefficient.

5. The method according to claim 4, characterized in that The collaborative student model is trained based on knowledge distillation technology, including: Inputting a multi-channel signal into a trained teacher model, and obtaining a teacher model loss according to an output of the trained teacher model, inputting a preset channel signal in the multi-channel signal into the cooperative student model, and obtaining a cooperative student model loss according to an output of the cooperative student model; Determining a knowledge transfer loss based on an output of the trained teacher model and an output of the collaborative student model; Optimizing the high-level CNN in the collaborative student model according to the collaborative student model loss, the teacher model loss, the knowledge transfer loss, and the third coefficient of the knowledge transfer loss until a stopping condition is met; The third coefficient is greater than the first coefficient.

6. A model training device for sleep staging, characterized in that: The device comprises: The first building module is used to build a single-channel input competitive student model and a multi-channel input teacher model for sleep staging; The first training module is used to input the multi-channel signal into the teacher model, and obtain the teacher model loss according to the output of the teacher model, input the preset channel signal in the multi-channel signal into the competitive student model, and obtain the competitive student model loss according to the output of the competitive student model; determine the knowledge transfer loss according to the output of the hidden layer in the teacher model and the output of the hidden layer in the competitive student model; optimize the teacher model and the competitive student model according to the competitive student model loss, the teacher model loss and the knowledge transfer loss until the stop condition is met; wherein the multi-channel signal includes EEG signals at two different scalp positions, a horizontal electrooculogram signal and an electromyogram signal at the mandible, and the competitive student model uses a single-channel EEG signal as input; A second building module is used to build a single-channel input cooperative student model for sleep staging based on the trained teacher model and the trained competitive student model; The second training module is used to train the collaborative student model based on the knowledge distillation technology to transfer the knowledge of the trained teacher model to the collaborative student model.

7. The device according to claim 6, characterized in that The teacher model includes a low-level CNN for each input channel and a high-level CNN for the splicing of the outputs of each low-level CNN, and the low-level CNN for each input channel is implemented by grouped convolution; the competitive student model includes a low-level CNN and a high-level CNN for a single input channel, and the low-level CNN for the single input channel shares the parameters of the low-level CNNs in the teacher model obtained based on channel shuffling.

8. The device according to claim 7, characterized in that The collaborative student model includes a low-level CNN and a high-level CNN for a single input channel; The second construction module is specifically used to use the parameters of the low-level CNN for the preset channel in the trained teacher model as the initial parameters of the low-level CNN for the single input channel in the cooperative student model; and use the parameters of the high-level CNN in the trained competitive student model as the initial parameters of the high-level CNN in the cooperative student model.

9. The device according to claim 6, characterized in that The first training module is specifically used to optimize the teacher model and the competitive student model according to the competitive student model loss, the teacher model loss, the knowledge transfer loss and the first coefficient of the knowledge transfer loss during the execution of a first preset number of training times; and to optimize the teacher model and the competitive student model according to the competitive student model loss, the teacher model loss, the knowledge transfer loss and the second coefficient of the knowledge transfer loss during the execution of a second preset number of training times; wherein the first coefficient is smaller than the second coefficient.

Citation Information

Patent Citations

  • Prediction method of epileptic attack based on multi-depth neural network migration feature learning

    CN110236533A

  • User risk assessment method and device, electronic equipment and storage medium

    CN111027870A

  • Learning efficient object detection models with knowledge distillation

    US20180268292A1

  • Machine learning apparatus and method based on multi-feature extraction and transfer learning, and leak detection apparatus using the same

    US20200097850A1

  • Multi-channel and with rhythm transfer learning

    US20200176122A1