EEG interpretable analysis method and related equipment for sleep staging
By performing time-frequency transformation on EEG data and constructing a conceptual function for a self-attention mechanism, and integrating discrimination rules into a sleep staging model, the problem of uninterpretable model knowledge in existing technologies is solved, and sleep staging results that can be understood by experts are achieved.
Patent Information
- Application Number
- CN202210723823.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-23
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2042-06-23
AI Technical Summary
Existing sleep staging models struggle to explain the learned knowledge in the medical field, making it difficult for experts to understand their diagnostic criteria.
By performing time-frequency transformation on EEG data, extracting features, and constructing a concept function based on the self-attention mechanism, the discriminant rules are integrated into the sleep staging model to provide discriminant criteria that experts can understand.
The sleep staging model has achieved interpretability, allowing experts to understand the model's criteria and improving the reliability of sleep staging results.
Smart Images

Figure CN115137374B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of sleep staging, and in particular to an electroencephalogram interpretability analysis method for sleep staging and related equipment. Background Art
[0002] The task of sleep staging is to determine the sleep state through physiological signals recorded during sleep (such as electroencephalography, EEG for short). It is the primary task of diagnosing sleep disorders such as insomnia and hypersomnia. At present, in clinical applications, neurologists usually visually observe the signal time series, manually score the whole night record according to the American Academy of Sleep Medicine (AASM) Interpretation Manual, and manually divide different sleep stages, such as wakefulness, rapid eye movement (REM), and non-REM stages (N1, N2, N3). The manual detection method based on vision is time-consuming and requires experts to have a lot of interpretation experience. In order to alleviate this phenomenon, existing studies have proposed a large number of intelligent sleep staging methods based on deep learning models. Although deep learning methods have shown superior performance in sleep staging tasks, the internal discrimination rules of neural network models are difficult to understand, and the goal of model design is to provide discrimination results rather than predictions. As a result, in sleep staging tasks, it is difficult for experts to understand the basis of staging from the level of physiological signals, and it is even more difficult to form trust in the model. The clinical application value of intelligent sleep staging models is not fully utilized. The interpretability technology in deep learning can provide a predictive basis for the model's sleep staging results and promote the transformation of intelligent sleep staging models from black boxes to white boxes. However, the existing interpretable deep learning models are difficult to apply directly in EEG-based sleep staging. The difficulty is mainly reflected in the following: experts and models have different ways of understanding EEG signals, and interpretable deep learning models are difficult to provide experts with understandable judgment basis. Unlike pictures and texts, EEG signals lack semantic information, and people cannot directly understand the complex neural activity information contained in them from the subtle changes in EEG waveforms. In the medical field, experts usually use the statistical information of EEG signals (energy information and special waveforms, such as spindles) to summarize the state of brain activity, but it is difficult for the model to learn these concepts autonomously. The medical domain knowledge and the knowledge learned by the staging model cannot explain each other, making it difficult for experts to understand the judgment basis of the sleep staging model. Summary of the invention
[0003] The main purpose of the present invention is to provide an EEG interpretable analysis method and related equipment for sleep staging, aiming to solve the technical problem that the knowledge learned from the existing sleep staging model and the medical field knowledge cannot be explained to each other, making it difficult for experts in the medical field to understand the judgment basis of the prediction results obtained based on the sleep staging model.
[0004] In a first aspect, the present invention provides an EEG interpretability analysis method for sleep staging, the EEG interpretability analysis method for sleep staging comprising the following steps:
[0005] Perform time-frequency transformation on the preprocessed EEG data to obtain several time-frequency segments;
[0006] Input several time-frequency segments into the trained sleep staging model to obtain a set of discrimination rules corresponding to the EEG data and the sleep staging results;
[0007] The step of inputting a plurality of time-frequency segments into the trained sleep staging model to obtain a set of discrimination rules corresponding to the EEG data and a sleep staging result includes:
[0008] Inputting a number of time-frequency segments into the trained feature extraction module to obtain the corresponding first features;
[0009] Inputting the first feature into the trained concept layer module to obtain discrimination information corresponding to a plurality of time-frequency segments, wherein each time-frequency segment includes a first preset number of discrimination information;
[0010] Processing the discrimination information based on the first activation function to obtain a set of discrimination rules corresponding to the EEG data, wherein each time-frequency segment corresponds to a discrimination rule;
[0011] Combining the discriminant information corresponding to the plurality of time-frequency segments into a first information group, and inputting the first information group into the trained classification module to obtain a second information group;
[0012] The second information group is processed based on the second activation function to obtain a sleep staging result corresponding to the EEG data.
[0013] Optionally, before the step of inputting the plurality of time-frequency segments into the trained sleep staging model to obtain a set of discrimination rules corresponding to the EEG data and a sleep staging result, the method further includes:
[0014] Perform time-frequency transformation on the preprocessed sample EEG data to obtain several sample time-frequency segments;
[0015] Screening out a second preset number of adjacent sample time-frequency segments, and inputting the second preset number of adjacent sample time-frequency segments into the sleep staging model to obtain a first loss function and a second loss function;
[0016] Combining the first loss function and the second loss function to obtain a joint loss function;
[0017] Adjust the parameters of the sleep staging model based on the joint loss function;
[0018] Check whether the joint loss function converges;
[0019] If the joint loss function does not converge, the screened new second preset number of adjacent sample time-frequency segments are used as the second preset number of adjacent sample time-frequency segments, and the step of inputting the second preset number of adjacent sample time-frequency segments into the sleep staging model to obtain the first loss function and the second loss function is returned;
[0020] If the joint loss function converges, the latest sleep stage model is used as the trained sleep stage model;
[0021] The step of inputting a second preset number of adjacent sample time-frequency segments into the sleep staging model to obtain a first loss function and a second loss function comprises:
[0022] Inputting adjacent sample time-frequency segments into a feature extraction module to obtain corresponding first sample features;
[0023] Input the first sample feature into the concept layer module to obtain corresponding sample discrimination information;
[0024] Processing the sample discrimination information based on the first activation function to obtain a discrimination rule prediction value corresponding to the sample EEG data;
[0025] Based on the true value of the discriminant rule and the predicted value of the discriminant rule corresponding to the sample EEG data, a first loss function is obtained;
[0026] Combining the sample discrimination information into a first sample information group, and inputting the first sample information group into a classification module to obtain a second sample information group;
[0027] Processing the second sample information group based on the second activation function to obtain a sleep stage prediction value corresponding to the sample EEG data;
[0028] Based on the true value of the discriminant rule and the predicted value of the discriminant rule corresponding to the sample EEG data, a second loss function is obtained.
[0029] Optionally, before the step of inputting a second preset number of adjacent sample time-frequency segments into the sleep staging model to obtain a first loss function and a second loss function, the step includes:
[0030] According to the quantifiable medical concepts in the AASM rules, feature extraction is performed on the second preset number of adjacent sample time-frequency segments by using signal processing technology to obtain corresponding concept features;
[0031] Based on the distribution frequency of the concept feature, the concept feature is discretized by using the equal frequency binning method to obtain the corresponding discrete feature;
[0032] Performing rule screening on the discrete features based on the full correlation feature selection method of Shapley value to obtain a set of discrimination rules related to sleep stages, wherein the set of discrimination rules includes a first preset number of discrimination rules;
[0033] A concept function based on the self-attention mechanism is constructed for each of the discrimination rules, and the concept function based on the self-attention mechanism is integrated into the concept layer module of the sleep staging model, wherein the concept layer module includes a self-attention model layer and a linear layer.
[0034] Optionally, the step of inputting the first feature into the trained concept layer module to obtain the discrimination information corresponding to the plurality of time-frequency segments includes:
[0035] The first feature is weighted by a self-attention model layer to obtain second features corresponding to a plurality of time-frequency segments, wherein the second feature corresponding to each time-frequency segment includes a time dimension and a frequency dimension;
[0036] The frequency dimension of the second feature is weighted through a linear layer to obtain discriminant information corresponding to a number of time-frequency segments.
[0037] Optionally, the step of performing time-frequency transformation on the preprocessed EEG data to obtain time-frequency graphs corresponding to a plurality of time-frequency segments includes:
[0038] Downsampling, bandpass filtering and artifact removal algorithms were used to reduce noise in the collected EEG data;
[0039] The EEG data after noise reduction is divided into a number of signal segments with a preset duration as one frame using the AASM interpretation standard;
[0040] Perform multi-window power spectrum analysis on the plurality of signal segments to obtain a plurality of time-frequency segments.
[0041] In a second aspect, the present invention further provides an EEG interpretability analysis device for sleep staging, the EEG interpretability analysis device for sleep staging comprising:
[0042] The time-frequency conversion module is used to perform time-frequency conversion on the preprocessed EEG data to obtain a number of time-frequency segments;
[0043] The model output module is used to input a number of time-frequency segments into the trained sleep staging model to obtain a set of discrimination rules corresponding to the EEG data and a sleep staging result;
[0044] The model output module is specifically used for:
[0045] Inputting a number of time-frequency segments into the trained feature extraction module to obtain the corresponding first features;
[0046] Inputting the first feature into the trained concept layer module to obtain discrimination information corresponding to a plurality of time-frequency segments, wherein each time-frequency segment includes a first preset number of discrimination information;
[0047] Processing the discrimination information based on the first activation function to obtain a set of discrimination rules corresponding to the EEG data, wherein each time-frequency segment corresponds to a discrimination rule;
[0048] Combining the discriminant information corresponding to the plurality of time-frequency segments into a first information group, and inputting the first information group into the trained classification module to obtain a second information group;
[0049] The second information group is processed based on the second activation function to obtain a sleep staging result corresponding to the EEG data.
[0050] Optionally, the EEG interpretability analysis device for sleep staging further includes a training module for:
[0051] Perform time-frequency transformation on the preprocessed sample EEG data to obtain several sample time-frequency segments;
[0052] Screening out a second preset number of adjacent sample time-frequency segments, and inputting the second preset number of adjacent sample time-frequency segments into the sleep staging model to obtain a first loss function and a second loss function;
[0053] Combining the first loss function and the second loss function to obtain a joint loss function;
[0054] Adjust the parameters of the sleep staging model based on the joint loss function;
[0055] Check whether the joint loss function converges;
[0056] If the joint loss function does not converge, the screened new second preset number of adjacent sample time-frequency segments are used as the second preset number of adjacent sample time-frequency segments, and the step of inputting the second preset number of adjacent sample time-frequency segments into the sleep staging model to obtain the first loss function and the second loss function is returned;
[0057] If the joint loss function converges, the latest sleep stage model is used as the trained sleep stage model;
[0058] The step of inputting a second preset number of adjacent sample time-frequency segments into the sleep staging model to obtain a first loss function and a second loss function comprises:
[0059] Inputting adjacent sample time-frequency segments into a feature extraction module to obtain corresponding first sample features;
[0060] Input the first sample feature into the concept layer module to obtain corresponding sample discrimination information;
[0061] Processing the sample discrimination information based on the first activation function to obtain a discrimination rule prediction value corresponding to the sample EEG data;
[0062] Based on the true value of the discriminant rule and the predicted value of the discriminant rule corresponding to the sample EEG data, a first loss function is obtained;
[0063] Combining the sample discrimination information into a first sample information group, and inputting the first sample information group into a classification module to obtain a second sample information group;
[0064] Processing the second sample information group based on the second activation function to obtain a sleep stage prediction value corresponding to the sample EEG data;
[0065] Based on the true value of the discriminant rule and the predicted value of the discriminant rule corresponding to the sample EEG data, a second loss function is obtained.
[0066] Optionally, the EEG interpretability analysis device for sleep staging further includes a construction module for:
[0067] According to the quantifiable medical concepts in the AASM rules, feature extraction is performed on the second preset number of adjacent sample time-frequency segments by using signal processing technology to obtain corresponding concept features;
[0068] Based on the distribution frequency of the concept feature, the concept feature is discretized by using the equal frequency binning method to obtain the corresponding discrete feature;
[0069] Performing rule screening on the discrete features based on the full correlation feature selection method of Shapley value to obtain a set of discrimination rules related to sleep stages, wherein the set of discrimination rules includes a first preset number of discrimination rules;
[0070] A concept function based on the self-attention mechanism is constructed for each of the discrimination rules, and the concept function based on the self-attention mechanism is integrated into the concept layer module of the sleep staging model, wherein the concept layer module includes a self-attention model layer and a linear layer.
[0071] Optionally, the model output module is further specifically used for:
[0072] The first feature is weighted by a self-attention model layer to obtain second features corresponding to a plurality of time-frequency segments, wherein the second feature corresponding to each time-frequency segment includes a time dimension and a frequency dimension;
[0073] The frequency dimension of the second feature is weighted through a linear layer to obtain discriminant information corresponding to a number of time-frequency segments.
[0074] Optionally, the time-frequency conversion module is further specifically used for:
[0075] Downsampling, bandpass filtering and artifact removal algorithms were used to reduce noise in the collected EEG data;
[0076] The EEG data after noise reduction is divided into a number of signal segments with a preset duration as one frame using the AASM interpretation standard;
[0077] Perform multi-window power spectrum analysis on the plurality of signal segments to obtain a plurality of time-frequency segments.
[0078] In a third aspect, the present invention also provides an EEG interpretable analysis device for sleep staging, the EEG interpretable analysis device for sleep staging comprising a processor, a memory, and an EEG interpretable analysis program for sleep staging stored in the memory and executable by the processor, wherein when the EEG interpretable analysis program for sleep staging is executed by the processor, the steps of the EEG interpretable analysis method for sleep staging as described above are implemented.
[0079] In a fourth aspect, the present invention also provides a readable storage medium, on which is stored a EEG interpretable analysis program for sleep staging. When the EEG interpretable analysis program for sleep staging is executed by a processor, the steps of the EEG interpretable analysis method for sleep staging as described above are implemented.
[0080] The present invention provides an EEG interpretable analysis method and related equipment for sleep staging. The EEG interpretable analysis method for sleep staging includes: constructing a sleep stage discrimination rule based on conceptual features to realize the encoding of sleep stage discrimination knowledge; integrating the discrimination rule into a sleep staging model to perform discriminant analysis of sleep states; training the sleep staging model integrated with the discrimination rule to obtain a sleep staging model after parameter learning optimization; inputting the EEG data to be evaluated into the sleep staging model after parameter learning optimization, the sleep staging result corresponding to the EEG data can be predicted, and the discrimination rule based on conceptual features is obtained in the concept layer module accordingly. The trained sleep staging model corresponding to the present invention can provide an expert-understandable explanation for the sleep staging result outputted by it, thereby achieving the purpose of interpretable analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0081] Figure 1 Schematic diagram of the hardware structure of the EEG interpretability analysis device for sleep staging involved in the embodiment of the present invention;
[0082] Figure 2 It is a flowchart of an embodiment of an EEG interpretability analysis method for sleep staging according to the present invention;
[0083] Figure 3It is a flowchart of another embodiment of the EEG interpretability analysis method for sleep staging of the present invention;
[0084] Figure 4 It is a flowchart of another embodiment of the EEG interpretability analysis method for sleep staging of the present invention;
[0085] Figure 5 This is a schematic diagram of the functional modules of an embodiment of an EEG interpretable analysis device for sleep staging according to the present invention.
[0086] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0087] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0088] In a first aspect, an embodiment of the present invention provides an EEG interpretability analysis device for sleep staging.
[0089] Reference Figure 1 , Figure 1 The hardware structure diagram of the EEG interpretable analysis device for sleep staging involved in the embodiment of the present invention. In the embodiment of the present invention, the EEG interpretable analysis device for sleep staging may include a processor 1001 (e.g., a central processing unit, CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components; the user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard); the network interface 1004 may optionally include a standard wired interface, a wireless interface (such as a wireless fidelity WIreless-FIdelity, WI-FI interface); the memory 1005 may be a high-speed random access memory (random access memory, RAM), or a stable memory (non-volatile memory), such as a disk storage, and the memory 1005 may optionally be a storage device independent of the aforementioned processor 1001. Those skilled in the art will understand that Figure 1 The hardware structure shown in the figure does not constitute a limitation of the present invention, and may include more or less components than those shown in the figure, or combine certain components, or arrange the components differently.
[0090] Continue to refer to Figure 1 , Figure 1The memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an EEG interpretability analysis program for sleep staging. The processor 1001 may call the EEG interpretability analysis program for sleep staging stored in the memory 1005, and execute the EEG interpretability analysis method for sleep staging provided in an embodiment of the present invention.
[0091] In a second aspect, an embodiment of the present invention provides an EEG interpretability analysis method for sleep staging.
[0092] Reference Figure 2 , Figure 2 The figure is a flow chart of an embodiment of an EEG interpretable analysis method for sleep staging according to the present invention.
[0093] In an embodiment of the EEG interpretability analysis method for sleep staging of the present invention, the EEG interpretability analysis method for sleep staging includes:
[0094] Step S10, performing time-frequency transformation on the preprocessed EEG data to obtain a number of time-frequency segments;
[0095] In this embodiment, since the EEG data collected by the sleep monitoring device is the original signal of the whole night, the above original signal has not been processed, which will affect the judgment of sleep stages, such as: (1) the original signal is a whole segment signal, which lasts for a long time and does not meet the AASM interpretation rules; (2) the original signal includes a noise signal, which will interfere with the subsequent analysis of sleep stages. Therefore, it is necessary to preprocess the EEG data, and since the main difference of EEG signals in different sleep stages is reflected in the frequency distribution, in order to make the EEG features more prominent and make the judgment result of sleep stages more accurate, it is necessary to perform time-frequency transformation on the preprocessed EEG data, convert the EEG signal from the time domain to the time-frequency domain, and obtain several time-frequency segments, that is, the time-frequency diagram corresponding to each EEG signal segment.
[0096] Further, in one embodiment, referring to Figure 3 , step S10 comprises:
[0097] Step S101, using downsampling, bandpass filtering and artifact removal algorithms to perform noise reduction processing on the collected EEG data;
[0098] Step S102, using the AASM interpretation standard to segment the EEG data after noise reduction into a plurality of signal segments with a preset duration as one frame;
[0099] Step S103: performing multi-window power spectrum analysis on the plurality of signal segments to obtain a plurality of time-frequency segments.
[0100] In this embodiment, specifically, the step of performing time-frequency transformation on the preprocessed EEG data to obtain a number of time-frequency segments includes: downsampling the collected EEG data to 256Hz, and selecting the EEG signal segment between lights off and lights on according to the lights on and lights off events during the collection process. The frequency band of non-EEG signals in the EEG signal segment between lights off and lights on is removed by bandpass filtering of 0.5Hz-45Hz, and artifacts such as electromyography and electrooculography are removed from the remaining EEG signals. That is, the collected EEG data is subjected to noise reduction processing by using downsampling, bandpass filtering and artifact removal algorithms to obtain EEG data after noise reduction processing, so as to improve the noise resistance of EEG data and reduce the interference of noise signals on subsequent sleep staging analysis.
[0101] At present, sleep stages are generally judged based on the AASM interpretation rules, with a 30-second signal segment as one frame. Therefore, after obtaining the EEG data after noise reduction, this embodiment will use the AASM interpretation standard to divide the EEG data after noise reduction into a number of signal segments with a preset duration as one frame, and the segments do not overlap. The signal segment of the preset duration is used as the minimum segment for sleep staging, and the sleep period with the highest score in the signal segment of the preset duration is used as the sleep state of the segment.
[0102] By performing multi-window power spectrum analysis on the above-mentioned signal segments that have been segmented, the EEG signals corresponding to the signal segments can be converted from the time domain to the time-frequency domain to obtain the power spectrum density of the EEG signals. That is, by performing multi-window power spectrum analysis on the above-mentioned signal segments, several time-frequency segments are obtained, making the EEG features more prominent.
[0103] Step S20, inputting a number of time-frequency segments into the trained sleep staging model to obtain a set of discrimination rules corresponding to the EEG data and a sleep staging result;
[0104] Reference Figure 4 , the step S20 comprises:
[0105] Step S201, inputting a number of time-frequency segments into a trained feature extraction module to obtain corresponding first features;
[0106] Step S202, inputting the first feature into the trained concept layer module to obtain discrimination information corresponding to a plurality of time-frequency segments, wherein each time-frequency segment includes a first preset number of discrimination information;
[0107] Step S203, processing the discrimination information based on the first activation function to obtain a set of discrimination rules corresponding to the EEG data, wherein each time-frequency segment corresponds to a discrimination rule;
[0108] Step S204, combining the discrimination information corresponding to the plurality of time-frequency segments into a first information group, and inputting the first information group into the trained classification module to obtain a second information group;
[0109] Step S205: Process the second information group based on the second activation function to obtain a sleep staging result corresponding to the EEG data.
[0110] In this embodiment, the above-mentioned several time-frequency segments are input into the trained sleep staging model to obtain a set of discrimination rules and sleep staging results corresponding to the EEG data. Experts in the medical field can combine the discrimination rules corresponding to the medical concepts with the sleep staging results to understand and determine the discrimination basis of the prediction results obtained by the sleep staging model, which solves the technical problem that the knowledge learned by the existing sleep staging model and the medical field knowledge cannot be explained to each other, resulting in it being difficult for experts in the medical field to understand the discrimination basis of the prediction results obtained based on the sleep staging model. Among them, the above-mentioned sleep staging model that can output the set of discrimination rules and sleep staging results corresponding to the EEG data specifically includes: a feature extraction module, a concept layer module, a first activation function, a classification module and a second activation function. Specifically, the steps of inputting several time-frequency segments into the trained sleep staging model to obtain a set of discrimination rules and sleep staging results corresponding to the EEG data include:
[0111] By inputting several time-frequency segments into the trained feature extraction module, the corresponding first feature can be obtained. The feature extraction module is based on the encoder, and several layers of encoders are connected in series. The input dimension and output dimension of each layer of encoder are consistent. After being processed by multiple layers of encoders, the temporal correlation relationship within several time-frequency segments can be extracted, and several time-frequency segments will be converted into high-level internal features, namely the first feature, whose dimension is T×F, where T is the time dimension and F is the frequency dimension.
[0112] Then the obtained first feature is input into the trained concept layer module, and the discrimination information corresponding to a number of time-frequency segments can be obtained, wherein each time-frequency segment contains a first preset number of discrimination information. In the above concept layer module, a concept function based on the self-attention mechanism is set for each discrimination rule, including a self-attention model layer and a linear layer, to realize the decoding of the above-obtained first feature to the discrimination rule. Among them, the concept function corresponding to the above concept layer module is h(·)={h1,…,h k ,…,h K}, h k is the concept function corresponding to the kth discrimination rule, and K is the number of discrimination rules. The corresponding output information obtained based on the concept function will be spliced into discrimination information of several time-frequency segments, wherein each time-frequency segment contains a first preset number of discrimination information.
[0113] By processing the discrimination information corresponding to each time-frequency segment obtained above based on the first activation function, a set of discrimination rules corresponding to the EEG data can be obtained, which serves as the basis for subsequent sleep stage discrimination, wherein each time-frequency segment corresponds to a discrimination rule, and the first activation function can use a sigmoid function.
[0114] After the discrimination information corresponding to the above-mentioned several time-frequency segments is merged into the first information group, it is input into the trained classification module to obtain the second information group. Among them, the above-mentioned classification module is based on the encoder, and several layers of encoders are connected in series, and the input dimension and output dimension of each layer of encoder are consistent. After being processed by multiple layers of encoders, the temporal correlation relationship between each time-frequency segment in the above-mentioned first information group can be obtained, and the first information group is encoded as above to obtain the second information group.
[0115] The second information group obtained through the encoding process is processed based on the second activation function, and the probability of each time-frequency segment belonging to each sleep stage is collected and distributed, so as to obtain the sleep staging result corresponding to the EEG data.
[0116] Furthermore, in one embodiment, step S202 further includes:
[0117] The first feature is weighted by a self-attention model layer to obtain second features corresponding to a plurality of time-frequency segments, wherein the second feature corresponding to each time-frequency segment includes a time dimension and a frequency dimension;
[0118] The frequency dimension of the second feature is weighted through a linear layer to obtain discriminant information corresponding to a number of time-frequency segments.
[0119] In this embodiment, specifically, the step of inputting the first feature into the trained concept layer module to obtain the discrimination information corresponding to the plurality of time-frequency segments further includes:
[0120] The self-attention model layer performs self-attention learning on the first feature corresponding to each time-frequency segment to obtain the second features corresponding to several time-frequency segments. The second feature corresponding to each time-frequency segment includes the time dimension and the frequency dimension. Among them, the attention mechanism can be regarded as the weighting of internal features, and the calculation formula is:
[0121]
[0122] where z k This is the result obtained by the self-attention model corresponding to the k-th discriminant rule. There are K independent concept functions corresponding to the self-attention model. The first feature The frequency vector on the tth time dimension, T is the time dimension; α tis the weight corresponding to the t-th frequency vector, which determines the model's attention to the vector and is calculated by the following formula:
[0123]
[0124]
[0125] Where W a and b a is a trainable model parameter. Through the concept functions corresponding to the K self-attention models, the weighted second feature is obtained Each of the second characteristics The dimension of is K×F, where K is the number of discriminant rules.
[0126] Through K linear layers, the second feature The frequency dimension in is weighted to obtain the discriminant information corresponding to several time-frequency segments. in is the discriminant information of the i-th time-frequency graph, and its dimension is K. The calculation formula of each linear layer is:
[0127] x c =W c z * +b c
[0128] Among them, W c and b c are trainable model parameters.
[0129] Furthermore, in one embodiment, before step S20, the method further includes:
[0130] Perform time-frequency transformation on the preprocessed sample EEG data to obtain several sample time-frequency segments;
[0131] Screening out a second preset number of adjacent sample time-frequency segments, and inputting the second preset number of adjacent sample time-frequency segments into the sleep staging model to obtain a first loss function and a second loss function;
[0132] Combining the first loss function and the second loss function to obtain a joint loss function;
[0133] Adjust the parameters of the sleep staging model based on the joint loss function;
[0134] Check whether the joint loss function converges;
[0135] If the joint loss function does not converge, the screened new second preset number of adjacent sample time-frequency segments are used as the second preset number of adjacent sample time-frequency segments, and the step of inputting the second preset number of adjacent sample time-frequency segments into the sleep staging model to obtain the first loss function and the second loss function is returned;
[0136] If the joint loss function converges, the latest sleep stage model is used as the trained sleep stage model;
[0137] The step of inputting a second preset number of adjacent sample time-frequency segments into the sleep staging model to obtain a first loss function and a second loss function comprises:
[0138] Inputting adjacent sample time-frequency segments into a feature extraction module to obtain corresponding first sample features;
[0139] Input the first sample feature into the concept layer module to obtain corresponding sample discrimination information;
[0140] Processing the sample discrimination information based on the first activation function to obtain a discrimination rule prediction value corresponding to the sample EEG data;
[0141] Based on the true value of the discriminant rule and the predicted value of the discriminant rule corresponding to the sample EEG data, a first loss function is obtained;
[0142] Combining the sample discrimination information into a first sample information group, and inputting the first sample information group into a classification module to obtain a second sample information group;
[0143] Processing the second sample information group based on the second activation function to obtain a sleep stage prediction value corresponding to the sample EEG data;
[0144] Based on the true value of the discriminant rule and the predicted value of the discriminant rule corresponding to the sample EEG data, a second loss function is obtained.
[0145] In this embodiment, before obtaining a set of discrimination rules corresponding to EEG data and a sleep staging result based on the trained sleep staging model, the constructed sleep staging model is trained to train the trainable parameters of the model to a better level.
[0146] Select sample EEG data, pre-process it to obtain a number of sample time-frequency segments corresponding to the sample EEG data. The above-mentioned sample time-frequency segments are used to train the sleep staging model. In order to ensure that the sample time-frequency data can correspond to the sleep staging model for a preset number of training times, a second preset number of adjacent sample time-frequency segments are screened out each time, and the second preset number of adjacent sample time-frequency segments are input into the sleep staging model to obtain a first loss function With the second loss function L Y .
[0147] Combined first loss function And the second loss function L Y The joint loss function can be obtained, and the parameters of the sleep staging model can be adjusted based on the obtained joint loss function. This implementation uses batch gradient and Adam optimizer to train the model, and sets the learning rate to 10 -3 Using the adaptive learning rate decay strategy, the loss function is optimized through iterative training. If the model loss does not decrease within 5 training cycles, the learning rate is decayed to half of the original value, and the minimum learning rate is set to 10 -6 The early stopping method is applied to avoid overfitting of the model. If the model loss does not decrease within 20 cycles, the training is stopped. The model parameters can be trained to a better level in the above iterative training method.
[0148] After each adjustment of the parameters of the sleep staging model based on the obtained joint loss function, it is detected whether the joint loss function in this cycle converges relative to the joint loss function obtained in the previous training cycle. If the joint loss function does not converge, the training is continued, and the new second preset number of adjacent sample time-frequency segments selected are used as the second preset number of adjacent sample time-frequency segments, and the step of inputting the second preset number of adjacent sample time-frequency segments into the sleep staging model is returned to obtain the first loss function and the second loss function. If the joint loss function converges, the training is completed, and the latest sleep staging model is used as the trained sleep staging model.
[0149] Specifically, the step of inputting a second preset number of adjacent sample time-frequency segments into the sleep staging model to obtain a first loss function and a second loss function includes:
[0150] Inputting adjacent sample time-frequency segments into a feature extraction module to obtain corresponding first sample features;
[0151] Input the first sample feature into the concept layer module to obtain corresponding sample discrimination information;
[0152] Processing the sample discrimination information based on the first activation function to obtain a discrimination rule prediction value corresponding to the sample EEG data;
[0153] Based on the true value of the discriminant rule corresponding to the sample EEG data (the label value obtained when processing the sample EEG data) and the predicted value of the discriminant rule, the first loss function is obtained. Among them, h j (g(x (i) )) is the discrimination rule;
[0154] Combining the sample discrimination information into a first sample information group, and inputting the first sample information group into a classification module to obtain a second sample information group;
[0155] Processing the second sample information group based on the second activation function to obtain a sleep stage prediction value corresponding to the sample EEG data;
[0156] Based on the true value of the discriminant rule corresponding to the sample EEG data (the label value obtained when processing the sample EEG data) and the predicted value of the discriminant rule, the second loss function, L Y (f(h(g(x (i) )));y (i) ), where f(h(g(x (i) ))) is the sleep stage result.
[0157] Furthermore, in one embodiment, before step S02, the method further includes:
[0158] According to the quantifiable medical concepts in the AASM rules, feature extraction is performed on the second preset number of adjacent sample time-frequency segments by using signal processing technology to obtain corresponding concept features;
[0159] Based on the distribution frequency of the concept feature, the concept feature is discretized by using the equal frequency binning method to obtain the corresponding discrete feature;
[0160] Performing rule screening on the discrete features based on the full correlation feature selection method of Shapley value to obtain a set of discrimination rules related to sleep stages, wherein the set of discrimination rules includes a first preset number of discrimination rules;
[0161] A concept function based on the self-attention mechanism is constructed for each of the discrimination rules, and the concept function based on the self-attention mechanism is integrated into the concept layer module of the sleep staging model, wherein the concept layer module includes a self-attention model layer and a linear layer.
[0162] In this embodiment, before the step of inputting the second preset number of adjacent sample time-frequency segments into the sleep staging model to obtain the first loss function and the second loss function, it is necessary to construct a discrimination rule and integrate the discrimination rule into the sleep staging model, so that the sleep staging results obtained based on the sleep staging model trained above can all obtain the discrimination rule corresponding to the medical concept. Specifically, the steps of constructing the discrimination rule and integrating the discrimination rule into the sleep staging model include:
[0163] According to the quantifiable medical concepts in the AASM rules, the feature extraction of the second preset number of adjacent sample time-frequency segments is performed by signal processing technology to obtain the corresponding concept features. There are 24 concept features selected in this embodiment, which are mainly divided into three categories, namely:
[0164] (1) Frequency band energy. According to the power spectrum density X corresponding to the signal segment = {x1,...,x i ,...,x N}, respectively calculate the relative energy of Delta (0.5-4Hz), Theta (4-8Hz), Alpha (8-12Hz) and Beta (>12Hz) bands, where the corresponding relationship between each band and the sleep stage is: Delta band is more prominent in N3 stage, Theta band is the sign of N1 stage, Alpha and Beta bands are used to distinguish W stage from N1 stage. A total of 4 energy features are obtained.
[0165] (2) Entropy. This feature can quantify the complexity of the EEG sequence. This embodiment adopts approximate entropy, permutation entropy, wavelet entropy and multiscale entropy as measurement methods, where the scale number of multiscale entropy is set to 13. A total of 16 entropy features are obtained.
[0166] (3) Basic signal attributes. This embodiment adopts kurtosis, mean, variance and zero crossing as the basic attributes of the signal. Among them, kurtosis can detect the peaks and valleys in the EEG signal, which helps to identify special waveforms such as K complex waves; a total of 4 basic features are obtained.
[0167] This embodiment scheme discretizes the concept features based on the distribution frequency of the concept features using the equal frequency binning method to obtain discrete features corresponding to 0-1. For example, if the continuous concept features are divided into three discrete features, the division criteria are 1) the 25% quantile of the sample feature; 2) the 50% quantile of the sample feature; 3) the 75% quantile of the sample feature. If the feature is greater than 25% and less than 50% quantile, the three discretized discrete features are [1, 0, 0].
[0168] In order to ensure the relevance of the discrimination rules to the sleep state, and to avoid the need for the model to make a trade-off between explanatory power (medical concept prediction) and accuracy (sleep stage prediction) during training, resulting in low concept accuracy or prediction accuracy. The present invention uses a full correlation feature selection method based on Shapley value to perform rule screening on the discrete features, and obtains a set of discrimination rules related to sleep stages C = {c1,...,c i ,...,c N}, wherein the set of discrimination rules includes a first preset number of discrimination rules, c i is the discrimination rule for the i-th time segment, and each c contains K discrimination information.
[0169] A concept function based on the self-attention mechanism is constructed for each of the discrimination rules, and the concept function based on the self-attention mechanism is integrated into the concept layer module of the sleep staging model, wherein the concept layer module includes a self-attention model layer and a linear layer.
[0170] In this embodiment, a method for interpretable EEG analysis for sleep staging is provided, including: constructing sleep stage discrimination rules based on conceptual features to realize the encoding of sleep stage discrimination knowledge; integrating the discrimination rules into the sleep staging model to perform discriminant analysis of sleep states; training the sleep staging model integrated with the discrimination rules to obtain a sleep staging model after parameter learning optimization; inputting the EEG data to be evaluated into the sleep staging model after parameter learning optimization, the sleep staging results corresponding to the EEG data can be predicted, and the discrimination rules based on conceptual features are obtained in the concept layer module accordingly. The trained sleep staging model corresponding to the present invention can provide expert-understandable explanations for the sleep staging results output by it, thereby achieving the purpose of interpretable analysis.
[0171] In a third aspect, an embodiment of the present invention further provides an EEG interpretability analysis device for sleep staging.
[0172] Reference Figure 5 , a schematic diagram of functional modules of an embodiment of an EEG interpretable analysis device for sleep staging.
[0173] In this embodiment, the EEG interpretability analysis device for sleep staging includes:
[0174] The time-frequency conversion module 10 is used to perform time-frequency conversion on the preprocessed EEG data to obtain a number of time-frequency segments;
[0175] The model output module 20 is used to input a number of time-frequency segments into the trained sleep staging model to obtain a set of discrimination rules corresponding to the EEG data and a sleep staging result;
[0176] The model output module 20 is specifically used for:
[0177] Inputting a number of time-frequency segments into the trained feature extraction module to obtain the corresponding first features;
[0178] Inputting the first feature into the trained concept layer module to obtain discrimination information corresponding to a plurality of time-frequency segments, wherein each time-frequency segment includes a first preset number of discrimination information;
[0179] Processing the discrimination information based on the first activation function to obtain a set of discrimination rules corresponding to the EEG data, wherein each time-frequency segment corresponds to a discrimination rule;
[0180] Combining the discriminant information corresponding to the plurality of time-frequency segments into a first information group, and inputting the first information group into the trained classification module to obtain a second information group;
[0181] The second information group is processed based on the second activation function to obtain a sleep staging result corresponding to the EEG data.
[0182] Furthermore, in one embodiment, the EEG interpretability analysis device for sleep staging further includes a training module for:
[0183] Perform time-frequency transformation on the preprocessed sample EEG data to obtain several sample time-frequency segments;
[0184] Screening out a second preset number of adjacent sample time-frequency segments, and inputting the second preset number of adjacent sample time-frequency segments into the sleep staging model to obtain a first loss function and a second loss function;
[0185] Combining the first loss function and the second loss function to obtain a joint loss function;
[0186] Adjust the parameters of the sleep staging model based on the joint loss function;
[0187] Check whether the joint loss function converges;
[0188] If the joint loss function does not converge, the screened new second preset number of adjacent sample time-frequency segments are used as the second preset number of adjacent sample time-frequency segments, and the step of inputting the second preset number of adjacent sample time-frequency segments into the sleep staging model to obtain the first loss function and the second loss function is returned;
[0189] If the joint loss function converges, the latest sleep stage model is used as the trained sleep stage model;
[0190] The step of inputting a second preset number of adjacent sample time-frequency segments into the sleep staging model to obtain a first loss function and a second loss function comprises:
[0191] Inputting adjacent sample time-frequency segments into a feature extraction module to obtain corresponding first sample features;
[0192] Input the first sample feature into the concept layer module to obtain corresponding sample discrimination information;
[0193] Processing the sample discrimination information based on the first activation function to obtain a discrimination rule prediction value corresponding to the sample EEG data;
[0194] Based on the true value of the discriminant rule and the predicted value of the discriminant rule corresponding to the sample EEG data, a first loss function is obtained;
[0195] Combining the sample discrimination information into a first sample information group, and inputting the first sample information group into a classification module to obtain a second sample information group;
[0196] Processing the second sample information group based on the second activation function to obtain a sleep stage prediction value corresponding to the sample EEG data;
[0197] Based on the true value of the discriminant rule and the predicted value of the discriminant rule corresponding to the sample EEG data, a second loss function is obtained.
[0198] Furthermore, in one embodiment, the EEG interpretability analysis device for sleep staging further includes a construction module for:
[0199] According to the quantifiable medical concepts in the AASM rules, feature extraction is performed on the second preset number of adjacent sample time-frequency segments by using signal processing technology to obtain corresponding concept features;
[0200] Based on the distribution frequency of the concept feature, the concept feature is discretized by using the equal frequency binning method to obtain the corresponding discrete feature;
[0201] Performing rule screening on the discrete features based on the full correlation feature selection method of Shapley value to obtain a set of discrimination rules related to sleep stages, wherein the set of discrimination rules includes a first preset number of discrimination rules;
[0202] A concept function based on the self-attention mechanism is constructed for each of the discrimination rules, and the concept function based on the self-attention mechanism is integrated into the concept layer module of the sleep staging model, wherein the concept layer module includes a self-attention model layer and a linear layer.
[0203] Furthermore, in one embodiment, the model output module 20 is further specifically used for:
[0204] The first feature is weighted by a self-attention model layer to obtain second features corresponding to a plurality of time-frequency segments, wherein the second feature corresponding to each time-frequency segment includes a time dimension and a frequency dimension;
[0205] The frequency dimension of the second feature is weighted through a linear layer to obtain discriminant information corresponding to a number of time-frequency segments.
[0206] Furthermore, in one embodiment, the time-frequency conversion module 10 is further specifically used for:
[0207] Downsampling, bandpass filtering and artifact removal algorithms were used to reduce noise in the collected EEG data;
[0208] The EEG data after noise reduction is divided into a number of signal segments with a preset duration as one frame using the AASM interpretation standard;
[0209] Perform multi-window power spectrum analysis on the plurality of signal segments to obtain a plurality of time-frequency segments.
[0210] Among them, the functional implementation of each module in the above-mentioned EEG interpretable analysis device for sleep staging corresponds to the various steps in the above-mentioned EEG interpretable analysis method embodiment for sleep staging, and their functions and implementation processes will not be repeated here one by one.
[0211] In a fourth aspect, an embodiment of the present invention further provides a readable storage medium.
[0212] The readable storage medium of the present invention stores an EEG interpretability analysis program for sleep staging, wherein when the EEG interpretability analysis program for sleep staging is executed by a processor, the steps of the EEG interpretability analysis method for sleep staging as described above are implemented.
[0213] Among them, the method implemented when the EEG interpretable analysis program for sleep staging is executed can refer to the various embodiments of the EEG interpretable analysis method for sleep staging of the present invention, and will not be repeated here.
[0214] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system 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, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0215] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0216] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device to execute the methods described in each embodiment of the present invention.
[0217] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for interpretable EEG analysis for sleep staging, characterized in that: The EEG interpretability analysis method for sleep staging includes: Perform time-frequency transformation on the preprocessed EEG data to obtain several time-frequency segments; Input several time-frequency segments into the trained sleep staging model to obtain a set of discrimination rules corresponding to the EEG data and the sleep staging results; The step of inputting a plurality of time-frequency segments into the trained sleep staging model to obtain a set of discrimination rules corresponding to the EEG data and a sleep staging result includes: Inputting a number of time-frequency segments into the trained feature extraction module to obtain the corresponding first features; Inputting the first feature into the trained concept layer module to obtain discrimination information corresponding to a plurality of time-frequency segments, wherein each time-frequency segment includes a first preset number of discrimination information; Processing the discrimination information based on the first activation function to obtain a set of discrimination rules corresponding to the EEG data, wherein each time-frequency segment corresponds to a discrimination rule; Combining the discriminant information corresponding to the plurality of time-frequency segments into a first information group, and inputting the first information group into the trained classification module to obtain a second information group; Processing the second information group based on the second activation function to obtain a sleep staging result corresponding to the EEG data; Before the step of inputting a plurality of time-frequency segments into the trained sleep staging model to obtain a set of discrimination rules corresponding to the EEG data and a sleep staging result, the method further includes: Perform time-frequency transformation on the preprocessed sample EEG data to obtain several sample time-frequency segments; Screening out a second preset number of adjacent sample time-frequency segments, and inputting the second preset number of adjacent sample time-frequency segments into the sleep staging model to obtain a first loss function and a second loss function; Combining the first loss function and the second loss function to obtain a joint loss function; Adjust the parameters of the sleep staging model based on the joint loss function; Check whether the joint loss function converges; If the joint loss function does not converge, the screened new second preset number of adjacent sample time-frequency segments are used as the second preset number of adjacent sample time-frequency segments, and the step of inputting the second preset number of adjacent sample time-frequency segments into the sleep staging model to obtain the first loss function and the second loss function is returned; If the joint loss function converges, the latest sleep stage model is used as the trained sleep stage model; The step of inputting a second preset number of adjacent sample time-frequency segments into the sleep staging model to obtain a first loss function and a second loss function comprises: Inputting adjacent sample time-frequency segments into a feature extraction module to obtain corresponding first sample features; Input the first sample feature into the concept layer module to obtain corresponding sample discrimination information; Processing the sample discrimination information based on the first activation function to obtain a discrimination rule prediction value corresponding to the sample EEG data; Based on the true value of the discriminant rule and the predicted value of the discriminant rule corresponding to the sample EEG data, a first loss function is obtained; Combining the sample discrimination information into a first sample information group, and inputting the first sample information group into a classification module to obtain a second sample information group; Processing the second sample information group based on the second activation function to obtain a sleep stage prediction value corresponding to the sample EEG data; Based on the true value of the discriminant rule and the predicted value of the discriminant rule corresponding to the sample EEG data, a second loss function is obtained.
2. The EEG interpretability analysis method for sleep staging as claimed in claim 1, characterized in that: Before the step of inputting the second preset number of adjacent sample time-frequency segments into the sleep staging model to obtain the first loss function and the second loss function, the step includes: According to the quantifiable medical concepts in the AASM rules, feature extraction is performed on the second preset number of adjacent sample time-frequency segments by using signal processing technology to obtain corresponding concept features; Based on the distribution frequency of the concept feature, the concept feature is discretized by using the equal frequency binning method to obtain the corresponding discrete feature; Performing rule screening on the discrete features based on the full correlation feature selection method of Shapley value to obtain a set of discrimination rules related to sleep staging, wherein the set of discrimination rules includes a first preset number of discrimination rules; A concept function based on the self-attention mechanism is constructed for each of the discrimination rules, and the concept function based on the self-attention mechanism is integrated into the concept layer module of the sleep staging model, wherein the concept layer module includes a self-attention model layer and a linear layer.
3. The EEG interpretability analysis method for sleep staging as claimed in claim 2, characterized in that: The step of inputting the first feature into the trained concept layer module to obtain the discrimination information corresponding to the plurality of time-frequency segments comprises: The first feature is weighted by a self-attention model layer to obtain second features corresponding to a plurality of time-frequency segments, wherein the second feature corresponding to each time-frequency segment includes a time dimension and a frequency dimension; The frequency dimension of the second feature is weighted through a linear layer to obtain discriminant information corresponding to a number of time-frequency segments.
4. The EEG interpretability analysis method for sleep staging as claimed in claim 1, characterized in that: The step of performing time-frequency transformation on the preprocessed EEG data to obtain time-frequency graphs corresponding to a plurality of time-frequency segments comprises: Downsampling, bandpass filtering and artifact removal algorithms were used to reduce noise in the collected EEG data; The EEG data after noise reduction is divided into a number of signal segments with a preset duration as one frame using the AASM interpretation standard; Perform multi-window power spectrum analysis on the plurality of signal segments to obtain a plurality of time-frequency segments.
5. An EEG interpretability analysis device for sleep staging, characterized in that: The EEG interpretability analysis device for sleep staging includes: The time-frequency conversion module is used to perform time-frequency conversion on the preprocessed EEG data to obtain a number of time-frequency segments; The model output module is used to input a number of time-frequency segments into the trained sleep staging model to obtain a set of discrimination rules corresponding to the EEG data and a sleep staging result; The model output module is specifically used for: Inputting a number of time-frequency segments into the trained feature extraction module to obtain the corresponding first features; Inputting the first feature into the trained concept layer module to obtain discrimination information corresponding to a plurality of time-frequency segments, wherein each time-frequency segment includes a first preset number of discrimination information; Processing the discrimination information based on the first activation function to obtain a set of discrimination rules corresponding to the EEG data, wherein each time-frequency segment corresponds to a discrimination rule; Combining the discriminant information corresponding to the plurality of time-frequency segments into a first information group, and inputting the first information group into the trained classification module to obtain a second information group; Processing the second information group based on the second activation function to obtain a sleep staging result corresponding to the EEG data; The EEG interpretability analysis device for sleep staging also includes a training module for: Perform time-frequency transformation on the preprocessed sample EEG data to obtain several sample time-frequency segments; Screening out a second preset number of adjacent sample time-frequency segments, and inputting the second preset number of adjacent sample time-frequency segments into the sleep staging model to obtain a first loss function and a second loss function; Combining the first loss function and the second loss function to obtain a joint loss function; Adjust the parameters of the sleep staging model based on the joint loss function; Check whether the joint loss function converges; If the joint loss function does not converge, the screened new second preset number of adjacent sample time-frequency segments are used as the second preset number of adjacent sample time-frequency segments, and the step of inputting the second preset number of adjacent sample time-frequency segments into the sleep staging model to obtain the first loss function and the second loss function is returned; If the joint loss function converges, the latest sleep stage model is used as the trained sleep stage model; The step of inputting a second preset number of adjacent sample time-frequency segments into the sleep staging model to obtain a first loss function and a second loss function comprises: Inputting adjacent sample time-frequency segments into a feature extraction module to obtain corresponding first sample features; Input the first sample feature into the concept layer module to obtain corresponding sample discrimination information; Processing the sample discrimination information based on the first activation function to obtain a discrimination rule prediction value corresponding to the sample EEG data; Based on the true value of the discriminant rule and the predicted value of the discriminant rule corresponding to the sample EEG data, a first loss function is obtained; Combining the sample discrimination information into a first sample information group, and inputting the first sample information group into a classification module to obtain a second sample information group; Processing the second sample information group based on the second activation function to obtain a sleep stage prediction value corresponding to the sample EEG data; Based on the true value of the discriminant rule and the predicted value of the discriminant rule corresponding to the sample EEG data, a second loss function is obtained.
6. The EEG interpretability analysis device for sleep staging as claimed in claim 5, characterized in that: The EEG interpretability analysis device for sleep staging also includes a construction module for: According to the quantifiable medical concepts in the AASM rules, feature extraction is performed on the second preset number of adjacent sample time-frequency segments by using signal processing technology to obtain corresponding concept features; Based on the distribution frequency of the concept feature, the concept feature is discretized by using the equal frequency binning method to obtain the corresponding discrete feature; Performing rule screening on the discrete features based on the full correlation feature selection method of Shapley value to obtain a set of discrimination rules related to sleep staging, wherein the set of discrimination rules includes a first preset number of discrimination rules; A concept function based on the self-attention mechanism is constructed for each of the discrimination rules, and the concept function based on the self-attention mechanism is integrated into the concept layer module of the sleep staging model, wherein the concept layer module includes a self-attention model layer and a linear layer.
7. An EEG interpretability analysis device for sleep staging, characterized in that: The EEG interpretable analysis device for sleep staging includes a processor, a memory, and an EEG interpretable analysis program for sleep staging stored in the memory and executable by the processor. When the EEG interpretable analysis program for sleep staging is executed by the processor, the steps of the EEG interpretable analysis method for sleep staging as described in any one of claims 1 to 4 are implemented.
8. A readable storage medium, characterized in that: The readable storage medium stores an EEG interpretable analysis program for sleep staging, wherein when the EEG interpretable analysis program for sleep staging is executed by a processor, the steps of the EEG interpretable analysis method for sleep staging as described in any one of claims 1 to 4 are implemented.
