INTRODUCTION
With the quickly changing digital world, personalization has emerged as a hallmark aspect of user-
centered applications, specifically multimedia consumption. Of these, music recommendation systems
have seen impressive growth, spearheaded by machine learning and artificial intelligence. Early music
recommendation systems depend mainly on user activity, listening habits, or direct choosing of moods
and preferences. Though effective in some measure, these approaches typically do not fully grasp the
user's current emotional state, hence restricting the accuracy and pertinence of recommendations. The
incorporation of affective computing—a technology that allows machines to perceive, understand, and
mimic human emotions—provides new possibilities for improving the personalization of user
experiences. Music, being emotional by its very nature, has been used for many years as an effective
means of mood management, psychological rehabilitation, and social bonding. Closing the gap
between emotional state and musical taste can thus greatly amplify the effects of music on users'
mental health.
This paper presents an Emotion-based Music Recommendation System that employs facial emotion
recognition to dynamically detect a user's present mood and suggest a Spotify playlist specific to that
emotion. In contrast to traditional methods, our system uses a webcam to capture real-time facial
expressions, processes the input locally on a convolutional neural network (CNN), and identifies the
user's emotional state. The emotion thus identified is translated into a predefined playlist through the
Spotify Web API, thus making the process of music selection context-aware and meaningful. The
system is based on up-to-date and robust technologies. Facial image capture and preprocessing are
achieved through OpenCV, while TensorFlow/Keras is used to develop and deploy the deep learning
model of emotion detection. Streamlit drives the user interface, with a clean and interactive front-end
experience. In addition, the application leverages Spotify's OAuth 2.0 for safe user authentication and
real-time music streaming, providing seamless integration with Spotify's streaming functionality.
Emotion-specific quotes and jokes are also available to the user, maximizing interactivity and
engagement.
Essentially, the system respects user privacy by conducting all facial analysis directly on the device,
without transferring or storing personal biometric data. This solves ethical issues but also maintains
conformity with data protection laws. The method assists users in a seamless, non-invasive way by
providing them with an emotionally intelligent interface that answers their mood using suitable
musical content. Through the integration of artificial intelligence, emotion analysis, and streaming
services, the suggested system illustrates the potential of applying affective computing to
entertainment and emotional support. It is not only an innovative music recommendation system but
also a prototype for emotionally-aware human-computer interaction systems in the future. Future
enhancements to the system can include multiple-user support, more personalization based on
listening history, vocal tone analysis integration, and greater accuracy through larger, culturally
diverse emotion datasets.
With this study, we seek to bring to the fore how using facial emotions to build real-time, personalized
music recommendations can provide a richer, more empathetic user experience that pushes the limits
of existing recommendation systems. This paper outlines the conceptual design, technical architecture,
and implementation of the system, aiming to deliver a responsive, privacy-focused solution that runs
efficiently on personal devices. The system processes data locally to maintain user confidentiality,
thus avoiding cloud-based biometric data storage. Through this work, we demonstrate how emotion-
aware computing can enrich user interaction, with potential applications extending to mental health
support, entertainment, and adaptive user interfaces. The subsequent sections detail the background,
methodology, and results that underscore the impact of emotion-based personalization in digital
services.
OBJECTIVE
The main objective of this project is to design and develop an intelligent system that can
automatically detect human emotions from facial expressions and provide suitable music
recommendations based on the detected mood. This system aims to combine the concepts of
computer vision, machine learning, and user-centered design to enhance user experience through
personalized entertainment.
The specific objectives of the project are as follows:
1. To develop an automated facial emotion recognition system
The project aims to build a system capable of identifying human emotions by analyzing facial
expressions captured through a webcam or image input. It focuses on recognizing key
emotions such as happiness, sadness, anger, surprise, fear, and neutrality.
2. To implement image processing and deep learning techniques
The system will utilize advanced techniques such as Convolutional Neural Networks (CNNs)
to extract facial features and classify emotions with high accuracy. This helps in improving the
reliability and performance of the emotion detection process.
3. To enable real-time emotion detection
One of the important objectives is to ensure that the system works in real-time, allowing users
to receive instant emotion analysis and corresponding music suggestions without delay.
4. To design a smart music recommendation system
Based on the detected emotion, the system will recommend a list of songs that match the
user’s mood. For example, happy songs for positive emotions and calm or soothing music for
sad or stressed emotions.
5. To personalize user, experience
The project aims to enhance user satisfaction by providing customized music
recommendations according to the emotional state of the user, making the system interactive
and engaging.
6. To create an efficient and user-friendly interface
The system will include a simple and easy-to-use interface where users can interact with the
application without requiring technical knowledge.
7. To integrate multiple technologies into a single system
The project focuses on combining computer vision, machine learning, and music
recommendation algorithms into one cohesive platform.
8. To reduce manual effort in selecting mood-based music
The system automates the process of choosing music according to emotions, saving time and
effort for users.
9. To explore future improvements and scalability
The project also aims to provide a foundation for future enhancements, such as integrating
voice emotion detection, expanding music databases, or deploying the system as a mobile or
web application.
SCOPE OF WORK
The scope of this project focuses on the development and implementation of an intelligent system that
can detect human emotions through facial expressions and provide appropriate music
recommendations based on the detected mood. This project combines the fields of computer vision,
machine learning, and recommendation systems to create a user-centric [Link] work begins
with data collection and preprocessing, where facial image datasets containing different emotional
expressions are gathered and prepared for training. The system will focus on recognizing basic human
emotions such as happiness, sadness, anger, surprise, fear, and neutral expressions.
The next phase involves designing and training a deep learning model, particularly using
Convolutional Neural Networks (CNN), to accurately identify emotions from facial features. The
model will be trained and tested to achieve reliable performance and minimize errors. The project also
includes the implementation of real-time face detection, where the system captures live video input
through a webcam and processes the facial expressions instantly. This allows the application to
function dynamically and interact with users in real time.
Another important part of the scope is the development of a music recommendation module, which
maps detected emotions to suitable categories of songs. The system will suggest music that aligns
with the user’s mood, enhancing emotional engagement and user satisfaction.
Additionally, the project covers the design of a user-friendly interface, enabling smooth interaction
between the user and the system. The interface will allow users to start emotion detection and view
recommended songs easily. The scope also includes system testing and evaluation, where the accuracy
of emotion detection and the effectiveness of music recommendations are analyze
This project aims to develop an intelligent system that bridges human emotions and digital
entertainment by automatically detecting facial expressions and providing mood-based music
recommendations. The scope of this work covers the complete lifecycle of the system, from input
acquisition to output delivery, ensuring efficiency, accuracy, and user [Link] system will
begin with capturing facial data through a webcam or image input, followed by processing and
analyzing facial features using computer vision techniques. It will focus on identifying subtle
variations in facial expressions to determine the emotional state of the user. The scope includes
building a robust emotion recognition mechanism capable of handling real-world conditions such as
varying lighting, facial orientations, and background noise.
A significant part of the work involves designing a smart mapping strategy that connects detected
emotions with suitable music categories. Instead of random suggestions, the system will provide
context-aware recommendations that align with the user’s current mood, enhancing emotional
engagement. The project also emphasizes creating a seamless and interactive user interface where
users can easily access features without technical complexity. The system will be designed to deliver
quick responses, ensuring real-time performance and smooth interaction. In addition, the scope
includes testing and validating the system under different scenarios to ensure reliability and
consistency. The project will also consider system limitations, such as dependency on camera quality
and predefined emotion categories, while maintaining a balance between performance and simplicity.
Overall, the scope of this project is not only limited to emotion detection and recommendation but
also extends to creating a scalable and adaptable framework that can be further enhanced with
advanced technologies, making it suitable for future applications in entertainment, mental wellness,
and human-computer interaction.
METHODOLOGY
The foundation of the facial emotion recognition component is the FER2013 dataset, a widely used
benchmark for emotion detection tasks. FER2013 contains 35,887 grayscale, 48x48-pixel images of
facial expressions, each categorized into one of seven emotion classes: anger, disgust, fear, happiness,
sadness, surprise, and neutral. These images were collected from various sources on the internet and
labeled manually. The dataset is split into training, validation, and test sets, and is used to train the
convolutional neural network (CNN) that powers the emotion classification engine in the system.
Our emotion-aware music recommendation system integrates real-time facial emotion recognition
with intelligent music selection to create a personalized user experience. It is composed of the
following three core modules:
1. Emotion Detection Module
This module leverages computer vision techniques to analyze live webcam input at a rate of 5
frames per second. It uses OpenCV’s Haar Cascade Classifier for real-time face detection and a
custom-built 7-layer Convolutional Neural Network (CNN) trained on FER2013 for emotion
classification. Each frame is preprocessed (grayscale conversion, resizing, and normalization)
before being passed into the model for inference. The system processes all data locally, and no
facial data is stored post-analysis, ensuring user privacy.
2. Music Recommendation Engine
Based on the detected emotion, the engine dynamically interacts with Spotify’s API to retrieve a
curated playlist aligned with the user's current mood. The system is capable of adjusting playback
characteristics such as tempo and volume to match or improve the emotional state. Songs begin
streaming within approximately 800 milliseconds post-detection. In addition to music,
motivational quotes and emotion-matched humorous content (e.g., jokes or GIFs) are displayed to
further enhance user engagement and emotional regulation.
3. User Interaction Interface
The front-end is developed using Streamlit and features an intuitive interface that requires
minimal user interaction. Emoji-based buttons and color-coded emotion labels provide simple
and immediate feedback. Users receive real-time updates on their detected emotions and
corresponding playlist. The interface is responsive and accessible via modern web browsers on
standard hardware.
Key Features
The system offers several advanced features, including:
• Context-aware audio tuning that aligns music tempo and tone with emotional cues.
• Mood-enhancing algorithms that gradually adjust the playlist to uplift negative emotions.
• Rapid response time and privacy-first design, suitable for use on typical consumer
hardware with a 720p webcam.
• Scalability for potential future extensions such as mobile platform deployment or multi-
user group emotion detection.
Functional Framework
The functional architecture is built on three integrated layers: input processing, emotion analysis,
and output generation.
• Input Layer: Captures video stream from webcam and preprocesses each frame (face
detection, grayscale conversion, normalization).
• Emotion Analysis Layer: Uses the CNN model to classify emotions from processed
images. The detected emotion serves as the input to the music recommendation
system.
• Output Layer: Communicates with the Spotify API to play an emotion-suitable
playlist. Simultaneously, the UI updates to reflect the detected emotion, display
relevant media (quotes or jokes), and provide control options to the user.