Institutional Repository of Vilnius University
Research on eeg classification algorithms by sleep stage /
Abstract
dc:descriptionThis thesis presents both a research study for automated sleep stage classification from electroencephalography (EEG) data. We target the five AASM stages (W, N1, N2, N3, REM) and use the Sleep-EDFx database. The full pipeline employs MNE for EDF/EDF+ ingestion, flexible selection of either a single EEG channel (Fpz--Cz) or three channels (Fpz--Cz, Pz--Oz, horizontal EOG), resampling to 100\,Hz, and segmentation into 30\,s epochs. Labels are mapped to classes consistent with AASM (R&K 3/4 merged into N3, movement/unknown excluded). We investigate a compact CNN baseline, a deeper 1D ResNet, and a CNN+BiLSTM sequence model implemented in PyTorch. For per-epoch CNNs we apply a five-state Hidden Markov Model (HMM) to the per-epoch logits as temporal post-processing, and enable the same HMM smoothing in the model serving side to maintain parity with evaluation, for the sequence-aware CNN+BiLSTM, which already models temporal context, we serve raw predictions without HMM. Complete application is also delivered: a FastAPI microservice with a Redis/RQ job queue for scalable asynchronous inference and a Next.js frontend for user interaction. Users can upload EEG files, select a model (1-channel or 3-channel, per-epoch or sequence-aware), and obtain interactive output including hypnograms, stage composition, summary sleep metrics, and a composite sleep score. Experiments on subject-independent Sleep-EDFx splits show that HMM post-processing substantially improves metrics for per-epoch CNNs and that a 1D ResNet provides a stronger per-epoch baseline than a lightweight CNN. The best overall performance is achieved by a 3-channel CNN+BiLSTM model, with a 3-channel ResNet1D + HMM configuration offering a competitive and a simpler alternative. The whole system and metrics is reproducible, and ready for future model extensions and integration into clinical workflows.
Degree
thesis:*- Grantor dc:publisher
- Institutional Repository of Vilnius University
- Year dc:date
- 2026
Author and committee
dc:creator, dc:contributor.*- Author dc:creator
-
- Straigis, Valentinas,
Subjects
dc:subject × 1Rights
dc:rights- Statement dc:rights
-
- info:eu-repo/semantics/openAccess
- Language dc:language
- eng
Identifiers
dc:identifier.*- Repository record dc:identifier
- https://repository.vu.lt/VU:ELABAETD277690369&prefLang=en_US