Reproduced Studies

Using SleePyPhases to reproduce published sleep ML results

SleePyPhases was validated by reproducing five published sleep analysis studies. Each reproduction demonstrates a different aspect of the framework — multi-dataset training, different model architectures, ECG-based staging, and more.

All reproduction projects live in reproduce/ and follow the same project.yaml + Python package structure as the tutorial.


spp-example — SimpleCNN on SleepEDF

A minimal reference implementation designed for learning and extension.

  • Dataset: SleepEDF (PhysioNet)
  • Model: SimpleCNN — 1D CNN with adaptive average pooling
  • Channels: Single EEG channel (Fpz-Cz)
  • Key techniques: Record-wise batching, fixed-size padding, 5-fold CV
  • Location: reproduce/spp-example/

Notable patterns: - Minimal SignalPreprocessing override (only resample) - fixedSize manipulation to handle variable-length recordings - addBatchDimension + toTensor pipeline - Good starting point for custom CNN experiments


SPP-DRCNN — Dilated Residual CNN

Reproduces a convolutional architecture that uses dilated convolutions for long-range temporal context.

  • Model: DRCNN (Dilated Residual CNN)
  • Channels: Multiple EEG + EOG channels
  • Key techniques: Multi-channel input, residual connections, dilated convolutions
  • Location: reproduce/SPP-DRCNN/

Notable patterns: - Multi-channel useSourceChannels configuration - Custom DataManipulation for multi-channel normalization - Demonstrates SleePyPhases.DataManipulation.znorm


SPP-SleepTransformer — Transformer-based Staging

Reproduces SleepTransformer, a self-attention model for sleep staging.

  • Model: SleepTransformer (encoder-only Transformer)
  • Channels: EEG + EOG
  • Key techniques: Epoch-level attention, sequence-to-sequence staging
  • Location: reproduce/SPP-SleepTransformer/

Notable patterns: - segmentLength and windowed batching (not record-wise) - prepareTargets manipulation for sequence output alignment - Shows how to configure Transformer positional encoding via model.* config


SPP-NeuroNet — Multi-modal Staging

  • Model: NeuroNet
  • Channels: EEG, EOG, EMG
  • Key techniques: Multi-modal input fusion, cross-modal attention
  • Location: reproduce/SPP-NeuroNet/

Notable patterns: - Multiple entries in useSourceChannels across modalities - stepsPerType with separate chains for EEG, EOG, EMG - Custom SignalPreprocessing with per-modality filtering


spp-ppgnet — PPG-based Staging

Reproduces a study using photoplethysmography (wrist-worn sensor) instead of EEG.

  • Model: PPGNet
  • Channels: PPG signal
  • Key techniques: Non-EEG signal preprocessing, ECG/PPG feature extraction
  • Location: reproduce/spp-ppgnet/

Notable patterns: - Demonstrates that SleePyPhases is not limited to EEG - Custom SignalPreprocessing for PPG-specific filtering - Shows stepsPerType.ppg channel type configuration


How reproductions are structured

Every reproduction project follows the same layout:

reproduce/SPP-XYZ/
├── project.yaml          # full config including dataset, model, training params
├── README.md             # paper reference + how to run
└── sppxyz/
    ├── __init__.py
    ├── phases/
    │   └── Init.py
    ├── SignalPreprocessing.py
    ├── DataManipulation.py
    └── models/
        └── ModelName/
            └── ModelName.py

To run any reproduction:

cd reproduce/SPP-XYZ
phases run          # runs all phases in dependency order

Advanced patterns from reproductions

Using multiple datasets in one experiment

plugins:
  - pyPhasesRecordloaderSleepEDF
  - pyPhasesRecordloadershhs
  - SleePyPhases

config:
  useLoader: shhs
  shhs-path: /data/shhs
  sleepedf-path: /data/sleepedf

Switch datasets:

phases run Extract --config useLoader=sleepedf
phases run Extract --config useLoader=shhs

Cyclic learning rate

trainingParameter:
  cyclicLearningRate: true
  findCyclicLearningRate: true   # run LR range finder first
  lr: 0.0001                     # min LR for CLR range
  batchSize: 32

Event-level evaluation

enableEventEval: true
clinicalMetrics: true

→ Browse the source: reproduce/ directory in the repository
→ Back to tutorial: Overview