Commit ·
2ecbbcc
0
Parent(s):
Add speech emotion recognition CNN model
Browse files- .gitattributes +2 -0
- README.md +52 -0
- cnn_emotion_model.keras +3 -0
.gitattributes
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.keras filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library: keras
|
| 3 |
+
language: en
|
| 4 |
+
tags:
|
| 5 |
+
- audio
|
| 6 |
+
- speech
|
| 7 |
+
- emotion-recognition
|
| 8 |
+
- keras
|
| 9 |
+
- tensorflow
|
| 10 |
+
metrics:
|
| 11 |
+
- accuracy
|
| 12 |
+
- f1
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# Speech Emotion Analyzer Model
|
| 16 |
+
|
| 17 |
+
This is a Keras model trained for speech emotion recognition.
|
| 18 |
+
|
| 19 |
+
## Model Details
|
| 20 |
+
|
| 21 |
+
The model is a Convolutional Neural Network (CNN) trained on audio features (Mel Spectrograms) to classify speech into the following emotion categories:
|
| 22 |
+
|
| 23 |
+
angry, disgust, fear, happy, neutral, sad, surprise
|
| 24 |
+
|
| 25 |
+
## Usage
|
| 26 |
+
|
| 27 |
+
To use this model, you can load it using TensorFlow/Keras:
|
| 28 |
+
|
| 29 |
+
```python
|
| 30 |
+
import tensorflow as tf
|
| 31 |
+
from huggingface_hub import hf_hub_download
|
| 32 |
+
|
| 33 |
+
repo_id = "RayyanAhmed9477/speech-emotion-analyzer"
|
| 34 |
+
filename = "cnn_emotion_model.keras"
|
| 35 |
+
|
| 36 |
+
# Download the model file
|
| 37 |
+
model_path = hf_hub_download(repo_id=repo_id, filename=filename)
|
| 38 |
+
|
| 39 |
+
# Load the model
|
| 40 |
+
model = tf.keras.models.load_model(model_path)
|
| 41 |
+
|
| 42 |
+
# Now you can use the model for prediction
|
| 43 |
+
# (You'll need to implement feature extraction similar to the original app)
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
## Features
|
| 47 |
+
|
| 48 |
+
- Data loading and preprocessing using the RAVDESS dataset
|
| 49 |
+
- Feature extraction using librosa (MFCCs and spectrograms)
|
| 50 |
+
- Neural network models (CNN) implemented with TensorFlow/Keras
|
| 51 |
+
- Model training with early stopping and comprehensive evaluation metrics
|
| 52 |
+
- Hyperparameter optimization
|
cnn_emotion_model.keras
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ac7fee19b920bc57b0da8b995fde6e94cbf34cb71e257bfce17c32cce5fe99ba
|
| 3 |
+
size 1702103
|