arshadykbk2/Child-Speech-Emotion-Recognition
0
๐๏ธ Child Speech Emotion Recognition (SER) System
A SOTA Deep Learning & Healthcare Platform for Automated Child Vocal Emotion Classification Built with Microsoft WavLM Transformer, 1D Residual CNNs, Attention Pooling, and FastAPI.
๐ Executive Summary
This project implements a state-of-the-art Child Speech Emotion Recognition (SER) System designed for clinical healthcare assessment, developmental psychology research, and academic demonstration.
The system classifies child vocalizations into 6 distinct emotion classes:
- ๐ Happy
- ๐ข Sad
- ๐ก Angry
- ๐จ Fear
- ๐ Neutral
- ๐คข Disgust
๐ Key Performance Metrics
The model was evaluated on the independent test dataset, achieving state-of-the-art classification performance:
๐๏ธ Neural Network Architecture
Input Audio (16kHz PCM Signal)
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Microsoft WavLM Base (768-dim Acoustic) โ <-- Pre-trained Transformer Encoder
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 1D Residual CNN (3 Residual Blocks) โ <-- Local Temporal Feature Extraction
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Attention Pooling Mechanism โ <-- Dynamic Time-Frame Weighting
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Linear Classification Head (6 Classes) โ <-- Softmax Probability Distribution
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ๐ Quick Start Guide (Offline Desktop Software)
๐ On Mac:
- Double-click `RUN_OFFLINE_MAC.command`.
- Safari/Chrome will open automatically to
http://localhost:8000.
๐ช On Windows:
- Double-click `RUN_OFFLINE_WINDOWS.bat`.
- Chrome/Edge will open automatically to
http://localhost:8000.
โ๏ธ Hugging Face Cloud Deployment
This project is pre-configured for 1-click hosting on Hugging Face Spaces:
- Create a new Space on Hugging Face (SDK: Docker $\rightarrow$ Blank).
- Upload the project files or push via Git CLI:
git clone https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE_NAME
cd YOUR_SPACE_NAME
cp -r /path/to/project/* .
git add .
git commit -m "Deploy Child Emotion AI Web App"
git push๐ Repository Directory Structure
โโโ RUN_OFFLINE_MAC.command # 1-Click Mac Executable Launcher
โโโ RUN_OFFLINE_WINDOWS.bat # 1-Click Windows Executable Launcher
โโโ Dockerfile # Containerization manifest for Cloud Deployment
โโโ server.py # FastAPI Backend Inference Server
โโโ index.html # Commercial React + Tailwind Healthcare UI
โโโ config.py # System Parameters & Hyperparameters
โโโ requirements.txt # Python Dependencies List
โโโ OFFLINE_APP_INSTRUCTIONS.md # User Guide for Offline Executables
โ
โโโ models/ # Neural Network Architectures
โ โโโ wavlm_classifier.py # WavLM Base Foundation Model
โ โโโ cnn.py # 1D Residual Convolutional Layers
โ โโโ attention.py # Attention Pooling Mechanism
โ
โโโ dataset/ # Data Processing & Loader Pipeline
โ โโโ parser.py # Audio Parser & Label Extractor
โ โโโ loader.py # PyTorch DataLoader & Collate Logic
โ โโโ preprocessing.py # 16kHz Resampling & Normalization
โ
โโโ training/ # Model Training Engine
โ โโโ trainer.py # Trainer Class with AMP & Early Stopping
โ โโโ losses.py # CrossEntropy & Focal Loss Functions
โ โโโ metrics.py # F1, Precision, Recall, ROC-AUC Computations
โ
โโโ utils/ # Utility Helpers
โ โโโ checkpoints.py # Model Checkpoint Saver/Loader
โ โโโ seed.py # Reproducibility Seed Manager
โ
โโโ outputs/ # Trained Artifacts & Weights
โโโ label_mapping.json # Class Index Mapping
โโโ checkpoints/
โโโ emotion_model.pth # 385 MB Trained Checkpoint (97.18% Accuracy)๐ License & Attribution
- Developed for: B.Tech Final-Year Capstone Project & Healthcare Deliverable.
- Dataset: Child Speech Emotion Dataset (C-BESD).
- Frameworks: PyTorch, Transformers, FastAPI, Tailwind CSS.
