Abstract
Sleep stage flagging is critical for diagnosing conditions like insomnia, sleep apnea, and narcolepsy. Traditional methods rely on time-intensive manual scoring by experts, limiting scalability and accessibility, especially in resource-limited settings. Automating sleep stage classification through signal processing and machine learning could improve diagnostic efficiency and reduce healthcare burdens. While prior studies have utilized multiple signals such as electroencephalogram (EEG), electromyogram (EMG), and electrocardiogram (ECG), this study focuses solely on ECG to provide a simpler, more accessible solution. By simplifying signal input, the approach enhances feasibility in resource-constrained environments. Features based on heart rate variability (HRV) and Poincaré plot descriptors were extracted and used to train machine learning models for five-stage sleep classification. The approach was evaluated using two publicly available datasets, the Haaglanden Medisch Centrum Sleep Staging Database and the MIT-BIH Polysomnographic Database, which were chosen for their varied recording environments and subject diversity. Neural Networks, K-Nearest Neighbors (KNN), XGBoost, and Random Forest were employed to assess performance. The highest classification accuracy of 67 % was achieved with long-duration ECG recordings, outperforming models trained on shorter segments by 12 %. These findings emphasize the impact of signal duration on classification performance and suggest opportunities to refine sleep stage prediction. The study demonstrates the feasibility of ECG-only systems for portable, low-cost, and scalable sleep monitoring. The insights gained may facilitate the development of more accessible and efficient sleep disorder detection, particularly in low-resource settings.