This project implements an emotion-based music recommender system utilizing Convolutional Neural Networks (CNN) and ResNet50V2 architectures. It involves training models to detect emotions in images and recommend music based on the identified emotional context within visual content.
EmotionDetectionResNet50V2ModelTrain.ipynb
: Jupyter Notebook for training the ResNet50V2 model to detect emotions in images.EmotionDetectionCNNModelTrain.ipynb
: Jupyter Notebook for training the CNN model for emotion detection in images.EmotionBasedMusicRecommderSystem.ipynb
: Jupyter Notebook implementing the music recommender system based on detected emotions.
The project utilizes the FER2013 dataset from Kaggle, containing facial expression images categorized into different emotions.
The notebook EmotionDetectionCNNModelTrain.ipynb
covers the training of the CNN model.
- Training involves preprocessing images and achieving a Test Loss of 0.92 and Test Accuracy of 66.41%.
The notebook EmotionDetectionResNet50V2ModelTrain.ipynb
details the training of the ResNet50V2 model.
- Training involves processing images and achieving a Test Loss of 1.09735 and Test Accuracy of 67.37%.
You can access the saved trained models (CNN_Model.h5 and ResNet50V2Model.h5) from this Google Drive folder.
The notebook EmotionBasedMusicRecommderSystem.ipynb
implements the music recommender system.
- It utilizes the trained models to detect emotions in images and recommends music based on the identified emotional context.
recommend_songs(pred_class)
: Recommends songs based on the predicted emotion class.load_and_preprocess_image(filename, img_shape=224, default_img_shape=128)
: Loads and preprocesses images for emotion detection.predict_and_plot(filename, class_names)
: Predicts emotions in an image and visualizes the prediction.
- Download the FER2013 dataset from the provided Kaggle link.
- Organize the dataset into appropriate train and test directories.
- Execute
EmotionDetectionCNNModelTrain.ipynb
andEmotionDetectionResNet50V2ModelTrain.ipynb
for model training. - Run
EmotionBasedMusicRecommderSystem.ipynb
to implement the music recommender system.
Feel free to explore the provided notebooks to understand the training process and the functionality of the music recommender system.