Sleep Research in the Era of AI

: The field of sleep research is both broad and rapidly evolving. It spans from the diagnosis of sleep-related disorders to investigations of how sleep supports memory consolidation. The study of sleep includes a variety of approaches, starting with the sole focus on the visual interpretation of polysomnography characteristics and extending to the emergent use of advanced signal processing tools. Insights gained using artificial intelligence (AI) are rapidly reshaping the understanding of sleep-related disorders, enabling new approaches to basic neuroscientific studies. In this opinion article, we explore the emergent role of AI in sleep research, along two different axes: one clinical and one fundamental. In clinical research, we emphasize the use of AI for automated sleep scoring, diagnosing sleep-wake disorders and assessing measurements from wearable devices. In fundamental research, we highlight the use of AI to better understand the functional role of sleep in consolidating memories. While AI is likely to facilitate new advances in the field of sleep research, we also address challenges, such as bridging the gap between AI innovation and the clinic and mitigating inherent biases in AI models. AI has already contributed to major advances in the field of sleep research, and mindful deployment has the potential to enable further progress in the understanding of the neuropsychological benefits and functions of sleep.


Introduction
Since the first studies of sleep, the field of sleep research has massively evolved.Be it for clinical or basic research purposes, sleep research today relies heavily on cuttingedge sensors that record complex signals of the human body, generating large amounts of data.Polysomnography (PSG), the golden standard tool for sleep assessments, typically generates time-domain signals of electroencephalography (EEG), electromyography (EMG), eye movements (electrooculography-EOG), and often additional signals, such as electrocardiography (ECG) or respiration patterns.All these rich signals are routinely collected overnight in sleep clinics and research laboratories to assist in the study of sleep functions and dysfunctions.In addition, wearable devices, although they are not the norm, are becoming more and more mainstream and are even considered in clinical evaluations of patients with sleep-wake disorders [1].These measurements collect large amounts of data that contain rich patterns of activity, to which the human eye is often oblivious.
To exploit the richness of sleep-related measurements, signal processing and artificial intelligence (AI) techniques have been introduced in the field of clinical and fundamental sleep research.AI has brought major changes to several domains in recent years, primarily those of (medical) imaging and language processing.AI techniques can be grouped into two large fields: feature-based or 'traditional' machine learning and deep-learning techniques.For feature-based techniques, before the actual AI algorithm can be applied, relevant features must be extracted from the data, from which the algorithm will then learn.In the case of EEG or, more broadly, time-series data, such features may, for instance, consist of power in specific frequency bands, EEG sensors in predefined scalp locations, or scale-free properties of EEG signals.The extracted features can then be used to perform a task of supervised or unsupervised learning.Supervised learning needs labels assigned to the data to guide learning, while unsupervised approaches can uncover patterns in a label-agnostic manner.The choice of the learning approach depends on the availability of labels, such as the category of presented stimuli, patient groups, diagnosis, etc., and the aim of the analyses.For example, supervised learning could be better suited for discriminating neural responses to external stimuli when the identity of the stimuli is known and can be used as labels [2].By contrast, if the goal is to identify subgroups in a patient population without a priori assumptions, unsupervised learning could be a more suitable approach [3].
When AI algorithms are based on deep learning, minimally preprocessed data are usually provided as input to a neural network, such as a convolutional neural network (CNN), which then performs the task of classifying the input signals, for example, via successive convolutional operations [4].CNNs were initially used in the domain of image classification [5] and have more recently been adapted for time-domain signals [6].The most prominent models that have emerged in recent years exploit the temporal and spatial properties of EEG signals [7], as well as the temporal dynamics and structure of sleep recordings [8].As expected, these powerful techniques have entered the field of sleep research and have the potential to push the field toward exciting new venues.
In this opinion article, we provide an overview of recent advances that AI algorithms have brought into the field of sleep research either in clinical or fundamental neuroscience (Figure 1).We start with a section on clinical sleep research, where we elaborate on investigations performed in sleep clinics (i.e., sleep scoring), where AI can assist in automating medical tasks, and in improving the diagnosis and prognosis of sleep-wake disorders.We then proceed with a section on how AI can assist in bringing sleep research outside sleep laboratories via wearable technologies.Then, we present highlights of fundamental neuroscience research, and we elaborate on the potential that AI techniques have for detecting patterns in EEG signals related to sleep functions such as memory consolidation.In the last section of this article, we discuss future directions for bridging AI and sleep research, as well as the challenges that will need to be addressed.then learn.In the case of EEG or, more broadly, time-series data, such features may, for instance, consist of power in specific frequency bands, EEG sensors in predefined scalp locations, or scale-free properties of EEG signals.The extracted features can then be used to perform a task of supervised or unsupervised learning.Supervised learning needs labels assigned to the data to guide learning, while unsupervised approaches can uncover patterns in a label-agnostic manner.The choice of the learning approach depends on the availability of labels, such as the category of presented stimuli, patient groups, diagnosis, etc., and the aim of the analyses.For example, supervised learning could be better suited for discriminating neural responses to external stimuli when the identity of the stimuli is known and can be used as labels [2].By contrast, if the goal is to identify subgroups in a patient population without a priori assumptions, unsupervised learning could be a more suitable approach [3].
When AI algorithms are based on deep learning, minimally preprocessed data are usually provided as input to a neural network, such as a convolutional neural network (CNN), which then performs the task of classifying the input signals, for example, via successive convolutional operations [4].CNNs were initially used in the domain of image classification [5] and have more recently been adapted for time-domain signals [6] .The most prominent models that have emerged in recent years exploit the temporal and spatial properties of EEG signals [7], as well as the temporal dynamics and structure of sleep recordings [8].As expected, these powerful techniques have entered the field of sleep research and have the potential to push the field toward exciting new venues.
In this opinion article, we provide an overview of recent advances that AI algorithms have brought into the field of sleep research either in clinical or fundamental neuroscience (Figure 1).We start with a section on clinical sleep research, where we elaborate on investigations performed in sleep clinics (i.e., sleep scoring), where AI can assist in automating medical tasks, and in improving the diagnosis and prognosis of sleep-wake disorders.We then proceed with a section on how AI can assist in bringing sleep research outside sleep laboratories via wearable technologies.Then, we present highlights of fundamental neuroscience research, and we elaborate on the potential that AI techniques have for detecting patterns in EEG signals related to sleep functions such as memory consolidation.In the last section of this article, we discuss future directions for bridging AI and sleep research, as well as the challenges that will need to be addressed.

AI in Clinical Sleep Research 2.1. AI as a Helper: The Case of Automating Sleep Scoring
Today, the diagnosis of most sleep-wake disorders requires patients to spend a night at the hospital or in a sleep lab, where they undergo a PSG recording.PSG signals are then temporally labeled into different stages that make up the architecture of sleep, in the so-called sleep scoring.Sleep scoring is a time-consuming and tedious process that relies heavily on clinical expertise.Trained clinicians spend hours visually inspecting and scoring overnight PSG recordings.However, this task comes with several caveats.First, it is time-consuming, as clinicians must visually assess every 30 s epoch of the full night PSG recording.Second, it is also prone to subjectivity, since physiological features in sleep may differ across patients, and it can be hard to detect and interpret them.This variability may often also result in low inter-rater reliability in sleep scoring [9][10][11].AI-based research over the last years has made impressive progress in automating the manual procedure of sleep scoring, reducing time demands and increasing objectivity.Different algorithms, ranging from relatively simple classifiers [12] to deep convolutional neural networks [13], have been proposed and have shown impressive results in sleep scoring PSG signals, recorded in both research and clinical settings.
In the first category, sleep scoring algorithms start by extracting features of PSG signals, such as EEG power spectra or EOG/EMG entropy, computed over 30 s intervals, and then use supervised learning algorithms to classify sleep stages.One notable example in this category is the YASA algorithm [14], which is based on a gradient boosting decisiontree architecture.This algorithm has been validated on over 30,000 h of PSG recordings from several laboratories and provides results on par with human experts [14].In the second broad category, sleep scoring algorithms based on deep neural networks instead exploit the temporal characteristics of PSG signals and only require minimal preprocessing, without pre-selecting specific features [15].One notable example of such algorithms is the U-Sleep artificial neural network, which was trained on more than 15,000 PSGs from multiple clinical studies, achieving a remarkably high performance and across-center generalization [15].Recent work has shown that this algorithm is particularly powerful, demonstrating resilience to the sleep scoring guidelines of the American Academy of Sleep Medicine (AASM) [16], as it performs equally well at sleep scoring even when nonrecommended and non-conventional channels are used as input [17].Overall, these studies show the strong potential of AI techniques to automate the tedious task of sleep scoring and to render it more objective and resilient across sleep experts.

AI for Augmenting Clinical Diagnosis: The Case of Sleep-Wake Disorders
Another field where AI can not only assist but potentially also augment human capacities is the diagnosis of sleep-wake disorders.About one-third of the human population will be affected by sleep-related troubles at some point in their lives [18].Sleep-wake disorders manifest with a large variety of symptoms and causes.The main two categories of sleep-related problems can be grouped around two families of symptoms: daytime sleepiness and difficulties falling asleep at night.These symptom families may seem distinct but are intermixed, as difficulties falling asleep may also result in daytime sleepiness.Similarly, very distinct sleep-wake disorders can share several symptoms, which makes their diagnosis challenging.Another challenge in the clinical routine today is that certain sleep-wake disorders, such as insomnia disorder, do not have objective biomarkers.The diagnosis of insomnia disorder relies on subjective self-reports and questionnaires [19].These caveats make the landscape of sleep-wake disorders heterogeneous and their diagnosis an open challenge.
Although AI is not currently used in clinical assessments of sleep-wake disorders, it has the potential to assist in several ways.AI algorithms can be used for the analysis of PSG signals with two goals: first, to reduce subjectivity in data analysis by providing homogeneous assessments and second, to increase sensitivity and uncover patterns that may be hidden from the human eye [20](Zubler and Tzovara 2023).Several studies have demonstrated the potential of deep learning in assisting in the diagnosis of sleep-wake disorders based on PSG signals, with a notable example of a recent application of neural networks trained to perform automatic sleep scoring and then to identify patients with narcolepsy type 1 via the resulting hypnodensity graphs [8].Future work can investigate additional disorders and explore the potential of deep learning algorithms for extracting fine-grained patterns that may additionally reflect the co-occurrence of multiple sleep-wake disorders or comorbidities with psychiatric or neurological disorders.
Apart from assisting in the diagnosis of individual patients, AI techniques also have the potential to enable a data-driven characterization of patient phenotypes across patient groups.Unsupervised learning has been used to disentangle the heterogeneous landscape of sleep-wake disorders.Clustering has been mainly used within individual disorders, such as central disorders of hypersomnolence [21,22], insomnia disorder [23,24], or obstructive apnea [25][26][27], with the goal of identifying unique patient profiles within a given group, based on available clinical markers.For central disorders of hypersomnolence, previous studies have identified clear clusters of patients with narcolepsy type 1, which typically manifests with a high prevalence for cataplexy, low hypocretin, and a high number of sleep onset rapid eye movement (REM) periods [21,28].By contrast, patients with narcolepsy type 2 and idiopathic hypersomnia are intermixed, as can be expected based on the current clinical criteria [21].Studies on obstructive sleep apnea have found heterogeneous patient clusters, mainly separated along demographic information such as age, body mass index, or disease severity.Similarly, studies on insomnia disorder have identified insomnia subtypes based on total sleep time, REM sleep, non-rapid eye movement (NREM) sleep, and the patient's sex [23,24].
To date, clustering on the full spectrum of sleep-wake disorders remains limited [3].A recent study analyzed a wide range of clinical variables for a cohort of more than 6000 patients with sleep-wake disorders and showed that within central disorders of hypersomnolence, patients with narcolepsy type 1 were relatively easy to discriminate, while patients with narcolepsy type 2 and idiopathic hypersomnia were intermixed, as one would expect, based on previous studies which focused on such sub-groups [21].The study additionally showed that when moving to the full spectrum of sleep-wake disorders, it is more challenging to disambiguate individual disorders, other than patients with breathing-related disorders and patients with narcolepsy type 1 [3].These results clearly show the complexity of the current landscape of sleep-wake disorders and call for additional biomarkers to characterize them [29].Overall, studies using unsupervised learning highlight the complexity of the full landscape of sleep-wake disorders and suggest that new diagnostic criteria may be needed to characterize them.

AI for Moving Sleep Outside Sleep Labs: The Case of Wearables
As the fields of sleep research and medicine evolve, new technologies necessarily follow.One key direction of research that has flourished in recent years is that of wearable devices employed to study sleep [1].Wearable devices have the potential to fundamentally change the study of sleep-wake disorders and the assessments of sleep hygiene, as they can be used at the patient's homes, bringing the study of sleep outside the lab and closer to the patients' daily lives [30].As wearable devices operate continuously, they generate large amounts of data, which makes the use of AI-based techniques for their analysis a necessity.
Although the use of wearable devices for studying sleep patterns is relatively new, there are already several studies showing the potential of these devices to classify sleepwake disorders [31,32].As a notable example, one recent study showed that cardiac and respiratory signals, which, in principle, are easily accessible with wearable devices, could identify suspected patients with obstructive sleep apnea [31].Heart rate variability during sleep can, for instance, be inferred from cardiac signals and can provide insights into sleepwake disorders [33] and potentially even assist in the prediction of long-term cardiovascular disease outcomes [34].Additionally, recording and analyzing nocturnal sounds has been proposed as a possible way to assist in sleep staging [35][36][37] which, if successful, may contribute to decoupling sleep investigations from sleep clinics.
One recent study has shown the strong potential of wearable devices to identify sleep patterns outside the lab, in a large population, using data from a large cohort of participants, compiled from the UK-Biobank [38].Based on wearable devices, actigraphy was measured and used to extract variables related to sleep hygiene, for example, sleep/wake time or phase.These variables were then used in an unsupervised learning algorithm to identify distinct phenotypes of sleep habits.The study provides an innovative way to objectively characterize sleep hygiene and extract, in a data-driven way, groups of distinct chronotypes (for example, "night owls" or "early birds").Additionally, the analysis of wearable data could identify insomnia-like patterns in the general population without reports of sleepwake disorders.Working with large-scale datasets that are collected outside the laboratory also has the advantage of taking into account temporal regularities and multidien events that may influence sleep quality and can, in principle, be extracted via smartphones [39].
For the purpose of home monitoring and making sleep assessments available to the general population, multiple commercial devices have been developed, such as EEG headbands (e.g., "Dreem"), smart watches (e.g., "Fitbit", "Actigraph"), or smart rings ("Oura").Recent work has assessed if these devices can be used for the purpose of sleep staging in the general population [40] and has found that overall they achieve reasonable results, with the best results being registered for headbands, suggesting that they have a potential to open new venues for large-scale sleep studies.
These studies together show the strong potential of wearable devices, which, handin-hand with AI techniques, can move the study of sleep patterns closer to the patients' homes.

AI for Hypothesis Testing: Pattern Analysis for Studying Sleep and Memory
In neuroscience research related to sleep functions, AI techniques have been used not only for clinical applications but also as powerful tools for data analysis.Namely, multivariate pattern analysis has become a prominent tool for analyzing EEG signals [2,41].With multivariate pattern analysis, researchers can extract rich patterns of EEG activity, which might span across multiple brain regions/electrodes and latencies and remain undetected with conventional univariate statistical analyses.These methods consist of training machine learning classifiers to discriminate neural responses to external stimuli.The trained classifiers are then applied to previously unseen test data to "predict" the external stimulus that caused them.The above-chance decoding or classification of the test data suggests that the trained classifiers have learned to represent task-relevant neural activity.Today, multivariate pattern analysis predominantly relies on 'traditional' machine learning algorithms, for example, linear classifiers, but more recent work has shown that CNNs can perform the same task with higher accuracy levels [7,42].
Therefore, the classification of EEG signals during sleep is not limited to diagnosing sleep-wake disorders and splitting sleep into its stages.It is also an effective technique to understand the functions of sleep.As a notable example, forming long-term memories is a crucial function of sleep.In rats and rodents, learned sequences of movements are reactivated neurally during sleep [43].The so-called 'offline replay' was first detected in the hippocampal place cells during sleep [44,45] and also during quiet rest, and it predicts subsequent behavior [46].Although the study of replay patterns is relatively straightforward in animals, using cutting-edge recording methods (i.e., by tracking the same cells during wakefulness and sleep), in humans, it is more challenging, as access to individual neurons is rare.AI techniques, such as multivariate pattern analysis, have helped bridge this gap.They make it possible to train classifiers that discriminate wholebrain patterns of interest (i.e., responses to external stimuli) during wakefulness and then evaluate how these patterns manifest offline, during sleep.
One notable study in this direction showed that newly formed memories are reactivated during sleep [47].The study decoded EEG activity during sleep to identify which images participants had viewed during wakefulness.These patterns reflected that learned stimuli manifested across REM and NREM sleep neurally, and that their occurrence in the latter could influence memory performance during subsequent wakefulness [47].In an intracranial EEG study, patterns of EEG signals related to presented stimuli were extracted, and their generalization during both wakefulness and sleep was assessed in relation to ripples [48].The study showed that for items that were later remembered, a late period of their encoding was replayed, and that for items that were forgotten, an early period of their encoding was replayed [48](Zhang, Fell, and Axmacher 2018).Similar techniques have been applied in the so-called targeted memory reactivation studies.In these studies, participants associate an auditory cue with a following event (e.g., a sequence of finger presses) during wakefulness, while the auditory cues are presented again during sleep to trigger a reactivation of previously learned associations.In these studies, machine learning algorithms can help identify how the targeted memories are reactivated neurally across sleep stages [49].Multivariate decoding, applied to hemodynamic signals, has also been used to show that patterns of awake activity that relate to reward are spontaneously reactivated during sleep, and their reactivation correlates with subsequent memory [50].Overall, AI techniques have proven valuable in the detection of neural replay of previous experiences during sleep, as well as in the study of the role of sleep in consolidating previous experience.

Discussion
In this article, we summarized insights that the use of AI techniques has brought into sleep research.These span from clinical applications, where AI can help improve the understanding of sleep-wake disorders, to fundamental research, where AI can shed light on memory and sleep functions.As novel and more powerful AI algorithms are developed, these will naturally also inform the study of sleep.In parallel to fostering research and providing major insights, the use of AI is also bringing several challenges that will need to be addressed in the near future.
The first and foremost challenge is bridging the gap between clinical practice and AI.Traditionally, the two fields have been quite disconnected.In recent years, to achieve cross-talk across disciplines, new educational programs have been formed whose goal is to educate AI scientists to directly understand clinical needs.These programs should continue to expand, and consider adding computational and programming training to medical curricula.Moreover, funding schemes that enable the translation of research results into innovative solutions that can be readily used by clinicians can help make novel technologies more easily accessible.Such efforts are likely to increase in the coming years, resulting in transdisciplinary interactions and the generation of new knowledge.
Other challenges that need to be addressed pertain to the very nature of AI, namely, the fact that several powerful AI algorithms often operate with limited transparency.Future initiatives need to emphasize not only algorithmic performance but also the generation of interpretable features [42].Another important current limitation is that of algorithmic bias.As AI algorithms learn from existing data, they will naturally perpetuate existing biases that the current datasets inherently contain [51].Future work can focus on addressing algorithmic bias, for example, via the use of diverse datasets or training practices in federated learning [52], whenever diverse datasets are not readily available.
One important note when it comes to algorithmic bias is that AI can also assist in overcoming human biases.One notable case of bias in the field of sleep studies is sleep scoring, where perceptual biases result in poor inter-rater agreements, which for certain sleep stages can be remarkably low [9][10][11].AI algorithms that are trained from a consensus of experts can help automate and objectify sleep scoring [17] and therefore assist in limiting perceptual biases.

Conclusions
AI has already brought major changes to sleep research.AI has provided novel insights into rendering critical and time-consuming tasks in sleep research, such as sleep scoring, more objective.It also has the potential to advance the characterization and treatment of sleep-wake disorders and to assist in out-clinic patient monitoring, in combination with wearable devices, which is an important milestone for the field of sleep research.Lastly, AI has brought novel insights into the neuropsychological benefits of sleep for human cognition and memory.Future efforts need to focus on a cultural exchange, where AI algorithms can be developed hand-in-hand with advancements in the study of brain and peripheral functions during sleep.

Figure 1 .
Figure 1.Overview of domains where AI can assist in sleep research.

Figure 1 .
Figure 1.Overview of domains where AI can assist in sleep research.