griko/voice-emotion-classification

0

stars

1

commits

Python

primary language

Mar 30, 2025

updated

README

Emotion Classification from Audio

A HuggingFace pipeline for emotion classification from audio using SpeechBrain ECAPA embeddings and SVM.

Model Details

  • Architecture: SpeechBrain ECAPA-TDNN embeddings (192-dim) + SVM classifier
  • Training Data: RAVDESS dataset
    • 7 emotion classes: angry, disgust, fearful, happy, neutral/calm, sad, surprised
    • Professional actors (24 speakers)
    • 5-fold cross-validation
  • Performance:
    • RAVDESS 5-fold cross-validation: 86.24% accuracy
  • Audio Processing:
    • Input format: Any audio file format supported by soundfile
    • Automatically converted to: 16kHz, mono, single channel, 256 Kbps

Installation

You can install the package directly from GitHub:

pip install git+https://github.com/griko/voice-emotion-classification.git

Usage

from voice_emotion_classification import EmotionClassificationPipeline

# Load the pipeline
classifier = EmotionClassificationPipeline.from_pretrained(
    "griko/emotion_7_cls_svm_ecapa_ravdess"
)

# Single file prediction
result = classifier("path/to/audio.wav")
print(result)  # ["angry"] or ["disgust"] or ["fearful"] or ["happy"] or ["neutral/calm"] or ["sad"] or ["surprised"]

# Batch prediction
results = classifier(["audio1.wav", "audio2.wav"])
print(results)  # ["angry", "disgust"]

Limitations

  • Model was trained on actor voices from RAVDESS dataset
  • Performance may vary on:
    • Different audio qualities
    • Different recording conditions
    • Multiple simultaneous speakers
    • Non-actor voices
    • Different languages or accents

Citation

If you use this model in your research, please cite:

@misc{koushnir2025vanpyvoiceanalysisframework,
      title={VANPY: Voice Analysis Framework}, 
      author={Gregory Koushnir and Michael Fire and Galit Fuhrmann Alpert and Dima Kagan},
      year={2025},
      eprint={2502.17579},
      archivePrefix={arXiv},
      primaryClass={cs.SD},
      url={https://arxiv.org/abs/2502.17579}, 
}

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

Acknowledgments

  • RAVDESS dataset for providing the training data
  • SpeechBrain team for their excellent speech processing toolkit

Contributors

griko

1 commits

griko/voice-emotion-classification

0

stars

1

commits

Python

primary language

Mar 30, 2025

updated

README

Emotion Classification from Audio

A HuggingFace pipeline for emotion classification from audio using SpeechBrain ECAPA embeddings and SVM.

Model Details

  • Architecture: SpeechBrain ECAPA-TDNN embeddings (192-dim) + SVM classifier
  • Training Data: RAVDESS dataset
    • 7 emotion classes: angry, disgust, fearful, happy, neutral/calm, sad, surprised
    • Professional actors (24 speakers)
    • 5-fold cross-validation
  • Performance:
    • RAVDESS 5-fold cross-validation: 86.24% accuracy
  • Audio Processing:
    • Input format: Any audio file format supported by soundfile
    • Automatically converted to: 16kHz, mono, single channel, 256 Kbps

Installation

You can install the package directly from GitHub:

pip install git+https://github.com/griko/voice-emotion-classification.git

Usage

from voice_emotion_classification import EmotionClassificationPipeline

# Load the pipeline
classifier = EmotionClassificationPipeline.from_pretrained(
    "griko/emotion_7_cls_svm_ecapa_ravdess"
)

# Single file prediction
result = classifier("path/to/audio.wav")
print(result)  # ["angry"] or ["disgust"] or ["fearful"] or ["happy"] or ["neutral/calm"] or ["sad"] or ["surprised"]

# Batch prediction
results = classifier(["audio1.wav", "audio2.wav"])
print(results)  # ["angry", "disgust"]

Limitations

  • Model was trained on actor voices from RAVDESS dataset
  • Performance may vary on:
    • Different audio qualities
    • Different recording conditions
    • Multiple simultaneous speakers
    • Non-actor voices
    • Different languages or accents

Citation

If you use this model in your research, please cite:

@misc{koushnir2025vanpyvoiceanalysisframework,
      title={VANPY: Voice Analysis Framework}, 
      author={Gregory Koushnir and Michael Fire and Galit Fuhrmann Alpert and Dima Kagan},
      year={2025},
      eprint={2502.17579},
      archivePrefix={arXiv},
      primaryClass={cs.SD},
      url={https://arxiv.org/abs/2502.17579}, 
}

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

Acknowledgments

  • RAVDESS dataset for providing the training data
  • SpeechBrain team for their excellent speech processing toolkit

Contributors

griko

1 commits

Languages

Python

100.0%