Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

MOODWAVE: A SENTIMENT-ENHANCED MUSIC

RECOMMENDER

Major Project - 1

Submitted by:
DHRUV AHUJA (9920103093)
MANAN SINGHAL (9920103086)
SARTHAK CHATURVEDI (9920103127)

Under the supervision of:

DR. KEDAR NATH SINGH

Department of CSE/IT
Jaypee Institute of Information Technology University, Noida
Abstract

In an era of digital music consumption, the overwhelming abundance of songs available


to listeners demands intelligent systems that can assist in discovering music that
resonates with their emotional state. To address this need, we present MoodWave, an
innovative Emotion-based Music Recommendation System powered by advanced Deep
Learning techniques and Natural Language Processing (NLP) methods.

MoodWave employs sentiment analysis and mood prediction to understand the


emotional content of songs and the feelings they evoke. Our project leverages state-of-
the-art deep learning models to analyze lyrics, audio features, and user-generated
content to classify songs into various mood categories. Through this multi-faceted
approach, EmoTune is designed to provide highly personalized music recommendations
that align with a listener's current emotional state, enhancing the overall music listening
experience.
Objectives

1. Data Collection
 Sources of Music Data
 Identify the sources of music data used in the project (e.g., Spotify API, custom
datasets).

 Data Preprocessing and Cleaning


 Describe the steps involved in cleaning and preparing the music data for analysis.
 Address issues such as missing values or data inconsistencies.

 Feature Extraction (Audio and Text Data)


 Explain the process of extracting relevant features from both audio and text data.
 Provide examples of the features extracted (e.g., audio tempo, lyric sentiment scores).

2. Sentiment Analysis
 Introduction to Sentiment Analysis
 Define sentiment analysis and its applications in various domains.

 Application of Sentiment Analysis to Song Lyrics


 Detail the methodology for applying sentiment analysis to song lyrics.

 Text Preprocessing Techniques


 Discuss techniques such as tokenization, stemming, and stop-word removal used in text
analysis.
 Sentiment Scoring and Labeling
 Explain how sentiment scores are assigned to song lyrics.
 Describe the labeling of songs into mood categories based on sentiment.

3. Audio Feature Extraction


 Extraction of Relevant Audio Features
 Provide a list of audio features extracted (e.g., tempo, rhythm, key).
 Explain why these features are relevant for mood prediction.

 Preprocessing of Audio Data


 Describe any data preprocessing steps for audio data (e.g., normalization).

 Feature Engineering for Mood Prediction


 Explain how audio features are used to represent the emotional aspects of music.

4. Deep Learning Model


 Architecture and Design of MoodWave Model
 Provide a detailed description of the neural network architecture used in MoodWave.

 Training the Model on Labeled Data


 Explain the process of training the deep learning model using labeled data.

 Model Evaluation and Validation Techniques


 Describe the metrics and techniques used to evaluate the performance of the model.

5. User Personalization
 Incorporating User Preferences and Feedback
 Explain how MoodWave takes into account user feedback and preferences.

 Collaborative Filtering and User Profiling


 Detail the methods for collaborative filtering and creating user profiles.

 Tailoring Music Recommendations Based on User History


 Illustrate how MoodWave customizes recommendations based on user listening
history.

6. System Implementation
 Technical Details of Implementing MoodWave
 Discuss the technical stack, programming languages, and frameworks used in the
project.

 Overview of the User Interface and Interaction Flow


 Provide a user-friendly interface for MoodWave and describe how users interact with
the system.

7. Results and Evaluation


 Performance Metrics for Mood Prediction
 Present the metrics used to assess the accuracy of mood prediction.

 User Satisfaction and Engagement Metrics


 Include metrics for measuring user satisfaction and system engagement.

 Comparative Analysis with Other Recommendation Systems


 Compare MoodWave's performance with other music recommendation systems.
Technology Used
1. Data Analysis:
 Pandas and NumPy: Pandas is employed for efficient data manipulation and analysis,
while NumPy provides support for numerical computations. Together, they form the
backbone of data preprocessing and feature engineering.

2. Deep Learning Model:


 Keras and TensorFlow: Keras, as a high-level neural network API, is utilized for
building and training deep learning models, while TensorFlow serves as the backend
engine to execute these models efficiently. This combination offers flexibility and ease
of use for model development.

3. Model Validation:
 scikit-learn (sklearn): Scikit-learn provides essential tools for model validation,
including techniques for model selection, hyperparameter tuning, and evaluation
metrics. It complements the deep learning framework by offering a comprehensive
machine learning toolkit.

4. Data Visualization:
 Seaborn and Matplotlib: Seaborn and Matplotlib are used to create visually appealing
and informative data visualizations and plots. They help in presenting insights, model
performance, and results effectively to both technical and non-technical audiences.

5. Spotify Integration:
 Spotipy Python Library: The Spotipy Python library is utilized to interact with
Spotify's APIs, allowing MoodWave to access music data directly from Spotify. It
facilitates data acquisition, including song metadata and audio features.

6. Authentication and Data Acquisition:


 Spotify Credentials: Spotify credentials are required to access Spotify's APIs securely.
These credentials are used for authentication and authorization to retrieve data, such as
song information and user profiles.

7. Deep Learning Models:


 MoodWave employs deep learning models such as Convolutional Neural Networks
(CNNs) or Recurrent Neural Networks (RNNs) for audio feature extraction and
sentiment analysis of song lyrics. These models are implemented using Keras and
TensorFlow.

8. Jupyter Notebook:
 Jupyter Notebook can be used as an interactive development environment for
experimenting with code, visualizing data, and documenting project progress. It
facilitates an iterative and exploratory approach to development.

9. Git and Version Control:


 Git: Git is used for version control to manage the project's source code, track changes,
and collaborate with team members effectively.
This technology stack provides a comprehensive set of tools and libraries for data analysis, deep
learning model development, data visualization, and integration with Spotify's music data. It offers
flexibility and scalability, enabling the creation of a sophisticated music recommendation system like
MoodWave.
Software Specification
=>Web Browser: Google Chrome, Brave
=>User Interface Design

Hardware Requirements

 Processor (CPU): Describe the recommended CPU specifications. Specify if multi-core processors are
advantageous for faster model training.

 Memory (RAM): Indicate the minimum RAM required for data processing and model
training. Mention if larger datasets demand more RAM.
 Storage: Specify the disk space requirements for storing datasets, code, and model
checkpoints. Mention whether SSDs or HDDs are preferable for faster data access.
 GPU (Graphics Processing Unit): If applicable, specify whether the project benefits from
GPU acceleration for deep learning tasks. Mention the GPU model and VRAM (Video RAM)
requirements.
 Operating System: State the compatible operating systems, such as Windows, Linux, or
macOS, and any specific dependencies for each.
 Cloud Services: If the project is intended for cloud deployment, mention the cloud service
providers (e.g., AWS, Google Cloud, Azure) and the required configurations for cloud
instances.
 Network Requirements: Specify any network connectivity requirements, such as internet
access for data retrieval from external sources.
Progress Updates Till the First Progress Report

1. Data Collection and Analysis:

To gather the necessary data, we implemented a set of functions using the Spotipy Library. This library
streamlined the process of retrieving technical information about playlists, songs, and artists from Spotify's
extensive music database. For the purpose of this project, we categorized the songs into four distinct
moods: "Energetic," "Calm," "Happy," and "Sad." These mood labels were inspired by research outlined in
the article titled "Music Mood Classification" [source link]. We collected 200 tracks per mood category
from various Spotify playlists and consolidated them into our main dataset, each track being assigned its
corresponding mood label. The dataset can be accessed on our GitHub repository [link].

Our main dataset comprises 800 rows and 18 columns. To simplify the data analysis process, we focused
on ten key features: Length, Danceability, Acousticness, Energy, Instrumentalness, Liveness, Valence,
Loudness, Speechiness, and Tempo. These features were selected because of their significant influence on
track classification.

Upon analyzing the data, we discovered noteworthy trends. For instance, "Happy" tracks tend to be the
most popular, "Sad" songs often have longer durations, "Energetic" tracks are characterized by higher
tempos, and "Calm" songs tend to exhibit more acoustic elements.

2. Model Development:

2.1 Pre-Processing the Data:

Before feeding the data into our model, we performed several pre-processing steps. We normalized the
feature values using the MinMaxScaler, ensuring that they fell within the range [0, 1] while preserving the
original data distribution. Additionally, we encoded the mood labels into numerical values as neural
networks require numeric inputs. The dataset was then divided into an 80% training set and a 20% testing
set to facilitate model training and evaluation.

The code we used to process the data:


The labels are encoded as follows:

2.2 Model Construction:

We constructed the model using the Keras library, designed for efficient experimentation with deep neural
networks. Our primary objective was to classify tracks into one of four mood categories: "Calm,"
"Energetic," "Happy," and "Sad." The model we designed is a multi-class neural network with ten input
features, one hidden layer comprising eight nodes, and an output layer with four nodes corresponding to
the four mood categories. The activation function employed is Rectified Linear Unit (Relu), and we used
logistic loss as the loss function with the Adam optimizer.
The code we used to build the Neural Network:

3. Model Evaluation:

3.1 Evaluating the Model:

To assess the model's performance, we utilized K-Fold Cross Validation with K=10 splits while shuffling
the data. This method allowed us to gauge the model's accuracy across different subsets of the data.
The code we used to evaluate the model:

3.2 Training the Model:

Finally, we trained the model using the training data and made predictions on the test data. The model was
trained on 80% of the dataset, which amounted to 640 samples.

To train the model, we used the following code:

Some of the output of the last epochs when the model was training:
By following this approach, we were able to achieve an accuracy of 72.75% in classifying music tracks
into their respective mood categories.
Future Scope

Enhancing Model Accuracy:

 In the pursuit of refining MoodWave as an accurate music mood classification system,


our future endeavors will focus on further improving the performance of our multi-class
neural network model. While our current model has demonstrated a commendable level
of accuracy, we recognize that there are opportunities to elevate its effectiveness.

In the coming phases of this project, we aspire to:


 Conduct extensive hyperparameter tuning and experimentation with various neural
network architectures, aiming to achieve even higher classification accuracy.

 Explore state-of-the-art deep learning techniques, including advanced network


architectures such as convolutional neural networks (CNNs) and recurrent neural
networks (RNNs), to uncover potential performance gains.

 Investigate the incorporation of transfer learning and pre-trained models, which may
prove valuable in capturing intricate patterns in music data.

 Leverage ensemble learning methods to combine the strengths of multiple models,


fostering a more robust and accurate mood classification system.

 By dedicating our efforts to enhancing the accuracy of our multi-class neural network, we
aim to deliver an increasingly precise and reliable music mood classification experience
to our users.

.
Exploring the Enjoyment of Music Mood Classification:

 Beyond the technical aspects, MoodWave aspires to create an engaging and enjoyable
experience for users as they explore and interact with music based on their moods. Our future
vision involves infusing an element of delight into the process of classifying music by mood.

Our future plans encompass:


 Crafting an intuitive and aesthetically pleasing user interface that makes navigating
MoodWave a visually engaging and user-friendly experience.
 Implementing interactive features that allow users to actively participate in refining mood
classifications, such as voting on the suitability of recommendations and contributing
feedback.
 Gamification elements, where users can earn rewards or badges for active engagement,
encouraging ongoing use and exploration of the platform.
 Incorporating social aspects, enabling users to share their mood-based playlists and
discoveries with friends, fostering a sense of community.

By infusing enjoyment and user engagement into MoodWave, we aim to create a platform that not
only serves as a valuable music discovery tool but also adds a touch of fun and excitement to the
music classification process, making it a joyful journey of musical exploration.
References

 Emotional Detection and Music Recommendation System based on User Facial Expression, S
Metilda Florence and M Uma 2020 IOP Conf. Ser.: Mater. Sci. Eng. 912 062007, DOI
10.1088/1757-899X/912/6/062007

 J. S. Joel, B. Ernest Thompson, S. R. Thomas, T. Revanth Kumar, S. Prince and D. Bini,


"Emotion based Music Recommendation System using Deep Learning Model," 2023
International Conference on Inventive Computation Technologies (ICICT), Lalitpur, Nepal,
2023, pp. 227-232, doi: 10.1109/ICICT57646.2023.10134389.

 Emotion Based Music Recommendation System, International Journal for Research in


Applied Science & Engineering Technology (IJRASET) ISSN: 2321-9653; IC Value: 45.98;
SJ Impact Factor: 7.538 Volume 10 Issue XII Dec 2022

 Ankita Mahadik, Shambhavi Milgir, Janvi Patel, Vijaya Bharathi Jagan, Vaishali Kavathekar,
2021, Mood based Music Recommendation System, INTERNATIONAL JOURNAL OF
ENGINEERING RESEARCH & TECHNOLOGY (IJERT) Volume 10, Issue 06 (June 2021),

You might also like