This repository investigates event-specific REM-to-Wake boundary detection from simultaneously recorded PSG and two-channel wearable forehead EEG. Sleep staging is a comparator and label source, not the project target.
As of 2026-10-31, Blocks 3-11 are complete. A corrected common-channel external-generalization experiment used all 196 eligible PSG nights across BOAS, gx36m, and ISRUC group 3. The direct advanced representation reached pooled external F1 0.2290. A later fixed stage-first comparison reached F1 0.1263 and increased false alarms, with its bootstrap F1-difference interval entirely below zero. Neither result is reliable or wearable validation. The Block 11 wearable streaming gate remains no_go, so Block 12 will document the no-go and reproducibility state rather than build a prototype.
- BOAS snapshot
1.1.1is frozen at 128 paired recordings and 100 participant-tablepidgroups. - The conservative primary set contains 276 REM-to-Wake events across 72 groups; the expanded quality-sensitivity set contains 348 across 88 groups.
- The transparent stage-first SF-C baseline obtained test event F1 0.0766 and 1.9692 false alarms/hour.
- The corrected multi-dataset PSG stage-first candidate reached pooled external F1 0.1263 and 0.4523 false alarms/hour versus direct PSG F1 0.2290 and 0.2048/hour. Its predicted REM sequences were fragmented, with 4.607 to 7.520 times as many REM bouts as the human stages.
- The direct DE-B baseline obtained test event F1 0.1497 and 1.2571 false alarms/hour, but precision remained 0.0909.
- Validation-only factorized DE-D improved validation F1 from 0.1127 to 0.1604 and reduced false alarms from 1.4496 to 0.9915/hour. It has not been evaluated on a new locked cohort.
- All 256 local EDF files match the official snapshot SHA-256 annex keys.
- The Block 7 channel gate passed for all 128 pairs: the complete common PSG EEG input is
F3/F4/C3/C4/O1/O2, the reduced PSG input isF3/F4, and the wearable input isHB_1/HB_2. - The train-only Block 7 feature gate passed for 82 recordings across 64
pidgroups. All 164 signal-path checks, five synthetic spectral checks, and 82 per-recording checks passed; PSG-6/PSG-2 overlap was exact and wearable features reproduced the frozen reference within4.77e-7. - An independent validator rehashed and reopened all 246 external feature arrays and passed 15/15 membership, schema, parity, and provenance checks.
- The Block 7 validation comparison is frozen. Reduced PSG (
P2-D) produced the strongest validation result, with event F1 0.1887 and 0.3702 false alarms/hour; six-channel PSG reached F1 0.1631 and 1.1107 false alarms/hour; direct wearable reached F1 0.1123 and 1.4558 false alarms/hour. - Strict PSG-to-wearable zero-shot transfer reached validation F1 0.0685 and 0.6526 false alarms/hour. Its F1 loss versus direct reduced PSG was 0.1202 with paired 95% interval 0.0336 to 0.2001, while its false-alarm difference remained inconclusive.
- The conditional alignment was not run: the performance condition opened, but only 11/80 feature dimensions exceeded the fixed distribution-shift threshold, below the required 20%.
- The frozen descriptive test comparison was executed once on 26 recordings from 20
pidgroups without refitting. Six-channel PSG produced the highest test F1 at 0.2048, followed by direct wearable at 0.1493, reduced PSG at 0.1429, and strict zero-shot transfer at 0.1067. - The validation ordering did not fully reproduce.
P6-D - P2-Dtest F1 was +0.0620 with paired 95% interval +0.0019 to +0.1194, reversing the validation point direction. The direct reduced-PSG versus zero-shot F1 difference remained positive at +0.0362 but its interval crossed zero. - Zero-shot transfer again had lower F1 but substantially fewer false alarms than direct wearable: the paired test differences were -0.0426 F1 and -0.8448 false alarms/hour, with only the false-alarm interval excluding zero.
- All 13/13 in-run checks and 13/13 independent output checks passed. The validator rehashed 108 external artifacts and reproduced 95,460 probabilities, event outputs, and paired contrasts twice.
- The first Block 8 experiment tested single-channel feature-contribution robustness using the frozen direct wearable model and validation partition only. Neutralizing
HB_1reduced F1 from 0.1123 to 0 and false alarms from 1.4558 to 0.5208/hour, failing the predefined material-change screen. NeutralizingHB_2reduced F1 to 0.0913 and false alarms to 1.0793/hour. - Both ablation directions persisted across all 16 leave-one-
pid-out folds. This identifies asymmetric channel dependence in the frozen classifier; it does not simulate physical electrode failure. - The second Block 8 experiment added deterministic raw-rate Gaussian noise before feature extraction. Both-channel probability agreement degraded monotonically from 20 to 0 dB; at 0 dB the detector found no true event. At 10 dB, isolated
HB_1noise reduced F1 to 0.0419 and increased false alarms to 4.4616/hour, while isolatedHB_2noise produced F1 0.0825 and 0.3514 false alarms/hour. - The raw-signal experiment passed 17/17 in-run checks and 12/12 independent checks twice. The validator regenerated 100 degraded feature arrays from EDF and reproduced 114,738 probabilities, event outputs, participant intervals, and frozen decisions. These controlled white-noise findings do not represent natural field artefacts.
- A predeclared train-only augmentation then exposed the unchanged bandpower-logistic pipeline to clean and four fixed noise conditions. Its grouped train-OOF threshold was 0.99. It reduced the isolated
HB_1false-alarm result from 4.4616 to 0.9413/hour, but clean F1 decreased from 0.1123 to 0.1024 and other noise conditions showed false-alarm tradeoffs. - The augmentation passed its targeted
HB_1robustness gates but failed the required +0.05 clean-F1 advancement gate. It is retained as a robustness comparator and does not replace the core detector. All 13 train, 11 validation, and 14 independent checks passed; the full independent reconstruction passed twice. - A frozen validation event-overlap analysis found 13/37 primary references detected by both direct PSG and wearable, seven by PSG only, three by wearable only, and 14 missed by all three direct models. The diagnostic union recall was 0.6216 but is not an ensemble result because its false-alarm burden was not evaluated.
- Widening event tolerance from +/-15 to +/-45 seconds increased direct-model union recall by 0.1081, with a participant interval of 0.0238 to 0.2400. This supports explicit boundary-uncertainty work; it does not make the present detector reliable. All 9/9 in-run and 10/10 independent checks passed without current-test access.
- A fixed alarm-fusion experiment then counted the hidden alarm cost.
P6-H2-ORreduced F1 to 0.1100 and increased false alarms to 2.2465/hour. The all-direct OR result was similarly adverse, with both paired participant directions excluding zero. - Fixed 2-of-3 laboratory consensus reached validation F1 0.2174 and 0.5397 false alarms/hour. Its FAR reduction versus six-channel PSG was consistent, but its F1-gain interval crossed zero. Because it requires PSG and remains low-precision, it is a mechanism comparator rather than a wearable result. Fixed fusion stops at v0.1.
- The Block 8 closeout synthesis rehashed 23 compact source artifacts and reviewed ten fixed evidence statements. All 132/132 source checks, 9/9 synthesis checks, and 9/9 independent reconstruction checks passed; an immutable rerun changed no reviewed file.
- Block 8 closes with wearable robustness failed and no deployable wearable method advanced. Stage-derived boundary uncertainty is prioritized because widening tolerance increased union recall by 0.1081 with a participant lower bound of 0.0238. Closing the block records a completed investigation, not a reliable detector.
- A 25-claim participant evidence-strength analysis found eight gates supported by their full stored range, eight point-gate-only results, four uncertainty-supported failures, four failed points with gate-overlapping ranges, and one joint contrast without a direct interval.
- Wearable non-advancement is strengthened because the augmentation clean-F1 interval, -0.0438 to +0.0132, remains below the required
+0.05gain. Boundary timing remains a priority because its interval is positive, but its lower bound does not clear the+0.10materiality gate. - A separately predeclared train-only LSTM-CRF screen compared the same eight-epoch wearable inputs with a matched flattened logistic model across five participant-held-out folds. LSTM-CRF F1 was 0.1965 versus 0.0982, while false alarms fell from 1.4679 to 0.5306/hour. The paired difference intervals were +0.0485 to +0.1367 F1 and -1.4804 to -0.4089 false alarms/hour.
- The LSTM-CRF point result passed the fixed +0.05 F1 and no-FAR-increase gate, and the favorable direction was participant-supported. It remains a train-development result: validation and test stayed closed, F1 remained below 0.20, and a new locked or external wearable cohort is required before model advancement.
- A nested train-only comparison then evaluated BLSTM-CRF, BGRU-CRF, TCN-CRF, and BLSTM-2H under fold-local architecture and threshold selection. The selected pipeline reached F1 0.1645 and 0.2812 false alarms/hour, versus 0.1604 and 0.2971/hour for its matched nested BLSTM-CRF control.
- The nested F1 gain was only +0.0041, with participant interval -0.0532 to +0.0608, and the false-alarm difference interval also crossed zero. Architecture choices varied across all candidate types over five folds. The +0.05 advancement gate failed, so the four-candidate exploration stops without authorizing a replacement or new-cohort confirmation.
- A train-only error diagnostic found that widening tolerance from +/-15 to +/-45 seconds recovered nine additional events, while widening to +/-105 seconds recovered only one more. Label-informed threshold upper bounds reached F1 0.2177-0.2324 but remained below 0.25 and are not usable performance estimates.
- Quality-tier recall differed substantially across every train procedure. LC-1 detected 9/53 clean primary events versus 47/127 MAD-flagged events; the nested selected pipeline detected 1/53 versus 31/127. Because the 10-MAD flag is nonspecific, this is an unresolved quality-tier dependence rather than proof of artefact detection.
- Of 177 nested false alarms, 167 were not within 45 seconds of a labeled transition. This motivated a predeclared robust-normalization and quality-balanced-loss experiment without an architecture change.
- The quality-balanced nested experiment completed 50 fits on the train cohort.
LC-QB1reached F1 0.1435 and 0.4130 false alarms/hour, versus 0.1604 and 0.2971/hour for the exactly reproduced nested BLSTM-CRF control. LC-QB1increased clean-event recall from 2/53 to 4/53 but left MAD-flagged recall at 30/127. Its F1 difference was -0.0169, false-alarm difference was +0.1160/hour, and clean-recall difference was +0.0377; all three predeclared advancement conditions failed.- The entire participant interval for false-alarm difference was adverse at +0.0555 to +0.1825/hour. The mechanism stops at v0.1 without post-result scaler or weight-ratio tuning.
- The exact control reproduced 75,539 prior probabilities with maximum difference 0. The independent validator passed 9/9 checks twice, and an isolated rerun reproduced all 101 external and 19 reviewed artifacts byte-for-byte.
- Block 9 audited Sleep-EDF Expanded version 1.0.0 before any external model fitting. The official manifest yielded 197 PSG/hypnogram pairs from 100 participant groups; seven local metadata/pilot files matched official SHA-256 values.
- Both fixed pilots contained
Fpz-CzandPz-Ozat 100 Hz and yielded eight contiguous R-to-W events on the 30-second grid. One excludedSleep stage ?interval extended beyond PSG support, failing the complete annotation-support criterion. - Direct external evaluation was stopped because Sleep-EDF's anterior-posterior bipolar channels do not preserve the ordered left/right
F3-M1/F4-M1feature meaning of the frozen BOAS reduced-PSG model. The full dataset was not downloaded and no model was fitted. The independent validator passed 8/8 checks twice. - A predeclared train-only experiment compared the existing 80-value bandpower context with a 360-value enriched representation and fold-local elastic-net pruning. The nested design completed 200 inner and 30 outer-final fits without opening validation or current-test data.
- Reduced-PSG elastic-net F1 improved from 0.1749 to 0.2278 while false alarms fell from 0.7419 to 0.5544/hour. Wearable F1 improved from 0.0978 to 0.1796 while false alarms fell from 1.5362 to 0.7927/hour.
- Both elastic-net candidates passed the predeclared point gate and had directional participant-bootstrap support. Their F1 lower bounds, +0.0186 for reduced PSG and +0.0439 for wearable EEG, did not reach the +0.05 material-support threshold, so the candidates are frozen for new-cohort confirmation rather than advanced as reliable detectors.
- Twenty-four elastic-net inner fits at
C=1.0reached the fixed iteration limit; all outer-final fits converged. The wearable selectedC=0.1in every fold and showed a supported improvement over unpruned enriched features. The independent validator passed 10/10 checks twice over 624 hashed external artifacts. - A predeclared full-night formulation audit found that the 2,563 review-sampled negatives covered only 3.488% of the regenerated eligible pool and differed materially in night position and stage-pair composition. The corrected labelled risk set contained 73,656 rows with natural positive prevalence 0.2444%.
- At the 0.25 false-alarms/hour selection budget, natural-prior full-risk-set fitting reached precision 0.1480, recall 0.1611, F1 0.1543, and 0.2653 false alarms/hour. The sampled balanced control reached F1 0.0513, while balanced full-risk fitting selected no alarms and reached F1 0.
- Natural-prior fitting reduced Brier score by 92.39% relative to balanced full-risk fitting and passed its frozen point gate. It led at the 0.10, 0.25, and 0.50/hour sensitivity budgets but not at 1.00/hour; no candidate exceeded F1 0.183.
- Forty-four of 50 new fits reached the fixed iteration limit. The formulation direction is retained for a separately predeclared confirmation, but it is not a reliable detector and must not be tuned against the observed outer results. Both independent result validators passed twice.
- The interval-aware experiment then built a signal-derived 15-second grid with 150,967 supported boundaries and compared nominal hard labels with equal event mass distributed over nominal -15, nominal, and nominal +15 seconds. At the primary budget,
HARD15reached F1 0.0109 andINT15reached F1 0, so the required +0.03 gain failed. - Although all 50 SGD fits stopped before the iteration limit, a post-run numerical audit found exact endpoint probabilities for 99.87% of outer scores and intercepts between approximately -1005 and -749. The frozen result is retained, but it identifies an unstable comparator rather than resolving the biological value of interval labels. The independent validator passed 12/12 checks and rehashed 182 external artifacts.
- A separately frozen causal endpoint-factorization test replaced rare-event fitting with 24,772 REM-before and 21,076 Wake-after state positives across the 150,967-point train grid. The heads reached ROC AUC 0.7692 and 0.8835, but their product reached event F1 0.0375 versus 0.0517 for CAUSAL-RW, failing the +0.03 advancement gate.
- All five endpoint-factorization folds selected the minimum threshold, placing 99.9583% of candidates above threshold. Contiguous collapse produced 142 runs with median duration 16,290 seconds; 97 lasted at least two hours. This identifies the score-to-alarm representation, not another architecture, as the next specific methodological issue. The independent validator passed 13/13 checks twice and verified 51 external artifacts.
- A predeclared train-only causal multiscale experiment added 180 high-resolution spectral, entropy, aperiodic-proxy, Hjorth, coupling, and change values to the 80-value causal baseline, while fixing the model, participant folds, alarm budget, and peak-first alarm rule.
ADV-PEAKreached F1 0.1125 and 0.1940 false alarms/hour versusBASE-PEAKF1 0.0236 and 0.2464/hour. The F1 difference was +0.0889 with participant interval +0.0433 to +0.1393, so the frozen point gate passed.- Absolute performance remained weak: 18/180 events were detected and only 15/64 participant groups had a true positive. The result supports the feature mechanism but not reliable wearable deployment. Independent validation passed 13/13 checks twice, 134 external hashes passed, and a full rerun reproduced the result.
- The eleven-source label analysis covered 1,993 nights and 4,046 strict adjacent REM-to-Wake events. Cross-source frequency, scorer dependence, and repeated-night dependence all passed their frozen materiality screens.
- The gx36m correction audit found 818 raw
-1labels outside the documented0..4vocabulary. Safe parsing changed 81 primary epochs toUNKNOWN; the gx36m event count remained 85, while scorer-specific statistics changed. Version 0.2 replaces the preserved v0.1 label result. - The common-channel PSG cohort contains 196 nights from 130 participant groups: 128 BOAS, 58 gx36m, and 10 ISRUC group-3 nights. Strict gx36m consensus corrected the model target pool from 521 to 482 events.
- The corrected leave-one-dataset-out experiment reused verified F4/C4/O2 feature caches, froze the original participant folds, and completed 36/36 converged fits. On pooled gx36m plus ISRUC,
ADV3-CHANGEreached F1 0.2290, recall 0.2564, and 0.2048 false alarms/hour versus F1 0.1579, recall 0.1795, and 0.2280/hour forPSD3-BASE. - The corrected pooled F1 difference was +0.0711, but its participant-bootstrap interval was -0.0177 to +0.1396. The point gate passed, while the strength of evidence remains inconclusive and 87/117 external events were missed.
- The corrected PSG experiment passed 13/13 run controls, 14/14 independent result checks, and 10/10 version-comparison checks. The validator verified 42 external artifacts and reconstructed 1,075 alarms, event and participant metrics, scorer sensitivity, bootstrap intervals, and the final decision.
- The Block 11 streaming gate failed four of five entry conditions: no wearable method independently advanced, accepted wearable event performance remained inadequate, robustness failed, and the causal candidate remained unconfirmed. The no-go synthesis passed 8/8 in-run and 13/13 independent checks without running a prototype.
The Block 7 and Block 8 results do not justify revising the frozen models or thresholds. The temporal experiments show no material nested improvement from small encoder variants, two-second spectral U-Net features, or the tested robust-scaling and tier-balancing mechanism. The enriched elastic-net and causal multiscale experiments identified positive feature directions, and the multi-dataset PSG result shows that some advanced-feature benefit transfers beyond BOAS. Absolute precision, recall, and F1 nevertheless remain low, and the external difference interval includes zero. Block 9 found that Sleep-EDF cannot provide a scientifically matched direct external test of the frozen reduced-PSG model. Block 10 corrected the full-night risk formulation, then found numerical degeneration in the interval-label comparator. No post-result feature or alarm tuning is authorized. The current BOAS test partition was already used descriptively and remains closed. A new paired wearable evaluation is still required before any wearable-method advancement claim.
- Project proposal
- Overall timeline
- Project working rules
- End-to-end audit, 2026-08-23
- Historical experiment first-commit index
- Reference DOI audit
- Block 7 entry conditions
- Block 7 paired-transfer protocol
- Block 7 feature-generation validation plan
- Block 7 feature-gate decision
- Block 7 transfer-validation result
- Block 7 zero-shot hypothesis analysis
- Block 7 validation freeze and test entry
- Block 7 descriptive test result
- Block 7 transfer-gate decision
- Block 8 single-channel protocol
- Block 8 single-channel result
- Block 8 single-channel decision
- Block 8 raw-signal noise protocol
- Block 8 raw-signal noise result
- Block 8 raw-signal noise decision
- Block 8 train-only augmentation protocol
- Block 8 train-only augmentation result
- Block 8 train-only augmentation decision
- Block 8 cross-modality overlap protocol
- Block 8 cross-modality overlap result
- Block 8 cross-modality overlap decision
- Block 8 fixed alarm-fusion protocol
- Block 8 fixed alarm-fusion result
- Block 8 fixed alarm-fusion decision
- Block 8 closeout protocol
- Block 8 closeout result
- Block 8 closeout decision
- Block 8 evidence-strength protocol
- Block 8 evidence-strength result
- Block 8 evidence-strength decision
- Train-only LSTM-CRF protocol
- Train-only LSTM-CRF result
- Train-only LSTM-CRF decision
- Nested deep temporal protocol
- Nested deep temporal result
- Nested deep temporal decision
- Deep temporal error diagnostic
- Deep temporal error decision
- Quality-balanced LSTM-CRF protocol
- Quality-balanced LSTM-CRF result
- Quality-balanced LSTM-CRF decision
- Block 9 Sleep-EDF compatibility protocol
- Block 9 Sleep-EDF compatibility result
- Block 9 Sleep-EDF compatibility decision
- Paired enriched-feature protocol
- Paired enriched-feature result
- Paired enriched-feature decision
- Full-night risk-set protocol
- Full-night risk-set amendment
- Full-night risk-set result
- Alarm-budget sensitivity result
- Full-night risk-set decision
- Interval-aware protocol
- Interval-aware amendment
- Interval-aware result
- Interval-aware decision
- Causal bidirectional protocol
- Causal bidirectional result
- Causal bidirectional decision
- Causal endpoint-factorization protocol
- Causal endpoint-factorization result
- Causal endpoint-factorization decision
- Causal multiscale feature protocol
- Causal multiscale feature result
- Causal multiscale feature decision
- Multi-dataset use assessment
- Multi-dataset PSG protocol
- Multi-dataset PSG result
- Multi-dataset PSG decision
- Multi-dataset stage-first protocol
- Multi-dataset stage-first result
- Multi-dataset stage-first decision
- Current weekly record
- BOAS dataset manifest
- Label/preprocessing gate
- Block 6 baseline decision
| Path | Purpose |
|---|---|
docs/ |
Protocols, decisions, planning, audits, and weekly records |
experiments/ |
Immutable dated result packages and failure records |
labels/ |
Versioned derived labels, background windows, quality flags, and membership |
splits/ |
Frozen participant-grouped assignments and balance summaries |
scripts/ |
Small reproducible acquisition, validation, analysis, and audit scripts |
Raw EDF files, fitted models, full feature arrays, and full-night candidate-score artifacts are stored outside Git and referenced by manifests. Compact reviewed tabular predictions and labeled-row scores may be retained when they are needed to recompute published metrics; they contain public BOAS identifiers rather than direct personal identifiers.
BOAS does not contain sleep-paralysis episodes, narcolepsy diagnoses, treatment outcomes, or exact physiological transition times. This project can establish technical feasibility and failure modes for wearable REM-to-Wake measurement. It cannot establish diagnosis, clinical utility, prevention, or intervention effectiveness.