EEG_sleep / README.md
TunisianCoder's picture
Update README.md
57c5105 verified
---
title: Sleep Stage Classifier
emoji: 😴
colorFrom: blue
colorTo: indigo
sdk: gradio
sdk_version: 6.12.0
app_file: app.py
pinned: false
license: mit
short_description: Classify sleep stages from raw EEG signals
python_version: '3.11'
---
# 😴 Sleep Stage Classification
Upload a CSV, TXT, or NPY file containing raw EEG signal data (100 Hz sampling rate).
The model classifies the signal into 30-second epochs across 6 sleep stages: **Wake, N1, N2, N3, N4, REM**.
## Model Architecture
- **Type**: 1D Convolutional Neural Network
- **Framework**: PyTorch
- **Input**: Single-channel EEG, 3000 samples per epoch (30s at 100 Hz)
- **Output**: 6-class classification logits → softmax probabilities
## API Usage
```python
from gradio_client import Client
client = Client("<your-username>/sleep-stage-classifier")
result = client.predict(file="path/to/eeg.csv")
print(result)
```
## Lovable / Frontend Integration
```javascript
import { Client } from "@gradio/client";
const client = await Client.connect(
"https://<your-username>-sleep-stage-classifier.hf.space"
);
const result = await client.predict("/predict", { file: yourFile });
console.log(result.data);
```