Skip to main content

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

Project description

SER-Standardizer

🇺🇸 English | 🇧🇷 Português

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).

Installation from source

Clone this repository to install it with pip (read more about it below):

git clone https://github.com/ViniciusSuaiden/ser-standardizer.git
cd ser-standardizer

The library 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 .

2. Full Installation (With Signal Processing)

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

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.0.tar.gz (20.7 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.0-py3-none-any.whl (23.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ser_standardizer-0.1.0.tar.gz
  • Upload date:
  • Size: 20.7 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.0.tar.gz
Algorithm Hash digest
SHA256 19f96da5b4fd98f00d14247f22194ce360511d702e6ec124b463a9a0245fe94d
MD5 7f022972c92f2715df9fb9b2d24045fb
BLAKE2b-256 c5c03dafe29314a5c47e6277bb02e312e808e23b2f33e865f49d5aca0ac86db6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ser_standardizer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e0760adec473a40c623f7ec91934c74b1fa60a20698ea1ad8bfc3407db6e4d01
MD5 89540756346b1c7193d063e15673b23c
BLAKE2b-256 4c511267b5ec405d28e00f892e01136b32a1dd1f3515ba6ad5d6e000c9c10830

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