What is Synheart Emotion?
Synheart Emotion is a multi-platform SDK for inferring momentary emotions from biosignals (heart rate and RR intervals) directly on device, ensuring privacy and real-time performance. Supported Emotions:- 😌 Baseline: Relaxed, peaceful emotional state
- 😰 Stress: Anxious, tense emotional state
Key Features
On-Device Processing
- All inference happens locally on your device
- No network calls required
- No raw biometric data leaves the device
- Privacy-first by design
Real-Time Performance
- < 1s inference latency per inference (ONNX models)
- ~0.8-7.24 MB model size per model
Research-Based
- Trained on WESAD dataset (wearable stress and affect detection)
- 78.4% accuracy on binary classification (Baseline vs Stress)
- 72.6% F1 score on WESAD validation set (LOSO CV)
- ExtraTrees classifiers with 14 HRV features
- ONNX format optimized for on-device inference
- Reproducible with published model card
Multi-Platform
| Platform | SDK | Installation | Version | Status |
|---|---|---|---|---|
| Python | synheart-emotion | pip install synheart-emotion | 0.1.0 | ✅ Ready |
| Dart/Flutter | synheart_emotion | flutter pub add synheart_emotion | 0.2.1 | ✅ Ready |
| Kotlin | ai.synheart:emotion | JitPack | 0.1.0 | ✅ Ready |
| Swift | SynheartEmotion | Swift Package Manager | 0.1.0 | ✅ Ready |
Architecture
All SDKs implement the same architecture:- Ring Buffer: Holds last 120s of HR/RR data (configurable, default: 120s window, 60s step)
- Feature Extractor: Computes 14 HRV features (time-domain, frequency-domain, non-linear)
- Scaler: Standardizes features using training μ/σ (built into ONNX model)
- Model: ExtraTrees (Extremely Randomized Trees) classifier
- Emitter: Throttles outputs (default: every 60s)
Quick Start Examples
- Python
- Dart/Flutter
- Kotlin
- Swift
Use Cases
Mental Health Apps
Monitor stress levels in real-time:Wellness Coaching
Track emotional patterns throughout the day:Research Applications
Collect emotion data for scientific studies:Model Details
Model Type: ExtraTrees (Extremely Randomized Trees) Task: Binary emotion recognition from HR/RR (Baseline vs Stress) Input Features: 14 HRV features over a 120s rolling window (default: 120s window, 60s step) 14 HRV Features:- Time-domain: RMSSD, Mean_RR, HRV_SDNN, pNN50
- Frequency-domain: HRV_HF, HRV_LF, HRV_HF_nu, HRV_LF_nu, HRV_LFHF, HRV_TP
- Non-linear: HRV_SD1SD2, HRV_Sampen, HRV_DFA_alpha1
- Heart Rate: HR (in BPM)
ExtraTrees_120_60: 120-second window, 60-second step (default)ExtraTrees_60_5: 60-second window, 5-second stepExtraTrees_120_5: 120-second window, 5-second step
- Accuracy: 78.4% on WESAD validation set (LOSO CV)
- F1 Score: 72.6% on WESAD validation set (LOSO CV)
- Latency: < 1ms per inference (ONNX models)
- Model Size: ~0.8-7.24 MB per model
API Parity
All SDKs expose identical functionality:| Feature | Python | Kotlin | Swift | Dart |
|---|---|---|---|---|
| EmotionConfig | ✅ | ✅ | ✅ | ✅ |
| EmotionEngine | ✅ | ✅ | ✅ | ✅ |
| EmotionResult | ✅ | ✅ | ✅ | ✅ |
| EmotionError | ✅ | ✅ | ✅ | ✅ |
| Feature Extraction | ✅ | ✅ | ✅ | ✅ |
| ExtraTrees/ONNX Model | ✅ | ✅ | ✅ | ✅ |
| Thread-Safe | ✅ | ✅ | ✅ | ✅ |
| Sliding Window | ✅ | ✅ | ✅ | ✅ |
Available SDKs
Python SDK
For research, backend, and data analysis
Dart/Flutter SDK
Cross-platform mobile apps (iOS + Android)
Kotlin SDK
Native Android apps
Swift SDK
Native iOS, macOS, watchOS apps
Privacy & Security
- On-Device Processing: All emotion inference happens locally
- No Data Retention: Raw biometric data is not retained after processing
- No Network Calls: No data is sent to external servers
- Privacy-First Design: No built-in storage - you control what gets persisted
- Not a Medical Device: This library is for wellness and research purposes only
Resources
- GitHub: synheart-ai/synheart-emotion
- Model Card: Model Details
- Technical Spec: RFC E1.1
- Issues: Report Bugs
- Discussions: Community Forum
Citation
If you use this SDK in your research:Author: Israel Goytom
Made with ❤️ by the Synheart AI Team