PROJECT 2
PROJECT 2
•Emotion-based music player reduces the time complexity of the user. Generally, people have a large number of songs on their playlist. Playing songs randomly does not satisfy the mood of the user. This system helps user to play songs automatically according to their mood.
•The facial expressions are captured through webcamera and the image of the user is given as input. It preprocess the image and face detection is done by using Haar cascade classifier.
•The captured image is input to CNN which learn features and these features are analyzed to determine the current emotion of user then the music will be played according to the emotion.
•In this project, five emotions are considered for classification which includes happy, sad, anger, surprise, neutral.
EXISTING SYSTEM
In today's world, with ever increasing advancements in the field of multimedia and technology, various music players have been developed with features like fast forward, reverse, variable playback speed (seek & time compression) local playback, streaming playback with multicast streams and including volume modulation, genre classification etc. These features may satisfy the user's basic requirements, but the user has to face the task of manually browsing through the playlist of songs and select songs based on the current mood and behavior. The motivation of this work comes from the possibility of reducing the human effort in creating music playlists manually, thus generating them automatically based on the user's emotional state. Existing systems create a personalized list based on the user's previous recommendations and does not take emotions into consideration.
SYSTEM REQUIREMENTS
Hardware requirements
•PC/Desktop/Laptop
•Operating system: Windows 8 or above
•8GB Ram
•Web camera
Software requirements
•Python 3.7 or above
•IDE: Jupyter Notebook/PyCharm IDE
•Framework: Streamlit
•Libraries: numpy, keras, tensorflow, Opencv
MODULES
Face Detection Module
Face detection uses such classifiers, which are algorithms that detect what's either a face or not a face .This module involves the ability to detect the user’s face in a frame. In order to achieve this, this module consists of the Haar-Cascade object detection algorithm which is offered through OpenCV library. The main aim of face detection is to spot the face within the frame by reducing external noises and other factors.
Feature Extraction
While performing feature extraction, we treat the pre-trained network that is a sequential model as an arbitrary feature extractor. Starting layers of a convolutional network extract high-level features from the taken image, so use only a few filters. As we make further deeper layers, we increase the number of the filters to twice or thrice the dimension of the filter of the previous layer. Filters of the deeper layers gain more features but are computationally very intensive. The outputs of the model are going to be feature maps. Load the input image for which we want to view the feature map to know which features were prominent to classify the image.
Emotion detection
Neural networks are as a black box, and learned features in a Neural Network are not interpretable. So basically, we give an input image then the CNN model returns the results. Emotion detection is performed by loading the model which is trained by weights using CNN. When we take the real-time image by a user then that image was sent to the pre-trained CNN model, then predict the emotion into one of the following parameters: happy, sad, scared, angry, neutral, surprise and adds the label to the image.
Songs recommendation
After successfully detecting the face, the classifier automatically detects the mood captured, then it searches for the expression tag and it redirects to Youtube where it generates a playlist and plays the song accordingly to suit the person's mood corresponding to the input given .
Suppose if the person is sad or angry then the player will play the song to make the user happy and calm.
METHODOLOGY
1. Capturing user’s face:
In the first step of our emotion-based music recommendation system, to capture the image of a user we are using the common device i.e, webcam the user uploads an image that represents their current emotional state. The image could be a photograph of themselves or any other visual representation that reflects their emotions. This image serves as input to our system, allowing us to analyze and interpret the user's emotional state.
2. Preprocessing:
Once the image is uploaded, we proceed to preprocess it to extract relevant information for emotion recognition. Preprocessing may involve resizing the image, normalizing the color channels, and removing any unnecessary background or noise. We apply image processing techniques to enhance the quality and clarity of the image, ensuring that it provides a reliable representation of the user's emotions.
3. Training:
In this step, we train a machine learning model using a dataset of labeled facial expressions or visual cues associated with different emotions. The training dataset consists of images with known emotional labels, allowing the model to learn the patterns and correlations between facial features and specific emotional states. Through the training process, the model becomes capable of recognizing and classifying emotions based on facial expressions in new, unseen images.
4. Emotion Recognition:
Using the trained model, we apply emotion recognition algorithms to the preprocessed image. The model analyzes the facial features, such as eye movements, eyebrow position, mouth shape, and overall expression, to infer the user's emotional state. The output of this step is a prediction or classification of the user's emotion, which could include categories such as happiness, sadness, anger, surprise, or neutral.
5. Play music:
Based on the recognized emotion, we proceed to recommend and play music that aligns with the user's emotional state. We have a database of music tracks tagged with corresponding emotional labels. Using the predicted emotion from Step 4, we select and play music that matches the user's emotional state. For example, if the user's emotion is recognized as sadness, we may recommend calming or soothing music. Conversely, if the user is predicted to be happy, we may suggest upbeat and energetic songs. The recommended music provides a tailored and immersive experience that resonates with the user's emotional needs and preferences.
Results
CONCLUSION
The Emotion-Based Music Player is used to automate and give a better music player experience for the end user. We use machine learning algorithms to recommend music based on real time facial expressions. This project could detect the emotions and music will be played accordingly. Therefore our projected system concentrate on identifying the human feelings for developing emotion based music player using machine learning techniques. This system is used to automate and give a better music player experience for the end user.