Speech Emotion Recognition
A speech emotion recognition system trained on four datasets. The project reported 93.27% accuracy. Here's what actually happened.
By Prasanna Patil, AI Engineer
reported accuracy
93.27%
project test result; evaluation notes below
datasets
4
CREMA-D · RAVDESS · TESS · SAVEE
reported inference
<200ms
project CPU timing; not a hardware guarantee
Summary
A model that listens to speech and classifies the emotion in it, trained across four public datasets instead of one, with a live pipeline that classifies microphone input in under 200 ms on a CPU. Aimed at customer-service and healthcare use cases.
The problem
Most SER systems are trained on one dataset and fall apart on anything else. The goal was to build something that generalises — not just RAVDESS, which every tutorial uses, but across accents, recording conditions, and emotion labels that don't always agree with each other.
My role
A personal project, built end to end: dataset preparation and label harmonisation, model design, training and evaluation, and the real-time inference pipeline with its Django REST backend and React frontend.
Architecture
Audio is turned into mel spectrograms with Librosa. A CNN extracts local patterns from each spectrogram and an LSTM models how those patterns change over time (CLSTM). For live use, PyAudio reads from the microphone, the same feature extraction runs on each chunk, and a Django REST backend serves predictions to a React frontend.
What I tried first (that didn't work)
Started with a plain LSTM on mel spectrograms. Decent on RAVDESS alone (around 78%), fell to 61% when I mixed in CREMA-D.
The model was memorising speaker identity, not emotion. Classic overfitting to a small, homogeneous dataset.
What worked
Stacking CNN + LSTM (CLSTM). The CNN extracts local patterns from the spectrogram, the LSTM captures how those patterns evolve over time. Trained on CREMA-D, RAVDESS, TESS, and SAVEE together after normalising the emotion label schema across all four.
Results
The project reported 93.27% accuracy and CPU inference below 200 ms, with a PyAudio and Librosa pipeline for microphone input. These are project results, not guarantees for a different dataset or machine.
Evaluation context: combining four datasets is not the same as holding out an entire dataset. The published notebook exposes inference code, but not the split sizes, speaker separation or a reproducible run for these figures. Treat them as project-reported results; independent comparison needs that evaluation protocol and the CPU, input duration and timing boundary for the latency measurement.
Limitations
- All four datasets are acted speech. Spontaneous speech in a real call centre is harder, and accuracy there would be lower until it's tested on real recordings.
- The emotion labels were mapped to one schema by hand, so some categories are approximations.
What I'd do differently
The label harmonisation was done by hand. I would version that mapping and compare a pretrained audio encoder such as wav2vec2 under the same evaluation protocol, including an unseen-speaker and unseen-dataset test.
Need a model turned into a product?
I can take a trained model through to a real-time service your application can call.