{'fraction_non_alphanumeric': 0.02648458514380302, 'fraction_numerical': 0.0038623353334712738, 'mean_word_length': 4.976916735366859, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Music Recommendation Based on Face Emotion Recognition

We propose a new approach for playing music automatically using facial emotion. Most of the existing approaches involve playing music manually, using wearable computing devices, or classifying based on audio features. Instead, we propose to change the manual sorting and playing. We have used a Convolutional Neural Network for emotion detection. For music recommendations, Pygame & Tkinter are used. Our proposed system tends to reduce the computational time involved in obtaining the results and the overall cost of the designed system, thereby increasing the system’s overall accuracy. Testing of the system is done on the FER2013 dataset. Facial expressions are captured using an inbuilt camera. Feature extraction is performed on input face images to detect emotions such as happy, angry, sad, surprise, and neutral. Automatically music playlist is generated by identifying the current emotion of the user. It yields better performance in terms of computational time, as compared to the algorithm in the existing literature.


Introduction
Many of the studies in recent years admit that humans reply and react to music and this music has a high impression on the activity of the human brain. In one examination of the explanations why people hear music, researchers discovered that music played a crucial role in relating arousal and mood. Two of the most important functions of music are it is ability is participants rated to help them achieve a good mood and become more self-aware. Musical preferences have been demonstrated to be highly related to personality traits and moods [1]. The meter, timbre, rhythm, and pitch of music are managed in areas of the brain that affects emotions and mood [2]. Interaction between individuals may be a major aspect of lifestyle. It reveals perfect details and much of data among humans, whether they are in the form of body language, speech, facial expression, or emotions [3]. Nowadays, emotion detection is considered the most important technique used in many applications such as smart card applications, surveillance, image database investigation, criminal, video indexing, civilian applications, security, and adaptive human-computer interface with multimedia environments.
With the increase in technology for digital signal processing and other effective feature extraction algorithms, automated emotion detection in multimedia attributes like music or movies is growing rapidly and this system can play an important role in many potential applications like human-computer interaction systems and music entertainment. We use facial expressions to propose a recommender system for emotion recognition that can detect user emotions and suggest a list of appropriate songs [13][14][15][16][17][18][19][20][21][22][23][24]. The proposed system detects the emotions of a person, if the person has a negative emotion, then a certain playlist will be shown that includes the most related types of music that will enhance his mood. And if the emotion is positive, a specific playlist will be presented which contains different types of music that will inflate the positive emotions [4].
The dataset we used for emotion detection is from Kaggle Facial Expression Recognition [5]. Dataset for the music player has been created from Bollywood Hindi songs. Implementation of facial emotion detection is performed using Convolutional Neural Network which gives approximately 95.14% of accuracy [2].

Literature Review
The review is done to get insights into the methods, their shortcoming which we can overcome. A literature review, a literature survey is a text of a scholarly paper, which includes the current understanding along with great findings, as well as theoretical and methodological contributions to a particular topic. The latent qualities of humans that can provide inputs to any system in various ways have brought the attention of several learners, scientists, engineers, etc. from all over the world.
The current mental state of the person is provided by facial expressions. Most of the time we use nonverbal clues like hand gestures, facial expressions, and tone of voice to express feelings in interpersonal communication. Preema et al [6] stated that it is very time-consuming and difficult to create and manage a large playlist. The paper states that the `music player itself selects a song according to the current mood of the user. The application scans and classifies the audio files according to audio features to produce mood-based playlists. The application makes use of the Viola-Jonas algorithm that is used for face detection and facial expression extraction. Support Vector Machine (SVM) was used in the classification extracted features into 5 major universal emotions like anger, joy, surprise, sad, and disgust.
Yusuf Yaslan et al. proposed an emotion-based music recommendation system that learns the user's emotion from signals obtained through wearable computing devices that are integrated with galvanic skin response (GSR) and photoplethysmography (PPG) physiological sensors in their paper [3]. Emotions are a basic part of human nature. They play a vital role throughout life. In this paper, the emotion recognition problem is taken into account as arousal and valence prediction from multi-channel physiological signals. In [7] Ayush Guidel et al stated that human being's state of mind and current emotional mood can be easily observed through their facial expressions. This system was developed by taking basic emotions (happy, sad, anger, excitement, surprise, disgust, fear, and neutral) into consideration. Face detection in this project was implemented by using a convolutional neural network. Music is usually told as a "language of emotions" throughout the planet.
The paper proposed by Ramya Ramanathan et al [1] conveyed the intelligent music player using emotion recognition. Journal of Informatics Electrical and Electronics Engineering (JIEEE) A2Z Journals specialty of the methodologies available for detecting human emotions for developing emotion-based music players, the approach a music player follows to detect human emotions, and the way it is ideal to apply the proposed system for emotion detection. It additionally offers a brief idea about our systems working, playlist generation, and emotion classification.CH Radhika et al [8] advised manual segregation of a playlist and annotation of songs, following the current emotional state of a user, as a labor-intensive and time-consuming task. Numerous algorithms had been proposed to automate this manner.
However, the prevailing algorithms are slow, increase the overall cost of the system by using additional hardware (e.g., EEG structures and sensors), and feature much less accuracy. The paper presents an algorithm that automatically does the process of generating a playlist of audio, based on the facial expressions of a person, for rendering salvage of time as well as labor, invested in performing this process manually. The algorithm given in the paper directs at reducing the overall computational time and the cost of the designed system. It additionally aims at growing the accuracy of the system design. The system's facial expression recognition module is validated by comparing it to a dataset that is both user-dependent and user-impartial.

Problem Definition
Develop a system that presents a cross-platform music player, which recommends music based on the real-time mood of the user through a web camera using Machine Learning Algorithms.

Proposed System Overview
The proposed system benefits us to present interaction between the user and the music player. The purpose of the system is to capture the face properly with the camera. Captured images are fed into the Convolutional Neural Network which predicts the emotion. Then emotion derived from the captured image is used to get a playlist of songs. The main aim of our proposed system is to provide a music playlist automatically to change the user's mood s, which can be happy, sad, natural, or surprised. The proposed system detects the emotions, if the topic features a negative emotion , then a selected playlist is going to be presented that contains the foremost suitable sorts of music that will enhance th e mood of the person positively. Music recommendation based on facial emotion recognition contains four modules.
• Real-Time Capture: In this module, the system is to capture the face of the user correctly • Face Recognition: Here it will take the user's face as input. The convolutional neural network is programmed to evaluate the features of the user image.
• Emotion Detection: In this section extraction of the features of the user image is done to detect the emotion and depending on the user's emotions, the system will generate captions.
• Music Recommendation: Song is suggested by the recommendation module to the user by mapping their emotions to the mood type of the song.

Face Detection
Face detection is one of the applications which is considered under computer vision technology. This is the process in which algorithms are developed and trained to properly locate faces or objects in object detection or related system in

Feature Extraction
While performing feature extraction, we treat the pre-trained network that is a sequential model as an arbitrary feature extractor. Allowing the input image to pass on it forward, stopping at the pre-specified layer, and taking the outputs of that layer as our features. 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.   Convolution neural network architecture applies filters or feature detectors to the input image to get the feature maps or activation maps using the Relu activation function [11]. Feature detectors or filters help in identifying various features present in the image such as edges, vertical lines, horizontal lines, bends, etc. After that pooling is applied over the feature maps for invariance to translation. Pooling is predicted on the concept that once we change the input by a touch amount, the pooled outputs don't change. We can use any of the pooling from min, average, or max. But max-pooling provides better performance than min or average pooling. Flatten all the input and giving these flattened inputs to a deep neural network which are outputs to the class of the object.

Songs Database
We created a database for Bollywood Hindi songs. It consists of 100 to 150 songs per emotion. As we all know music is undoubtedly involved in enhancing our mood. So, suppose a user is sad then the system will recommend such a music playlist which motivates him or her and by this automatic mood will be delighted.

Music Playlist Recommendation
By using the emotion module real-time emotion of the user is detected. This will give the labels like Happy, Sad, Angry, Surprise, and Neutral. Using the os.listdir() method in python we connected these labels with the folders of the songs database which we have created. Table 1 shows the list of songs. This method of os.listdir() is used to get the list of any file in the specified directories. if label== 'Happy': os.chdir("C:/Users/deepali/Downloads/Happy") self.mood.set("You are looking happy, I am playing song for You") # Fetching Songs songtracks = os.listdir() This will result in the recommended playlist for the user in the GUI of the music player by showing captions according to detected emotions. We have used a library called Pygame for playing the audio as this library supports playing various multimedia formats like audio, video, etc. Functions of this library such as playsong, pauseong, resumesong, and stopsong are used to working with the music player. Variables like playlist, songstatus, and root are used for storing the name of all songs, storing the status of currently active songs, and for the main GUI window respectively. For developing the GUI, we have used Tkinter.
Here are the results:

Result & Analysis
We evaluated a number of the studies which use support vector machine (SVM), extreme learning machine (ELM), and convolutional neural network [12].

Conclusion
A thorough review of the literature tells that there are many approaches to implement Music Recommender System. A study of methods proposed by previous scientists and developers was done. Based on the findings, the objectives of our system were fixed. As the power and advantages of AI-powered applications are trending, our project will be a state-of-the-art trending technology utilization. In this system, we provide an overview of how music can affect the user's mood and how to choose the right music tracks to improve the user's moods. The implemented system can detect the user's emotions. The emotions that the system can detect were happy, sad, angry, neutral, or surprised. After determining the user's emotion, the proposed system provided the user with a playlist that contains music matches that detected the mood. Processing a huge dataset is memory as well as CPU intensive. This will make development more challenging and attractive. The motive is to create this application in the cheapest possible way and also to create it under a standardized device. Our music recommendation system based on facial emotion recognition will reduce the efforts of users in creating and managing playlists.

Future Scope
This system, although completely functioning, does have scope for improvement in the future. There are various aspects of the application that can be modified to produce better results and a smoother overall experience for the user. Some of these that an alternative method, based on additional emotions which are excluded in our system as disgust and fear. This emotion included supporting the playing of music automatically. The future scope within the system would style a mechanism that might be helpful in music therapy treatment and help the music therapist to treat the patients suffering from mental stress, anxiety, acute depression, and trauma. The current system does not perform well in extremely bad light conditions and poor camera resolution thereby provides an opportunity to add some functionality as a solution in the future.