/ Модель

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

Параметры
113 млн
Архитектура
wav2vec2 · dense
Библиотека
transformers
Опубликована
11 авг 2026

wav2vec2-modified-shemo-augmented

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

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

10скачиваний за 30 дней0лайковвеса обновлены11 авг 2026

Бенчмарки

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

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

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

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

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

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

Модель разработал Махди Карими из факультета компьютерных наук и инженерии Университета Шахида Бехешти. Это дообученная модель Wav2Vec2 для распознавания эмоций в персидской (фарси) речи: она принимает монофонический аудиосигнал с частотой 16 кГц и классифицирует его по шести эмоциональным состояниям. Модель основана на superb/wav2vec2-base-superb-er и содержит 113,3 млн параметров.

При обучении на Modified ShEMO применялись аугментация аудио с изменением высоты тона и скорости, добавлением белого шума, а также веса классов для компенсации дисбаланса данных. В README указаны точность 77% и macro-F1 58%; модель особенно хорошо распознаёт нейтральность, гнев и грусть. Для входящего аудио рекомендуется использовать сегменты около трёх секунд с дополнением до четырёх секунд.

Модель предназначена для классификации эмоций в речи, например, в приложениях анализа разговоров и интерфейсах, реагирующих на эмоциональное состояние. Её результаты могут быть хуже на шумных записях без предварительного шумоподавления, на других языках и для редких состояний; у классов страха и удивления отмечен более низкий recall. Лицензия — Apache 2.0.

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

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

Ограничения

На шумных записях, на языках кроме персидского и для эмоциональных состояний, слабо представленных в обучающих данных, качество может снижаться. Для страха и удивления отмечен более низкий recall; заявленные метрики составляют 77% accuracy и 58% macro-F1.

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

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

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

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

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

Открыть на Hugging Face

Persian Speech Emotion Recognition (Wav2Vec2 Augmented)

This model is a fine-tuned version of the superb/wav2vec2-base-superb-er architecture, specifically trained to recognize human emotions from Persian (Farsi) speech. It classifies audio into 6 distinct emotional states.

Model Details

Model Description

This model provides a robust solution for Persian Speech Emotion Recognition (SER). It addresses the inherent severe class imbalance in Persian emotional datasets (specifically the lack of "happiness" samples) by utilizing targeted Data Augmentation (Pitch Shifting, Time Stretching, and White Noise Injection) and strategic Class Weighting during training. This ensures the model does not just default to majority classes like "neutral" or "angry", achieving a balanced and highly accurate F1-Macro score.

  • Developed by: Mahdi Karimi (Department of Computer Science and Engineering, Shahid Beheshti University)
  • Model type: Audio Classification (Wav2Vec2ForSequenceClassification)
  • Language(s) (NLP): Persian (Farsi)
  • License: Apache 2.0 (Inherited from the base dataset/model)
  • Finetuned from model: superb/wav2vec2-base-superb-er

Model Sources

Uses

Direct Use

The model is optimized for direct integration into production environments, such as Python-based backends (FastAPI/Flask) for web applications. It accepts 16kHz mono audio files and outputs the predicted emotional state, which can be used to drive UI animations (e.g., dynamic emojis in a React frontend).

Out-of-Scope Use

This model is trained specifically on semi-natural Persian speech. It may not perform optimally on:

  • Highly noisy environments without prior noise-cancellation preprocessing.
  • Languages other than Persian.
  • Extreme outlier emotional states not represented in the ShEMO dataset.

Bias, Risks, and Limitations

While the original ShEMO dataset suffers from a severe imbalance (e.g., "happiness" making up less than 7% of the data), this model explicitly mitigates this bias through synthetic data generation for minority classes.

However, users should be aware that the classes fear and surprise still have inherently lower recall due to the extreme scarcity of source samples. The model performs exceptionally well on neutral, anger, and sadness.

Recommendations

For downstream integration, it is recommended to chunk incoming audio streams into 3-second segments, pad them to max_length=64000 (at 16kHz), and use f1_macro rather than plain accuracy for any further re-evaluation.

How to Get Started with the Model

Use the code below to get started with the model. Note that the preprocessor_config.json is fully integrated.

from transformers import AutoFeatureExtractor, AutoModelForAudioClassification
import torch
import librosa

model_id = "mahdikarimiii/wav2vec2-modified-shemo-augmented"

# Load extractor and model
feature_extractor = AutoFeatureExtractor.from_pretrained(model_id)
model = AutoModelForAudioClassification.from_pretrained(model_id)

# Load and preprocess audio
audio_data, sr = librosa.load("path_to_audio.wav", sr=16000)

inputs = feature_extractor(
    audio_data,
    sampling_rate=16000,
    return_tensors="pt",
    padding="max_length",
    max_length=64000,
    truncation=True
)

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

predicted_id = torch.argmax(logits, dim=-1).item()
predicted_emotion = model.config.id2label[predicted_id]
print(f"Predicted Emotion: {predicted_emotion}")

Training Details

Training Data

The model was trained on the Modified ShEMO (Sharif Emotional Speech Database), which corrects significant transcription and alignment errors present in the original dataset. To combat class imbalance, the happiness class was heavily augmented using librosa prior to feature extraction.

Training Procedure

Preprocessing

  • Sampling Rate: All files strictly resampled to 16,000 Hz.
  • Chunking/Padding: Fixed sequence length of 64,000 samples (4 seconds).
  • Augmentation: White noise injection, pitch shifting (-2 to +2 semitones), and time stretching (0.8x to 1.2x) applied exclusively to minority classes.

Training Hyperparameters

  • Training regime: fp32
  • Learning Rate: 3e-5
  • Epochs: 5
  • Train Batch Size: 8 (per device)
  • Gradient Accumulation Steps: 2
  • Eval Batch Size: 8
  • Eval Accumulation Steps: 4
  • Loss Function: Weighted Cross-Entropy Loss (calculated via sklearn.utils.class_weight)

Evaluation

Testing Data, Factors & Metrics

  • Testing Data: 20% stratified split of the Modified ShEMO dataset (600 instances).
  • Metrics: F1-Macro (primary metric to ensure minority class representation) and Accuracy.

Results

The model achieves strong generalization, successfully pulling the recall of the "happiness" class from 0.00 (in non-augmented baseline runs) to 0.51, while maintaining high precision on majority classes.

Summary

MetricValue
Accuracy77.0%
F1-Macro58.0%
Validation Loss1.093

Environmental Impact

  • Hardware Type: Dual NVIDIA T4 (Kaggle Environment)
  • Hours used: ~0.6 hours

Citation

If you use this model, please ensure you also cite the creators of the original and modified ShEMO datasets:

BibTeX:

@Article{MohamadNezami2019,
    author="Mohamad Nezami, Omid and Jamshid Lou, Paria and Karami, Mansoureh",
    title="ShEMO: a large-scale validated database for Persian speech emotion detection",
    journal="Language Resources and Evaluation",
    year="2019"
}

@misc{yazdani2022persian,
    title={A Persian ASR-based SER: Modification of Sharif Emotional Speech Database},
    author={Ali Yazdani and Yasser Shekofteh},
    year={2022},
    eprint={2211.09956},
    archivePrefix={arXiv}
}

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

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

GPU в ailist

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

Нельзя запустить

Для архитектуры wav2vec2 нет загрузчика под задачу text-classification.

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

0 моделей