Exploring Quantum Recurrent Neural Networks in Sleep Medicine José Daniel Viqueira-Cao 1Alejandro Mayorga-Redondo 2Samuel Magaz-Romero 2 Eduardo Mosqueira-Rey 2Andrés Gómez-Tato 1Diego Alvarez-Estevez 2 1CESGA. Galicia Supercomputing Center, Spain 2Universidade da Coruña (CITIC), A Coruña, Spain Abstract Sleep medicine is devoted to the diagnosis and therapy of different sleep disorders with potential serious impacts on the health condition of individuals. The reference test to assess many of these disorders is the polysomnography (PSG). Clinical analysis of the PSG recording is expensive, requires substantial time and effort, and is prone to unintentional human misinterpretations, which is why automation of this process has been extensively studied throughout the last years. The complexity of the task, on the other hand, offers an ideal scenario for the benchmarking of new developments in the field of machine learning with potential contributions to the task. This work examines the applicability of quantum machine learning for the diagnosis of sleep-disordered breathing, a common sleep disorder related to the repeated occurrence of involuntary respiratory pauses during sleep. By computing the state evolution through density matrices, we emulate the behavior of a quantum recurrent neural network to study the feasibility of automatic classification of PSG sequences with the presence or absence of respiratory events (apnea/hypopnea). Introduction Motivation Polysomnography involves the recording of the patient’s physiological signals during a prolonged period of sleep (6-8 hours). A visual inspection of the resulting recording is performed by the clinical specialist to detect complex patterns of neurophysiological activity to build a profile of the patient’s sleep and diagnose any possible sleep-related disorders. Due to the length and complexity of the task, as portrayed in Figure 1, substantial time and effort are required, with potential occurrence of miss-scoring and annotation imprecision. Figure 1. A snapshot of 30 seconds of a polysomnography showcasing microarousals and respiratory events Focus of the study The complexity of the PSG analysis task offers an ideal scenario for the analysis of quantum machine learning (QML) methods. The aim is to study the viability of quantum recurrent networks in time series environments, specifically with PSG signals (such as ECG, EOG, EMG, airflow, SaO2, etc). Research goals Sleep-disordered breathing is one of the most common sleep disorders related to the occurrence of apneas and hypopneas. The former is defined as a total obstruction in the airflow for a period of at least 10 seconds, while the latter represents a partial cessation. The objective of the study is to automatically classify normal sleep periods with absence of apneas or hypopneas from those where these events are present. Datasets Data collection The datasets were constructed based on polysomnography recordings from different patients digitalized in the standard European Data Format (EDF). These files are processed using a windowing and normalization process in order to construct temporal segment instances. Characteristics The datasets generated for the study have the following characteristics: One single signal per instance, which represents the airflow of the patient. 150–300 instances per dataset, where each instance is a time series of the airflow signal 20-30 seconds long. A common sampling frequency of 10 Hz is used, which makes the total number of values per sequence up to 200-300. Figure 2 is a normal instance of a airflow signal whereas Figure 3 depicts an apnea event. Figure 2. Graphic of normal instance with no event Figure 3. Graphic of event instance with an apnea being displayed DOWNLOAD THIS POSTER! Quantum Recurrent Neural Networks Recurrent Neural Networks Recurrent neural networks (RNNs) are a type of neural network characterized by the use of memory, which allows them to remember past inputs and generate outputs based on them. They are particularly suited for use with sequential data, as this memory makes continuous processing easier. Figure 4. Diagram of a RNN In Figure 4, the conceptual model of the evolution of a recurrent neural networks through time presents the following sections: θ: The parameter (weight) set of the model. x(t),¯ y(t): The inputs and their corresponding outputs at instant t. h(t): The hidden state at instant t. That is, the memory that is passed on to the next iteration. The output at timestep tis influenced by the corresponding input x(t)and the hidden state of the previous input h(t−1), which makes the impact of memory on output generation effective. Developed quantum model Quantum recurrent neural networks (QRNNs) exploit basic properties of quantum mechanics, such as entanglement, to make a section of the resulting circuit act as memory. In this way, the values embedded in these qubits can influence subsequent outputs [1]. Figure 5. Diagram of a QRNN In Figure 5, the model of the developed QRNN can be appreciated. The different parts that comprise it are as follows: Exchange (E) and memory (M) registers. Econsists of nEqubits where input data are encoded. These qubits are measured and reset at the end of every timestep. Mconsists of nMqubits acting as memory and it is never measured. ρM (t): The density matrix describing the memory state, which acts as the hidden state in the classical RNN and transmits information to the next timestep. U(x(t),θ): The parameterized quantum operator encoding x(t)and evolving the quantum state. The parameter set θis the same for every timestep. In our experiments, we set nE= 1 because the input series is a single variable. We use the series of binary outputs from the exchange qubit measurements to classify the sample series as normal or anomalous. This classification is based on the condition that the percentage of 1s is above a threshold. Results Table 1 shows the results of different metrics after the training of the emulated QRNN with datasets of different sizes. These results are the average based on the test scores obtained from a total of 10 executions with different random parameter initializations for each dataset. Instances Timesteps Accuracy F1-score Precision Recall 150 200 0.99 ±0.02 0.97 ±0.05 1.00 ±0.00 0.94 ±0.09 200 300 0.84 ±0.10 0.87 ±0.06 0.77 ±0.09 1.00 ±0.00 300 300 0.73 ±0.03 0.79 ±0.02 0.66 ±0.03 1.00 ±0.00 Table 1. Metrics showing the average and the standard deviation of 10 executions. Conclusions Currently, various tests are being carried out according to the specifications indicated in the Datasets section. The results obtained demonstrate a clear ability of the model to differentiate between the two classes. In the future, more complex tests will be developed, with the following main additions proposed: Multi-class classification (differentiating between apnea class/hypopnea class, adding different sleep events such as microarousals, etc.). Multi-signal classification (adding other signals that may be indicative of abnormalities). Comparison with classical models, taking into account different metrics and aspects. References [1] J D Viqueira, D Faílde, M M Juane, A Gómez, and D Mera. Density matrix emulation of quantum recurrent neural networks for multivariate time series prediction. Machine Learning: Science and Technology, 6(1):015023, 2025. Acknowledgements This work has been supported by the EU’s Horizon 2020 under project NEASQC (grant No 951821), by the State Research Agency of the Spanish Government under Project PID2023-147422OB-I00 funded by MCIU/AEI/10.13039/501100011033 and by the Xunta de Galicia (Grant ED431C 2022/44) supported by the EU European Regional Development Fund (ERDF). DAE has received support from project RYC2022-038121-I, funded by MCIN/AEI/10.13039/501100011033 and European Social Fund Plus (ESF+), and project ED431F 2025/35 from Xunta de Galicia. JDVC and AMR were supported by Xunta de Galicia through the “Programa de axudas á etapa predoutoral” (IN606A-2023/011 and ED481A-2025/084 respectively). The authors also acknowledge Galicia Supercomputing Center (CESGA) for providing access to Qmio infrastructure with financing from the European Union, through the Programa Operativo Galicia 2014-2020 of ERDF_REACT EU, as part of the European Union’s response to the COVID-19 pandemic. https://eqtc2025.ku.dk/ European Quantum Technologies Conference 2025 (EQTC-2025), 10-12 November, Copenhagen, Denmark contact:
[email protected]