Introduction

The use of serial awakenings to investigate dream content has shown that the vast majority of dream reports are related to waking-life events1. The incorporation of content from these events into rapid eye movement (REM) sleep dreams peaks twice after an event of interest. The first peak, known as the day residue, occurs within one to two nights after the event2,3,4,5,6,7,8,9,10. The second peak, known as the dream lag, occurs five to seven nights after the same event3,6,11,12. While the day residue reflects the reverberation of recent memories10, the dream lag seems to correspond to long-term memory consolidation7.

Approximately 40% of dreams are related to events from the day immediately preceding the dream, i.e. correspond to a day residue1. The day residue is most prevalent during the N1 and the REM stages, occurring in about 50% of the dreams obtained upon awakenings from these stages13. As the earliest offline stage, sleep onset is increasingly recognized14,15 as important for learning & memory processes.

Both sleep16,17,18 and dreaming1,10,19 are known to regulate the affective valence associated with past waking experiences. While incorporated waking life events tend to be emotional and deemed important by the dreamers, waking-related dreams are often emotionally less intense than the original waking event to which they are associated1,10.

Dreaming during REM sleep engages the default mode network (DMN)20,21,22, which includes the medial prefrontal cortex, posterior cingulate cortex, hippocampus, precuneus, inferior parietal lobe, and temporal lobe, among other regions23. REM sleep dreaming has been proposed to be an enhanced form of daydreaming, sharing similar associative mechanisms and underlying neural networks, particularly the DMN24.

An investigation of the electroencephalographic (EEG) correlates of dreaming across sleep stages found that oneiric imagery was associated with decreased low-frequency (1–4 Hz) activity and increased high-frequency (20–50 Hz) activity in posterior cortical regions25. While REM sleep dreaming tends to be vivid and intense, visual imagery can also occur during non-REM stages25, in association with sparse, small, and shallow slow waves, particularly in central and posterior brain regions26.

While much has been learned about imagery during consolidated sleep, much less is known about the hypnagogic day residue and the interplay between visual imagery and affect at sleep onset. Using a serial awakenings protocol during brief nap episodes, with yoked pairs of affective visual stimuli and respective offline imagery, we have recently shown that the imagetic and affective aspects of the day residue are differentially processed during non-REM stages N1 and N2, so that the imagetic residue tends to linger while the emotional residue fades at sleep onset10. Since this imagetic lingering was inversely correlated with EEG power in the theta frequency band (4.5–6.5 Hz), we hypothesized that the visual reverberation of recent waking experiences as one falls asleep occurs against a stream of spontaneously generated memories, in association with theta oscillations generated in memory-related temporal circuits involving the hippocampus10. Here we set out to map the neural sources and the functional connectivity of the same dataset to 1) elucidate the brain regions involved in visuo-affective processing at sleep onset, 2) map the overlap of the identified regions with the DMN23, and 3) test the prediction that the imagetic residue is inversely correlated with theta activity in the hippocampus10.

Methods

Participants

Healthy adults (N = 28) were screened to exclude individuals with mental, neurological, or sleep disorders through interviews conducted by a psychiatrist (NBM, second author). The sample size was estimated based on a pilot study (n = 3, image residue correlated with PSD in theta frequency band with ρ = 0.505), using a 5% alpha error level and a 20% beta error level. A total of 16 men and 12 women were recruited, with an age range of 20–43 years, a mean of 30.99, and a SD = 7.25. To enhance the ability to recall and report dreams, the participants were instructed to maintain dream diaries during the two weeks prior to data collection. Additionally, they were asked to abstain from alcohol and caffeine consumption the day before the experiment. To increase sleep pressure, the participants underwent 50% sleep deprivation during the second half of the night before data collection.

All ethical standards pertaining to research with human participants were followed, as reviewed and approved by the UFRN Research Ethics Committee (approval #650.714/2014). In addition, all the participants provided written informed consent.

EEG recordings

Preparation for the recording sessions usually began at 7:30, and recordings typically ran from 9:40 to 14:00. Participants were prepared for recordings with 64-channel Brain Products EEG equipment, using a 10–20 standard cap and a sampling rate of 1 kHz. Electrooculogram (EOG) and electromyogram (EMG) sensors were also used to assist in sleep staging and subsequent signal processing. The sensors were properly tested and adjusted using conductive gel for optimal impedance matching. Subsequently, the participants were positioned on a reclining sofa, with a screen for stimulus display positioned at a distance of 1 m. The data collection room had acoustic and light insulation and was equipped with a sound system for audio recording and communication with the participant, as well as a beep to induce awakening. After the participant was properly installed in the experimental room, the lights were turned off, she/he received instructions on how the experiment would proceed, and a brief training session was conducted before initiating the experiment.

Experimental design

Figure 1 shows the sequence of events that make up each trial of the experiment, starting with 1) presentation of an affective image, followed by 2) oral description of the image, 3) oral rating of the image’s affective valence, 4) nap, 5) awakening, 6) oral description of the hypnagogic imagery and 7) oral rating of the affective valence of the hypnagogic imagery. Thus, each trial contained one awakening. In the first phase of the trial, a random image from the validated database of affective images27, or publicly available images matched to those but with better resolution, was displayed. The images were the same across participants, and the image order was randomized for every participant, without repeating the image between trials. The images were sorted according to affect, with 1/3 of the images (n = 12 images) being positive (e.g. children laughing, puppies), 1/3 of the images (n = 12 images) negative (e.g. shark attack, person beheaded) and 1/3 of the images (n = 12 images) neutral (e.g. a truck, an umbrella). The image remained on the screen for 15 s, after which the participant was invited to verbally describe the image for 30 s, responding to the question “What did you see?". Additionally, the participant verbally evaluated the image by rating its Affective Valence (AVs) on a scale from 1 to 9, with 1 for an extremely negative image and 9 for an extremely positive image. In the second phase of the trial, the participant was asked to close their eyes and sleep. In a second room, an expert tracked the electrical EEG activity online. To check for possible changes in the ‘day residue’ processing network as sleep deepens, the trials were randomly pre-assigned to WK, N1 and N2, and the resulting sequence of target states was implemented by the expert, via online sleep staging, during the recording session. The criteria were as follows: for WK, robust alpha oscillations in occipital channels; for N1, marked decrease in those oscillations; for N2, presence of cortical spindles and/or K complexes. When the signal characteristics of a randomized target sleep stage remained stable for 30 s, the experimenter triggered the beep to wake the participant. We aimed to capture the initial moments of each sleep stage. The median time with eyes closed before being startled by the beep that ended each nap was 128.5 s, with a minimum of 1.7 s and a maximum of 1768.5 s. Upon awakening, the participant was once again questioned with the prompt “What did you see?”, during which she/he verbally reported the imagery for 30 s. They were also required to evaluate the Affective Valence of the imagery (AVi), using the same rating scale. There were no word count differences between eyes open and eyes closed for stages N1 and N2, but there was a significant difference during WK (Supplementary Table S1). Furthermore, across the three stages of interest there were significant positive correlations between Image Residue and word count, with eyes open as well as closed (Supplementary Table S1). Thus, the more the participant talked about both image and imagery, the greater was the similarity between their imagetic contents. In contrast, there were no significant correlations between word count and Affect Residue (Supplementary Table S1).

Fig. 1: Experimental design.
figure 1

A trial consisted of 1) presentation of an affective visual image, 2) oral description of the image, 3) rating of the affective valence of the image, 4) closing the eyes for a variable duration across WK, N1 or N2, 5) awakening by a beep, 6) oral description of the imagery, and 7) rating of the affective valence of the imagery. Representative examples of EEG recordings within WK, N1, or N2 illustrate the three target hypnagogic stages of the experiment. When the participant was able to recall any visual imagery, the trial was considered a “recall” trial; otherwise, it was considered a “no recall” trial and was not used in subsequent analyses. Adapted from Fig. 1 of ref. 10.

Descriptive statistical information on the word count of oral reports after different sleep stages is presented in Supplementary Table S1.

Database consolidation

The experiment was performed under polyphasic sleep conditions, undergoing a multiple-awakening protocol. The aim was to collect 36 trials for each participant, properly balanced between three target stages of the wake-sleep cycle and uniformly distributed across the valence scale. However, few participants reached the desired stages in a truly balanced manner. In addition, for two participants the 36 trials were not achieved, which led us to perform a total of 1001 trials. Among these, in 211 trials the participants reported not remembering visualizing any images nor did they report other forms of mentation. This further reduced the total number of trials to 790. Another 54 trials were excluded for noise in the EEG recording. The EEG data analyzed included the 30 s prior to the beep. Artifacts due to eye movements and heartbeats were automatically removed using independent component analysis (ICA), and the missing channels were interpolated, as described by Mota et al. (2022)10. Finally, the definitive staging of the polysomnography was performed by an expert blinded to the experiment. Thus, the database resulted in 736 trials, with an average of 26.29 trials per participant. Of these, 401 trials were classified as wakefulness stage (WK), 208 as non-REM stage 1 (N1) and 127 as non-REM stage 2 (N2).

Imagetic residue (IR)

IR quantitatively indicates the semantic similarity between oral reports of the stimulus (s) and reports of images (i), considering only the trials in which there was recall of images. To measure IR, a word embedding technique was employed, using statistical regularities to represent words as vectors in a high-dimensional space where words with similar meanings are located close to each other. Participants were previously instructed to describe their visual experiences, and the question they answered upon being awakened (“What did you see?”) explicitly referred to a visual experience. There were no cases of reports occurring in non-visual sensory modalities. Because participants were sleep deprived during the second half of the night before the experiment, they typically experienced very intrusive visual images when closing their eyes10. The reports were recorded in MP4 format and then transcribed by experimentally blind professionals (http://ww.audiotext.com.br/). The reports were then transformed into lowercase letters, tokenized by words and cleaned of non-alphabetic tokens and stop-words, using the Portuguese stop-word list nltk28. A word embedding was then calculated for each report, with the neural network of the pre-trained multilingual word embedding model Fasttext29,30. Finally, the Image Residue was computed as the cosine similarity of the average word embedding (v1,v2), as presented in Eq. (1).

$$IR=cos({v}_{1}.{v}_{2})=\frac{{v}_{1}.{v}_{2}}{| {v}_{1}| .| {v}_{2}| }$$
(1)

where Vi refers to the Euclidean norm of vector Vi. Thus, a higher Image Residue indicates greater similarity between the imagistic content of the two reports. Descriptive statistical information on the distribution of image residues across different sleep stages is presented in Supplementary Table S2. Further details on the IR calculation are available in ref. 10.

Affective residue (AR)

AR measures the similarity between the affective valence of the stimulus and the affective valence of the imagery, as per Eq. (2):

$$AR=| A{V}_{i}-A{V}_{s}|$$
(2)

Consequently, AR yields an integer value for each trial within the closed interval of 0 to 8, where 0 represents maximum similarity between affective valences, and 8 represents the greatest distance between affective valences. Descriptive statistical information on the distribution of affective residues across different sleep stages is presented in Supplementary Table S2.

EEG source estimation

The sources were estimated using the SLORETA algorithm31. To achieve this, two sets of information were prepared.

The first set groups the structural information. It presents an anatomical model representing the individuals, created using the high-resolution ICBM152 MRI32, given that the subjects were adults, and no prior individual MRI collection was performed. The MRI underwent tissue segmentation using the Freesurfer software33. It was segmented into three layers, separating the brain mass, the skull and the scalp. The three-layer three-dimensional model reconstruction was then performed using the boundary element method described by (Brebbia; Dominguez, 1977)34 through the neural signal analysis software Brainstorm35. The layer of the anatomical model representing the source space was subdivided into 16006 voxels, evenly distributed throughout the volume of the brain and cerebellum. Additionally, fiducial points marked in the ICBM152 were used to place the sensors in the created model, following the international 10–20 standard, thereby generating the coordinate map for the 64 channels.

The second data set covers the functional information. This set includes the EEG signals with the 30 s of recordings preceding the alarm in each trial. The first 10 s of all trials were used to model noise characteristics, calculating a noise covariance matrix of the sensors for each subject.

Structural and functional data were related in Brainstorm through a linear system, allowing the determination of the Forward Solution. It consists of a data transformation matrix capable of taking functional data from the source space to the sensor space on the scalp. Subsequently, the noise covariance matrix and the Forward Solution were incorporated into the SLORETA algorithm, enabling the creation of an inverse operator for each subject in the database. Finally, the last 20 s of each EEG recording were selected to be subjected to the inverse operator, providing the source estimation for all 736 trials.

Computation of power from estimated signals

Brainstorm was used to calculate the power spectral density (PSD) for the 20 s of source estimation of each test, similarly to what was adopted, in EEG signals, by ref. 10. For this, the Welch method36 was used along the time axis, with a 4s Hamming window length, 80% overlap, and 512 frequency points. Subsequently, the frequency points were grouped, forming 14 bands with a frequency window of 2Hz each, ranging from 0.5 Hz to 28.5 Hz, according to Eq. (3):

$$Po{w}_{BAN{D}_{ii}}=\frac{\mathop{\sum }_{fLOWi}^{fHIGHi}PSD}{{\sum }\,\,PSD},i=1,2,...,14$$
(3)

where High and Low refer to the upper and lower limits of each band.

Statistical analysis

In this phase, we sought a statistical basis to determine whether the phenomena of Image Residue and Affective Residue have a significant relationship with neuronal electrical activity. Correlation, clustering and functional connectivity tools were used to analyze the sources. In addition, tests were performed to confirm the localization accuracy of the inverse operator for the deep sources mapped in the previous steps.

Correlation analysis

Kolmogorov–Smirnov and Levene tests showed that the Image Residue and Affect Residue data are not normally distributed but had homogeneous variance. Kruskal–Wallis tests were used to verify differences related to wake-sleep stages (Supplementary Table S2). Consequently, Spearman’s correlation test was chosen to investigate the relationship between phenomena and electrical source activity. Spearman’s correlation was calculated between the IR/AR ranking and the map of mean power comprising 16,006 sources. This was done individually for each of the 14 frequency bands during each of the three sleep stages. The significance threshold for correlation was determined through multiple comparisons using the Friedman test, with P value ≤0.01, among the 14 correlation maps. The test was iteratively conducted, reducing the correlation P value until a positive result indicating differences between the 14 maps was achieved. The P value was corrected using the False Discovery Rate (FDR) technique37. Then, the brain regions38 whose Spearman’s Rho modulus indicates values greater than 0.1 were projected into word clouds (Figs. 2b, 3b), to display the networks of regions with the strongest and most significantly correlated EEG source power with IR or AR. Words are displayed in the cloud in red for positive correlations and blue for negative correlations. Word sizes were scaled linearly by correlation strength, in descending order from left to right and top to bottom.

Fig. 2: Network of brain regions with significant correlations between EEG source power and imagetic residue.
figure 2

a Spearman correlation maps between EEG source power and IR are shown. During WK, significant correlations between EEG source power and IR (P ≤ 5.0833 × 10−8) were detected in the frequency bands 4.5–6.5 Hz (negative correlations) and 10.5–14.5 Hz (positive correlations). Significant correlations occurred more broadly during N1, in frequency bands 0.5–6.5 Hz (negative correlations), 8.5–12.5 Hz (positive correlations) and 26.5–28.5 Hz (positive correlations). b Word clouds depicting the networks of brain regions38 with EEG source power most strongly and significantly correlated with IR (Rho > 0.1, red for positive, blue for negative correlations). The word sizes are linearly scaled by correlation strength, in descending order from left to right and top to bottom. Please note that only negative correlations are above the cutoff, i.e. all the positive significant correlations were quite small. c Graph showing the Granger causality of the brain structures identified in (b). Blue, red and gray nodes correspond respectively to negative, positive and absence of correlation between EEG source power and IR. Arrows indicate causality direction, arrow width linearly represents causality strength. The abbreviations adopted in (b) and (c) follow the nomenclature used in the model atlas AALA338.

K-means clustering

K-means clustering of the 16,006 sources was performed using the Matlab functions to determine whether the detected neural activities are regionalized or diffuse throughout the brain volume. The K-means algorithm was run to generate 20 clusters, using a total of 5 repetitions, to ensure stability, and limited to 100 iterations. To calculate the distances between points, the City-Block metric, also known as Manhattan distance or L1 norm, was used. For each studied phenomenon (IR or AR) and each sleep stage (WK, N1, or N2), a feature vector X24×16006 was formed, composed of X1−14, by 14 Correlation Maps between the respective frequency band of power and the phenomenon (IR or AR); of X15−19, by 5 Principal Components, calculated with PCA, between the 14 maps of statistical moments of power (Mean, Median, Variance, Skewness, Kurtosis); of X20−24, by 5 Statistical Moments of the Mean, among all trials of each sleep stage, from the estimated LORETA signal: (Mean, Median, Variance, Skewness, Kurtosis).

Then, the sources were mapped to their respective spatial location, confirming the regionalization of the activities detected through the clusters. In this way, it was possible to proceed with the analyses, treating the source space as a set of several neuroanatomical regions, spatially well defined. For this, the sources were labeled in 170 regions using the Automated Anatomical Labeling Atlas 3 (AALA3) developed by Rolls et al.38. Labeling was carried out in an iterative process through the Brainstorm software to adjust AALA3 to the ICBM152 anatomy. The set of 16,006 sources resulted in the mapping of 160 regions, since 10 regions labeled in AALA3 had no correspondence in the ICBM152 anatomy.

Granger causality

Granger causality was calculated among the 160 regions for each sleep stage directly from the estimated LORETA signal, using the MVGC Multivariate Granger Causality toolbox39. Due to the non-stationarity of the signal, indicated by the unit root, using the Augmented Dickey–Fuller test (ADF)40, causality was calculated using a sliding window of 1s (ADF test indicated stationarity in 87.88% of windows in WK, 91.39% in N1, and 94.33% in N2), with 50% overlap and FDR-corrected P value (P valueWK≤5.37 × 10−4P valueN1 ≤ 2.09 × 10−4P valueN2 ≤ 1.31 × 10−4). The Granger order was set to 1 for all three cases, determined by the Akaike Information Criterion (AIC)41. Furthermore, data were normalized by the overall maximum connectivity value found across all analyses (WK/N1/N2). To focus on regions with higher connectivity, data were filtered to display only relationships greater than 10% of the maximum value found when examining connectivity using all 736 trials, regardless of sleep stage, resulting in Supplementary Tables S3 (WK), S4 (N1), and S5 (N2). Furthermore, the functional connectivity of the regions highlighted by the correlation analysis was indicated through graphs in Figs. 2c, 3c. They were generated using the tool (https://graphonline.ru). For this purpose, blue, red, and gray nodes were created, corresponding respectively to negative, positive correlation, and absence of correlation between EEG source power and IR/AR. The direction of causality was indicated by arrows, whose width linearly represents the strength of this causal relationship.

Inverse operator accuracy test for deep sources

The use of 64 channels and a template head model for source reconstruction hinders the localization and spatial resolution of SLORETA for deep brain structures. To overcome this limitation, the localization accuracy of the inverse operator was confirmed for all deep sources with EEG source power most strongly and significantly correlated with the imagery and affective residues (Rho > 0.1) or that showed significant causal relationship between each other, in the different sleep stages, across the different sleep stages (Supplementary Table S6). Among the structures verified, the precuneus is also included, as it extends from the cortical surface to deeper regions. All sources composing subcortical structures of interest (structures selected in the correlation and/or causality analyses), a total of 1311 sources, were separately tested as follows: (1) All sources in the model space were loaded with the value 0, except for the source Xi, under analysis, which was loaded with the value unit. Where ‘i’ is an integer ranging from 1 to 1311, corresponding to the source under analysis; (2) next, the forward operator was applied to the source map generated in (1) to simulate the 64-electrode EEG signal, equivalent to the source signal; (3) the EEG signal simulated in (2) was subjected to the inverse operator, generating a source map; (4) the map estimated in (3) was evaluated, checking whether the peak of the SLORETA signal occurs at source Xi. The procedure was repeated for all 1633 sources of interest, resulting in an average accuracy of 33.19%. Sources with 0% hits were discarded from the study, resulting in the exclusion of 10 thalamic nuclei, 2 raphe nuclei and the right ventral tegmental area.

Reporting summary

Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.

Results

Brain regions associated with the imagetic residue

Figure 2a shows the significant correlations between IR and EEG power within each frequency band, adopting an FDR-corrected statistical threshold of p−valueWK ≤ 5.0833 × 10−8 and p-valueN1 ≤ 7.6879 × 10−5 (Supplementary Table S7).

A group of brain regions showed source signals that were inversely correlated with IR (Supplementary Table S7). During WK, the most prominent negative correlations were found within the theta frequency band of 4.5–6.5 Hz in the right hemisphere, mainly in the AmygdalaR, Heschl’s gyrusR, Lateral orbital gyrusR, Superior temporal gyrusR, Inferior frontal gyrus opercular partR, HippocampusR, Middle frontal gyrusR, and Rolandic operculumR (peak Rho = −0.2193). During N1, negative correlations also occurred within the delta frequency band 2.5 to 4.5 Hz in the left hemisphere, particularly in Lobule X of the cerebellumL and Inferior temporal gyrus (peak Rho = −0.1808). A different set of brain regions showed source signals that were positively correlated with IR (Supplementary Table S7). During WK, both hemispheres were engaged within frequency bands 10.5–14.5 Hz, in the Middle cingulate & paracingulate gyriL, Middle frontal gyrusL, Superior parietal gyrusR, Superior frontal gyrus dorsolateralL, among other regions (peak Rho = 0.0882). During N1, positive correlations were detected in the left hemisphere within the alpha (8.5–12.5 Hz) and beta (26.5–28.5 Hz) frequency bands, in the Superior frontal gyrus medial orbitalL, and Superior frontal gyrus dorsolateralL, among other regions (peak Rho = 0.0629). No significant correlations were found during N2.

Overall, the lower frequencies were negatively correlated with IR, while the higher frequencies were positively correlated with IR. Figure 2b lists the brain regions that were most strongly and significantly correlated with IR. During WK, the maximum negative correlation occurred in the right amygdala (Rho = −0.2193) and the minimum negative correlation occurred in the right Rolandic operculum (Rho = −0.1001). During N1, the respective network comprises only two brain regions: the left cerebellar lobule X (Rho = −0.1808) and the left inferior temporal gyrus (Rho = −0.1547). Figure 2c shows the Granger causalities comprising the brain structures identified in Figure 2b. Significant causalities were only detected during WK, when source signals from the right lateral orbital cortex modulated source signals in the occipital cortex, the precuneus and the superior parietal gyrus.

Brain regions associated with the affective residue

Figure 3 a shows the significant correlations between AR and EEG power within each frequency band, adopting an FDR-corrected statistical threshold of p-valueWK ≤ 0.014, p-valueN1 ≤ 0.0037, and p-valueN2 ≤ 1.4962 × 10−4(Supplementary Table S8):

Fig. 3: Network of brain regions with significant correlations between EEG source power and affective residue.
figure 3

a Spearman correlation maps between EEG source power and AR are shown. Both positive and negative correlations between EEG source power and AR were significantly detected across several frequency bands during WK (P ≤ 0.014), N1 (P ≤ 0.0037), and N2 (P ≤ 1.4962 × 10−4). b Word clouds depicting the networks of brain regions38 with EEG source power most strongly and significantly correlated with AR (Rho > 0.1, red for positive, blue for negative correlations). The word sizes are linearly scaled by correlation strength, in descending order from left to right and top to bottom. c Graph showing the Granger causality of the brain structures identified in (b). Blue, red and gray nodes correspond respectively to negative, positive and absence of correlation between EEG source power and IR. Arrows indicate causality direction, arrow width linearly represents causality strength. The abbreviations adopted in (b) and (c) follow the nomenclature used in the model atlas AALA338.

A group of brain regions showed source signals that were negatively correlated with AR (Supplementary Table S8). During WK, this effect occurred within the alpha frequency band (8.5–12.5 Hz), with peak Rho = −0.1579 in the Inferior parietal gyrusR (excluding Supramarginal and Angular Gyri), spreading across regions such as Heschl’s gyrusL (Rho = −0.1384) and Supramarginal gyrusR (Rho = −0.1378), among others. During N1, negative correlations were detected in various regions within the delta frequency band (0.5–2.5 Hz), with peak Rho = −0.2105 in the Lateral Orbital GyrusL, spreading across regions such as Anterior orbital gyrusL (Rho = −0.2103) and Inferior occipital gyrusL (Rho = −0.1943), among others. No negative correlations were detected during N2.

Source signals from multiple brain regions were positively correlated with AR (Supplementary Table S8). During WK, these occurred within the beta frequency band (14.5–28.5 Hz), with peak Rho = 0.1576 in Lower Front Triangular Gyrus PartR, spreading across regions such as Inferior frontal gyrus opercular partR (Rho = 0.1576) and Posterior cingulate gyrusR (Rho = 0.15), among others. During N1, several brain regions showed positive correlations within theta, alpha and beta bands (peak Rho = 0.1670 in Supramarginal GyrusR), spreading across regions such as Inferior parietal gyrusR (excluding Supramarginal and Angular Gyri) (Rho = 0.0977) and Superior temporal gyrusR (Rho = 0.07), among others. During N2, positive correlations occurred in the right hemisphere within the theta band, with peak Rho = 0.3098 in Lower Front Triangular Gyrus PartR, spreading across regions such as Orbital part of inferior frontal gyrusR (Rho = 0.2584) and Rolandic operculumR (Rho = 0.2469), among others. Figure 3b lists the brain regions that were most strongly and significantly correlated with AR. During WK, the network ranged from the Inferior frontal gyrus opercular partR (Rho = 0.1576) to the Paracentral lobuleL (Rho −0.1001). During N1, the network ranged from the Lateral orbital gyrusL (Rho= −0.2105) to the Posterior orbital gyrusL (Rho = −0.1140). During N2, the network comprised the Lower Front Triangular Gyrus PartR (Rho = 0.3098) and the Middle frontal gyrusR (Rho = 0.1430). Figure 3c shows the Granger causalities comprising the brain structures identified in Fig. 3b. There was an increase in connectivity across the hypnagogic transition from WK to N1 to N2. During WK, signals in the right medial pulvinar thalamic nucleus showed a significant contralateral modulation of signals in the left anterior orbital gyrus, middle frontal gyrus and superior frontal gyrus. During N1, left hemisphere signals from the inferior pulvinar thalamic nuclei produced a modulation of signals in the left precuneus and right superior occipital gyrus. Furthermore, left hemisphere signals from the inferior pulvinar thalamic nucleus and the ventral posterolateral thalamic nucleus modulated signals in the left superior parietal gyrus. During N2, right hemisphere signals in the mediodorsal lateral parvocellular thalamic nucleus modulated ipsilateral theta signals in the middle frontal gyrus.

Deep regions associated with the imagetic and affective residues

The localization accuracy of the inverse operator was tested for the subcortical sources of 45 regions of interest. Among them, the 32 brain regions with the strongest EEG source power and significantly correlated with the imagetic or affective residues, in the different stages of sleep or that presented significant connectivity with the aforementioned regions, as shown in Supplementary Table S6. Of these, a total of 1311 subcortical sources were tested, culminating in the exclusion of 10 structures. A total of 22 deep brain structures were thus confirmed (Fig. 4a) according to the percentage of accuracy performed by the SLORETA algorithm in each structure (Fig. 4b). The analysis also includes the precuneus, which extends from the cortical surface to deeper regions.

Fig. 4: Inverse operator accuracy test for deep sources.
figure 4

The main structures are shown in (a), through their respective sets of sources and contours in different colors, according to the views left lateral, right lateral, front, back, upper and lower. In (b) the structures are represented individually with the respective percentages of accuracy of the SLORETA algorithm indicated by the color green. The acronyms adopted in (a) and (b) follow the nomenclature used in the model atlas AALA338.

Overlap of day residue networks with the DMN

The ‘day residue’ brain regions detected in this study showed a substantial degree of overlap with the DMN23, depending on the stage and type of residue considered. For IR, this overlap increased from 37.5% during WK to 50% during N1 (Supplementary Table S7). The comparison did not apply to N2, when we failed to detect any significant correlations. For AR, the overlap waxed and waned from 37.5% during WK, to 61.4% during N1, and then 11.11% during N2 (Supplementary Table S8).

Discussion

The results show that the hypnagogic processing of visual and affective content involves dynamic and sequential bi-hemispheric interactions across multiple cortical, subcortical, and cerebellar structures with visual, affective, optokinetic42, and cognitive functions. Low-frequency EEG power was associated with weaker residues, and high-frequency EEG power was associated with stronger residues. The visual aspects of the ‘day residue’ were inversely proportional, during relaxed WK immediately before sleep onset, to low-frequency EEG power in the range of 4.5 to 6.5 Hz, putatively produced by a right hemisphere network comprising limbic structures such as the amygdala and the hippocampus. These findings corroborate the prediction that the imagetic residue is inversely correlated with theta activity in the hippocampus10. The affective aspects of the ‘day residue’ engaged a substantially larger network of cortical and subcortical brain regions.

During N1, at the onset of sleep, the networks related to the visual and affective aspects of the day residue mostly shifted to the left hemisphere and were less influenced by the limbic system. During N2 the networks diverged entirely: while the visual residue did not correlate with EEG power from any source, the affective residue correlated strongly with EEG sources located in several regions of the right prefrontal cortex. The networks most significantly correlated with imagetic and affective residues were markedly different across wake-sleep states, partially overlapping with the DMN for up to 50% and 61% during N1, respectively. These include the AmygdalaR, the HippocampusRL, the InsulaR and the Posterior cingulate gyrusR. The increased connectivity observed from WK to N1 (and then N2 in the case of the affective residue) points to an evolving dynamic of information processing across the brain, as the participants transited from the externally oriented waking state to the internally driven hypnagogic state.

The results have potential implications for the current debate on the neural correlates of consciousness. A major point of dissent concerns the relative contributions of frontal vs. posterior cortical regions, as well as the role of subcortical structures. We found that the transition from waking to sleep imagery involves a rich and early dynamic of prefrontal and parietal cortex engagement, including the Lateral Orbital GyrusL, the Superior frontal gyrus dorsolateralR, the Middle frontal gyrusR, the Inferior frontal gyrus opercular partR, the Inferior frontal gyrus orbital partR, and the Inferior parietal gyrusR. These results are compatible with global workspace theory (GWT), which posits that consciousness arises from the widespread broadcasting of information mediated by prefrontal cortex networks43,44.

Notwithstanding, the widely distributed imagery networks engaged during hypnagogic sleep, despite some methodological differences, also seem to intersect broadly with the “posterior hot zone” associated with dreaming during consolidated NREM and REM sleep25. A more recent analysis of the same dataset as in ref. 25 suggested that occipital activity alone may suffice to explain the findings, without requiring the prefrontal cortex or the precuneus45, but in our study we detected the involvement of several posterior regions including the Superior occipital gyrusR, the Inferior occipital gyrusL, and the PrecuneusR. Of note, the precuneus is known to be engaged in self-related visual representations46, visual imagery during psychedelic states47,48 and lucid dreaming49. Altogether, the engagement of these posterior regions in hypnagogic imagery is compatible with predictions made by integrated information theory (IIT), which postulates the need for posterior activation in the generation of conscious imagery.

Our study has some important limitations. The experimental design deviated substantially from the natural circadian cycle, since participants were partially sleep deprived and asked to sleep during the day, which may have contributed to the sample imbalance. Furthermore, because the experiment was designed to capture the initial 30 s of each target stage, several trials that were labeled as N2 online were re-labeled as N1 offline, resulting in sample imbalance. The smaller sample possibly led to the absence in N2 of statistical significance for the correlation between EEG power and image or affective residues. Since the data were not perfectly balanced, we could not determine whether the lack of significant correlations in N2 is real, or rather it reflects an underpowered assessment. Another limitation is the potential interference between the image visualized in the target trial and the images visualized in previous trials. Furthermore, we cannot refute the possibility that the images recalled upon awakening from a given stage (for instance, N2) may reflect mentalization during a preceding stage (for instance, WK or N1). Also, we did not obtain other memory measures to assess image retrieval at a later stage, nor did we measure the success of encoding. Therefore, the use of a single memory measure (i.e., semantic similarity between visual stimulus and image report) should be considered another limitation of our study. Finally, the localization uncertainty related to source depth, the use of 64 EEG sensor channels, and the use of a template head model for source reconstruction led us to exclude ten thalamic nuclei, two raphe nuclei, and the right ventral tegmental area initially detected. Further source level studies using high-density EEG and individual head models should re-examine whether these and other deep subcortical regions also participate in the different aspects of the hypnagogic day residue.