Automatic sleep staging labels each 30-second slice of an overnight brain recording as wake, one of three non-REM stages, or REM sleep. Models trained in one clinic lose accuracy in another. Two separate fixes exist, and no one has tested them together. The first is adversarial domain adaptation: the model is trained so that a second network, the "domain discriminator," cannot tell which dataset a feature came from. The second is bidirectional sequence modeling: a recurrent network reads the night both forwards and backwards, so the stage at each moment is judged using what came before and after it. This matters most for transitional stages such as N1 and REM. The obvious combination is to put a discriminator on the output of a bidirectional recurrent network. We argue that this is the wrong place to align. The bidirectional state at time $t$ summarizes the whole surrounding night, and the whole night carries real biological differences between cohorts. Older adults in the Sleep Heart Health Study sleep differently from the young volunteers in Sleep-EDF. They spend different amounts of time in each stage and switch between stages differently. A discriminator reading those states can detect these differences, and fooling it forces the model to erase exactly the temporal structure that makes bidirectional context useful.
The proposal is to separate the two kinds of shift and align each where it lives. Differences in hardware and sampling rate show up within a single 30-second epoch, so the epoch features are aligned without conditions. Sleep-architecture differences are real properties of the labels, so the bidirectional context states are aligned only conditioned on the predicted stage, which removes the discriminator's ability to exploit how often each stage occurs. Residual recurrent connections are identity shortcuts that carry each layer's input straight past the recurrent block. They are what make the split workable. Epoch-level alignment happens at the bottom of a residual stream, so the aligned features are directly readable by the classifier at the top. This placement also means the reversed adversarial gradients from the epoch discriminator never have to pass back through the stacked recurrent layers.
Core Claim
In cross-cohort sleep staging, adversarially aligning the fused forward–backward recurrent states causes negative transfer. The damage grows with how different the source and target cohorts' stage-transition statistics are. We claim that two changes together recover the benefit of both adaptation and bidirectional context, with gains concentrated on the N1 and REM stages: (a) unconditional alignment of epoch features at the base of an additive residual recurrent stack, and (b) stage-conditioned alignment of the context states. The method is secondary to the diagnosis. The key new result would be a measured dose–response relationship between transition-statistics mismatch and the harm done by aligning context states.
Grounding in Prior Work
Three sleep papers motivate the gap from different sides. ADAST adapts across Sleep-EDF, SHHS-1 and SHHS-2 using a convolutional epoch encoder, a gradient-reversal discriminator and dual-classifier self-training. It classifies each epoch in isolation, with no model of transitions. Chambon et al. use a residual convolutional encoder followed by a bidirectional GRU across five cohorts. They achieve generalization only by pooling labeled data, and report that N1 and Wake/N1/REM confusions persist. García Ciudad et al. show that bidirectional context is what resolves REM boundaries in mice, and that the gains plateau at about 28–44 seconds of context. That plateau constrains our choice of context length.
Two papers supply the adaptation machinery and constrain the design. VRADA applies domain-adversarial training to a causal variational recurrent network for ICU time series. It aligns a single causal summary and never faces the question of which direction or which layer to align. ALIGN finds that aligning intermediate layers of a neural speech decoder keeps task information while removing session noise. That finding supports placing alignment below the top layer. ALIGN uses causal GRU and Transformer decoders, not bidirectional residual stacks.
The residual-recurrent literature supplies the backbone. Prakash et al. add identity shortcuts between stacked LSTM layers at zero parameter cost. DC-Bi-LSTM uses concatenative shortcuts to train bidirectional stacks up to 20 layers. DeepVar shows that residual BiLSTM stacks train well on small corpora. None of these three considers domain shift. ARTN is a cautionary note: adversarial training on static features needed an optimal-transport regularizer to avoid degenerate optima. We therefore treat training stability as something to measure, not assume. Despite its name, BiAT is "bidirectional" only in the sense of perturbing inputs from source to target and back, on image CNNs. It is not a close precedent.
Research Program
The model has three parts. A convolutional encoder, matched to ADAST's so that comparisons are fair, maps each epoch to a feature $e_t$. Next comes a stack of $L$ bidirectional GRU layers with additive residual shortcuts, $h^l_t = \mathrm{BiGRU}_l(h^{l-1}_t) + h^{l-1}_t$ with $h^0_t = e_t$. The input is a window of $K$ consecutive epochs. A per-epoch stage classifier sits on top. Training minimizes
$$\mathcal{L} = \mathcal{L}_{\text{cls}}^{S} \;-\; \lambda_0\, \mathcal{L}_{D_0}(e_t) \;-\; \lambda_c \sum_{c} \mathcal{L}_{D_c}\big(h^{L}_t \mid \hat{y}_t = c\big).$$
Here $\mathcal{L}_{\text{cls}}^{S}$ is cross-entropy on labeled source epochs. $D_0$ is an unconditional source-versus-target discriminator on epoch features. $D_c$ is a discriminator that sees only the top-layer context states of epochs predicted as stage $c$. $\hat{y}_t$ is the true label on source and a confidence-filtered pseudo-label on target. $\lambda_0$ and $\lambda_c$ weight the gradient-reversal terms. Because $D_c$ compares like with like, it cannot win by noticing that one cohort has more REM or longer N2 runs.
The analysis has three parts. First, we measure the source–target mismatch in stage-transition matrices for each adaptation pair. This uses target labels for evaluation only. We then correlate that mismatch with the accuracy change produced by naive fused-state alignment. Second, we compare gradient norms and training stability when the discriminator's reversed gradients enter at the top of the residual stack versus at its base. This directly tests the concern that identity shortcuts pass adversarial signals downward without attenuation. Third, we align the forward and backward streams with separate discriminators, to test whether the backward stream, which carries future context, is the one leaking architecture differences.
Baselines
The naive reference point is the same residual bidirectional stack trained on source labels only, with no discriminator. It shows how much of any gain comes from sequence context alone. For the isolated-epoch setting, ADAST reports a source-only average of 63.72% across the six scenarios (ADAST). We will also rerun source-only with our encoder.
The strongest existing method is ADAST itself. It reports 74.00% average cross-domain accuracy and 60.39 macro-F1 across the six Sleep-EDF/SHHS-1/SHHS-2 scenarios (ADAST). It is the strongest competitor because it is tuned for exactly these pairs and already adds self-training on top of adversarial alignment. We will use its released preprocessing (all signals resampled to 100 Hz, single EEG channel), its subject splits and its epoch encoder. For both methods, hyperparameters will be chosen by one fixed protocol that uses no target labels: source validation loss plus a discriminator-accuracy criterion, with the same number of tuning trials. Beating ADAST means exceeding both 74.00% accuracy and 60.39 macro-F1 on average. We also require improvements on N1 and REM F1 in at least four of the six scenarios, because that is where our mechanism predicts gains.
The most important ablation is "the obvious combination": the same residual bidirectional stack with one unconditional discriminator on the fused top-layer state. If our claim is right, it should beat source-only on pairs with similar transition statistics and fall behind it on dissimilar pairs. The remaining ablations each isolate one ingredient. We keep only $D_0$, keep only the conditioned $D_c$, remove the residual shortcuts, swap additive for concatenative shortcuts as in DC-Bi-LSTM, and use a causal (forward-only) stack.
Why not just…?
Why not just pool more labeled cohorts, as Chambon et al. did? Pooling works when labels exist across many sites. Chambon et al. report 0.869 accuracy and κ of 0.799 when training on 15,684 recordings. Our setting has an unlabeled target cohort, where the relevant comparison is source-only against adaptation, which ADAST reports as 63.72% versus 74.00%. On their own data, pooling still left systematic N1 errors. Pooling is complementary, not a substitute. As a secondary run, we will pool two labeled sources and adapt to the third to check that adaptation still adds value on top.
Why not just train ADAST's aligned encoder and then fit a bidirectional GRU on top? This is the most serious threat. It already aligns at the epoch level and adds context afterwards. We include it as a baseline. If it matches our full model, the honest conclusion is that stage-conditioned context alignment adds nothing and epoch-level alignment is enough. The diagnostic finding about fused-state alignment would still stand. We expect it to fall short only on target cohorts with a different architecture of sleep, where an unaligned context layer trained on source transitions misfires. The transition-resampling experiment below tests exactly that.
Why not just use a causal recurrent model or a shallow one? A causal model would avoid the future-context leak entirely. However, bidirectional context is specifically what resolves REM boundaries (García Ciudad et al.), and removing bidirectionality cost 1–2% in the multi-view setting of Xu et al.. A shallow stack avoids the question of gradients flowing through deep layers, but DeepVar and DC-Bi-LSTM found gains from depth once shortcuts were present. Both options appear in our ablation grid. If a one-layer stack matches, we will report that residual depth is unnecessary here.
Why not just replace the discriminator with a statistical distance such as maximum mean discrepancy? Non-adversarial alignment did well for EEG emotion transfer (Fordson et al.), and it would sidestep the instability ARTN reports. The conditioning argument applies equally to distance-based alignment, so we will run a stage-conditioned distance variant at both placements. No reported result was found on Lacuna for distance-based alignment on the Sleep-EDF/SHHS scenarios, so this is an open comparison, not a settled one.
Decisive Experiments
The main test uses the six ADAST scenarios, with the context window set to about 5–15 epochs following the plateau reported by García Ciudad et al.. We report accuracy, macro-F1, Cohen's κ, and per-stage F1 for N1 and REM, over five seeds.
The experiment that most directly tests the claim is a controlled transition shift. We rebuild target nights by resampling runs of labeled epochs to lengthen or shorten REM and N2 bouts. Each epoch's signal is left unchanged, so acquisition shift stays fixed while the transition statistics change by a controlled amount. The core claim is falsified if fused-state alignment does not degrade monotonically as this mismatch grows, or if the stage-conditioned model degrades just as much.
A secondary cross-laboratory transfer between the mouse cohorts of García Ciudad et al. tests a stronger version of architecture shift. Mouse cycles are about 10 minutes long, far from the human pattern, although that paper reports no adaptation baseline. Finally, we log the ratio of discriminator-gradient norm to classifier-gradient norm at each residual layer for the top-placed and bottom-placed discriminators. This checks whether the stability argument for aligning at the base of the stack holds in practice.
References
- Adversarial Domain Adaptation with Self-Training for EEG-based Sleep Stage Classification
- Automatic sleep stage classification with deep residual networks in a mixed-cohort setting
- Evaluating the Influence of Temporal Context on Automatic Mouse Sleep Staging through the Application of Human Models
- Variational Recurrent Adversarial Deep Domain Adaptation
- ALIGN: Adversarial Learning for Generalizable Speech Neuroprosthesis
- Neural Paraphrase Generation with Stacked Residual LSTM Networks
- Densely Connected Bidirectional LSTM with Applications to Sentence Classification
- DeepVar: An End-to-End Deep Learning Approach for Genomic Variant Recognition in Biomedical Literature
- Unsupervised Domain Adaptation With Adversarial Residual Transform Networks
- Bidirectional Adversarial Training for Semi-Supervised Domain Adaptation
- Deeply Exploiting Long-Term View Dependency for 3D Shape Recognition
- Not All Electrode Channels Are Needed: Knowledge Transfer From Only Stimulated Brain Regions for EEG Emotion Recognition