In a society where emotional intelligence, mental health, and emotional states are increasingly important, companies need to adapt to improve user experience and customer loyalty. 💡💖
EmoSense is a Machine Learning-based application 🤖 that detects emotions through communication channels, both verbal and written. It analyzes:
-
🎵 Audio waves and spectrograms.
-
📝 The semantic meaning of words.
Companies with a large number of customers (
By adding emotion analysis to these automated methods, we can enhance the experience and increase customer loyalty. 🎯😊
In our research, we found two approaches:
-
📜 Semantic analysis: Speech-to-text to convert audio into text and analyze the words.
-
🎙️ Audio analysis: Waves, tone, and spectrograms to deduce emotions.
- Traditional models: 🌲 Random Forest, 🌳 Decision Tree.
- Advanced models: 🤖 Deep Neural Networks (DNNs), 🧩 Convolutional Neural Networks (CNNs).
For our application, we will test various models and select the most suitable one. ⚙️📊
📌 RAVDESS Emotional Speech Audio
🔗 Dataset on Kaggle
The emotions are labeled in the filenames:
- 😐 Neutral (01)
- 😌 Calm (02)
- 😃 Happy (03)
- 😢 Sad (04)
- 😡 Angry (05)
- 😨 Fearful (06)
- 🤢 Disgusted (07)
- 😲 Surprised (08)
Other characteristics such as intensity and actor are also included. 🎭
- 📌 Cleaning and normalization.
- 📈 Data augmentation.
- Algorithms used: 🧠 MLP, SVM, CNN.
- Tools and frameworks: 🛠️ TensorFlow, Librosa, Scikit-Learn.
- Data split: 📊 Train / Validation / Test.
- Evaluation metrics: 🎯 Accuracy, Confusion Matrix.
- Performance improvement: 🔄 Class rebalancing with SMOTE, Model optimization with GridSearch.
- A Streamlit app that predicts emotions after recording an audio or writing a sentence.
- Text-based emotion recognition has proven to be highly effective.
- Audio-based emotion recognition presents unique challenges (finding datasets in Spanish, long training time, data quality).
- In the weighting of the emotion decision, the prediction with text has more influence.
- Expand training data to Spanish audio.
- Integrate English text-based emotion recognition.
- Real-time feedback loop for model improvement.
- Data augmentation to enhance the model.
- More emotions.
- The emotion decision will be weighted by the model's accuracy.
📖 Implementing Machine Learning Techniques for Continuous Emotion Prediction from Uniformly Segmented Voice Recordings 🔗 Artículo en Frontiers in Psychology
Yo have two options to run the app:
-
If you have streamlit installed. Run the app with the following steps:
1.1. Go to
streamlit-app/src
folder.1.2. Run the following command:
streamlit run app.py
-
Run the app with docker:
2.1. Go to
streamlit-app
folder and run the following command: docker build -t streamlit-app . 2.2. Run the docker container with the following command:
docker run -p 8501:8501 streamlit-app
Then you can access the app at http://localhost:8501.
In streamlit-app/src
folder you can find the app.py
file where the app is defined to run with streamlit in your local machine. And app2.py
file where the app is defined to run with docker.