Skip to main content

A tool for standardizing Speech Emotion Recognition (SER) datasets and extracting acoustic features.

Project description

SER-Standardizer

🇺🇸 English | 🇧🇷 Português

PyPI License: MIT Python Version

A modular infrastructure for dataset standardization and feature extraction in Speech Emotion Recognition (SER).

SER-Standardizer is a Python package built to unify the formatting of multiple speech databases, mitigating metadata heterogeneity. Its main goal is to facilitate cross-corpus training and generalization testing of machine learning models.

Beyond the standardization pipeline, the tool provides an extension module for acoustic feature extraction (spectral and prosodic) by integrating the openSMILE framework.

📋 Currently Supported Datasets

The tool currently supports loading and standardizing the following databases:

  • CREMA-D | IEMOCAP | EmoUERJ (PT-BR) | MSP-IMPROV | MSP-PODCAST | RAVDESS | EmoDB (DE)

Per-dataset download and directory-layout guides are available under docs/en/.

🚀 Installation

Prerequisites

  • Python 3.8 or higher
  • Libraries listed in pyproject.toml (installed automatically).

The library is published on PyPI and was designed with flexibility in mind, offering two installation modes to optimize the use of computational resources:

1. Base Installation (Lightweight Metadata)

Installs only the essential packages (pandas, audb) for tabular standardization and filtering.

pip install ser-standardizer

2. Full Installation (With Signal Processing)

Installs the heavy dependencies required for the feature extraction and audio manipulation module (opensmile, noisereduce).

pip install "ser-standardizer[features]"

Installation from source

Only needed to modify the code or track the development version:

git clone https://github.com/ViniciusSuaiden/ser-standardizer.git
cd ser-standardizer
pip install ".[features]"

💻 How to Use

The workflow is split into three logical steps:

1. Preprocessing (CLI)

After installation, the ser-std command becomes available in your terminal. To standardize a specific dataset:

# Example: crema_d
ser-std --dataset crema_d --input_dir /path/to/crema

The standardized .csv file is written to the user's home folder, with a specific name for each database.

2. Data Handling and Filtering (Python)

After preprocessing, use the library to load, filter and manipulate the audio directly in your code or Jupyter Notebook.

import ser_standardizer as ser

# Loads multiple standardized datasets into a single DataFrame
df = ser.load_datasets(["crema_d", "ravdess", "iemocap"])

# Filters by dataset, emotion and gender
df_target = ser.filters(
    df,
    datasets=['ravdess', 'iemocap'],
    emotions=['anger', 'sad'],
    genders=['female']
)

3. Acoustic Feature Extraction (Requires [features])

The extraction module automates digital signal processing. It includes the option to apply a Voice Activity Detection (VAD) mask based on RMS energy to extract features strictly from the effective phonation segments.

# Batch extraction via openSMILE
# Supported 'feature_set' values: 'eGeMAPS' or 'ComParE'
features_df = ser.extract_features(
    df_target,
    feature_set='eGeMAPS',
    feature_level='functionals', # 'functionals' (1 vector per utterance) or 'llds' (per frame)
    use_vad=False, # VAD (silence removal) is only allowed with feature_level='llds'
    sr=16000       # Sampling rate
)

# The result preserves the original indices, making concatenation easy
import pandas as pd
final_dataset = pd.concat([df_target, features_df], axis=1)

# Group-wise normalization (z-score) — removes corpus/speaker offsets.
# Pass the grouping column (e.g., 'dataset' or 'speaker_id').
X_corpus  = ser.normalize(features_df, df_target['dataset'])
X_speaker = ser.normalize(features_df, df_target['speaker_id'])

# --- Extra Utilities ---
# Listen to the audio in a Jupyter Notebook
ser.listen(df_target, index=42)

# Load the raw audio as a NumPy array (e.g., to feed neural networks)
audio_array = ser.load_audio(df_target, index=42)

# Load a batch of audio with zero-padding
batch = ser.load_batch(df_target, begin=0, end=32)

✍️ Authors

Vinicius Suaiden - USP - vinicius.suaiden@usp.br

Miguel Arjona Ramirez - USP - maramire@usp.br

Wesley Beccaro - USP - wesleybeccaro@usp.br

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ser_standardizer-0.1.1.tar.gz (20.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ser_standardizer-0.1.1-py3-none-any.whl (23.3 kB view details)

Uploaded Python 3

File details

Details for the file ser_standardizer-0.1.1.tar.gz.

File metadata

  • Download URL: ser_standardizer-0.1.1.tar.gz
  • Upload date:
  • Size: 20.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for ser_standardizer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c5c3a3b2ecdfd119a9e5d17581c11ad22313a6a9a00b5960d6c1a5dd0741bb82
MD5 adca2b525cdf67c36208e6b7426e9978
BLAKE2b-256 6b92b7019a202d20c13752e88366a0641c289dd33dd6a6b5381c1cddf4df5c37

See more details on using hashes here.

File details

Details for the file ser_standardizer-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for ser_standardizer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f09dddc5df0f20ed245e4767c86dbd5cb3d91a30b92e939a810c9db1b2831f74
MD5 5e12e21852c0a12c98033a8ba47e79d5
BLAKE2b-256 8f723537fbf8f543ede5cc59b2a1459ae54b78fc2e7fc9ff937e301bbc86477b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page