/ Модель

Характеристики

Параметры
403 млн
Лицензия
MIT
Архитектура
wav2vec2 · dense
Библиотека
transformers
Опубликована
16 мар 2026

urdu-ser-model

Классификация текстаТекст → label3 профессии

Мультиязычная модель Wav2Vec2 классифицирует эмоции в аудиоречи на урду и английском языке.

121скачиваний за 30 дней0лайковвеса обновлены22 апр 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Модель muhammadsuleman1533/urdu-ser-model разработана Мухаммадом Сулейманом в рамках проекта «Multimodal AI Mental Health Companion». Это дообученная для распознавания эмоций в речи версия мультиязычной модели facebook/wav2vec2-xls-r-300m на базе архитектуры Wav2Vec2ForSequenceClassification с примерно 402,7 млн параметров. Она принимает аудио на урду и английском и классифицирует его по семи эмоциональным категориям Экмана.

Модель предназначена для анализа эмоциональной окраски речи, в том числе в двуязычном и частично смешанном урду-английском контексте. Обучение проводилось на наборах RAVDESS, CREMA-D и UrduSER; основная целевая языковая группа — говорящие на урду, а также англоязычные пользователи. По данным карточки, качество различается между эмоциями: модель хуже распознаёт отвращение и часто пропускает грусть и страх. Урду-английское переключение кодов не было отдельной целью обучения, поэтому его распознавание может быть нестабильным. Лицензия — MIT.

Сценарии применения

  • определение эмоций в записях речи на урду
  • определение эмоций в английской речи
  • анализ эмоциональной окраски речи в двуязычных приложениях
  • классификация эмоциональных реплик в прототипах помощников по психическому здоровью

Ограничения

Для урду использовано меньше обучающих примеров, чем для английского, а смешанная урду-английская речь не обучалась отдельно. По карточке, модель заметно хуже распознаёт отвращение и может пропускать грусть и страх.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Bilingual Speech Emotion Recognition Model (Urdu + English)

Model Overview

This model performs bilingual Speech Emotion Recognition (SER) from audio input in both Urdu and English languages. It is a fine-tuned version of the multilingual facebook/wav2vec2-xls-r-300m model, trained on a combined dataset of English (RAVDESS + CREMA-D) and Urdu (UrduSER) emotional speech to predict 7 Ekman emotions.

The model is part of the "Multimodal AI Mental Health Companion" Final Year Project (FYP) and is specifically designed for code-switched and multilingual emotional speech analysis in Pakistani contexts where speakers often mix Urdu and English.

Supported Emotions (7 Ekman Classes)

Label IDEmotion
0anger
1disgust
2fear
3joy
4neutral
5sadness
6surprise

Language Capabilities

LanguageSupportedTraining DataNotes
Urdu✅ YesUrduSER (~3,500 samples)Primary target language
English✅ YesRAVDESS + CREMA-D (~8,900 samples)Strong performance
Code-Switched⚠️ PartialNot explicitly trainedMay work due to bilingual base model

Model Details

  • Model ID: muhammadsuleman1533/urdu-ser-model
  • Task: Audio Classification / Speech Emotion Recognition
  • Languages: Urdu & English (Bilingual)
  • Base Model: facebook/wav2vec2-xls-r-300m (Pre-trained on 128 languages)
  • Framework: PyTorch + Hugging Face Transformers
  • Model Size: 0.3B Parameters
  • Developed by: Muhammad Suleman (Team Leader: Muhammad)
  • License: MIT

Why wav2vec2 XLS-R for Bilingual SER?

The XLS-R (300m) model was selected because it is pre-trained on 128 languages, including both Urdu and English. This makes it uniquely suited for:

  1. Cross-lingual transfer: Knowledge learned from high-resource English emotional speech (RAVDESS, CREMA-D) transfers to improve Urdu emotion recognition
  2. Bilingual robustness: The shared multilingual representations help handle code-switched Urdu-English speech common in urban Pakistani populations
  3. Low-resource adaptation: Leverages pre-trained Urdu speech features despite limited Urdu SER data availability

Dataset Information

The model was trained on a bilingual hybrid corpus combining English and Urdu emotional speech to maximize generalization for both languages.

Dataset Composition

DatasetLanguageSamplesSpeakersTypeEmotion Labels
RAVDESSEnglish~1,44024 (12M/12F)Acted8 emotions
CREMA-DEnglish~7,44291 (48M/43F)Acted6 emotions
UrduSERUrdu~3,500~40Acted7 emotions
TOTALBilingual12,376~155Acted7 (standardized)

Language Distribution

LanguageTotal SamplesPercentage
English~8,88271.8%
Urdu~3,49428.2%
Total12,376100%

Data Split (Speaker-Disjoint)

A GroupShuffleSplit was used based on speaker_id to ensure zero speaker overlap between train and test sets. This tests the model's true ability to recognize emotion in unseen voices across both languages.

SplitSamplesEnglishUrdu
Training9,619~6,900~2,719
Testing2,757~1,982~775
Total12,376~8,882~3,494

Emotion Distribution & Class Imbalance

The combined dataset is moderately imbalanced with surprise being heavily under-represented in both languages.

EmotionTotal SamplesEnglishUrduClass Weight
anger~1,963~1,400~5630.898
disgust~1,963~1,400~5630.898
fear~1,963~1,400~5630.899
joy~1,963~1,400~5630.898
neutral~2,375~1,800~5750.759
sadness~1,963~1,400~5630.899
surprise~192~19208.588

Important Notes:

  • Surprise class: Only present in English datasets (RAVDESS). UrduSER does not contain surprise samples.
  • Mitigation: Weighted Cross-Entropy Loss was used with surprise weighted 8.5x higher to compensate for extreme under-representation.

Training Details

Training Configuration

ParameterValue
Epochs10 (with Early Stopping Patience=3)
Batch Size2 (Effective 16 via Gradient Accumulation ×8)
Learning Rate2e-5
OptimizerAdamW
Loss FunctionWeighted Cross-Entropy Loss
LR SchedulerCosine with 10% Warmup
Weight Decay0.01
Max Audio Length10 seconds (160,000 samples @ 16kHz)
Mixed PrecisionFP16
HardwareNVIDIA T4 GPU (Google Colab)
Training Duration~7-8 hours

Freezing Strategy

To prevent catastrophic forgetting of pre-trained multilingual speech representations:

  • Frozen: CNN feature extractor layers (wav2vec2.feature_extractor)
  • Trainable: Transformer encoder layers + Classification head

Preprocessing Pipeline

  1. Audio Loading: All files loaded with librosa at 16kHz mono
  2. Duration Filtering: Files outside 0.5-10 seconds filtered out (removed 6 corrupted files)
  3. Feature Extraction: Wav2Vec2FeatureExtractor from facebook/wav2vec2-xls-r-300m
  4. Label Encoding: 7 emotions mapped to numeric IDs (0-6)
  5. Standardization: All emotions mapped to 7 Ekman classes (e.g., "calm" → "neutral", "happy" → "joy")

Evaluation Metrics

Overall Performance (Final Model)

The model was trained for 10 epochs with early stopping (patience=3). Training converged at epoch 6.7.

MetricValue
Accuracy0.573 (57.3%)
Weighted F10.554
Macro F10.561
Validation Loss1.208

Per-Language Performance (Estimated)

Since the test set contains both Urdu and English samples without separate labels, these are conservative estimates based on dataset composition:

LanguageEstimated AccuracyNotes
English~60-65%More training data (72% of corpus), better representation
Urdu~45-50%Less data (28% of corpus) but benefits from multilingual transfer
Code-SwitchedUnknownNot explicitly trained, performance may vary

Class-wise Performance (Actual Results)

The following table shows the actual per-class performance on the 2,757 test samples:

EmotionPrecisionRecallF1-ScoreSupport
anger0.6900.8800.774433
disgust0.3870.2810.325431
fear0.6600.4300.520433
joy0.5930.5240.556433
neutral0.5100.8420.635562
sadness0.6880.3670.479433
surprise0.4641.0000.63432

| | Weighted Avg | 0.583 | 0.573 | 0.554 | 2,757 |

Key Observations

Strong Performance (F1 > 0.60):

  • Anger (0.774): Excellent recall (88%) - the model rarely misses anger when present. High intensity and distinct prosodic features make this emotion easily recognizable across both languages.
  • Neutral (0.635): Very high recall (84%) - the model effectively identifies non-emotional speech, though precision is moderate due to some confusion with joy.
  • Surprise (0.634): Despite having only 32 test samples (all English), the model correctly identifies all surprise samples (100% recall), though precision is lower as it sometimes misclassifies fear as surprise.

Moderate Performance (F1 0.45-0.60):

  • Joy (0.556): Moderate performance with balanced precision and recall. Some confusion with neutral speech.
  • Fear (0.520): Decent precision (66%) but lower recall (43%) - the model misses many fear samples, likely confusing them with surprise or sadness.

Weak Performance (F1 < 0.45):

  • Sadness (0.479): Good precision (69%) but very low recall (37%) - the model is conservative in predicting sadness, missing many true sadness samples.
  • Disgust (0.325): The most challenging emotion. Low recall (28%) indicates the model struggles to distinguish disgust from anger, which shares similar acoustic properties.

Training Progress

StepTraining LossValidation LossAccuracyF1 WeightedF1 Macro
30011.5621.9260.1570.0430.039
90010.9391.8060.3510.2690.226
15009.5051.5140.4130.3290.314
21008.0831.4450.4350.3670.365
27007.8211.3040.4930.4470.440
33007.0961.4200.4790.4210.406
39006.8361.2410.5490.5200.532
45006.1291.2080.5730.5540.560
54005.9991.2860.5560.5290.524

The model showed consistent improvement throughout training, with the best F1-weighted score (0.554) achieved at step 4500 (epoch ~5.6).


How to Use the Model

Installation

pip install transformers torch librosa soundfile

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers · text-classification

Можно запустить

Подбираем GPU…

Класс архитектуры
Wav2Vec2ForSequenceClassification
Ревизия весов
2ebd17d

0 моделей