Skip to content

zmkali/FDS_Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stress Detection and Adaptive Sound Intervention

Foundation of Data Science Project | BITS Pilani Dubai | Apr 2026

A dual-dataset machine learning framework that detects student stress from wrist-worn physiological signals and automatically prescribes personalised sound and haptic interventions.


Results

Metric Value
Overall Accuracy 91.33%
Stress F1-Score 0.940
Baseline F1-Score 0.935
Amusement F1-Score 0.787
CV Std Deviation ±0.026
Subjects Trained On 15 (WESAD)

What It Does

  1. Detects student stress state — Baseline, Stress, or Amusement — from wrist EDA, BVP, and skin temperature signals
  2. Maps detected state to an emotion zone using cross-dataset bridge analysis between WESAD and DEAP
  3. Generates and plays a real-time personalised alpha binaural beat intervention using NumPy sine wave synthesis
  4. Prescribes haptic feedback parameters for wearable device deployment

System Pipeline

Wrist Sensor Data (EDA · BVP · Temperature) ↓ Feature Extraction (10 features per 60s window) ↓ Random Forest Classifier (91.33% accuracy) ↓ Emotion Zone Mapping (WESAD → DEAP Bridge) ↓ Sound + Haptic Prescription


Tech Stack

Component Tool
Language Python 3.10
Machine Learning Scikit-learn
Signal Processing SciPy, NumPy
Web Application Streamlit
Visualisation Plotly
Data Handling Pandas
Sound Generation NumPy + Wave
Environment WSL2 Ubuntu 22.04

Datasets

WESAD — Wearable Stress and Affect Detection

  • 15 subjects wearing Empatica E4 wristband
  • Signals: BVP (64Hz), EDA (4Hz), Temperature (4Hz)
  • Labels: Baseline, Stress, Amusement
  • Stress induced via Trier Social Stress Test

DEAP — Database for Emotion Analysis

  • 32 subjects, audio-evoked emotional responses
  • Labels: Valence (1-9), Arousal (1-9)
  • Used for emotion zone mapping and intervention prescription
  • 4 quadrants: HVLA, HVHA, LVHA, LVLA

Project Structure

FDS_Project/ ├── app/ │ └── streamlit_app.py # Live demo application ├── src/ │ ├── load_wesad.py # WESAD data loader │ ├── load_deap.py # DEAP data loader │ ├── features.py # Feature extraction │ ├── model.py # Model training and evaluation │ ├── intervention.py # Sound and haptic mapping │ └── bridge.py # Cross-dataset bridge analysis ├── models/ │ ├── stress_classifier.pkl │ └── scaler.pkl ├── requirements.txt └── README.md


Run Locally

# Clone the repository
git clone https://github.com/zmkali/FDS_Project.git
cd FDS_Project

# Create virtual environment
python3 -m venv venv
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Run the application
streamlit run app/streamlit_app.py

Open browser at http://localhost:8501

Note: WESAD and DEAP datasets are not included in this repository due to size. Download WESAD from UCI ML Repository and DEAP from QMUL.


Key Features

  • Live Simulator — Adjust EDA, Heart Rate, and Temperature sliders to simulate wearable readings and get instant stress predictions
  • Real Subject Data — Load actual WESAD recordings and view EDA and BVP signal graphs
  • Binaural Beat Generation — System generates real alpha binaural beats dynamically using NumPy. No pre-recorded audio files
  • Real Metrics — Section 4 computes confusion matrix, feature importance, and F1 scores live from the trained model

References

  • Schmidt et al. (2018) WESAD, ICMI
  • Koelstra et al. (2012) DEAP, IEEE Transactions on Affective Computing
  • Colzato et al. (2017) Binaural Beats and Attentional Focus
  • Zhou et al. (2020) Calming Effect of Heartbeat Vibration

Team

Member Contribution
Ridhwan Ahamed Project lead, datasets, proposal
Tarun Model training, feature engineering, results
Aaqib Block diagram, bridge analysis, architecture
Zayaan Streamlit app, demo, sound generation

BITS Pilani Dubai Campus | Foundation of Data Science | 2026

About

Stress detection from wrist signals with 91.33% accuracy. Random Forest on WESAD + DEAP datasets with real-time binaural beat intervention. Python, Scikit-learn, Streamlit.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages