HARNESSING CLIENT-SIDE AI: DEVELOPMENT AND VALIDATION OF A TENSORFLOW.JS APPLICATION FOR NON-INVASIVE SNORING DETECTION
DOI:
https://doi.org/10.21776/ub.mnj.2026.012.01.08Keywords:
sleep apnea, snoring, artificial intelligence, machine learning, TensorFlow.js, sleep monitoring, non-invasive screening, web applicationAbstract
Background: Obstructive sleep apnea (OSA) is a prevalent global health issue, yet current monitoring methods are often inaccessible or impractical for routine, at-home use.
Objective: This study addresses the need for simple, non-invasive tools for sleep quality assessment.
Methods: We developed and evaluated a novel, browser-based snoring detection application leveraging TensorFlow.js. A binary classification model was trained on a balanced dataset of snoring and background noise audio. A key feature of the application is its client-side architecture, where all audio processing and model inference occur locally on the user's device, ensuring real-time performance and preserving user privacy. The model's performance was validated on a holdout test set using standard classification metrics.
Results: The model demonstrated robust performance, achieving an overall accuracy of 94.12%, a sensitivity of 95.00%, and a specificity of 93.22% in distinguishing snoring from ambient noise. The application successfully generated useful session statistics for users, including total snoring duration, frequency, and the percentage of snoring time during a monitoring session.
Conclusion: This study validates the use of a browser-based AI system as a reliable, scalable, and privacy-preserving tool for sleep quality monitoring. While not a diagnostic instrument, the application serves as a highly accessible preliminary screening and awareness tool. This approach represents a significant step toward democratizing sleep health monitoring and empowering individuals to take an active role in managing their well-being.
Downloads
References
Almendros I, Basoglu ÖK, Conde S V, Liguori C, Saaresranta T. Metabolic dysfunction in OSA: Is there something new under the sun? J Sleep Res; 2021. 30(5):e13250. DOI: 10.1111/jsr.13418
Baril AA, Martineau-Dussault MÈ, Sanchez E, André C, Thompson C, Legault J, et al. Obstructive sleep apnea and the brain: A focus on gray and white matter structure. Curr Neurol Neurosci Rep; 2021. 21(9):49. DOI: 10.1007/s11910-021-01094-2
Lechat B, Appleton S, Melaku Y, Hansen K, McEvoy R, Adams R, et al. The association of co-morbid insomnia and sleep apnea with prevalent cardiovascular disease and incident cardiovascular events. J Sleep Res; 2022. 31(5):e13583.
DOI: 0.1111/jsr.13563
Bhuniya S, Goyal M, Chowdhury N, Mishra P. Intermittent hypoxia and sleep disruption in obstructive sleep apnea increase serum tau and amyloid-beta levels. J Sleep Res; 2022. 31(3):e13488. DOI: 10.1111/jsr.13566
Caples S, Anderson W, Calero K, Howell M, Hashmi S. Use of polysomnography and home sleep apnea tests for the longitudinal management of obstructive sleep apnea in adults: An American academy of sleep medicine clinical guidance statement. J Clin Sleep Med. 17(5):1095–1101. DOI: 10.5664/jcsm.9240
Zhuang L, Dai M, Zhou Y, Zhang Y, Li J. Intelligent automatic sleep staging model based on CNN and LSTM. Front Public Heal; 2022. 10, 946833.
DOI: 10.3389/fpubh.2022.946833
Yan P, Luo W. WaveSleepNet: An interpretable network for expert-like sleep staging. arXiv Prepr arXiv; 2024. 2404.15342.
DOI: 10.48550/arXiv.2404.15342
Yeckle J, Manian V. Automated sleep stage classification in home environments: An evaluation of seven deep neural network architectures. Sensors; 2023. 23(21):8942. DOI: 10.3390/s23218942
Kang C, An S, Kim H, Choi S, Lee H, Lee J, et al. Age-integrated artificial intelligence framework for sleep stage classification and obstructive sleep apnea screening. Front Neurosci; 2023. 17:1059186.
DOI: 10.3389/fnins.2023.1059186
Pivetta B, Chen L, Nagappa M, Saripella A, Waseem R, Englesakis M, et al. Use and performance of the STOP-Bang questionnaire for obstructive sleep apnea screening across geographic regions. JAMA Netw Open. 4(1):e2034321.
Bariani RCB, Bigliazzi R, Junior MC, Moreira G, Fujita RR. Effectiveness of functional orthodontic appliances in obstructive sleep apnea treatment in children: Literature review. Braz J Otorhinolaryngol; 2021. 87(5):613–20. DOI: 10.1016/j.bjorl.2021.02.010
Geer J, Hilbert J. Gender issues in obstructive sleep apnea. Yale J Biol Med; 2021. 94(1):123–130. Available from: https://pubmed.ncbi.nlm.nih.gov/34602886/
Hu B, Zheng Z, Yang X, Li X, Wu Z, Chen X, et al. ConvTransSleepNet: A novel framework for EEG-based automatic sleep staging in wearable sleep sensors. 2024 IEEE Int Conf Networking, Sens Control; 2024;1–6.
DOI: 10.1109/NNICE61279.2024.10498257
Downloads
Published
Issue
Section
License
Copyright (c) 2025 MNJ (Malang Neurology Journal)

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.












