YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
SER-CNN-Transformer
Speech Emotion Recognition β CNN-Transformer + Multidimensional Attention
This repository implements a Speech Emotion Recognition (SER) system based on a hybrid CNN-Transformer architecture enhanced with a Multidimensional Attention Mechanism.
Highlights
- Hybrid CNN + Transformer backbone for robust speech representation
- Multidimensional Attention Mechanism for improved emotion discrimination
- Scripts for preprocessing, training, and inference on IEMOCAP features
Requirements
pip install -r requirements.txt
Quick Start
- Preprocess IEMOCAP (optional if using built-in loader):
python preprocessing/process_IEMOCAP.py
- Train a model with MFCC features (example):
python train_IEMOCAP.py -f mfcc -m CTMAM -b 128 -e 150 -l 0.001 -g 0
- Run inference on an audio file (feature extraction + predict):
python predict.py --model-path data/IEMOCAP/model_CTMAM_mfcc_all.pth --file examples/sample.wav
Notes:
- Use
-gto select GPU id (set to-1for CPU). - Use
-fto change feature type (e.g.,mfcc,fbankif supported).
Data
- The repository contains helper scripts in
preprocessing/to prepare the IEMOCAP features. - Example dataset folder:
data/IEMOCAP/with precomputed feature files and checkpoints.
Project Structure
train_IEMOCAP.pyβ training entrypointpredict.pyβ inference scriptmodels.pyβ model definitions (CNN-Transformer and attention modules)data_loader.pyβ dataset and dataloader utilitiespreprocessing/β data processing helpers for IEMOCAP
Pretrained Models & Checkpoints
- Example checkpoint included:
data/IEMOCAP/model_CTMAM_mfcc_all.pthand metric/loss logs in the same folder. - To evaluate or resume training, point
--model-pathto the checkpoint file.
Evaluation
- Training script saves checkpoints and logs final metrics to
data/IEMOCAP/. - Add evaluation code or use
predict.pyto compute per-file predictions and aggregate metrics.
License
MIT
Inference Providers NEW
This model isn't deployed by any Inference Provider. π Ask for provider support