Predicting the loss of responsiveness when falling asleep in humans

Falling asleep is a dynamical process that is poorly defined. The period preceding sleep, characterized by the progressive alteration of behavioral responses to the environment, which may last several minutes, has no electrophysiological definition, and is embedded in the first stage of sleep (N1). We aimed at better characterizing this drowsiness period looking for neurophysiological predictors of responsiveness using electro and magnetoencephalography. Healthy participants were recorded when falling asleep, while they were presented with continuous auditory stimulations and asked to respond to deviant sounds. We analysed brain responses to sounds and markers of ongoing activity, such as information and connectivity measures, in relation to rapid fluctuations of brain rhythms observed at brain onset and participants' capabilities to respond. Results reveal a drowsiness period distinct from wakefulness and sleep, from alpha rhythms to the first sleep spindles, characterized by diverse and transient brain states that come on and off at the scale of a few seconds and closely reflects, mainly through neural processes in alpha and theta bands, decreasing probabilities to be responsive to external stimuli. Results also show that the global P300 was only present in responsive trials, regardless of vigilance states. A better consideration of the drowsiness period through a formalized classification and its specific brain markers such as described here should lead to significant advances in vigilance assessment in the future, in medicine and ecological environments.


Introduction
Falling asleep is a dynamical process characterized by blurred perceptions, hypnagogic hallucinations, and decreased responsiveness to the environment ( Casagrande et al., 1997 ;Foulkes and Vogel, 1965 ;Ogilvie et al., 1989 ;Yang et al., 2010 ). This drowsiness period may last several minutes before entering in effective sleep, defined behaviourally as the moment when subjects cease to be responsive. At the electrophysiological level, brain activity changes from rapid wakefulness rhythms to slower ones, and to the occurrence of phasic events specific to sleep, such as K-complexes and sleep spindles. Yet, the precise time course of responsiveness fading during this wake-sleep transition and the corresponding electrophysiological markers remain unknown. Figure 1. Experimental Design. A. Experimental paradigm. Auditory sequences of 5 sounds were presented with local and global deviancies, defined respectively as sequences with a deviant 5 th sound (sound B), and rare sequences presented 20% of time (in red). B. Hori stages (labelled with H) of drowsiness and their simplified version (labelled with D). Ongoing brain activity (power spectrum density, permutation entropy, weighted symbolic mutual information) and response to local and global deviancy were recorded with electro-and magnetoencephalography during wakefulness, drowsiness and sleep. who were still responding kept exhibiting a P300, a brain response associated with predictive coding and consciousness ( Bekinschtein et al., 2009 ;Dehaene and Changeux, 2011 ;Wacongne et al., 2011 ), while those who were not responding did not exhibit any P300. There were then clear-cut differences in behavioural and brain responses to external stimulations within this same stage of N1 sleep, raising the question of the real electrophysiological markers of sleep onset. Improving our knowledge of those markers seems critical in order to properly assess vigilance and related cognitive and behavioural states, whether it be in the fields of medicine, research or public health, such as in the evaluation of drowsiness while driving or operating machinery.
Such a fuzziness in behavioural and brain responses observed in N1 sleep is largely favoured by the large time window used for sleep scoring (typically 30 sec.), which necessarily leads to the averaging of multiple brain activities, and implies that what is called N1 sleep (and preceding wakefulness) is likely to include periods of wakefulness, drowsiness and sleep. Indeed, N1 sleep may regroup within the same 30 sec. epoch alpha rhythms, alpha suppression with a flattening of the signal, theta rhythms, and grapho-elements such as vertex sharp waves or incomplete sleep spindles. The presence of those different electroencephalographic (EEG) patterns before entering N2 sleep, when occur the first sleep spindle or K-Complex, has already been described a few decades ago (Gibbs and Gibbs, 1950 ;Hori, 1991 ;Santamaria and Chiappa, 1987 ). Hori and colleagues ( Hori, 1991 ;Hori et al., 1994 ) developed a 5 seconds-epoch classification of drowsiness based on the different EEG patterns ( figure 1. B), enabling to better reflect the rapid rhythm modifications that occur during the wake-sleep transition. They showed that both hypnagogic perceptions and reaction times evolved in correlation with these successive EEG modifications. More recently, alpha suppression and the occurrence of theta rhythms have been associated with decreased brain connectivity ( Noreika et al., 2020 ) and modifications in conscious threshold ( Noreika et al., 2017 ), and the theta-alpha ratio was shown to discriminate non-responsive periods in deep drowsiness from responsive wakefulness ( Comsa et al., 2018 ).
We then propose here to go further in the definition of sleep onset, in specifying the time-course of responsiveness fading in association with physiological markers, and trying to extract the physiological predictors of responsiveness at each given time. We re-analysed the wake-sleep transition of our above-mentioned study ( Strauss et al., 2015 ) taking advantage of the detailed Hori classification ( Hori et al., 1994 ) and its simplified version ( Nittono et al., 2001 ) ( figure 1. B), and extracted related markers of ongoing activity reflecting information and connectivity in the brain ( Denis A. Sitt et al., 2014 ) and eventrelated responses (ERFs) to stimuli. We used machine learning methods to extract the predictors of responsiveness. We demonstrate here the existence of a period of drowsiness distinct from wakefulness and sleep, characterized by transient brain states that come on and off at the scale of a few seconds and where brain activity and long-distance communication in specific frequency bands, especially the alpha band, are the best predictors of responsiveness.

Procedure
The current paper is a reanalysis of data described in Strauss et al. (2015) . Subjects were recorded in magneto-and electroencephalography (M/EEG) in wakefulness and sleep during a morning nap, after a night of sleep restriction (4h of sleep, controlled by actimetry -Actiwatch 7, Sleepwatch software 7.5 CamNtech).

Stimulation
Stimuli were pairs (AB) of phonetically distant French vowels (100 ms duration). Each pair was used to form 2 types of blocks with 100 sequences of 5 vowels (150ms stimulus onset asynchrony (SOA) between vowels). Sequences were separated by silent gaps of variable duration (700 to 1000ms inter-trial interval (ITI), 50ms steps) . In one block type (aa), the 5 vowels within the sequence were identical (aaaaa, 'local standard' sequence, LS) in the 10 first sequences of habituation and then in 80% of the sequences of the block, defining then the 'global standard' (GS) sequence (cf figure 1. B). In the 20% remaining sequences ('global deviants', GD), the 5 th vowel differed from the 4 first ones (aaaa B , 'local deviant', LD). In the other block type (a B ), reversely 'local deviant' sequences were used as 'global standards', and 'local standards' sequences as 'global deviants'. The global effect was then computed contrasting the global deviant sequences to the global standard ones, and the local effect contrasting the local deviant sequences to the local standard ones. Each type of blocks was repeated twice in order to counterbalance vowels.
Auditory sequences were presented during sleep and during wakefulness before and after the nap. To monitor responsiveness to the environment, subjects were asked to give a motor response whenever they heard a global deviant (in pressing a button, hand was balanced across subjects), and to try to continue responding even as they were falling asleep during the sleep session. As we asked subjects to respond as soon as they were aware of deviant sounds, responsiveness and consciousness were confounded in this study. We confirmed this association in showing that the M/EEG global effect (P300) was not present in non-responsive trials (cf figure 3 .). Importantly, we controlled in a previous publication ( Strauss et al., 2015 ) that the presence of the P300 was associated with conscious detection and not only with motor responses by asking subjects not to respond but to be attentive to GD sequences in half of the blocks during wakefulness. We confirmed that a P300 was still elicited after global deviant sequences in those no-report but attentive blocks.

Subjects
31 healthy right-handed subjects and good sleepers between 18 and 35 years old were recruited on a voluntary basis after giving written informed consent. The study was approved by the Ethical Committee Ile de France VII (Comité de Protection des Personnes 08-021). They had no history of neurological, psychiatric or sleep disorders, and were refrained to use stimulating beverages (coffee, tea, energy drinks) in the 24h before the experiment. Only subjects who correctly applied the motor detection task when falling asleep and who had enough N1 trials to extract a clear auditory event-related field were kept for analysis (N = 15). Those reporting having stopped on purpose to respond to global deviant sequences in order to fall asleep were rejected (for detailed sleep parameters see table S1). We then excluded one of the remaining subjects because of the absence of alpha rhythms during eyes-closed calm wakefulness (which is the case in about 10% of the general population ( Santamaria and Chiappa, 1987 )), which prevented to score the Hori stages before the occurrence of theta waves.

Simultaneous M/EEG Recording
MEG and EEG signals were simultaneously recorded with the Elekta Neuromag system in supine position (204 planar gradiometers and 102 magnetometers) and its built-in EEG system (60 channels, referenced to an additional nose electrode). Electrocardiogram (ECG), electrooculogram (EOG) (horizontal and vertical) and chin electromyogram (EMG) were recorded as auxiliary bipolar channels. During the acquisition the signal was low-pass filtered at 330 Hz, high-pass filtered at 0.1 Hz and sampled at 1 KHz. EEG, EOG and EMG signals were used to monitor sleep stages on-line. The head position in the MEG sensor array was continuously acquired during each block thanks to four head-position indicator coils attached to the scalp and previously digitized with respect to three anatomical landmarks (nasion and preauricular points, Polhemus Isotrak system).

Sleep Onset Analysis
Wakefulness and sleep stages were scored off-line (Noxturnal software, v.4.4.2) on EEG, EOG and EMG signals by a sleep expert according to both the reference 30s-epoch sleep classification (American Academy of Sleep Medicine and Iber, 2007 ) and the Hori scale of drowsiness ( Hori et al., 1994 ), based on epochs of 5 sec. ( fig. 1. A). We also defined different sub-stages within N2 sleep: in addition to the Hori stage 9 (H9), that we scored as epochs containing the first sleep spindles in the first 15 s. of N2 sleep, we separated the 'early-N2' from the consolidated or 'late-N2', with epochs respectively in the first 5 minutes of N2 or later. We also differentiated epochs with sleep spindles, K-complexes or slow waves in addition to the theta background, which were manually detected.
The time spent in each Hori stage were not similar and some of them were only poorly represented ( Tanaka et al., 1996 ) (ex: H6 to H8, cf fig. 1. C). In order to increase the number of trials per condition and to be able to compute event related fields (ERFs), we used a simplified drowsiness (D) classification regrouping some of the Hori stages with similar EEG activity, thus ending up with only 4 D stages (see also ( Nittono et al., 2001 )). Epochs containing alpha rhythms (H1 to H3) were grouped in D1. Epochs with flattening of the signal (H4) and theta waves (H5) were kept apart in D2 and D3. Epochs with sharp waves or incomplete spindles (H6, H7 and H8) were grouped in D4.

Behaviour
Statistical analysis for response rates and reaction times were performed with Kruskal-Wallis ANOVA tests for comparison across multiple stages, and with paired Wilcoxon sign rank tests for comparison between two stages.

MEG preprocessing
Signal analyses are only reported on MEG data considering its much higher number of sensors, better source localization and signal-to-noise ratio compared to EEG. Data were preprocessed with successively signal space separation correction, continuous head movement compensation and bad channels correction (MaxFilter, Elekta Neuromag). Signal was then down-sampled (250Hz), filtered (0.3-80Hz) and epoched from -200 to 1450ms around the sequence onset. Bad trials were visually detected and excluded.

Event Related Fields (ERFs)
ERFs for local and global effects were computed for each drowsiness stage with subjects presenting at least 10 trials in the considered stage. Statistical analyses were performed with cluster permutation tests corrected for multiple comparisons over time and sensor space for each type of sensors (magnetometers and gradiometers, with Fieldtrip, Monte-Carlo method, 1000 permutations). Search windows were defined between 0 and 400ms after the 5 th deviant sound for the local mismatch effect (MMN time window) and between 48 and 700ms for the global effect (P300 time window). For simplicity and based on Strauss et al. (2015) , we report topographies, time series and statistical analyses conducted on one type of MEG sensors (gradiometers oriented on the dy axis). If several clusters were significant for the same effect, we reported the time of the significant time-window over the different clusters, and the p-value and effect size (Cohen's d) of the biggest cluster (see SI table S3 for complete results with all clusters and sensor types). Based on previous MEG studies using the same paradigm ( Bekinschtein et al., 2009 ;Wacongne et al., 2011 ;Strauss et al., 2015 ), a sensor lying next to the auditory cortex and lateralized to the left hemisphere was selected to display MEG time series for local and global effects. ERFs amplitude analysis are performed on the average of 4 sensors in the left temporal area.

Measures of ongoing brain activity
To assess ongoing brain activity, we computed three classes of measures based on oscillations: 1) spectral power, comprising raw and normalized Power Spectral Density (PSD), Median Spectral Frequency (MSF), spectral edge 90 (SEF90), spectral edge 95 (SEF95) and the theta/alpha ratio, 2) metrics quantifying the information content of the MEG signal, comprising Spectral Entropy (SE), Kolmogorov-Chaitin complexity (K) and Permutation Entropy (PE; ( Bandt and Pompe, 2002 )) and 3) functional connectivity measures, including Symbolic Mutual Information (SMI) and weighted Symbolic Mutual Information (wSMI) ( King et al., 2013 ), that quantify the amount of information shared between distant sensors. PSD markers were computed in delta (1-4), theta (4-8Hz) alpha (8-12Hz), beta (12-30Hz), gamma (30-60Hz) and high gamma (60-80Hz) bands. PE was computed in theta, alpha, beta and gamma. SMI and wSMI were computed in theta and alpha bands. All markers were computed for each epoch and channel, using the interval between the baseline and 600 ms (the onset of the last stimulus).
PSD was computed using the welch method ( Welch, 1967 ), dividing the signal into segments of 512 ms, with 400ms overlap between segments. Segments were windowed using a Hanning window and zero padded to 4096 samples. The power in each band was computed by integrating the power within the band.
Kolmogorov-Chaitin complexity was computed by compressing a discretization of the signal using a histogram approach with 32 bins. Permutation Entropy was obtained by computing the entropy of a symbolic transformation of the signals ( King et al., 2013 ). SMI and wSMI is then computed from the same symbolic transformation, but data was first filtered using Current Source Density estimates ( Kayser and Tenke, 2006 ) to diminish the volume conduction.
Subject's markers were computed by averaging across sensors (mean) and epochs (80% trimmed mean) for each of the Hori stages. For the connectivity metrics, each sensor's connectivity was estimated as the median connectivity to all other sensors. Group statistics were calculated using Page's L test for multiple comparisons between ordered correlated variables ( Page, 1963 ).

Decoding
To relate the ongoing brain activity to the subjects' responsiveness, we employed a multivariate decoding approach. We computed each of the previously described markers and averaged across sensors, obtaining 26 values for each epoch. As predictive model, we used an Extremely Randomized Trees classifier (ET) ( Geurts et al., 2006 ). We used the Area Under the Receiver-Operator Characteristic curve (ROC-AUC) as the performance metric. To assess its variability, we used repeated (10) stratified 10-fold cross-validation (when training and testing in the same stage) and the percentile bootstrap approach ( Efron and Tibshirani, 1994 ) repeated 1000 times (for training and testing in different stages). In each of the bootstrap repetitions, we randomly subsampled each subject's data independently, maintaining the same number of responsive and unresponsive epochs. Each time we trained the ET classifier, we also trained a 'dummy' classifier to obtain the empirical chance level of the training samples distribution. This type of classifier generates predictions based on the distribution of training samples for each class without accounting for the features. Finally, we computed the differences between the ET and the empirical chance level estimation for each test case and computed the 2.5 and 97.5 percentiles of the distribution to test if the model's predictive capacity was above chance level as equivalent to p < 0.05 ( Tan, 2010 ).

Software and Data
MEG data was preprocessed with Fieldtrip ( Oostenveld et al., 2011 ). Markers were computed using NICE ( Denis  and MNE-Python ( Gramfort et al., 2013 ). Decoding was computed using scikit-learn ( Abraham et al., 2014 ;Pedregosa et al., 2012 ;). All scripts used for the analysis after pre-processing the data are available at https://github.com/fraimondo/lg _ sleep _ paper . Raw and epoched MEG data are subject to the data privacy, ethics requirements and informed consents signed by the participants at the moment of acquisition. It can be shared upon reasonable request to authors and with a formal data sharing agreement. The MEG-extracted markers for the analysis are available from figshare with the DOI: 10.6084/m9.figshare.14039315.

Behaviour
Subjects were continuously presented during wakefulness and the transition to sleep with sequences of five sounds (local-global paradigm, see figure 1. A) embedding local (low-level, within sequences) and global (high-level, between sequences) violations of regularities. They were asked to give a motor response to global deviancies as soon as they were aware of them, until they fell asleep.
Behavioural results relative to drowsiness classifications ( figure 1. B) are presented in figure 2 and table S2. All subjects emitted motor responses to global deviant sequences in wakefulness and in the first drowsiness stages, when alpha rhythms were present (Awake and H1-H3/D1: 100%). Then, during the descent to sleep, we observed a progressive decrease in the number of responsive subjects, with a clear drop coinciding with the occurrence of sharp waves (from 85.7% in H5/D3 to 28.6% in H6/D4). In the first few minutes of N2 sleep, few subjects were still responding (H9 and early-N2: 14.3%), but no subject continued to respond during consolidated N2 sleep (late-N2). The motor response rate to global deviants, computed over all the subjects, also decreased with drowsiness depth (Page's L = 1159, p < 1e-15, see table S2), with an important decrease coinciding with the occurrence of theta waves (from H4/D2: 38.8% to H5/D3: 13.1%). In parallel, reaction times increased (Page's L = 325, p = 0.006).
Note that this analysis of the local effect combined responsive and non-responsive trials, while the MEG-MMR may behave differently depending on responsive states. The decrease in amplitude with drowsiness could be explained by an absence of MMR in non-responsive trials, whose number increases with drowsiness depth. We therefore computed the local effect only in blocks where responsiveness could be monitored (when local deviants are also global deviants, aaaaa/aaaaB blocks, see figure S1). Indeed, we found that the amplitude of the MMR peak was significantly modulated by the responsive state, with significant effects only in the responsive conditions and not in non-responsive conditions, and with significant increased amplitude of the MMR peak within the same drowsiness stage in the responsive compared to the non-responsive condition (for example in D1, p = 0.035). Within a given responsive state, the MMR peak was actually only slightly modulated by vigilance.

Global effect
The global effect was analysed comparing brain responses elicited by standard and deviant (rare) sequences, an effect known to be associated with the P300 in EEG ( Bekinschtein et al., 2009 ;Wacongne et al., 2011 ;Strauss et al., 2015 ). Data were split according to the subject's responsiveness to global deviant sequences ( figure 3 ), which was, critically, reflecting the presence or absence of awareness of those sequences. The global effect when subjects were responsive could be computed only until D3, since too few sequences were detected after this stage to compute an ERF ( < 10 trials per subject and condition). Until D3, a significant global effect was found in all stages (Awake: 140-900ms, p = 0.003, d = 2.61, n = 14; D1: 144-900ms, p = 0.001, d = 2.10, n = 14; D2: 188-584ms, When falling asleep, both the number of subjects responding and the response rate per subject decrease, and reaction times increase. Responses are no longer emitted in consolidated N2 sleep (after the first 5 minutes of N2 -late N2 Sleep) and in epochs containing spindles or K-complexes (Sp/KC). Error bars represent standard error to the mean (sem). p = 0.006, d = 3.69, n = 7; D3: 128-192ms, p = 0.035, d = 5.02, n = 5). The effect started over bilateral temporal areas and spread to anterior areas in later latencies ( > 350ms). This late anterior effect was shortened through drowsiness stages and failed to reach significance in D3. Of note, the more advanced stages of drowsiness were also associated with a decreased statistical power, with fewer subjects and trials in each condition, and a lower signal to noise ratio, especially in D3, characterized by an increase in physiological noise with slower rhythms of larger amplitude (for example, the same global effect analysis repeated 10 times on subsampled data of 5 randomly different subjects from wakefulness to D2 retrieve non-significant results 3 times in wakefulness, 5 times in D1 and 1 time in D2). Contrary to the responsive condition, no global, P300 effect was detected in the non-responsive condition, whatever the vigilance stage (Awake: n = 4, D1: n = 14, D2: n = 11, D3: n = 14, D4: n = 12, N2: n = 13, NS).

Information and connectivity decreases accompanying drowsiness
To assess ongoing brain activity in the wake-sleep transition, we computed for each subject on each vigilance stage 26 markers across frequency bands, encompassing three classes of measures: spectral power, information metrics and functional connectivity measures. We first considered the signal during constant stimuli between the onsets of the 1 st and the 5 th sounds (before the deviant sound). In line with the visual classification, Power Spectral Density (PSD) measures significantly and progressively decreased in alpha band from wakefulness to N2 ( figure 4 bottom; Page's L trend test = 3794, p < 1e-14) but increased in theta band (Page's L = 3766.0, p < 1e-14, figure 4 ; top). However, information (PE) and connectivity (wSMI) significantly decreased in both frequency bands across Hori stages (alpha: L = 3989, p < 1e-14 for PE, L = 4002, p < 1e-14 for wSMI; theta: L = 3963, p < 1e-14 and L = 3755, p < 1e-14 re-spectively), pointing towards a general loss of integrated information and more local processes. An alternative visualization can be found in Figure S2, comparing the absolute change in the markers value between each of the Hori stages and wakefulness.
Similar results were obtained when considering the neural responses after the deviant sound (see supplementary figure S3). The theta/alpha ratio, which has been proposed as a marker of drowsiness and a predictor of responsiveness ( Comsa et al., 2018 ), also presented a significant positive trend (L = 3983, p < 1e-14; see supplementary figure S4). For additional spatial information, see figure S5.

Responsiveness is driven by the ongoing brain state
We then tested if responsiveness during these vigilance stages could be related to the overall ongoing brain state. We evaluated the capacity to distinguish the responsive (MR + ) from non-responsive (MR-) trials on a trial-by-trial basis, based on the MEG markers computed just before the global deviant stimuli (between the onsets of the 1 st and the 5 th sounds). To this aim, we trained Extremely Randomized Trees classifiers (ET) to distinguish between markers computed during trials where the subject did respond (MR + ) and trials where the subjects' response was absent (MR-). We first measured the ROC-AUC using cross-validation on separate classifiers trained with data from single drowsiness stages. We found above chance classification in every stage, namely AUC H5. Furthermore, we tested if a model trained in one Hori stage could also decode responsiveness in the other stages. Overall, we found that models trained in the awake state were able to achieve higher performance in decoding responsiveness in states of lower vigilance (H3 to Figure 3. Event Related Fields to auditory deviancies. A. The MEG-Mismatch response (the prediction error signal) peaks at around 160 ms after deviant sound (vertical line on time series, time of topographies) in wakefulness and progressively decreases through drowsiness stages. It fails to reach significance from the occurrence of theta waves (D3). At the contrary, earlier and later effects, that reflect adaptation processes, are preserved in drowsiness and sleep. B. The P300 is present in the responsive but not in the non-responsive condition, whatever the vigilance state. Significant clusters are shown ( x p < 0.05, * p < 0.01) on topographies (t = 350ms) with green lines on time series for significant effects in the left temporal sensor (p < 0.05).
H5), a model trained in H1 was only able to decode responsiveness in wakefulness, a model trained in H2 was capable of decoding responsiveness in states of lower vigilance and H3 to H5 presented similar decoding capabilities between them. Results are summarized in figure 5 and Table S4. Additionally, we tested the models using the markers computed on the signals after the global deviant stimuli. We obtained lower AUC values and less generalizable models with higher variability (see supplementary figure S6 and table S5).
Finally, to test for the existence of a common pattern able to predict responsiveness across all stages, we used a single model trained on data encompassing wakefulness and H1 to H5. We employed the same methodology, but keeping data balanced across stages for each bootstrap repetition. None of the models presented higher accuracy than any of the stage-specific models, neither with the pre-stimulus nor the poststimulus data (see supplementary figure S7). Indeed, only the model using the post-stimulus data presented a confidence interval above chance level, implicating that creating general models encompassing all stages are not possible with the hereby employed markers and data.
The uni-directional transfer of decoding means that the best decoder for a given Hori stage is also capable of decoding in other stage. Given the hereby employed markers, it means that at a given stage, the interaction between spectral, information and connectivity markers that best predict responsiveness are indeed also capable of doing so in another stage, indicating a common pattern that is present in both stages. On the other hand, failure to transfer decoding means that the neural signatures that best decode responsiveness on a given stage are not present in the other stage. While this proves that there are distinctive patterns, it cannot be used to conclude that there are no common patterns. Furthermore, in case of set of stages with bi-directional transfer, as for the decoders for H3, H4 and H5, one could argue that this is due to the fact that this stages are, in terms of markers, equal. To further test if these predictive models were indeed capturing common patterns across distinct Hori stages or the Hori stages were simply not distinct, we employed the same methodology, but now using the decoder to predict the stages instead of the motor responses. We found above chance-level classification performance across all Hori stages when considering only responsive, non-responsive, or both conditions mixed, meaning that Hori stages were indeed distinct in terms of information and connectivity markers. Results are summarized in table S6, S7 and S8. Additionally, by inspecting the predictive models that learned to distinguish MR + from MR-, we can obtain a quantification of the involvement of each electrophysiological marker for the classification. This metric, named feature importance, can be interpreted as the mutual information between the marker and the outcome label, conditional to the rest of the markers. The results, summarized in figure 5 , indicate that the results obtained in terms of transfer learning (i.e. decoding across Hori stages) reflect the fact that the same markers are ranked as highly important in all stages. In particular, PE , Theta/Alpha ratio and normalized delta share highly ranked positions in most of the stages. H1, on the other hand, presents a distinctive signature in terms of importance, which might be the reason why a model train in this stage is not capable of decoding responsiveness in other stages.

Whole-brain vs modular processes?
While markers of ongoing brain activity are able to distinguish responsiveness within and across Hori stages, we then tested if they were reflecting overall whole-brain processes or were consequences of highly spatially-specific processes. We performed a non-parametric statistical test on the contrasts between MR + and MR-within each Hori stage. The obtained results, summarized in table S9, indicate that not all of the important markers present statistically significant differences. For example, gamma power is ranked second in importance for H4, but the cluster test indicates a p-value of 0.265. Precisely, these results indicate that the interactions among markers is a key element that allows the distinction of vigilance stages. Furthermore, a closer analysis on the location of these differences between MR + and MR-trials, depicts the presence of spatially specific patterns of activity. Particularly, differences in mark-ers of spectral power and information are located in posterior regions of the scalp (see figure S8).
Although connectivity was not included among the relevant markers for decoding responsiveness, it is important to analyse connectivity separately. Obtaining a single value of connectivity across all pair of scalp sensors might not disclose specific networks of information sharing across the brain. An appropriate analysis of connectivity markers indicates that both wSMI and wSMI show significant differences modulated by the Hori stage, responsiveness and the interaction between them (see table S10 for ANOVA results). Post-hoc tests showed significant differences in connectivity in theta band (wSMI ) between frontal, temporal and parietal regions, only for the H6 to 8 stage (and in a lesser extend in H3 and H4, figure 6 , top). No particular connections were deemed informative in H1, H2 and H5 or in alpha band ( figure 6 , bottom), suggesting that information sharing mechanisms in these stages are highly specific and not captured by the employed metric or an interaction between markers that were captured only by the decoding models. Note however that the same analysis using the Drowsiness stages retrieved significant differences in connectivity within the alpha band in the D1 stage (grouping H1 to H3), in posterior regions ( Figure S9). Overall, these results suggest that different regional processes occur in the different drowsiness stages to predict responsiveness.

Discussion
Falling asleep is not an on-off mechanism, nor a gradual incursion of a unique process leading to sleep. Our results highlight the existence of a drowsiness period in the transition to sleep, where the probability to be responsive to the environment decreases in a stepwise manner, from alpha rhythms to the firsts sleep spindles. This drowsiness period is char- Figure 5. Responsiveness during Hori stages can be decoded from the ongoing brain state prior to the stimuli. The top figure depicts the ROC-AUC values distribution by training and testing set. Each dot represented the ROC-AUC value for one cross-validation iteration in the case of within-stage decoding and one bootstrap iteration in the case of cross-stage decoding. Boxplots depict the median, inter-quartile ranges and 95% confidence intervals. The middle figure depicts the difference between the respective predictive models and a dummy classifier which predicts based on the number of training samples from each class, without considering the markers. The positive lower bound of the confidence intervals indicate that the predictive models ROC-AUC are statistically significant above chance level. The bottom figure reveals which electrophysiological markers are most important for the prediction of responsiveness across the different drowsiness stages . Each plot depicts the rank (top 6) of mean feature importance in the decoding of responsiveness in each Hori stage. acterized by successive and transient brain states that come on and off at the scale of a few seconds, and where activity and long-distance communication in specific frequency bands, especially the alpha and theta band, are the best predictors of responsiveness. We also show that the ability to respond is closely associated with predictive coding capabilities of the brain, reflected by the mismatch negativity (MMN) and the P300. We clearly define here the drowsiness period in humans, with associated modifications in behaviour, cognition and physiological brain activities, and demonstrate its distinction with wakefulness and sleep.
We used a detailed 5 sec. epochs classification of drowsiness ( Hori et al., 1994 ;Nittono et al., 2001 ) to monitor precisely the rapid modifications in vigilance and responsiveness that take place during the wake-sleep transition, and characterized their corresponding brain states with MEEG methods. We showed that the probability of being conscious and responsive decreases progressively from wakefulness to sleep and in relation with drowsiness stages, with decreasing response rates, a decreasing number of responsive subjects, and increasing reaction times. Importantly, this process is often non-monotonous and characterized by frequent rises and falls in vigilance. This period of altered behaviour, or drowsiness period, is already detectable in the first stage of calm wakefulness (with alpha rhythms, D1) and lasts until the occurrence of the firsts sleep spindles. Stable non-responsiveness is indeed only achieved few minutes after the first sleep spindles, a time that appears to also correspond to the subjective perception of sleep onset, often delayed from the onset of N1 sleep ( Bonnet and Moore, 1982 ). This delayed behavioural onset of consolidated sleep could account for the classical misperception of sleep onset when referring the usual sleep classification, especially in patients with insomnia ( Hermans et al., 2019 ). Besides, even in wakefulness (H0) subjects presented a certain amount of misses (response rate of 85.4%), indicating they probably presented lapses in attention (without clear modifications in vigilance). In H1 in presence of alpha waves, an early decrease in vigilance may be also possible, as we know that other signs such as slow eye movements can be present in drowsiness before EEG modifications ( Santamaria and Chiappa, 1987 ).
We also explored cognitive capabilities during this drowsiness period, by analysing the participants' ability to extract rules and detect auditory deviancies. We analysed the hierarchical prediction error signals emitted in response to local and global auditory deviancies, characterized respectively by the MMN and the P300. In line with previous results ( Bekinschtein et al., 2009 ;Sergent et al., 2005 ;Sitt et al., 2014 ;Strauss et al., 2015 ), we confirmed that the ability to report the conscious detection of global deviancies was associated with the occurrence of the P300, and that this P300 was absent when the subjects were not responsive, whatever the vigilance state (awake, drowsy or asleep). Importantly, we previously showed that the P300 was also present in non-responsive but attentive trials in wakefulness in a no-report task ( Strauss et al., 2015 ), and then that the P300 was not a simple marker of the motor response, but an index of conscious detection of deviant sounds. The absence of P300 in non-responsive trials across all vigilance states suggests that non-responsive trials were indeed non-consciously detected, and that responsiveness did reflect conscious access in our study, as expected by the nature of the task (subjects should respond when conscious, and subjects who reported having voluntarily stopped responding when falling asleep were discarded from analysis). These results highlight the dissociation between vigilance and consciousness and their related brain markers.
Considering the MMN (MEG MMR peak), overall across vigilance states, we found that its amplitude decreased progressively with drowsiness depth and failed to reach significance from the occurrence of theta waves (D3). These results replicate those of Nittono et al. (2001) , who described the MMN at sleep onset using the Hori classification and its simplified version, as such as we did in this study. We note nevertheless a residual pic still present at the time of the MMN. It would then be possible that a small effect persists in drowsiness and sleep, which could explain other findings in the literature of a MMN present in various non-conscious states ( Atienza et al., 1997 ;Bekinschtein et al., 2009 ;Fischer et al., 1999 ;Heinke et al., 2004 ;Naccache et al., 2005 ;Nashida et al., 2000 ;Schlossmacher et al., 2020 ). Those analyses, however, did not systematically take into account the effect of conscious access of deviant sounds on the MMN (but see ( Schlossmacher et al., 2020 )). When we analysed the MMN in trials where responsiveness could be monitored, we found that the MMN was actually mostly driven by the responsive state, i.e. here conscious access, and only weakly by vigilance. While these last results may be interpreted with caution, they are in line with other studies having shown the important modulation of the MMN by conscious access ( Chen et al., 2020 ;Kimura et al., 2010 ;Wei et al., 2002 ). When falling asleep, the brain's low (MMN) and high (P300)-level prediction capabilities seem to be largely determined by the conscious access of deviancies.
In addition to brain responses to deviances, we analysed the brain ongoing activity specific to the different drowsiness stages. When characterising drowsiness and sleep, frequency-selective brain activity play a key role. In fact, the currently employed classification relies on the presence or absence of alpha and theta rhythms. The functional aspects of those rhythmic activities are still a matter of debate. Previous work shows evidence for alpha-band activity as attention-related inhibitors of sensory input that facilitate the suppression of distracters ( Sokoliuk et al., 2019 ) and as a supporter of brain idling, while other works indicate that particular rhythms in alpha band are dependent on the task and scalp location ( Nunez et al., 2001 ). Very recently, functional connectivity in the alpha band was also suggested to reflect the level of disconnection from the external environment in sleep ( Imperatori et al., 2021 ). Overall, whole-brain reduction in alpha activity points towards the predominance of local brain processes over globally coordinated ones. As concerns the theta band, this frequency range has been linked to phased-locked neural information exchange ( Buzsáki, 2002 ;King et al., 2013 ), coupling sensory and memory-activated neurons ( Buzsáki, 2002 ). Interestingly in the wake-sleep transition, while overall alpha power decreases and theta activity increases, results indicate that both theta and alpha rhythms become more predictable and localized within the brain across the brain.
In order to determine which electrophysiological markers of brain activity are predictive of consciousness and responsiveness during drowsiness, we analysed the relations between MEG markers, drowsiness (Hori) stages and responsiveness at the single-trial level. We first found that a classifier trained with these markers can predict responsiveness given the Hori stage. We then found that while the markers can still capture the visually-detected differences across stages, there are still common components across stages that predicts responsiveness. Indeed, responsiveness could be decoded in several Hori stages in deep drowsiness using the same model, pointing toward a common underlying set of brain mechanisms responsible for conscious responsiveness. Nevertheless, it is important to remark that each Hori stage presented a different set of features as part of the optimal decoding model. This indicates that each stage has a distinctive neural signature with respect to conscious responsiveness. Detailed investigation of the decoding algorithms and markers indicate that these brain mechanisms are evidenced by rhythms in delta, theta, alpha and beta bands, with a major component of information in alpha band particularly located in posterior scalp regions. Connectivity analyses confirmed this critical posterior-parietal hub in alpha band for responsiveness, while theta band evidenced responsiveness through fronto-temporo-parietal information sharing. Two recent studies ( Bourdillon et al., 2020 ;Imperatori et al., 2021 ) highlighted also the functional connectivity (wSMI) in high delta-theta band as a marker of consciousness across vigilance states. Our results in theta may partially overlap with those findings, with the limit that the continuous stimulation constrained our analyses to too short epochs to analyse connectivity in the delta band.
Interestingly, depicting the existence of a set of transient brain states, each one with a diverse set of properties that predict the subjects' response, is a first step towards shedding light on deeper research questions. Future works could focus on studying the relation between the transitions across these states and the subject's response: is the stimulation/response changing the state of the brain? What are the dynamic properties of these states? It is also interesting to note that the brain markers best predicted responsiveness in the pre-deviant period than in the post-deviant period, suggesting that the ongoing brain state drove responsiveness to sounds more than the sound drove the ongoing brain state. This also shows that brain responses to stimulations (such as in the pre-deviant period) did not mask the ongoing physiological activity, and that rhythms driven by physiological modifications of vigilance were predominant. The specific context of auditory stimulations, which may change the brain state that we want to characterize, appears then to not critically influence physiological rhythms and should not invalidate the visual classification of drowsiness, nor the electrophysiological marker analyses. Although we are aware that experimental conditions may slightly influence our measures, such as described in the context of the "Psychological Uncertainty Principle" ( Lindsay and Anderson, 2000 ), we believe that this limitation is inherent to our question of research. Also, even ecological conditions for sleep are varied and not devoid of environmental stimulations and constrains.
Overall, these results depict the existence of a diverse set of transient brain states in the wake-sleep transition, reinforcing the increasing evidence for a transient and local modulation of vigilance and sleep ( Andrillon et al., 2021 ;Siclari and Tononi, 2017 ). This study highlights the high variability of brain patterns over time, across and within drowsiness stages, but also over brain space. In the future, using distinct spatial filters may help to capture those local sleep patterns. Along with those local and transient modulations, capabilities of humans to integrate sensory stimuli, learn rules, predict input, update priors, consciously access information and execute motor actions are progressively impaired. This period of rapidly changing brain states defines the drowsiness period, distinct from wakefulness and sleep, i.e. stable non-responsiveness, but currently embedded in calm wakefulness and N1 sleep when referring to the reference sleep classification (American Academy of Sleep Medicine and Iber, 2007 ). Heterogeneity of N1 sleep has already been highlighted in other behavioural and neuro-imaging studies ( Bareham et al., 2014 ;Magnin et al., 2010 ;Ogilvie, 2001 ;Stevner et al., 2019 ;Strauss et al., 2015 ), and shows the lower inter-scorer reliability ( Rosenberg and Van Hout, 2013 ). While this classification based on 30 sec. time windows (American Academy of Sleep Medicine and Iber, 2007 ) is convenient for manual scoring and to identify sleep disorders in consolidated sleep, finer-grained EEG monitoring with shorter epochs appears to be critical when assessing vigilance and the falling asleep process. In this line, micro-sleep episodes, defined as alpha suppression of less than 15 sec., have been very recently explored for evaluating vigilance ( Hertig-Godeschalk et al., 2019 ;Skorucak et al., 2020 ). We demonstrate here , supported by behavioural and in-depth brain activity measures, that using shorter epochs is indeed relevant, but that the different EEG patterns should also be analysed to assess the level of drowsiness. The proposed classification of drowsiness, considering alpha suppression, theta activity and sharp waves can easily be monitored in routine EEG. If it originates from descriptions of sleep onset made few decades ago ( Hori et al., 1994 ;Santamaria and Chiappa, 1987 ;), recent data suggest it reflects clear behavioural and brain modifications ( Bareham et al., 2014 ;Noreika et al., 2020 ;) and we here demonstrate it nicely reflects the decreasing probability to be conscious and responsive. In addition to visual scoring that may be time consuming in clinical routine, more dynamical measures should also be considered, such as the theta-alpha ratio, strongly correlated with this drowsiness classification ( Noreika et al., 2020( Noreika et al., , 2017, along with other methods of automatic scoring ( Jagannathan et al., 2018 ). And finally, the extraction of even finer information through brain makers described here, such as entropy in the alpha band, will enable to significantly increase the prediction of responsiveness and associated cognitive capabilities.

Conclusion
In conclusion, evaluating vigilance is a general concern, in clinical routine in neurological or sleep disorders (such as in insomnia or when performing maintenance of wakefulness tests), as well as in ecological environments. The present research brings significant advances in our understanding of the wake to sleep transition, and advocate for a better recognition of the drowsiness period. Currently embedded in calm wakefulness and the first stage of sleep (N1), it should be recognized in itself as a transition process leading to but different from sleep, i.e. from a stable minimally responsive brain state. Using a formalized classification of drowsiness or related brain markers such as described here should significantly improve vigilance assessment in the future. And finally, if we aim to match behavioural, perceptive and electrophysiological definitions of sleep onset, sleep itself should starts after the first sleep spindles or K-complexes.

Declaration of Competing Interest
The authors declare no competing interests.