SAVRN
Search Contact SAVRN

Open-weight model · Audio classification

speech-emotion-recognition-with-openai-whisper-large-v3

by Muhammad Firdho firdhokk/speech-emotion-recognition-with-openai-whisper-large-v3

This project leverages the Whisper model to recognize emotions in speech. The goal is to classify audio recordings into different emotional categories, such as Happy, Sad, Surprised, and etc.

Parameters637M
Context
Weights2.5 GB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads12.6k

Runs On

What it takes to serve speech-emotion-recognition-with-openai-whisper-large-v3 (637M parameters): the memory its weights need at each precision, and the cheapest way to rent enough data-center GPUs to hold them.

PrecisionWeightsMemory neededCheapest setupPer hourAlso fits
16-bit 1.3 GB 1.5 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
8-bit 0.6 GB 0.8 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
4-bit 0.3 GB 0.4 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00

Memory is the weights at that precision plus 20% for the runtime and a short context; a long context needs more. Prices are the lowest on-demand hourly rates in the SAVRN Index, read Sep 18, 2026.

Model Card

By Muhammad Firdho, published under apache-2.0, revision 15fd07411456.

This project leverages the Whisper model to recognize emotions in speech. The goal is to classify audio recordings into different emotional categories, such as Happy, Sad, Surprised, and etc. The dataset used for training and evaluation is sourced from multiple datasets, including: The dataset contains recordings labeled with various emotions. Below is the distribution of the emotions in the dataset: This distribution reflects the balance of emotions in the dataset, with some emotions having more samples than others. Excluded the "calm" emotion during training due to its underrepresentation. The model used is the Whisper Large V3 model, fine-tuned for audio classification tasks: I map the…

Read Muhammad Firdho's full model card

Speech Emotion Recognition with Whisper

This project leverages the Whisper model to recognize emotions in speech. The goal is to classify audio recordings into different emotional categories, such as Happy, Sad, Surprised, and etc.

Dataset

The dataset used for training and evaluation is sourced from multiple datasets, including: - RAVDESS - SAVEE - TESS - URDU

The dataset contains recordings labeled with various emotions. Below is the distribution of the emotions in the dataset: | Emotion | Count | |-------------|-----------| | sad | 752 | | happy | 752 | | angry | 752 | | neutral | 716 | | disgust | 652 | | fearful | 652 | | surprised | 652 | | calm | 192 |

This distribution reflects the balance of emotions in the dataset, with some emotions having more samples than others. Excluded the "calm" emotion during training due to its underrepresentation.

Preprocessing

  • Audio Loading: Using Librosa to load the audio files and convert them to numpy arrays.
  • Feature Extraction: The audio data is processed using the Whisper Feature Extractor, which standardizes and normalizes the audio features for input to the model.

Model

The model used is the Whisper Large V3 model, fine-tuned for audio classification tasks: - Model: openai/whisper-large-v3 - Output: Emotion labels (Angry', 'Disgust', 'Fearful', 'Happy', 'Neutral', 'Sad', 'Surprised')

I map the emotion labels to numeric IDs and use them for model training and evaluation.

Training

The model is trained with the following parameters: - Learning Rate: 5e-05
- Train Batch Size: 2 - Eval Batch Size: 2 - Random Seed: 42
- Gradient Accumulation Steps: 5
- Total Train Batch Size: 10 (effective batch size after gradient accumulation) - Optimizer: Adam with parameters: betas=(0.9, 0.999) and epsilon=1e-08 - Learning Rate Scheduler: linear - Warmup Ratio for LR Scheduler: 0.1 - Number of Epochs: 25 - Mixed Precision Training: Native AMP (Automatic Mixed Precision)

These parameters ensure efficient model training and stability, especially when dealing with large datasets and deep models like Whisper. The training utilizes Wandb for experiment tracking and monitoring.

Metrics

The following evaluation metrics were obtained after training the model: - Loss: 0.5008 - Accuracy: 0.9199 - Precision: 0.9230 - Recall: 0.9199 - F1 Score: 0.9198

These metrics demonstrate the model's performance on the speech emotion recognition task. The high values for accuracy, precision, recall, and F1 score indicate that the model is effectively identifying emotional states from speech data.

Results

After training, the model is evaluated on the test dataset, and the results are monitored using Wandb in this Link. | Training Loss | Epoch | Step | Validation Loss | Accuracy | Precision | Recall | F1 | |:-------------:|:-------:|:----:|:---------------:|:--------:|:---------:|:------:|:------:| | 0.4948 | 0.9995 | 394 | 0.4911 | 0.8286 | 0.8449 | 0.8286 | 0.8302 | | 0.6271 | 1.9990 | 788 | 0.5307 | 0.8225 | 0.8559 | 0.8225 | 0.8277 | | 0.2364 | 2.9985 | 1182 | 0.5076 | 0.8692 | 0.8727 | 0.8692 | 0.8684 | | 0.0156 | 3.9980 | 1576 | 0.5669 | 0.8732 | 0.8868 | 0.8732 | 0.8745 | | 0.2305 | 5.0 | 1971 | 0.4578 | 0.9108 | 0.9142 | 0.9108 | 0.9114 | | 0.0112 | 5.9995 | 2365 | 0.4701 | 0.9108 | 0.9159 | 0.9108 | 0.9114 | | 0.0013 | 6.9990 | 2759 | 0.5232 | 0.9138 | 0.9204 | 0.9138 | 0.9137 | | 0.1894 | 7.9985 | 3153 | 0.5008 | 0.9199 | 0.9230 | 0.9199 | 0.9198 | | 0.0877 | 8.9980 | 3547 | 0.5517 | 0.9138 | 0.9152 | 0.9138 | 0.9138 | | 0.1471 | 10.0 | 3942 | 0.5856 | 0.8895 | 0.9002 | 0.8895 | 0.8915 | | 0.0026 | 10.9995 | 4336 | 0.8334 | 0.8773 | 0.8949 | 0.8773 | 0.8770 |

How to Use

# Requires: librosa
from transformers import AutoModelForAudioClassification, AutoFeatureExtractor
import librosa
import torch
import numpy as np

model_id = "firdhokk/speech-emotion-recognition-with-openai-whisper-large-v3"
model = AutoModelForAudioClassification.from_pretrained(model_id)

feature_extractor = AutoFeatureExtractor.from_pretrained(model_id, do_normalize=True)
id2label = model.config.id2label
def preprocess_audio(audio_path, feature_extractor, max_duration=30.0):
    audio_array, sampling_rate = librosa.load(audio_path, sr=None)

    max_length = int(feature_extractor.sampling_rate * max_duration)
    if len(audio_array) > max_length:
        audio_array = audio_array[:max_length]
    else:
        audio_array = np.pad(audio_array, (0, max_length - len(audio_array)))

    inputs = feature_extractor(
        audio_array,
        sampling_rate=feature_extractor.sampling_rate,
        max_length=max_length,
        truncation=True,
        return_tensors="pt",
    )
    return inputs
def predict_emotion(audio_path, model, feature_extractor, id2label, max_duration=30.0):
    inputs = preprocess_audio(audio_path, feature_extractor, max_duration)

    device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
    model = model.to(device)
    inputs = {key: value.to(device) for key, value in inputs.items()}

    with torch.no_grad():
        outputs = model(**inputs)

    logits = outputs.logits
    predicted_id = torch.argmax(logits, dim=-1).item()
    predicted_label = id2label[predicted_id]

    return predicted_label
audio_path = "/content/drive/MyDrive/Audio/Speech_URDU/Happy/SM5_F4_H058.wav"

predicted_emotion = predict_emotion(audio_path, model, feature_extractor, id2label)
print(f"Predicted Emotion: {predicted_emotion}")

Framework versions

  • Transformers 4.44.2
  • Pytorch 2.4.1+cu121
  • Datasets 3.0.0
  • Tokenizers 0.19.1

Configuration

Architecture
WhisperForAudioClassification
Layers
32
Vocabulary size
51,866
Stored precision
float32
Model type
whisper

Identity and Version

Repository
firdhokk/speech-emotion-recognition-with-openai-whisper-large-v3
Publisher
Muhammad Firdho
Task
Audio classification
Modality
Audio
Library
transformers
Parameters
637M parameters
Languages
Not stated by the source
Revision
15fd0741145616b5b8c2a4549165674ea2252bb4
First published
2024-09-21
Last updated
2025-11-01

Files and Weights

6 files, 2.5 GB in total. The weights are 2 files totalling 2.5 GB in bin, safetensors.

Weights2 files · 2.5 GB
Configuration2 files · 1.9 KB
Documentation1 file · 7.2 KB
Repository1 file · 1.5 KB
Every file
FileTypeSizeSHA-256
model.safetensorsWeights2.5 GB d5a5dfcd9cf6
training_args.binWeights5.2 KB 8684f29931ee
config.jsonConfiguration1.6 KB
preprocessor_config.jsonConfiguration340 B
README.mdDocumentation7.2 KB
.gitattributesRepository1.5 KB

License and Download

License
apache-2.0
Access
Open weights, no gate
Download size
2.5 GB
Download from Muhammad Firdho

Released by Muhammad Firdho through its official repository on Hugging Face. Read the license.

Built From

Memory Requirements

PrecisionWeights in memory
As published2.5 GB
16-bit1.3 GB
8-bit0.6 GB
4-bit0.3 GB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About speech-emotion-recognition-with-openai-whisper-large-v3

How much GPU memory does speech-emotion-recognition-with-openai-whisper-large-v3 need?

About 1.5 GB at 16-bit and 0.4 GB at 4-bit: the weights (637M parameters) plus a working margin. A long context needs more.

What is the cheapest GPU to run speech-emotion-recognition-with-openai-whisper-large-v3 on?

At 16-bit, 1x MI300X from $1.85 an hour; at 4-bit, 1x MI300X from $1.85 an hour, at the lowest on-demand prices the SAVRN Index lists.

Can I use speech-emotion-recognition-with-openai-whisper-large-v3 commercially?

Yes. speech-emotion-recognition-with-openai-whisper-large-v3 is released under Apache License 2.0. The Apache License 2.0 is a permissive open-source license. It permits commercial use, modification and redistribution. It requires keeping the license and copyright notices and any NOTICE file, stating significant changes, and it includes an express patent grant from contributors.

Similar Models

Model · Audio classification

Qwen3-ForcedAligner-0.6B-4bit

Ivan

4-bit quantized version of Qwen/Qwen3-ForcedAligner-0.6B for Apple Silicon inference via MLX. Predicts word-level timestamps for audio+text pairs in a single non-autoregressive forward pass. Unlike ASR (autoregressive, token-by-token), the forced aligner runs the entire sequence in one forward pass through the decoder. The classify head predicts a timestamp class (0–4999) at each token position, which maps to time via classindex × 80ms. This model is designed for use with speech-swift: Text decoder (attention projections, MLP, embeddings) quantized to 4-bit using group quantization (groupsize=64). Audio encoder and classify head kept as float16 for accuracy.

Open weights apache-2.0 415M parameters mlx

Model · Audio classification

MuQ-large-msd-iter

MuQ

This is the official repository for the paper "MuQ: Self-Supervised Music Representation Learning with Mel Residual Vector Quantization". For more detailed information, we strongly recommend referring to https://github.com/tencent-ailab/MuQ and the paper). In this repo, the following models are released: - MuQ(see this link): A large music foundation model pre-trained via Self-Supervised Learning (SSL), achieving SOTA in various MIR tasks. - MuQ-MuLan(see this link): A music-text joint embedding model trained via contrastive learning, supporting both English and Chinese texts. To begin with, please use pip to install the official muq lib, and ensure that your python>=3.8: To extract music…

Open weights cc-by-nc-4.0 333M parameters

The model was trained on MSP-Podcast for the Odyssey 2024 Emotion Recognition competition baseline This particular model is the multi-attributed based model which predict arousal, dominance and valence in a range of approximately 0...1. CCC based on Test3 and Development sets of the Odyssey Competition

Open weights mit 319M parameters transformers

The model expects a raw audio signal as input and outputs predictions for age in a range of approximately 0...1 (0...100 years) and gender expressing the probababilty for being child, female, or male. In addition, it also provides the pooled states of the last transformer layer. The model was created by fine-tuning Wav2Vec2-Large-Robust Timit and For this version of the model we trained all 24 transformer layers. An ONNX export of the model is available from Further details are given in the associated paper and tutorial.

Open weights cc-by-nc-sa-4.0 318M parameters transformers

Model · Audio classification

wavlm-emotion-russian-resd

Aniemore

Speech emotion recognition for Russian over seven classes: anger, disgust, enthusiasm, fear, happiness, neutral, sadness. Fine-tuned from jonatasgrosman/expw2v2truwavlms363 on Aniemore/resd. Audio resampled to 16 kHz mono, clips capped at 12 s, normalized per utterance, padding masked. UA is macro-averaged recall, WA is accuracy, F1 is macro-averaged. All three test sets went through the same harness, so the rows are comparable to each other. The RESD split matches fold 1 of EmoBox bit for bit. The top entry there is WavLM-large at WA 56.47 / UA 55.87 / F1 55.82. These numbers are higher, but the training protocol differs — EmoBox freezes the encoder and trains a probe, this is a full…

Open weights mit 317M parameters transformers

The model is a fine-tuned version of jonatasgrosman/wav2vec2-large-xlsr-53-english for a Speech Emotion Recognition (SER) task. The dataset used to fine-tune the original pre-trained model is the RAVDESS dataset. This dataset provides 1440 samples of recordings from actors performing on 8 different emotions in English, which are: It achieves the following results on the evaluation set: The following hyperparameters were used during training: - learningrate: 0.0001 - trainbatchsize: 4 - evalbatchsize: 4 - gradientaccumulationsteps: 2 - totaltrainbatchsize: 8 - lrschedulertype: linear - numepochs: 3 - mixedprecisiontraining: Native AMP Any doubt, contact me on Twitter. - Transformers 4.8.2…

Open weights apache-2.0 316M parameters transformers