  Objective. Sleep is a critical physiological process that plays a vital role
in maintaining physical and mental health. Accurate detection of arousals and
sleep stages is essential for the diagnosis of sleep disorders, as frequent and
excessive occurrences of arousals disrupt sleep stage patterns and lead to poor
sleep quality, negatively impacting physical and mental health. Polysomnography
is a traditional method for arousal and sleep stage detection that is
time-consuming and prone to high variability among experts. Approach. In this
paper, we propose a novel multi-task learning approach for arousal and sleep
stage detection using fully convolutional neural networks. Our model,
FullSleepNet, accepts a full-night single-channel EEG signal as input and
produces segmentation masks for arousal and sleep stage labels. FullSleepNet
comprises four modules: a convolutional module to extract local features, a
recurrent module to capture long-range dependencies, an attention mechanism to
focus on relevant parts of the input, and a segmentation module to output final
predictions. Main results. By unifying the two interrelated tasks as
segmentation problems and employing a multi-task learning approach,
FullSleepNet achieves state-of-the-art performance for arousal detection with
an area under the precision-recall curve of 0.70 on Sleep Heart Health Study
and Multi-Ethnic Study of Atherosclerosis datasets. For sleep stage
classification, FullSleepNet obtains comparable performance on both datasets,
achieving an accuracy of 0.88 on the former and an accuracy of 0.83 on the
latter. Significance. Our results demonstrate that FullSleepNet offers improved
practicality, efficiency, and accuracy for the detection of arousal and
classification of sleep stages using raw EEG signals as input.
