Source-linked AI summary
Joint Classification and Prediction CNN Framework for Automatic Sleep Stage Classification
Huy Phan, Fernando Andreotti, Navin Cooray, Oliver Y. Chén, Maarten De Vos
TL;DR
Manual sleep staging is tedious, time-consuming, and prone to subjective error, motivating automatic methods that exploit dependencies between consecutive epochs. The paper proposes a multi-task CNN that classifies one epoch, predicts neighboring labels, and aggregates multiple decisions; experiments compare it with established baselines and deep-learning approaches.
Problem
Manual sleep staging is tedious, time-consuming, and prone to subjective error, while consecutive sleep epochs exhibit strong label dependency.
Method
A multi-task CNN transforms an epoch into a multi-channel time-frequency image, jointly classifies it and predicts neighboring labels, and supports aggregation of multiple decisions.
Results
The proposed framework outperforms common classification-scheme baselines and reimplemented deep-learning approaches in the reported comparisons.
Takeaways & Limitations
Joint classification and prediction leverages sleep-epoch dependency while avoiding the stated ambiguity and computational overhead of many-to-one contextual input.
Abstract
from arXiv · showhide
Correctly identifying sleep stages is important in diagnosing and treating sleep disorders. This work proposes a joint classification-and-prediction framework based on CNNs for automatic sleep staging, and, subsequently, introduces a simple yet efficient CNN architecture to power the framework. Given a single input epoch, the novel framework jointly determines its label (classification) and its neighboring epochs' labels (prediction) in the contextual output. While the proposed framework is orthogonal to the widely adopted classification schemes, which take one or multiple epochs as contextual inputs and produce a single classification decision on the target epoch, we demonstrate its advantages in several ways. First, it leverages the dependency among consecutive sleep epochs while surpassing the problems experienced with the common classification schemes. Second, even with a single model, the framework has the capacity to produce multiple decisions, which are essential in obtaining a good performance as in ensemble-of-models methods, with very little induced computational overhead. Probabilistic aggregation techniques are then proposed to leverage the availability of multiple decisions. We conducted experiments on two public datasets: Sleep-EDF Expanded with 20 subjects, and Montreal Archive of Sleep Studies dataset with 200 subjects. The proposed framework yields an overall classification accuracy of 82.3% and 83.6%, respectively. We also show that the proposed framework not only is superior to the baselines based on the common classification schemes but also outperforms existing deep-learning approaches. To our knowledge, this is the first work going beyond the standard single-output classification to consider multitask neural networks for automatic sleep staging. This framework provides avenues for further studies of different neural-network architectures for automatic sleep staging.
I. INTRODUCTION
Automatic sleep staging addresses the tedious and subjective manual scoring of sleep epochs, while exploiting temporal dependencies through contextual formulations. This work proposes a one-to-many joint classification-and-prediction framework using a single epoch as input.
- Manual sleep-stage scoring is tedious, time-consuming, and prone to subjective error, motivating automatic methods for sleep-disorder monitoring.
- Consecutive sleep epochs exhibit strong dependency because sleep stages transition slowly, motivating contextual sleep-staging models.In MASS, 83.3% of adjacent epoch pairs share a label, and 79.3% remain equal when separated by one epoch.
- Common many-to-one models use surrounding epochs as input to classify a target epoch, whereas the proposed one-to-many formulation uses one target epoch to classify itself and predict neighboring labels.
- The proposed framework uses a simple CNN with time-frequency image input, a multi-task softmax layer, and a multi-task loss function.
B. Contributions
The paper contributes a joint classification-and-prediction formulation, a CNN implementation with probabilistic decision aggregation, and evaluations on public sleep datasets under multiple signal conditions.
- The work formulates automatic sleep staging as joint classification and prediction to address shortcomings of common classification schemes.
- The proposed framework combines a simple efficient CNN with a multi-task softmax layer and multi-task loss for the joint task.
- Additive and multiplicative voting aggregate the multiple decisions produced by the framework.
- Experiments used Sleep-EDF with 20 subjects and MASS with 200 subjects.
- The experiments evaluated unimodal single-channel EEG and multimodal combinations of EEG, EOG, and EMG, while allowing other signal modalities straightforwardly.
B. Montreal Archive of Sleep Studies (MASS)
MASS provides a heterogeneous 200-subject evaluation setting spanning five recording subsets and standardized sleep-stage labels. The framework maps a single epoch’s time-frequency representation to labels for the target and neighboring epochs, enabling aggregated decisions.
- MASS contains whole-night recordings from 200 subjects across five heterogeneous subsets, SS1–SS5.
- The recordings were manually labeled by experts under AASM or R&K standards and converted into five stages: W, N1, N2, N3, and REM.
- Raw signals are transformed into log-power spectra, smoothed and reduced with frequency-domain filter banks, then stacked into a multi-channel time-frequency image X_n.
- The multi-task CNN maximizes probabilities for the target label and neighboring epochs within an output context of size 2τ + 1.
- The joint formulation is orthogonal to contextual-input many-to-one classification and produces 2τ + 1 decisions that can be aggregated into a final decision.
B. Time-Frequency Image Representation
Each signal epoch is transformed into a multi-channel time-frequency image before joint classification and context prediction. Learned frequency filtering reduces dimensionality while retaining channel-specific representations.
- Signal transformation: A 30-second EEG, EOG, or EMG epoch is converted by STFT into a 129 × 29 log-power spectrum image.The STFT uses a two-second window, 50% overlap, a Hamming window, and a 256-point FFT.
- Multi-channel representation: For P = 1, 2, or 3 channels, the resulting representation is a multi-channel time-frequency image X ∈ R^P×M×T.The channel configurations correspond to EEG; EEG and EOG; or EEG, EOG, and EMG.
- CNN input and outputs: The CNN receives X_n and jointly performs classification of the current epoch and prediction of labels in its surrounding context.The framework first forms channel-specific images, stacks them, and applies the multi-task CNN.
- Input geometry: Each convolutional filter spans the full frequency and channel dimensions while operating across time with temporal size w < T.The resulting feature map is passed through ReLU activation.
1) Over-Time Convolutional Layer:
The CNN uses multiple temporal resolutions and 1-max pooling to learn and retain the strongest time-frequency matches. Its multi-task output is trained with summed cross-entropy errors across subtasks.
- Over-Time Convolutional Layer: R filter sets use different temporal widths, with Q filters per set, yielding Q × R filters that capture complementary features.Different widths provide multiple temporal resolutions.
- 1-Max Pooling Layer: 1-max pooling retains the most prominent activation from each feature map, producing a feature vector of size Q × R.Pooling is applied across all feature maps generated by the convolutional filters.
- 1-Max Pooling Layer: Convolution acts as time-frequency template matching, while 1-max pooling keeps the strongest match location for each learned template.The filters indicate how well task-specific templates match different parts of the input.
- Multi-Task Softmax Layer: The multi-task softmax layer penalizes both classification and prediction errors by summing cross-entropy losses over the individual subtasks.The CNN output includes multiple task-specific probability distributions.
- Multi-Task Softmax Layer: Training minimizes the multi-task cross-entropy error over N samples, with ℓ2 regularization weighted by λ and additional dropout regularization.Optimization uses Adam.
D. Ensemble of Decisions and Aggregation
A single multi-task CNN supplies multiple decisions for each target epoch from nearby input epochs. Additive and multiplicative voting aggregate these probabilities, with multiplicative voting favoring consistent categories more strongly.
- Decision ensemble: The framework produces multiple classification and prediction decisions for a target epoch using one model.These decisions may be inconsistent, so aggregation is used to obtain a more reliable label.
- Aggregation schemes: Two probabilistic aggregation schemes are evaluated: additive voting and multiplicative voting.Both combine the available decisions for the target epoch.
- Aggregation schemes: Each neighborhood epoch X_i contributes an estimated probability P(y_n | X_i) for target-stage label y_n.The neighborhood spans indices n − τ through n + τ.
- Decision rule: The final predicted label is selected by maximizing the aggregated likelihood over the sleep-stage label set.Likelihood maximization follows additive or multiplicative voting.
- Aggregation schemes: Multiplicative voting more strongly favors categories with consistent decisions and suppresses categories with divergent decisions than additive voting.The distinction concerns how disagreement among neighborhood decisions affects category likelihoods.
V. EXPERIMENTS
Experiments evaluate the proposed framework against one-to-one, many-to-one, and deep-CNN baselines using cross-validation on Sleep-EDF and MASS. The setup also varies CNN filter count and output context size.
- Experimental goals: The study tests feasibility, compares joint classification-and-prediction with one-to-one and many-to-one schemes, and benchmarks different deep-learning approaches.These goals define the experimental comparison.
- Datasets and validation: Sleep-EDF uses leave-one-subject-out validation, while MASS uses 20-fold cross-validation with 180 training, 10 validation, and 10 test subjects per fold.Sleep-EDF iterations use 15 training and 4 validation subjects among the remaining 19.
- Parameter settings: The experiments vary the convolutional filter count Q across {100, 200, 300, 400, 500, 1000} and test output context size 3, equivalent to τ = 1.The influence of these parameters is evaluated experimentally.
- Baselines: The one-to-one baseline maps one epoch to one label, whereas the many-to-one baseline uses three contextual epochs to predict one target label.Both baselines retain common experimental settings such as the CNN architecture and learned filter bank.
- CNN baselines: A six-layer deep CNN baseline is compared with the proposed three-layer 1-max CNN to assess architecture generalizability and efficiency.The deep baseline contains two convolutional, two subsampling, and two fully connected layers.
D. Experimental Results
The framework predicts neighboring epochs alongside classifying the input epoch, and aggregates these decisions to improve accuracy. It consistently outperforms common schemes while retaining computational advantages over contextual-input baselines.
- Classification vs prediction accuracy: The three subtasks classify the input epoch and predict its left and right neighbors from the same output context.
- Classification vs prediction accuracy: Prediction accuracy remains close to classification accuracy despite lacking neighboring signal inputs, especially with multimodal inputs.For the 1-max CNN, left/right gaps average 2.9%/1.4% on Sleep-EDF and 2.2%/1.3% on MASS.
- Advantages of joint classification and prediction: Multiplicative voting adds 3.0% and 4.7% absolute accuracy over classification on Sleep-EDF and MASS, respectively.Additive voting gains are 2.8% and 4.5%; multiplicative voting is better by about 0.2–0.3%.
- Advantages of joint classification and prediction: The proposed one-to-many framework consistently outperforms one-to-one and many-to-one baselines across the reported datasets and CNN bases.With the 1-max CNN, gains over one-to-one/many-to-one are 2.5%/0.2% on Sleep-EDF and 1.0%/1.6% on MASS.
- Advantages of joint classification and prediction: Three-times larger contextual input roughly triples training time for the many-to-one baseline compared with one-to-one training.On MASS with the 1-max CNN, training takes 4.0 hours versus 1.36 hours.
3) Performance comparison:
Across the paper’s comparisons, the one-to-many framework with the 1-max CNN is the strongest overall system on both datasets, although evaluation setups affect comparability and some class-wise exceptions occur.
- In-work comparison: The one-to-many framework with the 1-max CNN outperforms the other in-work system combinations on both datasets and across modality combinations.It remains optimal on most metrics despite occasional baseline advantages in average MF1 or sensitivity.
- Comparison with previous methods: Sleep-EDF results vary noticeably because prior studies use different testing dependencies and recording segments.Dependent testing and inclusion of out-of-bed wake epochs can bias or boost reported accuracy, making unlike setups improper to compare directly.
- Comparison with previous methods: 2.9% higher overall accuracy than DeepSleepNet is obtained on MASS when all three adopted channels are used.
- Comparison with previous methods: Direct comparison with several MASS studies is inappropriate because they evaluated subsets rather than all 200 subjects.The authors reimplemented competing methods under a compatible setup.
- Class-wise performance: N1 shows modest class-wise performance because it is infrequent and resembles other sleep stages.The paper identifies oversampling and loss weighting as possible improvement directions.
VI. DISCUSSION
The discussion attributes gains mainly to sleep-stage continuity and disagreement handling on non-transition epochs, while transition epochs remain intrinsically difficult to label.
- Transition versus non-transition epochs: 83.4% of MASS epochs belong to the non-transition set, whereas 16.6% occur at stage transitions.
- Transition versus non-transition epochs: Transition-set accuracy is lower because a 30-second epoch may contain two stages while receiving only one manual label.The paper also notes reduced labeling accuracy and subjectivity near transitions.
- Hypnogram illustration: Figure 7 compares ground truth with one-to-one, many-to-one, and proposed one-to-many hypnogram outputs for one MASS subject.
- Cause of performance improvement: On non-transition epochs, the proposed framework exceeds the two baselines by 2.7% and 1.3%.
- Cause of performance improvement: Among epochs disagreeing with one-to-one, the proposed method reaches 60.4% accuracy versus 30.5% for the baseline.Against many-to-one, the corresponding accuracies are 52.4% and 37.2% on the dissenting subset.
B. Influence of the Number of Convolutional Filters
Increasing the number of convolutional filters has only a modest effect on accuracy, while multimodal inputs consistently improve performance. The output context introduces a trade-off because distant-epoch predictions can reduce aggregate performance.
- Filter-count influence: 0.5% absolute accuracy gain on Sleep-EDF resulted from increasing Q from 100 to 1000, despite a tenfold increase in filter count.With P = 2 and multiplicative voting, Q had limited influence on performance.
- Filter-count influence: 0.4% accuracy improvement on MASS was observed when Q increased from 100 to 1000 with P = 3.The improvement was similarly modest despite the larger network.
- Input modalities: 4.1% absolute accuracy gain on MASS came from adding EOG to EEG, with another 1.1% gain after adding EMG.These results were averaged over Q and show consistent benefits from multimodal inputs.
- Output context: Larger output contexts can weaken links to distant neighboring epochs, reducing individual prediction quality and potentially worsening aggregate performance.The framework therefore faces a trade-off between more ensemble decisions and weaker far-away predictions.
- Output context: 0.1% accuracy declines on Sleep-EDF and 0.3% and 0.2% losses on MASS occurred when the output context increased to five.The losses corresponded to additive and multiplicative voting, respectively.
E. Multitask vs Ensemble
The proposed multitask CNN produces decisions for classification and neighboring-epoch prediction within one model, enabling comparison with an equivalent ensemble. After aggregation, multitask and ensemble differences become negligible, while the multitask 1-max CNN outperforms the deep CNN baseline on both datasets.
- Individual subtasks: Separate ensemble CNNs perform better than the corresponding multitask model on individual subtasks because multitasking combines them into a harder modeling task.This comparison covered left prediction, classification, and right prediction subtasks.
- Aggregated decisions: After aggregation, performance differences between the multitask and ensemble models become negligible across CNN architectures and datasets.The comparison used equivalent three-CNN ensembles and multitask models.
- Baseline comparison: The multitask 1-max CNN outperforms the deep CNN baseline on both Sleep-EDF and MASS after aggregation.The paper presents this as the more important cross-dataset comparison.
- Framework role: The framework produces multiple decisions from a single model, which can be combined through aggregation to form a final decision.This one-to-many output provides the multitask model with an ensemble-like decision structure.
- Evaluation scope: The proposed framework was demonstrated on Sleep-EDF and MASS, two public sleep datasets.The study reports generalizability across both datasets.