  Although deep learning algorithms have proven their efficiency in automatic
sleep staging, the widespread skepticism about their "black-box" nature has
limited its clinical acceptance. In this study, we propose WaveSleepNet, an
interpretable neural network for sleep staging that reasons in a similar way to
sleep experts. In this network, we utilize the latent space representations
generated during training to identify characteristic wave prototypes
corresponding to different sleep stages. The feature representation of an input
signal is segmented into patches within the latent space, each of which is
compared against the learned wave prototypes. The proximity between these
patches and the wave prototypes is quantified through scores, indicating the
prototypes' presence and relative proportion within the signal. The scores are
served as the decision-making criteria for final sleep staging. During
training, an ensemble of loss functions is employed for the prototypes'
diversity and robustness. Furthermore, the learned wave prototypes are
visualized by analysing occlusion sensitivity. The efficacy of WaveSleepNet is
validated across three public datasets, achieving sleep staging performance
that are on par with the state-of-the-art models when several WaveSleepNets are
combine into a larger network. A detailed case study examined the
decision-making process of the WaveSleepNet which aligns closely with American
Academy of Sleep Medicine (AASM) manual guidelines. Another case study
systematically explained the misidentified reason behind each sleep stage.
WaveSleepNet's transparent process provides specialists with direct access to
the physiological significance of its criteria, allowing for future adaptation
or enrichment by sleep experts.
