Preprint / Version 1

To what extent can machine learning predict individual responses to temazepam using baseline polysomnographic sleep characteristics?

##article.authors##

  • Briana Vasile British School of Bucharest, Bucharest, Romania

DOI:

https://doi.org/10.58445/rars.4159

Keywords:

Sleep Medicine, Temazepam, Polysomnography, Machine Learning

Abstract

Sleep disorders affect millions of people worldwide, who then commonly get prescribed benzodiazepines such as temazepam, helping improve sleep quality. However, individual responses to these medications can vary substantially. This makes it difficult to identify which patients are most likely to benefit from treatment. Thus, this study aims to investigate the extent to which machine learning can be used to predict individual responses to temazepam using baseline polysomnographic (PSG) sleep characteristics.

 

Through the use of paired placebo and temazepam overnight sleep recordings from 22 participants, multiple sleep metrics were extracted. These sleep metrics were then compared between treatment conditions. Exploratory analyses evaluated changes in overall sleep architecture, variability between individuals, and demographic subgroups. AI model development followed an 80/10/10 train-validation-test split to maximise predictive performance while minimising overfitting. Ridge Regression and Random Forest Regression were tested using leave-one-out cross-validation (LOOCV) within the development cohort, with change in sleep efficiency defined as the primary treatment-response outcome.

 

Temazepam was associated with a significant reduction in N1 sleep (p = 0.024) and increase in N2 sleep (p = 0.027). Conversely, changes in overall sleep efficiency, total sleep time, and Wake After Sleep Onset (WASO) were not statistically significant. Ridge Regression achieved an LOOCV Mean Absolute Error (MAE) of 3.63 percentage points, compared with 3.79 for Random Forest Regression. However, Random Forest produced lower prediction errors in the validation set and was therefore chosen for independent testing, where it produced an MAE of 3.03 percentage points.

 

These findings suggest that baseline PSG characteristics do contain information relevant to individual temazepam response. Predictive performance, however, was relatively limited due to a smaller sample size and varied across evaluation stages. Thus, the findings should be considered preliminary and support the feasibility of individualised treatment-response modelling rather than be seen as a clinically reliable prediction.

References

De Gans, C. J., Burger, P., Van Den Ende, E. S., Hermanides, J., Nanayakkara, P. W. B., Gemke, R. J. B. J., Rutters, F., & Stenvers, D. J. (2024). Sleep assessment using EEG-based wearables – A systematic review. Sleep Medicine Reviews, 76, 101951. https://doi.org/10.1016/j.smrv.2024.101951

Huang, A. A., & Huang, S. Y. (2026). Revolutionizing Sleep Medicine: The Impact of Machine Learning on Diagnosis, Treatment, and Personalized Care. Health Science Reports, 9(6), e72323. https://doi.org/10.1002/hsr2.72323

Jackson, E. A., Cardoni, A. A., McElnay, J. C., Jones, M. E., & Alexander, B. (1982). Temazepam (Restoril, Sandoz Pharmaceuticals). Drug Intelligence & Clinical Pharmacy, 16(9), 650–656. https://doi.org/10.1177/106002808201600902

Jaki, T., Chang, C., Kuhlemeier, A., The Pooled Resource Open-Access ALS Clinical Trials Consortium, & Van Horn, M. L. (2025). Predicting Individual Treatment Effects: Challenges and Opportunities for Machine Learning and Artificial Intelligence. KI - Künstliche Intelligenz, 39(1), 27–32. https://doi.org/10.1007/s13218-023-00827-4

Kozole Smid, A. K., Mlakar, A., & Štukovnik, V. (2024). Toxicity of benzodiazepines in the treatment of insomnia disorders in older adults: A systematic literature review. Croatian Medical Journal, 65(2), 146–155. https://doi.org/10.3325/cmj.2024.65.146

Liu, M.-H., Chien, S.-Y., Wu, Y.-L., Sun, T.-H., Huang, C.-S., Hsu, K.-C., & Hang, L.-W. (2024). EfficientNet-based machine learning architecture for sleep apnea identification in clinical single-lead ECG signal data sets. BioMedical Engineering OnLine, 23(1), 57. https://doi.org/10.1186/s12938-024-01252-w

Naha, S., Sivaraman, M., & Sahota, P. (2024). Insomnia: A Current Review. Missouri Medicine, 121(1), 44–51.

Pollard, T., Moody, B. E., Lehman, L. H., Gow, B. J., Fernandes, C., Xie, C., Johnson, A., Mark, R. G., & Heldt, T. (2026). PhysioNet as a global platform for biomedical research. Nature Health, 1(8), 792–795. https://doi.org/10.1038/s44360-026-00096-z

Rechtschaffen, A., & Kales, A. (Eds). (1968). A Manual of Standardized Terminology, Techniques and Scoring System for Sleep Stages of Human Subjects (NIH Publication No. 204). U.S. National Institute of Neurological Diseases and Blindness.

Downloads

Posted

2026-09-13