RAGSleepNet: Dual-Store Retrieval for Evidence-Grounded Sleep Staging from Single-Channel EEG
Main Article Content
Abstract
Automatic sleep stage classification now approaches expert agreement on single channel electroencephalography, yet the resulting decisions remain opaque and cannot be audited against the rules clinicians apply. This work introduces RAGSleepNet, a retrieval augmented and explainable staging framework in which every decision is produced together with the evidence supporting it. A dual scale convolutional encoder followed by a transformer context encoder maps each 30 s epoch, with its twenty surrounding epochs, into a contextual query. The query addresses two retrieval branches: a non parametric exemplar memory holding embeddings of all scored training epochs, and a store of 12 clinical knowledge cards whose predicates are soft functions of 17 interpretable descriptors derived from American Academy of Sleep Medicine criteria. A gating network estimates how far the parametric head, the retrieved exemplars and the cards should be trusted for each epoch, and the three posteriors are combined in a log linear mixture. Subject independent five fold cross validation on 39 nights from 20 subjects of the Sleep-EDF Expanded database, comprising 42,307 scored epochs, yields 82.44 percent accuracy, 75.14 percent macro F1 and a Cohen kappa of 0.7588. Band stop probing shows that removing the frequency support cited by the card lowers the posterior of the predicted stage by 0.271, against 0.066 for a random band, confirming that the explanations are faithful.
