Emotionfy is a cutting-edge system that merges the power of emotion detection with personalized music recommendations. Using deep learning for facial emotion recognition and Spotify’s API, this application recommends playlists tailored to the user’s emotional state. Upload an image, and Emotionfy will do the rest — analyzing your emotion and curating a playlist to match your mood.
TEAM MEMBERSRey Reyes: CNN Researcher, Backend Developer
Lucas Yao: Backend Developer, Frontend Support
Fei Lin: Frontend Developer, Backend Support
1. Emotion Detection FER Dataset
This dataset contains 35,887 grayscale 48x48 pixel images labeled with the following emotions: - Angry - Disgust - Fear - Happy - Neutral - Sad - Surprise
2. Face Expression Recognition Dataset
A complementary dataset designed for facial emotion recognition tasks.
To enhance emotion detection by integrating Spotify's API, Emotionfy recommends playlists based on user emotions. The deep learning model analyzes facial expressions and maps them to Spotify playlists, offering a seamless blend of technology and music personalization.
MODEL ARCHITECTURE Base Model: Trained a CNN on the FER Kaggle dataset for emotion classification.
Emotion-to-Playlist Mapping: A custom layer maps detected emotions to Spotify playlists for seamless recommendations.
Frontend
React: Interactive user interface
Backend Flask: API communication and emotion detection
Spotify Web API: Playlist recommendations
Data augmentation and preprocessing techniques for improved model generalization
Libraries and Tools TensorFlow and Keras: Deep learning frameworks
OpenCV: Image processing
Pandas and Numpy: Data handling
Matplotlib and Seaborn: Data visualization
Jupyter Notebook: Model development and experiments
Spotify OAuth 2.0: Secure user authentication for playlist access
Spotify Web Playback SDK: Music playback within the interface
1. Emotion Detection
Analyze facial expressions in images or real-time video streams.
Detect and classify emotions such as Happy, Sad, Angry, etc.
2. Playlist Recommendation
Fetch Spotify playlists tailored to the detected emotion.
Play music directly within the app.
3. User Interface
Upload images or stream video for real-time emotion analysis.
Display detected emotions with an accompanying playlist.
Emotion Detection: Accuracy, precision, recall, F1-score
Playlist Recommendation: Relevance and alignment based on user feedback
SETUP INSTRUCTIONS
Requirements
Python 3.8 or above
Spotify Developer Account (for API integration)
1. Clone the repository:
git clone https://github.com/your-username/emotionfy.git cd server
2. Install dependencies:
pip install -r requirements.txt
3. Configure Spotify API:
Create a Spotify Developer Account.
Set up an app and note the Client ID and Client Secret.
Update the config.py file with these credentials.
4. Run the application:
npm dev run
5. Run the server:
python3 main.pyUSER INTERFACE
FUTURE ENHANCEMENTS
User Customization: Link personal Spotify accounts for tailored recommendations.
Platform Expansion: Integration with Apple Music and other music platforms.
Improved Emotion Detection: Incorporate video-based emotion tracking for dynamic recommendations.
MIT License Copyright (c) 2024 Emotionfy TeamPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

