Skip to content

ivengexnce/Space-Explorer-AI-Wellbeing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

15 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation


 โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ•—
โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ•šโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•
โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘    โ•šโ–ˆโ–ˆโ–ˆโ•”โ• 
โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘    โ–ˆโ–ˆโ•”โ–ˆโ–ˆโ•— 
โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•—
 โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•  โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•   โ•šโ•โ•   โ•šโ•โ•  โ•šโ•โ•
                            + MAITRI AI

โœฆ Space Exploration Platform ร— Emotion-Aware AI Wellbeing Companion โœฆ


License Python Flask PHP MySQL DeepFace Gemini AI Made in Bharat


"Most digital platforms treat users as data sources. MAITRI treats them as human beings."


๐ŸŒŒ About ยท โœจ Features ยท ๐Ÿ› ๏ธ Tech Stack ยท โšก Quick Start ยท ๐Ÿ“ Architecture ยท ๐Ÿ“Š Metrics ยท ๐Ÿ‘ฅ Team


๐ŸŒŒ What Is This?

Two deeply human problems. One platform. Built in Bharat. ๐Ÿ‡ฎ๐Ÿ‡ณ

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  ๐Ÿš€  ORBITX                                                        โ”‚
โ”‚                                                                    โ”‚
โ”‚  Space knowledge is scattered across hundreds of sources.          โ”‚
โ”‚  Students waste hours jumping between NASA, Wikipedia,             โ”‚
โ”‚  and random videos โ€” and still miss critical information.          โ”‚
โ”‚                                                                    โ”‚
โ”‚  OrbitX unifies planets, missions, telescopes, and space           โ”‚
โ”‚  technology into one authenticated, AI-guided platform.            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  ๐Ÿค–  MAITRI AI                                                     โ”‚
โ”‚                                                                    โ”‚
โ”‚  Every wellbeing tool just logs data. It watches you.              โ”‚
โ”‚  It records you. But it never speaks to you. It never cares.       โ”‚
โ”‚                                                                    โ”‚
โ”‚  MAITRI watches through your webcam in real time, understands      โ”‚
โ”‚  how you feel, and responds like a warm companion โ€” in your own    โ”‚
โ”‚  language, with music that matches your mood.                      โ”‚
โ”‚  9 Indian languages. Powered by Gemini AI.                         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐ŸŽฏ Problem โ†’ Solution

# Problem Reality Today Our Answer
1 ๐ŸŒ Space Education Knowledge across hundreds of scattered sources OrbitX โ€” unified, AI-guided learning hub
2 ๐Ÿค– Wellbeing Monitoring Tools that log but never respond MAITRI โ€” responds, speaks, and truly cares
3 ๐Ÿ—ฃ๏ธ Language Barrier No Indian-language AI wellbeing support Built-in support for 9 Indian languages
4 ๐Ÿ˜ด Fatigue Detection Ignored entirely by existing tools Real-time eye-blink tracking + blink-rate analytics

โœจ Features

๐Ÿช OrbitX โ€” Space Exploration Platform

Feature Description
๐Ÿช Unified Knowledge Planets, missions, telescopes, and space tech โ€” all in one place
๐Ÿ” Secure Auth PHP + bcrypt hashing + SQL injection-safe prepared statements
๐Ÿ“Š Live Dashboard Mission analytics, satellite stats, planet overview, activity feed
๐Ÿ† Achievements Gamified milestones โ€” First Launch, Earth Observer, Deep Space Scout
๐Ÿ“ก Mission Tracker Active, planned, and historic missions with real-time status
๐Ÿ“„ Reports Downloadable scientific reports and archived documents
๐ŸŒ™ Dark Mode Seamless dark / light theme toggle

๐Ÿค– MAITRI AI โ€” Emotion-Aware Wellbeing Companion

Feature Description
๐ŸŽญ Emotion Detection 7-class real-time facial emotion via DeepFace + Haar Cascade, 87% accuracy
๐Ÿ˜ด Fatigue Detection Eye-blink timer + blink-rate (BPM) analytics โ€” Drowsy (3s) โ†’ Fatigued (6s)
๐Ÿ“ Baseline Calibration Motion detector calibrates to each user's natural fidget level (no false alarms)
๐Ÿƒ Behaviour Analysis Rolling-average smoothed frame differencing โ€” Calm / Restless / Hyperactive / Inactive
๐Ÿ—ฃ๏ธ Voice Response Always-on empathetic TTS via pyttsx3 (female voice, 145 WPM)
๐ŸŽต Music Recommendations Emotion-matched songs across 9 Indian languages + YouTube & Spotify links
๐Ÿ”ด Alert System Severity-graded alerts โ€” INFO / CAUTION / WARNING / CRITICAL โ€” with speak-friendly TTS text
๐Ÿ›ก๏ธ Echo Guard Prevents MAITRI's own voice from being transcribed as user input
๐Ÿ“ˆ Session Reports .txt + .json + .csv logs + Matplotlib PNG graph (auto-generated)
๐Ÿ“Š Wellbeing Score 0โ€“100 score derived from emotion distribution across the full session
โšก WebSocket Real-time data streaming to frontend โ€” no page refresh needed
๐Ÿ”„ Voice Loop Continuous listen โ†’ transcribe โ†’ respond โ†’ repeat, with back-off on errors

๐Ÿ› ๏ธ Tech Stack

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                       ORBITX + MAITRI AI                            โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Frontend     โ”‚  HTML5 ยท CSS3 ยท JavaScript ES6                      โ”‚
โ”‚               โ”‚  Orbitron ยท Share Tech Mono ยท Chart.js ยท SocketIO   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Backend      โ”‚  Flask 3.0 ยท Flask-SocketIO ยท PHP 8.0               โ”‚
โ”‚               โ”‚  pyttsx3 ยท SpeechRecognition ยท WebSocket            โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Database     โ”‚  MySQL 8.0 ยท mysqli Prepared Statements             โ”‚
โ”‚               โ”‚  PHP Session Auth ยท bcrypt password hashing         โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  AI / ML      โ”‚  DeepFace ยท OpenCV ยท Haar Cascade                   โ”‚
โ”‚               โ”‚  Gemini 1.5 Flash (primary AI)                      โ”‚
โ”‚               โ”‚  Groq Llama 3.1 (fallback) ยท GPT-4o-mini (fallback) โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Platform     โ”‚  Python 3.11 ยท NumPy ยท Matplotlib                   โ”‚
โ”‚               โ”‚  Threading ยท UUID ยท Watchdog ยท Dataclasses          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“ Project Structure

space-explorer-ai-wellbeing/
โ”‚
โ”œโ”€โ”€ ๐Ÿ—‚๏ธ  assets/                    โ†’ Images, videos, logos
โ”‚
โ”œโ”€โ”€ ๐Ÿ”  auth/
โ”‚   โ”œโ”€โ”€ login.html                โ†’ Space-themed login page
โ”‚   โ”œโ”€โ”€ login.php                 โ†’ Secure PHP auth (prepared statements)
โ”‚   โ””โ”€โ”€ auth.css
โ”‚
โ”œโ”€โ”€ ๐Ÿ“Š  dashboard/
โ”‚   โ”œโ”€โ”€ dashboard.html            โ†’ Full SPA dashboard
โ”‚   โ”œโ”€โ”€ dashboard.css
โ”‚   โ”œโ”€โ”€ dashboard.js              โ†’ Charts, modals, theme toggle
โ”‚   โ””โ”€โ”€ getprofile.php            โ†’ User profile JSON API
โ”‚
โ”œโ”€โ”€ ๐Ÿš€  explore/
โ”‚   โ”œโ”€โ”€ explore.html              โ†’ Space exploration section
โ”‚   โ””โ”€โ”€ explore.css
โ”‚
โ”œโ”€โ”€ ๐Ÿ   home/
โ”‚   โ”œโ”€โ”€ home.html                 โ†’ Main home page
โ”‚   โ”œโ”€โ”€ script.js                 โ†’ Nav, FAQ, scroll reveal
โ”‚   โ””โ”€โ”€ style.css
โ”‚
โ”œโ”€โ”€ ๐Ÿ“  signup/
โ”‚   โ”œโ”€โ”€ signup.html               โ†’ Registration with OTP field
โ”‚   โ””โ”€โ”€ signup.php                โ†’ PHP signup + bcrypt handler
โ”‚
โ”œโ”€โ”€ ๐Ÿค–  MAITRI_AI/
โ”‚   โ”œโ”€โ”€ app.py                    โ†’ Flask v5.0 backend + SocketIO server
โ”‚   โ”œโ”€โ”€ MAITRI_AI.html            โ†’ Real-time AI frontend panel
โ”‚   โ””โ”€โ”€ Pys/
โ”‚       โ”œโ”€โ”€ ai_responder.py       โ†’ Gemini / Groq / OpenAI + 9-language music DB
โ”‚       โ”œโ”€โ”€ vision_module.py      โ†’ DeepFace emotion detection
โ”‚       โ”œโ”€โ”€ fatigue_detector.py   โ†’ FatigueDetector class + blink-rate BPM
โ”‚       โ”œโ”€โ”€ behavior_detector.py  โ†’ Calibrated, smoothed motion classifier
โ”‚       โ”œโ”€โ”€ audio_module.py       โ†’ Noise-cached mic + record_and_transcribe()
โ”‚       โ”œโ”€โ”€ voice_output.py       โ†’ pyttsx3 TTS (dedicated daemon thread)
โ”‚       โ”œโ”€โ”€ alert_system.py       โ†’ Severity-graded structured alert engine
โ”‚       โ”œโ”€โ”€ report.py             โ†’ TXT + JSON + CSV + graph ReportBundle
โ”‚       โ”œโ”€โ”€ emotion_graph.py      โ†’ Dual-subplot Matplotlib PNG generator
โ”‚       โ””โ”€โ”€ requirements.txt
โ”‚
โ”œโ”€โ”€ ๐Ÿ—„๏ธ  database/
โ”‚   โ””โ”€โ”€ orbitx_db.sql             โ†’ Full MySQL database export
โ”‚
โ”œโ”€โ”€ ๐ŸŒ  landingpge.html            โ†’ Cinematic video landing page
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ LICENSE                        โ†’ MIT License
โ””โ”€โ”€ README.md

โšก Quick Start

Prerequisites

  • XAMPP โ€” Apache + MySQL
  • Python 3.11+
  • One free API key โ€” Gemini recommended

Step 1 โ€” Clone

git clone https://github.com/ivengexnce/space-explorer-ai-wellbeing.git
cd space-explorer-ai-wellbeing

Step 2 โ€” Database Setup

# 1. Start XAMPP โ†’ Apache + MySQL
# 2. Open:  http://localhost/phpmyadmin
# 3. Create a database named:  orbitx_db
# 4. Click Import โ†’ select database/orbitx_db.sql โ†’ Go

Step 3 โ€” OrbitX Web Platform

# Windows
xcopy /E /I . C:\xampp\htdocs\OrbitX

# macOS / Linux
cp -r . /opt/lampp/htdocs/OrbitX

# Open in browser
http://localhost/OrbitX/landingpge.html

Step 4 โ€” MAITRI AI Backend

cd MAITRI_AI

# Set your Gemini API key โ€” FREE at makersuite.google.com
export GEMINI_API_KEY=your_key_here        # macOS / Linux
set GEMINI_API_KEY=your_key_here           # Windows CMD
$env:GEMINI_API_KEY="your_key_here"        # Windows PowerShell

# Install Python dependencies
pip install -r Pys/requirements.txt

# Start the AI server
python app.py

Step 5 โ€” Open MAITRI AI

http://localhost/OrbitX/MAITRI_AI/MAITRI_AI.html

โœ… Allow camera and microphone when prompted. MAITRI will greet you and ask your music language preference. ๐ŸŒธ


๐Ÿ”‘ API Keys

Only one key is required. The system auto-detects and falls back gracefully.

Provider Tier Link
Gemini 1.5 Flash โœ… Free makersuite.google.com
Groq Llama 3.1 โœ… Free console.groq.com
GPT-4o-mini โš ๏ธ Limited free platform.openai.com

๐ŸŽต Music Support โ€” 9 Indian Languages

MAITRI detects your language preference from speech or a modal on first launch:

Language Example Artists
๐ŸŽต Hindi / Bollywood Arijit Singh, A.R. Rahman, Atif Aslam
๐ŸŽต Punjabi / Bhangra Diljit Dosanjh, Guru Randhawa
๐ŸŽต Tamil / Kollywood Anirudh Ravichander, Harris Jayaraj
๐ŸŽต Telugu / Tollywood Sid Sriram, M.M. Keeravani
๐ŸŽต Marathi Ajay-Atul, Swapnil Bandodkar
๐ŸŽต Bengali / Bangla Anupam Roy, Rabindranath Tagore
๐ŸŽต Kannada Santhosh Narayanan
๐ŸŽต Malayalam Vidyasagar
๐ŸŽต English / International The Weeknd, Coldplay, ABBA

Every recommendation includes a YouTube and Spotify deep-link.


๐Ÿ“Š Performance Metrics

Metric Result
๐ŸŽญ Emotion Detection Accuracy 87% (DeepFace + OpenCV)
โšก Detection Latency < 450 ms per frame (hard-timeout guarded)
๐ŸŒ Languages Supported 9 Indian + English
๐Ÿ”’ Security OWASP Top-10 tested โ€” 0 vulnerabilities
๐Ÿ”„ Concurrent Sessions Multi-session via threading + watchdog
โฑ๏ธ TTS Response Time < 1 second (pyttsx3 daemon thread)
๐Ÿ“ˆ Session Reports TXT + JSON + CSV + PNG graph auto-generated
๐Ÿƒ Motion Calibration First 8 frames โ†’ personal baseline (no false alarms)

๐Ÿ“ System Architecture

User Browser
     โ”‚
     โ”œโ”€โ”€ OrbitX  (PHP + MySQL)
     โ”‚     โ””โ”€โ”€ Landing โ†’ Login โ†’ Dashboard โ†’ Explore โ†’ Profile
     โ”‚
     โ””โ”€โ”€ MAITRI AI Panel  (HTML + WebSocket)
           โ”‚
           โ””โ”€โ”€ Flask Server  (app.py v5.0)
                 โ”‚
                 โ”œโ”€โ”€ Watchdog Thread       โ†’ stale/degraded session detection
                 โ”‚
                 โ”œโ”€โ”€ Vision Module         โ†’ DeepFace      โ†’ Emotion Label + Confidence
                 โ”œโ”€โ”€ Fatigue Detector      โ†’ Eye-blink BPM โ†’ Awake/Drowsy/Fatigued
                 โ”œโ”€โ”€ Behaviour Detector    โ†’ Calibrated Frame Diff โ†’ Calm/Restless/...
                 โ”‚
                 โ”œโ”€โ”€ AI Responder          โ†’ Gemini / Groq / GPT-4o-mini
                 โ”‚     โ””โ”€โ”€ Music Picker   โ†’ 9-language DB + YouTube + Spotify links
                 โ”‚
                 โ”œโ”€โ”€ Alert System          โ†’ Severity-graded structured alerts
                 โ”œโ”€โ”€ Voice Output          โ†’ pyttsx3 daemon TTS + Echo Guard
                 โ”œโ”€โ”€ Audio Module          โ†’ Noise-cached mic โ†’ Google STT โ†’ Sphinx fallback
                 โ”‚
                 โ””โ”€โ”€ Report Generator      โ†’ TXT + JSON + CSV + Matplotlib PNG + Wellbeing Score

๐Ÿ—„๏ธ Database Schema

CREATE TABLE users (
  id          INT AUTO_INCREMENT PRIMARY KEY,
  username    VARCHAR(50)  UNIQUE NOT NULL,
  fullName    VARCHAR(100) NOT NULL,
  email       VARCHAR(100) UNIQUE NOT NULL,
  phone       VARCHAR(20),
  password    VARCHAR(255) NOT NULL,  -- bcrypt hashed
  avatar      VARCHAR(255),
  bio         TEXT,
  dob         DATE,
  created_at  TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

๐Ÿ”„ What's New โ€” v2 Module Upgrades

A full pass was made over every Python module to improve robustness, data richness, and developer experience:

alert_system.py

  • Structured dict return (severity, code, message, speak) instead of a bare string
  • Four severity tiers: INFO / CAUTION / WARNING / CRITICAL
  • New detection: rapid mood oscillation and positive streak recognition
  • alert_speak() helper returns TTS-friendly text with no jargon

behavior_detector.py

  • Baseline calibration โ€” first 8 frames build a personal movement baseline
  • Rolling average (deque 10) majority-vote smoothing kills false "Hyperactive" flashes
  • Returns a structured dict (label, movement, smoothed, calibrated)
  • Thread-safe with a dedicated lock; reset_calibration() for camera switches

fatigue_detector.py

  • FatigueDetector class โ€” proper per-session state isolation
  • Blink-rate (BPM) tracking across the whole session
  • Structured dict return (level, eyes_visible, elapsed_sec, blink_count, blinks_per_min)
  • Module-level singleton + detect_fatigue_full() for backward-compatible upgrade path

audio_module.py

  • Noise-profile caching โ€” adjust_for_ambient_noise runs once per process, not every listen (saves ~400ms per call)
  • record_audio() returns a dict (audio, success, reason) instead of bare AudioData
  • speech_to_text() returns (text, source) tuple so you always know if Google or Sphinx answered
  • record_and_transcribe() one-call convenience wrapper for the voice loop
  • reset_noise_calibration() for environment changes

report.py

  • CSV export alongside TXT + JSON โ€” ready for Excel / pandas analysis
  • Wellbeing score (0โ€“100) derived from emotion-weighted log
  • Auto-generates PNG graph by calling emotion_graph.plot_emotions() on save
  • Returns ReportBundle dataclass with all paths and summary data

emotion_graph.py

  • Non-blocking โ€” uses matplotlib.use("Agg") backend, never calls plt.show()
  • Dual subplot: emotion timeline scatter + pie chart of distribution
  • Color-coded per-emotion (green = happy, cyan = neutral, red = angry โ€ฆ)
  • Saves PNG to reports/ and returns the path
  • Dark-theme styling to match the MAITRI UI

๐Ÿ› Troubleshooting

Issue Fix
DeepFace install fails pip install deepface tensorflow --upgrade โ€” use Python 3.7โ€“3.10
Microphone not working Check OS permissions; select correct input device
No audio from pyttsx3 Settings โ†’ Speech โ†’ Add voices; restart after installing
Camera not detected Allow camera permissions; HTTPS required in deployed environments
Database connection fails Ensure MySQL is running in XAMPP; check credentials in login.php
Emotion graph blank pip install matplotlib if not already installed

๐Ÿค Contributing

# Fork the repo on GitHub
git clone https://github.com/YOUR_USERNAME/space-explorer-ai-wellbeing.git

git checkout -b feature/AmazingFeature
git commit -m "Add AmazingFeature"
git push origin feature/AmazingFeature
# Open a Pull Request

๐Ÿ‘ฅ Team

Name Roles
Meet Maru Full Stack ยท AI Integration ยท Backend ยท Database ยท Frontend ยท UI/UX

๐Ÿซ Institution โ€” Viva Institute of Technology, Mumbai ๐Ÿ† Event โ€” Ingenious ๐Ÿ“š Category โ€” SE Mini Project ๐Ÿ“… Year โ€” 2025โ€“26


๐Ÿ“„ License

Licensed under the MIT License โ€” see LICENSE for details. Free to use, modify, and distribute with attribution to Team CypherItX.


โญ If this project helped you, please star the repository โญ

Built with โค๏ธ by Team CypherItX
Viva Institute of Technology ยท Ingenious ยท 2025โ€“26
Made in Bharat ๐Ÿ‡ฎ๐Ÿ‡ณ

About

๐Ÿš€ Space exploration platform for students & researchers + real-time AI emotion wellbeing companion ( SIH Problem Statement). Detects facial emotions via webcam, responds with empathy in 9 Indian languages using Gemini AI. Built with Python, Flask, DeepFace, PHP, MySQL & WebSocket. Open source. Made in BHARAT

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors