1D-Vision Transformer: Pioneering Explainable Multitask Learning for Home-Based Sleep Care

Multimodal Sleep Stage and Sleep Apnea Classification Using Vision Transformer: A Multitask Explainable Learning Approach

2025-01-01
Kianoosh Kazemi, Iman Azimi, Michelle Khine, Rami N Khayat, Amir M Rahmani, Pasi Liljeberg
Summary
Problem
Method
Results
Takeaways
Abstract

This paper introduces a 1D-Vision Transformer (1D-ViT) framework designed for the simultaneous classification of five sleep stages and sleep apnea types. By utilizing multimodal wearable data (PPG and respiratory signals) in a multitask learning (MTL) setting, the model achieves 78% accuracy for sleep staging and 74% for apnea detection, moving toward clinically viable home-based monitoring.

TL;DR

Researchers have developed a 1D-Vision Transformer (1D-ViT) that simultaneously classifies sleep stages and identifies apnea types using simple wearable sensor data (PPG and respiration). Achieving 78% accuracy in sleep staging, the model uses "Attention Maps" to show clinicians exactly which physiological events—like a gasp or a shallow breath—triggered the diagnosis, solving the AI "black box" problem in sleep medicine.

Problem & Motivation: Beyond the Lab and the Black Box

Sleep monitoring is currently trapped between two extremes:

  1. PSG (Polysomnography): The gold standard, but it's a "wires-everywhere" lab experience that is expensive and impossible for long-term home use.
  2. Consumer Wearables: Convenient, but often scientifically shallow, treating sleep stages and disorders as unrelated metrics.

Existing AI solutions for sleep staging often ignore the intrinsic correlation between a sleep stage (like REM) and the physiological manifestation of a disorder (like Apnea). Moreover, clinicians are hesitant to use AI because it doesn't explain why it labeled a segment as "N3" or "Hypopnea." The authors set out to build a bridge: a model that is both multi-talented and transparent.

Methodology: The Power of 1D-Vision Transformers

The core innovation lies in treating 1D physiological signals as a sequence of "patches," much like how a standard ViT treats parts of an image.

The Architecture

The model processes four channels: Photoplethysmogram (PPG), Respiratory Flow (RF), and two Respiratory Effort (RC, RA) signals.

  • Patching: The signals are divided into non-overlapping patches using a 1D-convolutional layer.
  • Self-Attention: The Transformer Encoder uses Multi-Head Self-Attention (MHSA) to capture global dependencies across a 30-second window.
  • Multitask Heads: The model branches into two specialized output layers—one for the 5 sleep stages (Wake, N1, N2, N3, REM) and one for apnea types (Normal, Central, Obstructive, Hypopnea).

Overall Architecture and Data Pipeline

Experiments & Results: Robust and Interpretable

The model was tested on a dataset of 123 individuals using an inter-patient testing approach, meaning it was tested on people it had never "seen" during training—a crucial requirement for real-world medical applications.

Performance Highlights:

  • Sleep Staging: 78% Accuracy, with a balanced F1-score of 0.79.
  • Apnea Classification: 74% Accuracy overall, excelling in detecting normal breathing vs. pathological events.
  • Task Synergy: The model performed exceptionally well in certain cohorts, reaching 94% accuracy for hypersomnia patients.

Sleep Stage Confusion Matrix

Opening the Black Box

What makes this study "clinical-grade" is its use of Attention Scores. By analyzing where the Transformer "looks," the researchers found that the model naturally prioritizes:

  • Respiratory Troughs and Peaks: The points where inhalation shifts to exhalation.
  • Stability: The model ignores irregular artifacts caused by apnea when trying to determine the sleep stage, focusing instead on the "cleaner" parts of the signal to ensure accuracy.

Critical Analysis & Conclusion

Takeaway

The 1D-ViT proves that we don't need a lab full of wires to get professional-grade sleep insights. By using Multitask Learning, the model learns that sleep stages and disorders are two sides of the same coin, leading to better performance in both.

Limitations & Future Work

While the model is highly accurate for stages like N2 and Wake, transitional stages like N1 (36% F1-score) and REM still pose challenges due to their physiological similarity to light sleep or wakefulness. Furthermore, identifying "Hypopnea" remains difficult because its patterns are subtle compared to full "Apnea" events.

The future of sleep medicine isn't just "more data"—it's smarter, explainable models that can run on the hardware already sitting on our bedside tables.

Find Similar Papers

Try Our Examples

  • Search for recent studies using Multitask Learning (MTL) for simultaneous sleep stage and sleep apnea classification in peer-reviewed journals.
  • Which paper first introduced the Vision Transformer (ViT) architecture, and how have subsequent works adapted it specifically for 1D physiological signal processing?
  • Investigate the application of attention-based explainability techniques in other medical time-series tasks such as ECG-based arrhythmia detection or EEG-based seizure prediction.
Contents
1D-Vision Transformer: Pioneering Explainable Multitask Learning for Home-Based Sleep Care
1. TL;DR
2. Problem & Motivation: Beyond the Lab and the Black Box
3. Methodology: The Power of 1D-Vision Transformers
3.1. The Architecture
4. Experiments & Results: Robust and Interpretable
4.1. Performance Highlights:
4.2. Opening the Black Box
5. Critical Analysis & Conclusion
5.1. Takeaway
5.2. Limitations & Future Work