Single-channel electroencephalogram sleep stage classification method
By combining multi-scale convolutional neural networks and self-attention mechanisms with a lightweight Transformer module, the problems of class imbalance and computational complexity in single-channel EEG signal classification are solved, achieving efficient sleep stage classification suitable for portable devices.
Patent Information
- Application Number
- CN202510802990.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-16
- Publication Date
- 2025-11-11
AI Technical Summary
Traditional sleep staging methods are time-consuming and highly subjective, making them difficult to meet the needs of portable devices and large-scale screening. Furthermore, existing single-channel EEG signal classification methods face problems such as class imbalance, signal complexity, and computational complexity, especially performing poorly in the N1 and REM stages.
A multi-scale convolutional neural network combined with a self-attention mechanism is used to extract time-frequency features, capture the dependence of sleep stage transitions, perform temporal enhancement through a lightweight Transformer module, and fuse spectral statistical features. The main and auxiliary classifiers and class imbalance optimization loss function are used for training.
It significantly improves classification performance for a few categories of sleep stages, reduces computational complexity, is suitable for resource-constrained portable devices, and improves classification accuracy and efficiency.
Smart Images

Figure CN120918679A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for classifying sleep stages using single-channel electroencephalogram (EEG) signals, belonging to the field of deep learning technology. Background Technology
[0002] Traditional sleep staging relies on polysomnography (PSG) and manual analysis by experts, which is time-consuming and highly subjective, making it difficult to meet the needs of portable devices and large-scale screening.
[0003] In recent years, automatic sleep staging based on single-channel electroencephalogram (EEG) signals has attracted widespread attention due to its portability and low cost.
[0004] However, existing methods face challenges including: (1) Class imbalance problem: For example, in the Sleep-EDF Expanded dataset, there are fewer samples in the N1 (8.69%) and N3 (6.05%) stages, resulting in poor classification performance; (2) Complexity of EEG signals: Non-stationarity and individual differences make feature extraction difficult, especially the spectral overlap in the N1 and REM stages; (3) Computational complexity: Traditional deep learning models (such as DeepSleepNet and ConvTransSleepNet) have a large number of parameters and are not suitable for resource-constrained portable devices.
[0005] Existing methods such as DeepSleepNet, which combines convolutional neural networks (CNN) and long short-term memory networks (LSTM), SeqSleepNet, which uses recurrent neural networks (RNN) to model temporal features, and ConvTransSleepNet, which integrates CNN and Transformer, generally have F1 scores below 0.525 in the N1 stage, which is difficult to meet clinical needs. Summary of the Invention
[0006] The purpose of this invention is to provide a single-channel EEG signal sleep stage classification method that can solve the problems of class imbalance, signal complexity, and computational efficiency.
[0007] To achieve the above objectives, the present invention provides the following technical solution: In a first aspect, the present invention provides a method for classifying sleep stages using single-channel electroencephalogram (EEG) signals, comprising: Acquire single-channel EEG signals and preprocess them to generate signal segments of fixed duration; The signal segment is input into the trained sleep stage classification model for classification, and the sleep stage classification result is obtained. Sleep stage classification models include: The feature extraction module is used to extract multi-scale time-frequency features from signal segments, generate primary time-frequency features, capture sleep stage transition dependencies, perform time-series enhancement on the primary time-frequency features, and generate enhanced time-series features; and to extract spectral statistical features from signal segments, generating spectral statistical features. The feature fusion module is used to fuse enhanced temporal features and spectral statistical features to generate a comprehensive feature vector; The classification module is used to output the probability distribution of different sleep stages using the main classifier based on the comprehensive feature vector, and to output the binary discrimination result of the sleep stage with the fewest samples using the auxiliary classifier. Among them, the sleep stage classification model is trained based on the outputs of the main classifier and the auxiliary classifier, and the loss function is optimized through class imbalance. The sleep stage with the highest probability output by the main classifier is used as the sleep stage classification result.
[0008] In conjunction with the first aspect, further, acquiring single-channel EEG signals and performing preprocessing to generate signal segments of fixed duration includes: preprocessing single-channel EEG signals using bandpass filtering and standard fractional normalization to generate signal segments of fixed duration.
[0009] Building upon the first aspect, further, multi-scale time-frequency feature extraction is performed on the signal segment to generate primary time-frequency features, including: Multi-scale convolutional neural networks are used to extract multi-scale time-frequency features from signal segments to generate primary time-frequency features. Multi-scale convolutional neural networks include: Several parallel convolutional branches, each including several sets of convolutional kernels of different scales, are used to extract time-frequency features of different scales from signal segments; The channel self-attention mechanism, connected to the output of each convolutional branch, is used to dynamically adjust the weights of each time-frequency feature according to its importance; and to concatenate the dynamically adjusted time-frequency features to generate primary time-frequency features. Residual connections are used to directly connect the input of each convolutional branch to its output, thus avoiding gradient degradation.
[0010] Building upon the first aspect, further, by capturing the dependence on sleep stage transitions, temporal enhancement is performed on the primary time-frequency features to generate enhanced temporal features, including: The lightweight Transformer module is used to capture the sleep stage transition dependencies, and the primary time-frequency features are temporally enhanced to generate enhanced temporal features. The lightweight Transformer module includes several encoder layers, each containing several attention heads. The lightweight Transformer module constructs the dependencies between sleep stages through a multi-head self-attention mechanism and captures the temporal continuity of sleep stages through learned positional encoding.
[0011] In conjunction with the first aspect, further, spectral statistical features are extracted from the signal segments to generate spectral statistical features including: Perform a Fast Fourier Transform on the signal segment and calculate the power spectral density; Based on the power spectral density, the relative power of different fundamental frequency bands is extracted; Based on the relative power of different fundamental frequency bands, spectral statistics are calculated to generate spectral statistical features; Among them, spectral statistics include logarithmic power, spectral entropy, centroid, skewness, and kurtosis.
[0012] In conjunction with the first aspect, further, by fusing enhanced temporal features and spectral statistical features, a comprehensive feature vector is generated, including: Enhanced time-series features and spectral statistical features are concatenated along the feature dimension; The stitched features are subjected to nonlinear transformation and dimensionality reduction using a multilayer perceptron. Batch normalization and activation functions are applied to the hidden layers of the multilayer perceptron to output a comprehensive feature vector.
[0013] In conjunction with the first aspect, further, the main classifier is a fully connected layer with a Softmax activation function, and its output dimension is equal to the total number of categories in the sleep stage; the auxiliary classifier is a single-neuron output layer with a Sigmoid activation function.
[0014] Building upon the first aspect, further optimization of the class imbalance loss function is needed. for: ; in, This represents the focus loss of the main classifier. The binary cross-entropy loss of the auxiliary classifier is represented by... This represents the weighting coefficient.
[0015] In a second aspect, the present invention provides a computer device, comprising: Storage medium used to store computer programs; A processor for executing the computer program to implement the single-channel EEG signal sleep stage classification method of any one of the first aspects.
[0016] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the single-channel EEG signal sleep stage classification method described in any of the first aspects.
[0017] Fourthly, the present invention provides a computer program product, including a computer program that, when executed by a processor, implements the single-channel EEG signal sleep stage classification method described in any of the first aspects.
[0018] Compared with the prior art, the beneficial effects of the present invention are: This invention provides a single-channel EEG signal sleep stage classification method that extracts multi-scale time-frequency features from signal segments, captures sleep stage transition dependencies for temporal enhancement, integrates spectral statistical features, uses a main classifier to output the probability distribution of different sleep stages, and uses an auxiliary classifier to output the binary discrimination result of the sleep stage with the fewest samples. This method can solve the problems of class imbalance, signal complexity, and computational efficiency. The sleep stage classification model provided by this invention accurately captures the time-frequency features of EEG signals through a multi-scale convolutional neural network combined with a self-attention mechanism, and innovatively integrates spectral statistical features. It also uses a lightweight Transformer to model sleep stage transition dependencies and employs a multi-task learning framework and class imbalance optimization loss function, which can significantly improve the classification performance of sleep stages with scarce samples. Furthermore, the number of parameters is significantly reduced compared to existing technologies, making it suitable for resource-constrained portable devices. Attached Figure Description
[0019] Figure 1 This is a flowchart of the single-channel EEG signal sleep stage classification method provided in this embodiment of the invention; Figure 2 This is a schematic diagram comparing the frequency band power distribution of each sleep stage according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the training and validation loss curves provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the confusion matrix provided in an embodiment of the present invention. Detailed Implementation
[0020] The technical solution of this application will be further described in detail below with reference to specific embodiments.
[0021] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application. Unless otherwise specified, the embodiments of this application and the technical features within them can be combined with each other.
[0022] This application provides a method for classifying sleep stages using single-channel electroencephalogram (EEG) signals, including: Acquire single-channel EEG signals and preprocess them to generate signal segments of fixed duration; The signal segment is input into the trained sleep stage classification model for classification, and the sleep stage classification result is obtained.
[0023] In this embodiment, as Figure 1 As shown, the sleep stage classification model includes: The feature extraction module is used to extract multi-scale time-frequency features from signal segments, generate primary time-frequency features, capture sleep stage transition dependencies, perform time-series enhancement on the primary time-frequency features, and generate enhanced time-series features; and to extract spectral statistical features from signal segments, generating spectral statistical features. The feature fusion module is used to fuse enhanced temporal features and spectral statistical features to generate a comprehensive feature vector; The classification module is used to output the probability distribution of different sleep stages using the main classifier based on the comprehensive feature vector, and to output the binary discrimination result of the sleep stage with the fewest samples using the auxiliary classifier.
[0024] In this embodiment, the sleep stage classification model is trained based on the outputs of the main classifier and the auxiliary classifier, using a class imbalance optimization loss function.
[0025] After inputting the signal segment into the trained sleep stage classification model, the sleep stage with the highest probability output by the main classifier is taken as the sleep stage classification result.
[0026] The single-channel EEG signal sleep stage classification method provided in this application extracts multi-scale time-frequency features from signal segments, captures sleep stage transition dependencies for temporal enhancement, fuses spectral statistical features, uses a main classifier to output the probability distribution of different sleep stages, and uses an auxiliary classifier to output the binary discrimination result of the sleep stage with the fewest samples. This method can solve the problems of class imbalance, signal complexity, and computational efficiency.
[0027] In one possible embodiment, acquiring a single-channel EEG signal and preprocessing it to generate a signal segment of fixed duration includes: preprocessing the single-channel EEG signal using bandpass filtering and standard fractional normalization to generate a signal segment of fixed duration.
[0028] In this embodiment, acquiring a single-channel EEG signal and performing preprocessing to generate a signal segment of fixed duration includes the following steps: Step 1: Acquire single-channel EEG signals; Specifically, the Sleep-EDF Expanded dataset was loaded, and single-channel EEG signals were acquired through the Fpz-Cz channels at a sampling frequency of 100Hz.
[0029] Step 2: Perform bandpass filtering to remove low-frequency noise and high-frequency interference; Specifically, a bandpass filter of 0.5Hz to 30Hz is used to remove low-frequency noise and high-frequency interference.
[0030] Step 3: Apply standard fractions to standardize and generate signal segments of fixed duration.
[0031] Specifically, the single-channel EEG signal was preprocessed using Z-score standardization, with 3,000 sampling points set to generate a 30-second signal segment.
[0032] In one possible embodiment, multi-scale time-frequency feature extraction of a signal segment to generate primary time-frequency features includes: using a multi-scale convolutional neural network to extract multi-scale time-frequency features of the signal segment to generate primary time-frequency features.
[0033] In this embodiment, the multi-scale convolutional neural network includes: Several parallel convolutional branches, each including several sets of convolutional kernels of different scales, are used to extract time-frequency features of different scales from signal segments; The channel self-attention mechanism, connected to the output of each convolutional branch, is used to dynamically adjust the weights of each time-frequency feature according to its importance; and to concatenate the dynamically adjusted time-frequency features to generate primary time-frequency features. Residual connections are used to directly connect the input of each convolutional branch to its output, thus avoiding gradient degradation.
[0034] Specifically, the multi-scale convolutional neural network includes two parallel convolutional branches, where the kernel size of one convolutional branch is [3,5,7,9] and the kernel size of the other convolutional branch is [3,5,7,11]. The output of each convolutional branch is weighted by a channel self-attention mechanism.
[0035] The self-attention mechanism is defined as follows: ; in, , , The query vector, key vector, and value vector are generated from the input features through 1D convolution. This represents the dimension of each attention head.
[0036] In one possible embodiment, capturing sleep stage transition dependencies and performing temporal enhancement on primary time-frequency features to generate enhanced temporal features includes: using a lightweight Transformer module to capture sleep stage transition dependencies, performing temporal enhancement on primary time-frequency features, and generating enhanced temporal features.
[0037] In this embodiment, the lightweight Transformer module includes several encoder layers, each encoder layer including several attention heads; the lightweight Transformer module constructs the dependencies between sleep stages through a multi-head self-attention mechanism, and captures the temporal continuity of sleep stages through learned positional encoding.
[0038] Specifically, the Transformer module includes a 3-layer encoder, each layer of which includes 8 attention heads with an embedding dimension of 128. The learnable parameters are positional encodings, and the GELU activation function is used with a dropout rate of 0.2.
[0039] In one possible embodiment, spectral statistical feature extraction is performed on the signal segment to generate spectral statistical features, including: Perform a Fast Fourier Transform on the signal segment and calculate the power spectral density; Based on the power spectral density, the relative power of different fundamental frequency bands is extracted; Based on the relative power of different fundamental frequency bands, spectral statistics are calculated to generate spectral statistical features.
[0040] In this embodiment, the spectral statistics include logarithmic power, spectral entropy, centroid, skewness, and kurtosis.
[0041] Specifically, a 1024-point Fast Fourier Transform (FFT) is performed on the signal segment, and the power spectral density is calculated using the Welch method. Based on the power spectral density, the relative power of 10 frequency bands is extracted: Delta (0.55Hz~4Hz), Theta (4Hz~8Hz), Alpha (8Hz~12Hz), Beta (12Hz~30Hz), Gamma (30Hz~40Hz), Slow Delta (0.5Hz~2Hz), Fast Delta (2Hz~4Hz), Slow Theta (4Hz~6Hz), Fast Theta (6Hz~8Hz), and Spindle (12Hz~16Hz). Based on the relative power of different frequency bands, spectral statistics are calculated and projected onto 256-dimensional spectral statistical features using a multilayer perceptron (MLP).
[0042] In one possible embodiment, fusing enhanced temporal features and spectral statistical features to generate a comprehensive feature vector specifically includes: Enhanced time-series features and spectral statistical features are concatenated along the feature dimension; The stitched features are subjected to nonlinear transformation and dimensionality reduction using a multilayer perceptron. Batch normalization and activation functions are applied to the hidden layers of the multilayer perceptron to output a comprehensive feature vector.
[0043] In one possible embodiment, the main classifier is a fully connected layer with a Softmax activation function, and the output dimension is equal to the total number of categories in the sleep stage; the auxiliary classifier is a single-neuron output layer with a Sigmoid activation function.
[0044] In this embodiment, the class imbalance optimization loss function for: ; in, This represents the focus loss of the main classifier. The binary cross-entropy loss of the auxiliary classifier is represented by... This represents the weighting coefficient.
[0045] In this embodiment, five sleep stage types are defined: Wake, N1, N2, N3, and REM. The main classifier outputs a 5-dimensional vector, which corresponds to the probability of the Wake, N1, N2, N3, and REM stages, respectively. The auxiliary classifier is used to perform binary discrimination on the sleep stages with the fewest samples, namely the N1 and N3 stages, and outputs the independent classification results of N1 / N3.
[0046] The Delta, Theta, Alpha, Beta, and Gamma frequency band power distributions in the Wake, N1, N2, N3, and REM stages are compared below. Figure 2 As shown.
[0047] Specifically, weighting coefficients The value range is 0.1 to 0.5, and the focusing parameter for Focal Loss is 2.0.
[0048] Based on the outputs of the main classifier and the auxiliary classifier, the sleep stage classification model is trained by optimizing the loss function through class imbalance until the training termination condition is met, thus obtaining a well-trained sleep stage classification model.
[0049] Specifically, training termination conditions include: reaching the maximum number of training epochs (80 epochs), triggering the early stopping mechanism (patience value of 10 epochs), or convergence of the macro-average F1 score. The training and validation loss curves are shown below. Figure 3 As shown.
[0050] After inputting the signal segment into the trained sleep stage classification model, the sleep stage with the highest probability output by the main classifier is taken as the sleep stage classification result.
[0051] The classification distribution of the sleep stage classification model provided in this embodiment on the validation set is as follows: Figure 4 As shown.
[0052] To verify the sleep stage classification method of single-channel EEG signal provided in the embodiments of this application, an ablation experiment was conducted based on the sleep stage classification method of single-channel EEG signal provided in the embodiments of this application.
[0053] Experimental parameter settings include: Data: Sleep-EDF Expanded dataset, Fpz-Cz channels, 563,117 30-second signal segments.
[0054] Preprocessing: bandpass filtering (0.5 Hz ~ 30 Hz), IQR artifact removal (threshold 5.0 ~ 8.0).
[0055] Model: Batch size 24, 80 training epochs, AdamW optimizer, Focal Loss.
[0056] Hardware: NVIDIA RTX 4090D GPU, PyTorch framework.
[0057] The experiment compared the proposed method with DeepSleepNet, SeqSleepNet, and ConvTransSleepNet, with the average performance calculated after 5 runs. Key metrics included accuracy, macro-average F1 score, Cohen's Kappa (k coefficient), and F1 score in the N1 / N3 stages. The experimental results are shown in Table 1.
[0058] Table 1: Experimental Results Data Table.
[0059] .
[0060] Experimental results show that the sleep stage classification model provided in this application achieves an accuracy of 88.2%, a macro-average F1 score of 0.8166, and a k-coefficient of 0.8232 on the Sleep-EDF Expanded dataset. The F1 score for the N1 stage reaches 0.633, significantly outperforming existing sleep stage classification methods (DeepSleepNet has an accuracy of 82.0%, SeqSleepNet has an accuracy of 83.3%, and ConvTransSleepNet has an accuracy of 84.6%). Therefore, the single-channel EEG signal sleep stage classification method provided in this application can overcome the shortcomings of traditional sleep stage classification methods in terms of minority class classification and computational complexity.
[0061] The single-channel EEG signal sleep stage classification method provided in this application captures multi-scale features of EEG signals using convolutional kernels of different sizes (3, 5, 7, 9 and 3, 5, 7, 11), and enhances the expression of key features through a self-attention mechanism. Ablation experiments show that it contributes approximately 4.6% to the F1 score of the N1 stage.
[0062] The single-channel EEG signal sleep stage classification method provided in this application uses a 3-layer, 8-head Transformer module. It optimizes stage transition modeling through learning-based location coding, and ablation experiments show that it contributes approximately 14% to the F1 score.
[0063] The single-channel EEG sleep stage classification method provided in this application uses the Welch method to calculate the power spectrum, extracts the logarithmic power and statistical features of 10 frequency bands, and enhances the distinguishability between the N1 (Theta wave) and N3 (Delta wave) stages. Ablation experiments show that it contributes approximately 10% to the F1 score. Data augmentation (1.5-fold enhancement rate for the N1 stage) and frequency masking are achieved through MixUp, demonstrating strong robustness to individual differences and signal noise. Cross-dataset tests (Sleep-EDF-2013 and SHHS) show that the F1 score fluctuation is less than 3%. Spectral feature extraction provides a visual output of frequency band power and statistical features, supporting the Sleep Stage Visualizer tool to generate intuitive sleep structure diagrams, facilitating the analysis of sleep efficiency (87.5%) and REM proportion (21.3%).
[0064] The single-channel EEG sleep stage classification method provided in this application enhances the feature representation of N1 and N3 stages through an auxiliary classifier and optimizes class imbalance through Focal Loss (focus parameter of 2.0, with class weights of 0.75, 0.75, 0.25, 0.75, and 0.25 for Wake, N1, N2, N3, and REM stages, respectively). The F1 score for N1 and N3 stages reaches 0.633, which is 35.8% to 71.1% higher than existing sleep stage classification methods.
[0065] The single-channel EEG signal sleep stage classification method provided in this application embodiment has been validated across datasets, showing that the sleep stage classification model's performance degradation on unseen data is less than 5%, indicating its strong generalization ability. The total number of parameters is approximately 5M, which is about 30% less than that of traditional methods (ConvTransSleepNet has a total number of approximately 7M parameters). The inference time is approximately 0.02 seconds for a 30-second signal segment, making it suitable for resource-constrained portable devices.
[0066] This application provides an application of a single-channel EEG signal sleep stage classification method in sleep monitoring.
[0067] Specifically, it is applied to: Portable sleep monitoring device, based on single-channel EEG, to classify sleep stages and optimize sleep quality assessment; Sleep analysis provides metrics such as sleep efficiency, deep sleep percentage, and REM sleep rate. A home sleep management system that combines visualization tools to output sleep structure analysis and supports personalized sleep management.
[0068] This application provides a computer device, including: Storage medium used to store computer programs; A processor is used to execute computer programs to implement the single-channel EEG signal sleep stage classification method provided in any embodiment of this application.
[0069] This application provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements the single-channel EEG signal sleep stage classification method provided in any embodiment of this application.
[0070] This application provides a computer program product, including a computer program that, when executed by a processor, implements the single-channel EEG signal sleep stage classification method provided in any embodiment of this application.
[0071] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0072] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0073] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0074] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0075] The above are merely preferred embodiments of this application. It should be noted that, for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for classifying sleep stages using single-channel electroencephalogram (EEG) signals, characterized in that, include: Acquire single-channel EEG signals and preprocess them to generate signal segments of fixed duration; The signal segment is input into the trained sleep stage classification model for classification, and the sleep stage classification result is obtained. Sleep stage classification models include: The feature extraction module is used to extract multi-scale time-frequency features from signal segments, generate primary time-frequency features, capture sleep stage transition dependencies, perform time-series enhancement on the primary time-frequency features, and generate enhanced time-series features; and to extract spectral statistical features from signal segments, generating spectral statistical features. The feature fusion module is used to fuse enhanced temporal features and spectral statistical features to generate a comprehensive feature vector; The classification module is used to output the probability distribution of different sleep stages using the main classifier based on the comprehensive feature vector, and to output the binary discrimination result of the sleep stage with the fewest samples using the auxiliary classifier. Among them, the sleep stage classification model is trained based on the outputs of the main classifier and the auxiliary classifier, and the loss function is optimized through class imbalance. The sleep stage with the highest probability output by the main classifier is used as the sleep stage classification result.
2. The single-channel EEG signal sleep stage classification method according to claim 1, characterized in that, Acquiring and preprocessing single-channel EEG signals to generate fixed-duration signal segments involves: preprocessing single-channel EEG signals using bandpass filtering and standard fractional normalization to generate fixed-duration signal segments.
3. The single-channel EEG signal sleep stage classification method according to claim 1, characterized in that, Multi-scale time-frequency feature extraction is performed on the signal segment to generate primary time-frequency features, including: Multi-scale convolutional neural networks are used to extract multi-scale time-frequency features from signal segments to generate primary time-frequency features. Multi-scale convolutional neural networks include: Several parallel convolutional branches, each including several sets of convolutional kernels of different scales, are used to extract time-frequency features of different scales from signal segments; The channel self-attention mechanism, connected to the output of each convolutional branch, is used to dynamically adjust the weights of each time-frequency feature according to its importance; and to concatenate the dynamically adjusted time-frequency features to generate primary time-frequency features. Residual connections are used to directly connect the input of each convolutional branch to its output, thus avoiding gradient degradation.
4. The single-channel EEG signal sleep stage classification method according to claim 1, characterized in that, By capturing sleep stage transition dependencies and performing temporal enhancement on primary time-frequency features, enhanced temporal features are generated, including: The lightweight Transformer module is used to capture the sleep stage transition dependencies, and the primary time-frequency features are temporally enhanced to generate enhanced temporal features. The lightweight Transformer module includes several encoder layers, each containing several attention heads. The lightweight Transformer module constructs the dependencies between sleep stages through a multi-head self-attention mechanism and captures the temporal continuity of sleep stages through learned positional encoding.
5. The single-channel EEG signal sleep stage classification method according to claim 1, characterized in that, Spectral statistical features are extracted from signal segments, generating spectral statistical features including: Perform a Fast Fourier Transform on the signal segment and calculate the power spectral density; Based on the power spectral density, the relative power of different fundamental frequency bands is extracted; Based on the relative power of different fundamental frequency bands, spectral statistics are calculated to generate spectral statistical features; Among them, spectral statistics include logarithmic power, spectral entropy, centroid, skewness, and kurtosis.
6. The single-channel EEG signal sleep stage classification method according to claim 1, characterized in that, By fusing enhanced temporal features and spectral statistical features, a comprehensive feature vector is generated, including: Enhanced time-series features and spectral statistical features are concatenated along the feature dimension; The stitched features are subjected to nonlinear transformation and dimensionality reduction using a multilayer perceptron. Batch normalization and activation functions are applied to the hidden layers of the multilayer perceptron to output a comprehensive feature vector.
7. The single-channel EEG signal sleep stage classification method according to claim 1, characterized in that, The main classifier is a fully connected layer with a Softmax activation function, and its output dimension is equal to the total number of categories in the sleep stage; the auxiliary classifier is a single-neuron output layer with a Sigmoid activation function.
8. The single-channel EEG signal sleep stage classification method according to claim 1, characterized in that, Class Imbalanced Optimization Loss Function for: ; in, This represents the focus loss of the main classifier. The binary cross-entropy loss of the auxiliary classifier is represented by... This represents the weighting coefficient.
9. A computer device, characterized in that, include: Storage medium used to store computer programs; A processor for executing the computer program to implement the single-channel EEG signal sleep stage classification method according to any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the single-channel EEG signal sleep stage classification method according to any one of claims 1 to 8.
Citation Information
Cited By
Sleep optimization system based on brain wave adjustment
CN121400846A
A sleep optimization system based on brainwave regulation
CN121400846B
Single-channel electroencephalogram sleep analysis method and related equipment
CN121971042A