๐๏ธ ์ด ๋
ผ๋ฌธ์ Standford ๋ํ๊ต์์ ์ง์ ์์งํ 14,000๋ช
์ ํ์ ๋ฐ์ดํฐ๋ฅผ ๊ฐ์ง๊ณ Sleep Foundation Model์ ๊ตฌ์ถํ ๋ด์ฉ์ ๋ด๊ณ ์๋ค. ICML์ 2024๋
์ฑํ๋์์ผ๋ฉฐ, ์ฝ๋๋ ๊ณต๊ฐ๋์ด์๋ค: https://github.com/rthapa84/sleepfm-codebase. Biomedical AI ๋ถ์ผ์์ ์ํ ์ ๋์ด ์๋ AI ํํ์ ๊ฐ์ ๋์๋ค๋ ์ ์ด ์ธ์๊น์๊ณ , ์ด๋ฅผ ์ํด ์ด๋ ํ ๋ฐฉ๋ฒ๋ก ๊ณผ novelty๋ฅผ ๊ฐ์ง๊ณ ์ฐ๊ตฌ๋ฅผ ์งํํ๋์ง ์ดํด๋ณด๋ฉด ์ถํ์ ๋๋ AI ํํ์ ๋
ผ๋ฌธ์ ์ ์ถํ ๋ ๋์์ด ๋ง์ด ๋ ๊ฒ ๊ฐ์ ๋ฆฌ๋ทฐํด ๋ณด์๋ค.
1. Introduction
- Sleep ์ฐ๊ตฌ์์ gold standard๋ก ์ฐ์ด๋ PSG๋ ํฌ๊ฒ ์ธ ๊ฐ์ง modality๋ก ๋๋ ์ ์๋ค:
- Brain Activity Signals (BAS) : electroencephalogram (EEG - ๋ํ๋), electrooculograms (EOG - ์์ ๋), electroencephalogram (EMG - ๊ทผ์ ๋). ๋ณดํต ์๋ฉด ๋จ๊ณ๋ฅผ ํ๋จํ ๋ ๊ฐ์ฅ ๋ง์ด ์ฌ์ฉ๋๋ค. ์ด 10๊ฐ ์ฑ๋.
- Electrocardiogram (ECG, ์ฌ์ ๋) : ์ฌ๋ฐ๋์ ์ฃผ๊ธฐ์ค์ ์ผ์ด๋๋ ์ฌ์ฅ์ ์ ๊ธฐ์ ํ๋ ์ํ๋ฅผ ์ธก์ . sleep disordered breathing events (SDB) ๊ฒ์ถ์ ์ฌ์ฉ๋ ์ ์์. ์ด 2๊ฐ ์ฑ๋.
- Respiratory sensors : ๊ฐ์ด, ๋ณต๋ถ ์์ง์, ์ฌ๋ฐ, ๋น๊ฐ ํ๋ฆ(nasal flow), ๊ตฌ๊ฐ ํ๋ฆ(oral flow)๋ฅผ ํฌํจ. SDB ๊ฒ์ถ์ ์ง์ ์ ์ผ๋ก ํ์ฉ๋จ. ์ด 7๊ฐ ์ฑ๋.
- ๊ธฐ์กด ์๋ฉด ์ฐ๊ตฌ๋ค์ ํ๊ณ:
- ์๋ฉด ํ๋
์๋ํ๋ labeled data์ ํ์ ์ ์ผ๋ก ์ฐ๊ตฌ๊ฐ ์ด๋ฃจ์ด์ง.
- ํ ๊ฐ์ง ํ์คํฌ์๋ง ์ ์ฉ ๊ฐ๋ฅํ ๋ชจ๋ธ
- Contrastive Learning
- ์๋ฉด ๋ถ์ผ์์ CL์ ํ์ฉํ ์ฐ๊ตฌ: single channel ECG, ECG + electronic health records (EHR)
- multi-modal CL ์ ๊ทผ ๋ฐฉ๋ฒ์ผ๋ก PSG ๋ฐ์ดํฐ๋ฅผ ๋ถ์ํ ๊ฒ์ ๋ณธ ์ฐ๊ตฌ๊ฐ ์ต์ด์ด๋ค.
- Contribution
- Stanford Sleep Clinic์์ 14,000๋ช
์ ํ์์๊ฒ์ ์์งํ 100,000 ์๊ฐ์ ๋ฐ์ดํฐ๋ฅผ ํ์ฉํ ์ต์ด์ contrastive learning ๊ธฐ๋ฐ์ foundation model์ด๋ค.
- ์ธ๊ตฌํต๊ณํ์ ์ ๋ณด (๋์ด, ์ฑ๋ณ), ์๋ฉด ๋จ๊ณ ๋ถ๋ฅ, ์๋ฉด ํธํก ์ฅ์ ์ด๋ฒคํธ ๊ฒ์ถ์ ํ์คํฌ์์ SleepFM์ด baseline (end-to-end CNN model)๋ณด๋ค ์ข์ ์ฑ๋ฅ์ ๋ณด์๋ค.
- Leave-one-out CL ๊ธฐ๋ฒ์ ์๋กญ๊ฒ ๋์
ํด์ Pairwise CL๋ณด๋ค downstream task์์ ์ฑ๋ฅ์ด ์ข์์ ์ฆ๋ช
ํ์๋ค.
- Machine Learning for Analyzing Sleep Data
- Autoencoders, CNNs, RNNs, DNNs ๋ฑ์ด ์๋ฉด ๋จ๊ณ ๋ถ๋ฅ์ ์ฐ์.
- ํธํก ์ด๋ฒคํธ ๊ฒ์ถ ํ์คํฌ์์๋ ECG, EEG์ respiratory channels ๋ฑ์ด ์ฃผ๋ก ์ฐ์. multi-modal์ ์ฌ์ฉํ์ฌ (EEG, EOG, EMG) multi-task (e.g. sleep stages, arousal, leg movements, and sleep-disordered breathing) learning ๋ชจ๋ธ๋ ์์์ง๋ง, ๋ชจ๋ supervised learning ์ด์๋ค.
- Contrastive Learning
- ์ปดํจํฐ ๋น์ ์์ ์์๋์ด ๋ฐ์ ํ self-supervised learning ํํฌ๋. InfoNCE, SimCLR, MoCo, SupCon ๋ฑ์ด ์์. ์ด๋ค์ ๋๋ถ๋ถ image-based์ uni-modal contrastive appraoch ๋ผ๊ณ ๋ณผ ์ ์์.
- ๊ทธ์ ๋ฐํด Contrastive Language-Image Pretraining (CLIP) ์ image์ text embedding์ ํ์ฉํ multi-modal model.
- ConVIRT: chest radiographs ์ report ๋ฅผ ํ์ฉ (multi-modal)
- ์ปดํจํฐ ๋น์ ์ธ ์๋ฉด ์ํ๊ณ์์ ์ฐ์ธ multi-modal contrastive learning: ECG + structured records / ECG + EHR + clinical notes
- SleepFM์ PSG ๋ฐ์ดํฐ์ 19๊ฐ channel์ ํ์ฉํ ์ต์ด์ multi-modal contrastive model์ด๋ค.
3. Method
3.1. Dataset and Preprocessing
- 30-second ๋จ์ - ๋ณธ ๋
ผ๋ฌธ์์๋ clip์ด๋ผ๊ณ ์นญํจ.
- resampled to 256 Hz
- Sleep Stage: Wake, Stage1, Stage2, Stage3, REM ๋ถ๋ฅ ๋ฌธ์
- SDB: binary label
- ์ ์ฒด ๋ฐ์ดํฐ์
์ ๋ค์๊ณผ ๊ฐ์ด ๋๋: pretrain/train/validation/test as (11,261/1,265/141/1,401) - ํ์ ๊ธฐ์ค
- pretrained dataset์ Foundation model์ pretrain ํ ๋์๋ง ์ฐ์.
3.2. Embedding Model

- 3๊ฐ์ EfficientNet architecture๋ฅผ ํ์ฉํ multi-channel 1D convolution์ด ๊ฐ๊ฐ modality์ embedding model (Encoder)๋ก ์ฌ์ฉ๋จ.
- Depthwise separable convolution, Dropout layer, Residual Connection์ด ์ฌ์ฉ๋จ.
3.3. Multi-modal Contrastive Learning
- postive pair ๊ธฐ์ค: ๊ฐ์ ์๊ฐ์ different modality - temporally aligned 30-second clips across modality
- negative pair: ๊ทธ ์ธ training batch์์ non-matching instances๋ ๋ชจ๋ negative pair๋ก ํ์ต.
- 2๊ฐ์ง Contrastive Learning Types (+ ์ฌ๊ธฐ์์ ์๋กญ๊ฒ ์ ์ํ Leave-one-out CL)
- Pairwise CL: 3๊ฐ์ modality ์ค 2๊ฐ๋ฅผ ๊ณ ๋ฅด๋ ์กฐํฉ์ผ๋ก ๊ฐ๊ฐ contrastive loss๋ฅผ ๊ณ์ฐ, ์ต์ข
์ ์ผ๋ก ๋ชจ๋ ์กฐํฉ์์ ๋์จ loss๋ฅผ ํฉ์ณ์ ์ฌ์ฉ.
- Leave-one-out CL: 3๊ฐ์ modality ์ค 2๊ฐ์ embedding์ ํ๊ท ๋ธ ๊ฒ๊ณผ ๋ค๋ฅธ ํ๋์ modality๋ฅผ pair๋ก ์ฌ์ฉ.
3.4. Model Training
- Baseline model: 1D EfficientNet ๊ตฌ์กฐ๋ฅผ ์ฌ์ฉํ CNN ๊ธฐ๋ฐ ๋ชจ๋ธ
- Downstream task๋ฅผ ์ํด modality encoder์์ ๊ฐ๊ฐ training, validation, test set์ embedding์ ๋ฝ๋๋ค. ์ดํ Logistic Regresion classifier๋ฅผ ์ฌ์ฉํ์ฌ sleep stage์ SDB ํ์คํฌ๋ฅผ ํ์ต์ํจ๋ค.
- ์ฝ๋๋ฅผ ๋ณด๋ Logistic Regression์ผ๋ก multi-class training ์ OVR(one vs. rest) ๋ฐฉ์์ผ๋ก ํ์์. XGBClassifier๋ก๋ ํ
์คํธ ํด๋ณธ ๊ฒ ๊ฐ์๋ฐ Logistic Regression์ด ๋ ์ ๋์์ ํ์๋ฅผ ์ ํํ ๊ฒ ๊ฐ์.
๐ก ๋์ ๊ถ๊ธ์ฆ: ์ Foundation Model์์๋ Ridge/Logistic Regression๊ณผ ๊ฐ์ ๋จ์ํ ๋จธ์ ๋ฌ๋ ๊ธฐ๋ฐ์ linear probing์ ์ฌ์ฉํ๋ ๊ฒ์ผ๊น? Deep Neural Network (FC layer ํน์ CNN layer) ๋ฑ์ ์ฌ์ฉํ๋ฉด ์๋๋? ์๋๋ ChatGPT์ ๋ต๋ณ์ด๋ค.
- ์ฐ๋ฆฌ๋ Foundation model์ embedding์ด ์ผ๋ง๋ informative ํ์ง, linearly separable ํ ๊ฒ์ด ๊ถ๊ธํจ.
- ๋ง์ฝ DNN์ ์ฌ์ฉํ๋ค๋ฉด:
- Overfit to small downstream data
- Hide the weakness of poor embeddings by adding capacity ๋ฑ์ ๋ฌธ์ ๊ฐ ์์ ์ ์์.
- ๋ฐ๋ผ์ logistic/ridge regression์ model capacity๊ฐ ๋ณ์๊ฐ ๋ ์ ์๋ ๊ฐ๋ฅ์ฑ์ ์์ ๋ฏ๋ก, foundation model์ embedding quality์๋ง ์์กดํ์ฌ ๋ถ๋ฅ ๋ฌธ์ ๋ฅผ ํ ์ ์๋๋ก ํ๋ค.
4. Experiments and Results
๐๏ธ ๋
ผ๋ฌธ์ ํ์ด๋ผ์ดํธ์ธ ์คํ ํํธ์ด๋ค. ๋ค์ํ ๋ค์ด์คํธ๋ฆผ ํ์คํฌ์์ SleepFM ์๋ฑํ ์ฑ๋ฅ์ ๋ณด์ฌ์ฃผ๊ณ , multi-modality, few-shot ์ฑ๋ฅ, public dataset์ ํ์ฉํ external validation์ ํ์๋ค.
4.1. Demographic Attributes Classification
- ๋์ด๋ฅผ ์ด 4๊ฐ์ ๊ทธ๋ฃน์ผ๋ก ๋๋์ด์ ๋ง์ถ๋ ๋ถ๋ฅ ๋ฌธ์ :

- Leave-One-Out ๋ฐฉ์์ด ์ฑ๋ฅ์ด ๊ฐ์ฅ ์ข์๋ค.
- ์ฑ๋ณ ๋จ vs. ์ฌ ๋ถ๋ฅ ๋ฌธ์ :

- ๋ง์ฐฌ๊ฐ์ง๋ก Leave-One-Out ๋ฐฉ์์ด ์ฑ๋ฅ์ด ๊ฐ์ฅ ์ข์๋ค.
4.2. Retrieval Analysis
- ํ๋์ modality embedding์ ๊ฐ์ง๊ณ cosine similarity๋ฅผ ํ์ฉํ์ฌ ๊ฐ์ฅ ๊ฐ๊น์ด embedding์ ์ฐพ๊ธฐ
- Top10 ์ค์์ ์ ๋ต pair๊ฐ ์์ผ๋ฉด count
- ์ด 90,000๊ฐ์ ๋๋คํ๊ฒ ์ ํ๋ clip์ ๊ฐ์ง๊ณ ์ํ.
- ์ฌ๊ธฐ์์ randomํ๊ฒ 10๊ฐ๋ฅผ ๊ณจ๋์ ๋ Recall@10๋ 10/90000 = 0.0001 (์ด ๊ฐ๋ณด๋ค ์ปค์ผ ํจ)

- ๊ฒฐ๊ณผ: Pairwise CL์ด ์๋ฑํ ์ฑ๋ฅ์ด ์ข์์. ๋ฌธ์ ์์ฒด๊ฐ pairwise cosine similiarty๋ฅผ ๊ณ์ฐํ๋ ๊ฒ์ด๊ธฐ ๋๋ฌธ์ training ์์ pairwise๋ก ํ๋ จ์ํค๋ ๊ฒ์ด ๋ ํจ๊ณผ์ ์ด์์ ๊ฒ.
- ๋ค๋ง Respiratory๋ก ๋ค๋ฅธ modality๋ฅผ retrieval ํ๋ ํ์คํฌ์์๋ ๋น๊ต์ ์ฑ๋ฅ์ด ์ข์ง ์์์. ๊ทธ ์ด์ ๋ก๋ BAS๋ ECG๋ ์ง์ ์ ์ธ ์ ๊ธฐ ์๊ทน์ผ๋ก ์ธก์ ํ๋ ๊ฒ์ธ๋ฐ Repiratory channel์ ๊ฐ์ ์ ์ธ ์์ง์์ ๊ธฐ๋กํ๋ ๊ฒ์ด๊ธฐ ๋๋ฌธ์ ๋ชธ์ ์์ธ๋ non-breathing related motion ๋ฑ์ ์ํฅ์ ๋ฐ์ ์ ์๊ธฐ ๋๋ฌธ์ด๋ผ๊ณ ์ค๋ช
.
4.3. Downstream Classification Tasks
-
Sleep Stage classification ์ฑ๋ฅ

-
SDB classification ์ฑ๋ฅ (Binary)

- Supervised CNN: pretraining + training dataset์ ๋ชจ๋ ํ์ฉํ์ฌ ํ๋ จ
- SleepFM (Leave-On-Out / Pairwise): pretraining์ผ๋ก FM ๋ชจ๋ธ ํ๋ จ, training data๋ก linear probing.
- ๊ฒฐ๊ณผ: SleepFM ์ค Leave-One-Out ์ด ์ฑ๋ฅ์ด ์ข์๋ค.
- ์ถ๊ฐ์ ์ผ๋ก, ๊ฐ๊ฐ์ single modality embedding๋ง์ ๊ฐ์ง๊ณ ์ ํ์คํฌ๋ฅผ ์งํ. BAS๋ sleep stage classification์์ ์ข์ ์ฑ๋ฅ์, repiratory signal์ SDB event detection์์ ์ข์ ์ฑ๋ฅ์ ๋ณด์ฌ์ฃผ์๋ค. ๊ฐ๊ฐ์ single modality๋ง์ ๊ฐ์ง๊ณ ๋ ์ด๋ ์ ๋์ ์ฑ๋ฅ์ ๋์ค๋๋ผ.
- ์๋ก ๋ค๋ฅธ age์ gender group์์์๋ ๊ฐ๊ฐ์ ํ์คํฌ ์ฑ๋ฅ์ ๋น๊ตํด ๋ณด์์ ๋, ํฐ ์ฐจ์ด๊ฐ ์์๋ค.
4.4. Few-Shot Evaluation
- few shot์ ์ฑ๋ฅ์ ๋น๊ตํ๊ธฐ ์ํด model์ด ๋ณด๋ ํ์์ ์๋ฅผ k=1 ๋ถํฐ ์ต๋(1265๋ช
)๊น์ง ๋๋ ค๊ฐ๋ฉฐ ๋น๊ตํ์์.
- Supervised CNN: few-shot example๋ง ๊ฐ์ง๊ณ ํ๋ จ
- SleepFM: ์ด๋ฏธ pretrained ๋ ๋ชจ๋ธ์ few-shot๋ง ๊ฐ์ง๊ณ logistic regression ๋ชจ๋ธ ํ๋ จ
- ์์ํ ์ ์๋ฏ์ด, ๊ฒฐ๊ณผ๋ SleepFM, Leave-One-Out์ด ๊ฐ์ฅ ์ข์๋ค.

4.5. Benefit of Multi-Modal Pretraining
- 3๊ฐ์ modality๋ฅผ ์ ๋ถ ์ฌ์ฉํ๋ ๊ฒ์ด ๊ฐ์ฅ ์ข์ ์ฑ๋ฅ์ ๋ณด์์.
- 2 modality์ single modality๋ฅผ ๊ฐ์ง๊ณ pretraining ์ ํตํด Foundation Model์ ํ์ต
- ์ดํ 3๊ฐ, 2๊ฐ, 1๊ฐ์ modality๋ฅผ ๊ฐ์ง๊ณ ํ์ตํ Foundation Model์์ ๊ฐ๊ฐ BAS embedding์ ๋ฝ์ sleep stage classification์ ์ํ logistic regression ์ ํ์ต, ๋์ผํ๊ฒ SDB detection์์๋ respiratory embedding๋ง ๋ฝ์์ ํ์ตํ์ฌ ์ฑ๋ฅ์ ๋น๊ตํ์๋ค.

- Sleep Stage์์๋ BAS๊ฐ ๊ฐ์ฅ ์ฐ๊ด์ฑ์ด ๋์ผ๋ฏ๋ก BAS / BAS+RESP / BAS+ECG / BAS+ECG+RESP ๋ฅผ ํ์ฉํ Foundation Model ์ฑ๋ฅ์ ๋น๊ตํ์๊ณ ,
- SDB์์๋ Respiratory signal์ด ๊ฐ์ฅ ์ฐ๊ด์ฑ์ด ๋์ผ๋ฏ๋ก RESP / RESP + BAS / RESP + ECG / RESP + BAS + ECG ๋ฅผ ํ์ฉํ Foundation Model ์ฑ๋ฅ์ ๋น๊ตํ์์.
- Few-shot evaluation์ผ๋ก training dataset์ ์ฐ์ธ ํ์ ์๋ฅผ ์ ์ฐจ ๋๋ ค๊ฐ๋ฉฐ ์ฑ๋ฅ ๋น๊ต
- ๊ฒฐ๋ก ์ ์ผ๋ก 2๊ฐ์ modality๋ฅผ ๊ฒฐํฉํ BAS-ECG ๋ชจ๋ธ๊ณผ RESP-ECG ๋ชจ๋ธ์ ์ฑ๋ฅ์ด 3๊ฐ modality๋ฅผ ์ฌ์ฉํ ๊ฒ๊ณผ ๋น์ทํ(ํน์ ๋ ์ข์) ์ฑ๋ฅ์ ๋ณด์๋๋ฐ, ์ด๋ฅผ ํตํด ECG signal์ด ์ข๋ pretraining ์์ representation์ ๋์ฑ ํ๋ถํ๊ฒ ๋ง๋ค์ด์ค๋ค๋ ๊ฒ์ ์ ์ ์๋ค.
- ๋ํ BAS๋ RESP๋ฅผ ๋จ๋
์ผ๋ก pretraining ์ ์ฌ์ฉ์์๋ ์ฑ๋ฅ์ด ์ง์์ ์ผ๋ก ์ข์ง ์์๋ค.
4.6. External Validation
- pretraining stage์์๋ Stanford ์์ ์์งํ ๋ฐ์ดํฐ์
์ ํ์ฉํ๊ณ , downstream task์์๋ PhysioNet2018 ๋ฐ์ดํฐ๋ฅผ ํ์ฉํ์ฌ generalizability ๋ฅผ ๋ณด์ฌ์ฃผ์๋ค.
- ๋น๊ต: Supervised-CNN์ external dataset์ผ๋ก๋ง supervised learning ์ ์งํํ์์.
- 100๊ฐ์ test set์ ๋ํ ์ฑ๋ฅ ๋น๊ต ๊ฒฐ๊ณผ: SleepFM์ด Supervised CNN๋ณด๋ค ์ข์๋ค.
- ์ฆ, domain์ด ๋ค๋ฅธ ๋ณ์์ ๋ฐ์ดํฐ๋ฅผ ํ๋๋ ๋ณด์ง ์์ pretrained foundation model์ด ์๋ก์ด site์ ๋ฐ์ดํฐ์
์๋ adaptationํ ์ ์๋ค๋ ๊ฒ์ ๋ณด์๋ค.

5. Discussion and Conclusion
Future Work
- Standford์์ ์์งํ one institution sleep data๋ง์ ๊ฐ์ง๊ณ ์คํ์ ์งํํ์๋ค. -> ์ข ๋ ๋ค์ํ site๋ฅผ ๊ฐ์ง๊ณ generalizability๋ฅผ ์ธก์ ํ๋ ๊ฒ์ด ์ ์๋ฏธํ ๊ฒ.
- Downstream task๋ก sleep stage์ SDB detection๋ง์ ์ฌ์ฉํ์ง๋ง, arousal detection, periodic leg movements, disease ๋ฑ์ ๋ถ๋ฅํ๋ ํ์คํฌ๋ ๊ฐ๋ฅํ ๊ฒ์ด๋ค.
- Contrastive Learning์ ์ ์ธํ๊ณ ๋ ๋ค๋ฅธ SSL method๋ฅผ ํ์ฉํ์ฌ ์ฑ๋ฅ์ ๋น๊ตํ๋ ๊ฒ.