[Paper Review] Real-Time Sleep Staging using Deep Learning on a Smartphone for a Wearable EEG
This paper presents the first real-time, on-device sleep staging system using a smartphone and a single-channel wearable EEG, leveraging a Time-Distributed 1D Convolutional Neural Network with Z-score calibration for instrument- and subject-independent inference. It achieves 83.5% accuracy in five-class sleep stage classification (Wake, N1, N2, N3, REM) on the Sleep-EDF dataset using only 30-second epochs, enabling portable, server-free, real-time sleep monitoring on mobile devices.
We present the first real-time sleep staging system that uses deep learning without the need for servers in a smartphone application for a wearable EEG. We employ real-time adaptation of a single channel Electroencephalography (EEG) to infer from a Time-Distributed 1-D Deep Convolutional Neural Network. Polysomnography (PSG)-the gold standard for sleep staging, requires a human scorer and is both complex and resource-intensive. Our work demonstrates an end-to-end on-smartphone pipeline that can infer sleep stages in just single 30-second epochs, with an overall accuracy of 83.5% on 20-fold cross validation for five-class classification of sleep stages using the open Sleep-EDF dataset.
Motivation & Objective
- To develop a real-time, on-device sleep staging system that eliminates the need for hospital-based polysomnography (PSG) and server-side processing.
- To enable accurate, portable, and user-friendly sleep staging using only a single-channel EEG from a wearable device on a smartphone.
- To overcome limitations of existing systems by achieving real-time, 30-second epoch classification with high accuracy using a lightweight, on-device deep learning model.
- To ensure model robustness across different EEG devices and subjects through Z-score calibration using wake-stage standard deviation.
Proposed method
- The system uses a Time-Distributed 1D Convolutional Neural Network (TD-1D-CNN) to classify single 30-second EEG epochs in real time.
- Raw EEG from the AF7 channel is down-sampled to 100Hz and processed every 30 seconds using statistical features including mean, standard deviation, and Min-Max-Distance (MMD).
- Z-score calibration is applied using the standard deviation of the wake stage to normalize EEG signals across different devices and subjects, ensuring instrument- and subject-independence.
- The model is trained and validated using 20-fold cross-validation on the open Sleep-EDF dataset, with feature importance analyzed via mutual information to prioritize key statistical features.
- A TensorFlow Lite-based Android application streams EEG data via Bluetooth Low Energy (BLE) from the wearable Muse headband and visualizes real-time sleep stage predictions with confidence scores.
- The system is validated through real-time REM detection and simulated eye movements, jaw clenching, and blinks during wakefulness to confirm signal responsiveness.
Experimental results
Research questions
- RQ1Can a single-channel wearable EEG combined with a lightweight deep learning model enable real-time, on-device sleep staging without server dependency?
- RQ2How accurate can a 1D-CNN-based model be in classifying five sleep stages (Wake, N1, N2, N3, REM) using only 30-second EEG epochs on a smartphone?
- RQ3To what extent can Z-score calibration using wake-stage standard deviation improve model generalization across different EEG devices and individuals?
- RQ4How does the performance of this on-device system compare to human expert scoring in terms of inter-rater reliability and classification accuracy?
Key findings
- The model achieves an overall accuracy of 83.5% on 20-fold cross-validation for five-class sleep stage classification using the Sleep-EDF dataset.
- On independent test nights, accuracy ranges from 72% (worst case) to 81.72%, with F1-score of 76.23% and micro-averaged F1-score of 0.82.
- N1 stage has the lowest performance (precision 0.47, recall 0.42, F1 0.44), primarily due to the absence of an occipital electrode for reliable detection.
- The standard deviation of EEG signals was found to be the most important statistical feature, contributing 53.33% on average to feature importance, justifying its use in Z-score calibration.
- The system successfully validates real-time REM detection and simulates eye movements and blinks during wakefulness, confirming responsiveness and reliability in dynamic conditions.
- The confusion matrix and hypnogram comparison show strong alignment with ground truth, particularly for N2 and N3 stages, indicating robust performance for non-REM stages.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.