Downloads · 30 days
0
JagjeevanAK/Speech-emotion-detection
Speech-emotion-detection is a audio classification model from JagjeevanAK. Use it for the audio classification task on the model card, and read the license before you ship it in a product. It is set up for tensorflow. The card lists the license as mit.
This model performs speech emotion recognition, classifying audio into 8 different emotional states.
Downloads · 30 days
0
Access
Public
Updated Aug 11, 2025
Repo size
4.5 MB
Likes
0
Public
Click a slice to open those files.
.h54.3 MB · 94%
From the Hugging Face model README
This model performs speech emotion recognition, classifying audio into 8 different emotional states.
This is a deep learning model trained to recognize emotions from speech audio. The model can classify audio into the following emotions:
The model uses audio features extraction including:
import librosa
import numpy as np
from tensorflow.keras.models import load_model
# Load the model
model = load_model('trained_model.h5')
# Load and preprocess audio
def extract_feature(data, sr, mfcc=True, chroma=True, mel=True):
result = np.array([])
if mfcc:
mfccs = np.mean(librosa.feature.mfcc(y=data, sr=sr, n_mfcc=40).T, axis=0)
result = np.hstack((result, mfccs))
if chroma:
stft = np.abs(librosa.stft(data))
chroma_feat = np.mean(librosa.feature.chroma_stft(S=stft, sr=sr).T, axis=0)
result = np.hstack((result, chroma_feat))
if mel:
mel_feat = np.mean(librosa.feature.melspectrogram(y=data, sr=sr).T, axis=0)
result = np.hstack((result, mel_feat))
return result
# Load audio file
audio_path = "your_audio_file.wav"
data, sr = librosa.load(audio_path, sr=22050)
# Extract features
feature = extract_feature(data, sr, mfcc=True, chroma=True, mel=True)
feature = np.expand_dims(feature, axis=0)
feature = np.expand_dims(feature, axis=2)
# Make prediction
prediction = model.predict(feature)
predicted_class = np.argmax(prediction, axis=1)
# Map to emotion labels
emotions = {
0: 'Neutral',
1: 'Calm',
2: 'Happy',
3: 'Sad',
4: 'Angry',
5: 'Fearful',
6: 'Disgust',
7: 'Surprised'
}
predicted_emotion = emotions[predicted_class[0]]
print(f"Predicted emotion: {predicted_emotion}")
librosa
tensorflow
numpy
scikit-learn
The model was trained on the RAVDESS (Ryerson Audio-Visual Database of Emotional Speech and Song) dataset, which contains speech emotion recordings with the following emotion categories:
The dataset provides high-quality audio recordings from multiple speakers, allowing the model to learn robust emotion recognition patterns across different voices and speaking styles.
The model has been trained and evaluated with the following performance metrics:

The training curves show the model's learning progress over epochs, demonstrating convergence and good generalization.

The confusion matrix shows the model's performance on the RAVDESS dataset, demonstrating how well the model distinguishes between different emotional states.
[Specify your license here]
If you use this model, please cite:
@misc{speech-emotion-recognition,
author = {JagjeevanAK},
title = {Speech Emotion Recognition Model},
year = {2025},
publisher = {Hugging Face},
url = {https://huggingface.co/JagjeevanAK/Speech-emotion-detection}
}