A compact PyTorch model for five-stage sleep-stage classification from polysomnography signals. Processes 300 seconds of context (10 × 30-second epochs) and classifies each epoch into Wake, N1, N2, N3, or REM. Designed for edge deployment on resource-constrained devices.
Quick Start
python
1import torch
2from huggingface_hub import hf_hub_download
3from safetensors.torch import load_file
45# Download checkpoint6path = hf_hub_download(7 repo_id="shamique/Light-Weight-Neuromorphic-Sleep-Stage-Model",8 filename="student_full_finetuned.safetensors",9)1011# Load model (see source repo for ImprovedStudent class definition)12# https://github.com/shamiquekhan/neuromorphic-sleep-staging-pipeline13from sleep_staging.models.improved_student import ImprovedStudent
1415model = ImprovedStudent()16model.load_state_dict(load_file(path, device="cpu"))17model.eval()1819# Run inference on preprocessed PSG data20# Input: [batch, 10, 4, 3000] — 10 epochs, 4 channels, 3000 samples @ 100Hz21x = torch.randn(1,10,4,3000)# replace with real data2223with torch.inference_mode():24 logits = model(x)# [1, 10, 5]25 probs = torch.softmax(logits, dim=-1)26 preds = probs.argmax(dim=-1)# [1, 10]2728STAGE_NAMES ={0:"Wake",1:"N1",2:"N2",3:"N3",4:"REM"}29for i inrange(10):30print(f"Epoch {i}: {STAGE_NAMES[preds[0, i].item()]} ({probs[0, i, preds[0, i]].item():.2%})")
Honest assessment: Overall accuracy (87.7%) is strong with balanced performance across all five stages. N1 is the most challenging stage (F1=0.445) due to its transitional nature and low prevalence (~4.6% of epochs).
Preprocessing
The model expects preprocessed data:
Bandpass filter: 0.5–35 Hz
Notch filter: 50 Hz
Normalization: z-score per channel
Epoching: 30-second windows at 100 Hz
See the source repo for the full preprocessing pipeline.
1@project{neurosleep_2026,
2 title={NeuroSleep: Light-Weight Sleep Stage Scoring},
3 author={Kaushik, P. and Vora, S. and Bhatt, S. and Khan, S. and Lone, A.J.},
4 year={2026},
5 institution={VIT Bhopal University}
6}
Download Counting
Hugging Face counts downloads per unique file. For this model, the primary tracked file is student_full_finetuned.safetensors. Each HTTP request (GET or HEAD) to this file counts as one download. Clone operations that download all files are counted once per file.
For granular download analytics (unique users, CI/CD filtering), see Publisher Analytics.