parichay28 / music-mood-finder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MUSIC MOOD RECOGNITION

A machine learning approach to predict the mood of the music or a song and using that predicted mood to create a customized playlist from a list of available songs in local directory.

Approach

We have taken 518 songs and extracted 18 features from them using librosa and saved in dataset.csv file. Mean,standard deviation and variance of all those 18 features is calculated as well. By doing that total number of input features in the dataset are 54. To manually label these songs with ease, we have relied on the top spotify playlists which are created according to the moods. Some of them are:

  1. Happy Songs

  2. Relax Playlists

  3. Angry Playlists

  4. Sad Playlists

The issue of a song belonging to one or more category is resolved by assigning them to a particular mood category out of four.

Models useds and their accuracies.

Models Training accuracy Testing accuracy
Logistic Regression 88.12% 82.05%
Naive Bayes 78.45% 76.28%
KNN 78.17% 78.84%
SVM 87.84% 76.92%

Prerequisites

Python 3.7 or any other version above than Python 2.7

https://realpython.com/installing-python/

sklearn

pip install -U scikit-learn

pandas

pip install pandas

numpy

pip install numpy

matplotlib

pip install matplotlib

pickle

pip install pickle

librosa

pip install librosa

tkinter

apt-get install python-tk

pygame

pip install pygame

mutagen

pip install mutagen

ttkthemes

pip install ttkthemes

How To Run

Just install all the prerequisites and run the musicplayer.py file. A GUI will open, Add your song and wait for few seconds to get the mood of the song. After detection of mood, All the songs having similar mood will be added automatically.

Author

Parichay Agrawal

Prashant Sharma

Sahil Singh

About


Languages

Language:Python 100.0%