Sleep stage classification from ECG using machine learning: Evaluating the impact of signal duration
Mohammadreza Iravani1, Sadaf Moharreri1
1Department of Biomedical Engineering, Kho.C., Islamic Azad University, Khomeinishahr, Iran.
Neurobiology of Sleep and Circadian Rhythms
|December 17, 2025
Summary
This study shows that using only electrocardiogram (ECG) signals can accurately classify sleep stages. Longer ECG recordings significantly improve sleep stage prediction accuracy for accessible sleep disorder diagnosis.
Area of Science:
- Biomedical Engineering
- Computational Neuroscience
- Medical Signal Processing
Background:
- Accurate sleep stage classification is vital for diagnosing sleep disorders like insomnia and sleep apnea.
- Current manual scoring methods are time-consuming and limit scalability, especially in resource-limited settings.
- Automating sleep stage classification using machine learning can enhance diagnostic efficiency and reduce healthcare burdens.
Purpose of the Study:
- To develop and evaluate a simplified sleep stage classification system using only electrocardiogram (ECG) signals.
- To assess the feasibility of using heart rate variability (HRV) and Poincaré plot descriptors for sleep stage prediction.
- To demonstrate a cost-effective and scalable solution for sleep monitoring, particularly in low-resource environments.
Main Methods:
- Extracted heart rate variability (HRV) and Poincaré plot features from ECG signals.
- Trained machine learning models (Neural Networks, KNN, XGBoost, Random Forest) for five-stage sleep classification.
- Validated the approach on two public datasets (Haaglanden Medisch Centrum and MIT-BIH Polysomnographic Databases).
Main Results:
- The highest classification accuracy achieved was 67% using long-duration ECG recordings.
- Models trained on longer ECG segments outperformed those trained on shorter segments by 12%.
- The study highlights the significant impact of signal duration on classification performance.
Conclusions:
- Sleep stage classification is feasible using solely ECG signals, offering a simpler and more accessible alternative to multi-signal methods.
- ECG-only systems demonstrate potential for portable, low-cost, and scalable sleep monitoring solutions.
- The findings support the development of more accessible sleep disorder detection tools for low-resource settings.
Related Concept Videos
Electrocardiogram
5.3K
An electrocardiogram (ECG or EKG) is a critical diagnostic tool that records the electrical signals produced by the heart during each heartbeat. This recording is achieved through electrodes placed strategically on the arms, legs, and chest. The electrocardiograph amplifies these signals and produces 12 distinct tracings, offering a comprehensive understanding of the heart's electrical activity.
Three major waveforms are present in a typical ECG recording: the P wave, the QRS complex, and...
Three major waveforms are present in a typical ECG recording: the P wave, the QRS complex, and...
5.3K
Stages of Sleep
1.3K
Sleep progresses through distinct stages, each characterized by specific brain wave patterns and physiological responses ranging from wakefulness to stages of non-rapid eye movement, known as non-REM, to rapid eye movement, referred to as REM. Understanding these stages helps in recognizing how sleep supports various bodily and cognitive functions.
Before sleep begins, in wakefulness, the brain exhibits primarily beta waves, which are high in frequency and low in amplitude, indicating alertness...
Before sleep begins, in wakefulness, the brain exhibits primarily beta waves, which are high in frequency and low in amplitude, indicating alertness...
1.3K
ECG Interpretation of Rhythms
12.1K
An electrocardiogram (ECG)graphically represents the heart's electrical activity on ECG paper or a monitor.
Components of the Electrocardiogram
The primary components of a normal ECG waveform in Normal sinus rhythm(NSR) include the P wave, PR interval, QRS complex, ST segment, T wave, and occasionally a U wave.
ECG waveforms are divided by vertical and horizontal lines at standard intervals.
The horizontal axis measures time and rate, and the vertical axis measures amplitude or voltage....
Components of the Electrocardiogram
The primary components of a normal ECG waveform in Normal sinus rhythm(NSR) include the P wave, PR interval, QRS complex, ST segment, T wave, and occasionally a U wave.
ECG waveforms are divided by vertical and horizontal lines at standard intervals.
The horizontal axis measures time and rate, and the vertical axis measures amplitude or voltage....
12.1K
Correlation between ECG and Cardiac Cycle
11.5K
The electrical signals recorded on an electrocardiogram (ECG) occur before the mechanical processes of contraction and relaxation during the cardiac cycle.
A cardiac action potential originates in the SA node and spreads throughout the atria and the AV node in approximately 0.03 seconds. This results in the P wave in an ECG and triggers atrial contraction. The action potential is then briefly slowed at the AV node, allowing the atria to contract and fill the ventricles with blood before...
A cardiac action potential originates in the SA node and spreads throughout the atria and the AV node in approximately 0.03 seconds. This results in the P wave in an ECG and triggers atrial contraction. The action potential is then briefly slowed at the AV node, allowing the atria to contract and fill the ventricles with blood before...
11.5K
Instrumentation Amplifier
993
An electrocardiography (ECG) machine is an essential piece of medical equipment used to monitor the electrical activity of the heart. It operates by detecting small electrical changes on the skin that result from the depolarization of the heart muscle during each heartbeat. However, these signals are in the microvolt range and can be easily overwhelmed by noise or interference.
To overcome this challenge, an ECG machine utilizes an instrumentation amplifier. This specialized amplifier is...
To overcome this challenge, an ECG machine utilizes an instrumentation amplifier. This specialized amplifier is...
993


