# Transformer-based deep learning approach for obstructive sleep apnea detection using single-lead ECG

**Authors:** Malak Abdullah Almarshad, Saad Al-Ahmadi, Saiful Islam, Adel Soudani, Ahmed S. BaHammam

PMC · DOI: 10.3389/frai.2026.1727091 · Frontiers in Artificial Intelligence · 2026-02-11

## TL;DR

This paper presents a new deep learning model using a single-lead ECG to detect obstructive sleep apnea with high accuracy and detailed insights.

## Contribution

A transformer-based deep learning model with a novel autoencoder positional encoding technique for OSA detection using raw single-lead ECG data.

## Key findings

- The model achieves a high F1 score, outperforming existing methods by over 13% on average.
- The model provides one-second interval classifications of apnea episodes for detailed clinical insights.

## Abstract

Obstructive sleep apnea (OSA) results from repeated collapses of the upper airway during sleep, which can lead to serious health complications. Although polysomnography (PSG) is the diagnostic gold standard, it is costly, labor-intensive, and associated with long waiting times. With the rapid evolution of automated scoring solutions and the emergence of machine learning (ML) and deep learning (DL) in many disciplines, there is a need for tools that use fewer signals and can provide accurate diagnoses. DL models can an process large amounts of data and often generalize effectively to new instances. This makes them a suitable choice for classifying continuous time series data. This study introduces a transformer-based deep learning approach using a single-lead electrocardiogram (ECG) for OSA detection. The proposed architecture, designed to handle raw signals with high sampling rates, preserves temporal continuity over unlimited durations. Without any preprocessing, the model tolerates high-noise raw data. The model is tested with different positional embedding techniques. Additionally, a novel positional encoding technique using an autoencoder is introduced. The proposed approach achieves a high F1 score, outperforming other published work by an average margin of more than 13%. In addition, the model classifies apnea episodes at one-second intervals, providing clinicians with nuanced insights.

## Linked entities

- **Diseases:** obstructive sleep apnea (MONDO:0007147)

## Full-text entities

- **Diseases:** tachycardia (MESH:D013610), arrhythmias (MESH:D001145), stroke (MESH:D020521), DL (MESH:D007859), metabolic disease (MESH:D008659), bradycardia (MESH:D001919), Sleep Disorders (MESH:D012893), OSA (MESH:D020181), Sleep Apnea (MESH:D012891), Apnea (MESH:D001049), CVDs (MESH:D002318)
- **Chemicals:** TN (MESH:C009497), oxygen (MESH:D010100), NaN (-)
- **Species:** Homo sapiens (human, species) [taxon 9606]

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/PMC12932532/full.md

## Figures

8 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12932532/full.md

## References

63 references — full list in the complete paper: https://tomesphere.com/paper/PMC12932532/full.md

---
Source: https://tomesphere.com/paper/PMC12932532