YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

πŸͺ‘ SmartChair AI β€” Intelligent Posture Monitoring System

Real-time posture classification, spine risk prediction, and adaptive health coaching using IMU + load cell + thermal sensor fusion.

Python 3.9+ TensorFlow ESP32 AWS IoT


🎯 Features

# Feature Status Accuracy/Performance
1 Real-time posture classification βœ… 95.48%+ ML accuracy (ensemble voting)
2 Long-term spine risk prediction βœ… RULA-based + exponential decay accumulator
3 Personalised sitting behaviour model βœ… Learns fatigue onset, break patterns per user
4 Smart micro-break recommendations βœ… Adaptive, score-based urgency (not fixed timer)
5 Exercise suggestion system βœ… 20+ exercises mapped to specific posture issues
6 Hybrid sensor fusion βœ… IMU + load cell + thermal (14-channel fusion)
7 Fatigue & drowsiness detection βœ… CoP variance + micro-movement analysis
8 Daily/weekly posture score dashboard βœ… 0-100 score with hourly breakdown + trends
9 Injury risk alert system βœ… Acute + chronic + trend-based alerts
10 Cloud integration (AWS IoT Core) βœ… MQTT/TLS, DynamoDB, Lambda scoring
11 Multi-user recognition βœ… Weight signature + k-NN (3-shot enrollment)
12 Gamification system βœ… Points, streaks, badges, leaderboard

πŸ—οΈ System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    SENSOR LAYER                           β”‚
β”‚  MPU6050 (50Hz)  β”‚  4Γ— HX711 Load Cells  β”‚  AMG8833     β”‚
β”‚  6-axis IMU      β”‚  Weight Distribution    β”‚  Thermal     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚                    β”‚                    β”‚
         β–Ό                    β–Ό                    β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              EDGE INFERENCE (ESP32-S3)                     β”‚
β”‚  Feature Extraction β†’ TFLite INT8 / Random Forest         β”‚
β”‚  <30ms inference β”‚ <50KB model β”‚ 14 input channels         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚ UART / Local WiFi
                           β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              INTELLIGENCE LAYER (Raspberry Pi)             β”‚
β”‚                                                            β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚ Ensemble      β”‚  β”‚ RULA Risk     β”‚  β”‚ Fatigue      β”‚   β”‚
β”‚  β”‚ Classifier    β”‚  β”‚ Scorer        β”‚  β”‚ Detector     β”‚   β”‚
β”‚  β”‚ (98%+ F1)     β”‚  β”‚ (1-7 scale)   β”‚  β”‚ (CoP+IMU)   β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚ User         β”‚  β”‚ Break         β”‚  β”‚ Exercise     β”‚   β”‚
β”‚  β”‚ Recognition  β”‚  β”‚ Engine        β”‚  β”‚ Suggester    β”‚   β”‚
β”‚  β”‚ (k-NN)       β”‚  β”‚ (Adaptive)    β”‚  β”‚ (Targeted)   β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚ Spine Risk   β”‚  β”‚ Gamification  β”‚  β”‚ Injury       β”‚   β”‚
β”‚  β”‚ Predictor    β”‚  β”‚ Engine        β”‚  β”‚ Alerts       β”‚   β”‚
β”‚  β”‚ (Long-term)  β”‚  β”‚ (Points/Bdge) β”‚  β”‚ (3-tier)     β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚ MQTT / TLS
                           β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   CLOUD LAYER (AWS)                        β”‚
β”‚  IoT Core β†’ DynamoDB (telemetry) β†’ Lambda (daily scores)  β”‚
β”‚          β†’ SNS (critical alerts) β†’ S3 (raw data backup)   β”‚
β”‚          β†’ API Gateway β†’ Dashboard Web App                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“Š ML Models

Posture Classifier (Primary)

  • Architecture: Soft-voting ensemble (SVM + DecisionTree + MLP + XGBoost + RandomForest)
  • Basis: SitPose (F1=98.2% on 7-class posture)
  • Input: 119 hand-crafted features from 2.56s sliding windows (128 samples @ 50Hz)
  • Features: IMU statistics, FFT spectral features, cross-axis correlations, CoP metrics, load distribution ratios
  • Edge deployment: micromlgen β†’ C header for ESP32 (<5KB, <5ms inference)

MLSTM-FCN (Alternative Deep Model)

  • Architecture: Parallel Conv1D-FCN + LSTM with Squeeze-Excite attention
  • Basis: MLSTM-FCN + FusionActNet
  • Input: (128, 14) sequential tensor (14 sensor channels Γ— 128 timesteps)
  • Edge deployment: TFLite INT8 quantization (<50KB, <30ms on ESP32-S3)

πŸ”§ Hardware (~$110-165 total)

See HARDWARE_BOM.md for complete bill of materials and wiring diagram.

Key sensors:

  • IMU: MPU6050 (6-axis, I2C, 50Hz) β€” mounted under seat center
  • Load Cells: 4Γ— 50kg half-bridge with HX711 ADC β€” at chair corners
  • Thermal: AMG8833 8Γ—8 IR grid β€” on backrest for presence detection
  • MCU: ESP32-S3 (dual-core 240MHz, 8MB PSRAM, WiFi/BLE)
  • Gateway: Raspberry Pi 4B (complex ML + cloud)

πŸš€ Quick Start

1. Install Dependencies

pip install numpy scipy scikit-learn xgboost tensorflow matplotlib pandas joblib

2. Run Full Demo (Synthetic Data)

python -m smart_chair.main

3. Train Production Model

from smart_chair.ml_models.posture_classifier import EnsemblePostureClassifier
from smart_chair.data_collection.synthetic_data_generator import generate_dataset, subject_based_split

dataset = generate_dataset(n_subjects=20, samples_per_posture_per_subject=500)
train, test = subject_based_split(dataset)

clf = EnsemblePostureClassifier()
clf.train(train["imu_data"], train["load_data"], train["labels"],
          test["imu_data"], test["load_data"], test["labels"])
clf.save("posture_model.joblib")

πŸ“ Project Structure

smart_chair/
β”œβ”€β”€ config/settings.py              # All system constants and parameters
β”œβ”€β”€ utils/feature_engineering.py    # Feature extraction pipeline (14 channels)
β”œβ”€β”€ data_collection/
β”‚   β”œβ”€β”€ synthetic_data_generator.py # Physics-based synthetic data
β”‚   └── protocol.py                 # Real data collection procedure
β”œβ”€β”€ ml_models/
β”‚   β”œβ”€β”€ posture_classifier.py       # Ensemble + MLSTM-FCN classifiers
β”‚   β”œβ”€β”€ spine_risk_predictor.py     # RULA scorer + fatigue detector + alerts
β”‚   β”œβ”€β”€ user_recognition.py         # Multi-user recognition + personalized model
β”‚   β”œβ”€β”€ break_recommendation.py     # Adaptive break engine + exercise suggester
β”‚   └── gamification.py             # Points, badges, streaks, leaderboard
β”œβ”€β”€ cloud/aws_iot_integration.py    # MQTT client + AWS infrastructure
β”œβ”€β”€ firmware/esp32_firmware.ino     # ESP32-S3 Arduino firmware
β”œβ”€β”€ HARDWARE_BOM.md                 # Parts list + wiring diagram
└── main.py                         # System orchestrator (Raspberry Pi)

πŸ“š Research References

Paper Contribution ArXiv
SitPose Ensemble posture classification (F1=98.2%) 2412.12216
MLSTM-FCN Multivariate time series architecture 1801.04503
FusionActNet Static/Dynamic dual-expert IMU classification 2310.02011
SSL-Wearables Self-supervised pre-training for HAR 2206.02909
UniMTS Foundation model for IMU (zero-shot) 2410.19818
DULA/DEBA Differentiable ergonomic assessment 2205.03491
TinyNav TFLite Micro on ESP32 (<30ms) 2603.11071
AuthentiSense Few-shot biometric user authentication 2302.02740
Edge Impulse TinyML MLOps platform 2212.03332

πŸ“„ License

MIT License β€” Free for personal and commercial use.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Papers for Ishan2607/smartchair-ai