Coder Social home page Coder Social logo

laplacekorea / speech-emotion-classification-with-pytorch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from haoheliu/speech-emotion-classification-with-pytorch

0.0 1.0 0.0 144.68 MB

This repository contains PyTorch implementation of 4 different models for classification of emotions of the speech.

Jupyter Notebook 58.86% Python 41.14%

speech-emotion-classification-with-pytorch's Introduction

Speech-Emotion-Classification-with-PyTorch

This repository contains PyTorch implementation of 4 different models for classification of emotions of the speech:

  1. Stacked Time Distributed 2D CNN - LSTM
  2. Stacked Time Distributed 2D CNN - Bidirectional LSTM with attention
  3. Parallel 2D CNN - Bidirectional LSTM with attention
  4. Parallel 2D CNN - Transformer Encoder

DATASET

Models are trained on RAVDESS Emotional Speech Audio dataset. It consits of 1440 speech audio-only files (16 bits, 48kHz, .wav).
Dataset is balanced:
dataset1
Emotions have 2 intensities: strong and normal (except for the neutral emotion, which only has normal intensity).
dataset2

PREPROCESSING

Signals are loaded with sample rate of 48kHz and cut off to be in the range of [0.5, 3] seconds. If the signal is shorter than 3s it is padded with zeros.
MEL spectrogram is calculated and used as an input for the models (for the 1st and 2nd model the spectrogram is splitted into 7 chunks).
Example of the MEL spectrogram:
spectrogram
Dataset is splitted into train, validation and test sets, with following percentage: (80,10,10)%.
Data augmentation is performed by adding Additive White Gaussian Noise (with SNR in range [15,30]) on the original signal. This enormously improved accuracy and removed overfitting.
Datasets are scaled with Standard Scaler.

MODELS

Architectures for all 4 models are shown from left to right respectively:

spectrogram

RESULTS

1. Model:
Accuracy: 94.02%

Confusion Matrix Influence of Emotion intensity on correctness
KM1 EI1
Losses before augmentation Losses after augmentation
LO1 L1

2. Model:
Accuracy: 96.55%

Confusion Matrix Influence of Emotion intensity on correctness
KM2 EI2
Losses before augmentation Losses after augmentation
LO2 L2

3. Model:
Accuracy: 95.40%

Confusion Matrix Influence of Emotion intensity on correctness
KM3 EI3
Losses before augmentation Losses after augmentation
LO3 L3

4. Model:
Accuracy: 96.78%

Confusion Matrix Influence of Emotion intensity on correctness
KM4 EI4
Losses before augmentation Losses after augmentation
LO4 L4

speech-emotion-classification-with-pytorch's People

Contributors

kosta-jo avatar haoheliu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.