Montage-Dependent Trade-Off Between Sleep Depth and Cross-Modal Subject Correspondence in Self-Supervised PSG–MSLT Representations Learned From a Narcolepsy-Enriched Cohort

Published: 25 October 2026| Version 1 | DOI: 10.17632/vp4bj6scjr.1
Contributor:
Jian Cui

Description

This repository contains the reproducibility package for the manuscript "Montage-Dependent Trade-Off Between Sleep Depth and Cross-Modal Subject Correspondence in Self-Supervised PSG-MSLT Representations Learned From a Narcolepsy-Enriched Cohort" (IEEE JBHI, draft). The code implements the full study pipeline: (1) harmonization of heterogeneous paired polysomnography (PSG) and multiple sleep latency test (MSLT) recordings into a unified 100‑Hz, 8‑channel format; (2) computation of the continuous sleep‑depth value (SDV) anchor from central EEG; (3) five‑fold subject‑level cross‑modal self‑supervised pretraining with masked reconstruction, temporal contrast, cross‑modal contrast, domain‑adversarial learning, and SDV regression; (4) frozen‑encoder probing for SDV readout, XML ordinal‑depth validation, and cross‑modal subject retrieval; (5) statistical analysis with paired testing, bootstrap confidence intervals, and Holm‑Benjamini‑Hochberg correction; (6) acquisition‑robustness and inference‑efficiency benchmarks.

Files

Steps to reproduce

This release contains code, configuration, and documentation only. Raw PSG-MSLT recordings, derived subject-level data, trained weights, and reference results are not included. Exact reproduction therefore requires controlled data access and the authorized external SDV implementation and checkpoint. 1. Install Python 3.11 or newer and requirements.txt. From the release root, run scripts/check_release.py. Set PAPER2_SOURCE_ROOT to the controlled archive, arrange data as described in docs/INPUT_LAYOUT.md, and place the external SDV files under code/external/legacy_sdv. 2. From code, run build_paper2_manifest.py, build_paper2_nap_manifest.py, build_paper2_signal_cache.py, build_paper2_nap_intervals.py, and build_paper2_window_manifests.py in order. Use the parameters in configs/paper2_main.yaml. Review all QC files and exclude only records with documented validity failures. 3. Run extract_paper2_sdv.py. Generate the frozen split with build_paper2_cv_folds.py using seed 20261017, stratified five-fold assignment by group and device type, and no subject overlap across training, validation, and test sets. Run smoke_paper2_dataset.py. 4. Train all folds with train_paper2_variant_cv.py --variant proposed --fold all, using 35 epochs, 1000 steps per epoch, eight subjects per batch, and the supplied loss weights. Evaluate with evaluate_paper2_frozen_cv.py --fold all. Run the no-anchor and single-objective controls with run_paper2_remaining_baselines.ps1. Use validation data only for model selection. 5. Run the downstream analyses listed in docs/RUN_ORDER.md, including montage comparison, depth-correspondence trade-off, independent stage-depth validation, device-stratified retrieval, handcrafted-feature baseline, sensitivity analyses, and inference benchmarks. 6. Generate tables and figures with the dedicated scripts listed in docs/FIGURE_TABLE_MAP.md. Record software and hardware versions, seeds, logs, and command lines. Because the controlled data, derived data, checkpoints, and result files are not public, users should report their own execution outputs and should not claim exact numerical reproduction.

Categories

Biomedical Engineering, Machine Learning, Narcolepsy, Electroencephalography, Sleep Medicine

Licence