Skip to content

Absar-source/CodeAlpha_VoiceEmotionRecognition

Repository files navigation

Emotion Detection from Voice

This project uses Convolutional Neural Networks (CNNs) to detect emotions from voice recordings. The dataset is preprocessed to extract MFCC (Mel Frequency Cepstral Coefficients) features, which are then used to train a deep learning model to classify emotions.

Features

  • Emotion Detection: Classifies emotions such as happy, sad, angry, calm, etc.
  • Visualization: Displays MFCC curves and confusion matrices for better understanding.
  • Preprocessing: Standardizes audio features for consistent input to the model.

Results

Model Performance

  • Test Accuracy: ~92%

  • Confusion Matrix: Confusion Matrix

  • Accuracy and Loss Graphs:

    • Accuracy: Accuracy Graph
    • Loss: Loss Graph

Installation

Prerequisites

  • Python 3.8 or higher
  • Virtual environment (recommended)

Clone the Repository

git clone https://github.com/your-username/emotion-detection-from-voice.git
cd emotion-detection-from-voice

###Set Up Virtual Environment

python -m venv .venv
[activate](http://_vscodecontentref_/1)  # On Windows
# source .venv/bin/activate  # On Linux/Mac

Install Dependencies

pip install -r requirements.txt

Usage

  1. Preprocess the Dataset Place your .wav files in the data/ directory. The dataset should follow the RAVDESS naming convention.

  2. Train the Model Run the main.py script to preprocess the data, train the model, and save the results:

python [main.py](http://_vscodecontentref_/3)
  1. Visualize Results Run the Visualize.py script to generate the confusion matrix and accuracy/loss graphs:
python [Visualize.py](http://_vscodecontentref_/4)
  1. Test with New Audio Use the evaluate.py script to test the model with a new .wav file:
python [evaluate.py](http://_vscodecontentref_/5)

Dependencies

  • librosa
  • numpy
  • matplotlib
  • keras
  • scikit-learn
  • tensorflow
  • tqdm Install all dependencies using:
pip install -r requirements.txt

References

  • RAVDESS Dataset
  • Librosa Documentation

License This project is licensed under the MIT License. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors