Music Genre Classification
DONE BY:
MAHEK TAZEEN-1208
SYED MUSTAFA ALI-1240
NILOUFER KHANAM-1246
ABSTRACT:
Artificial Intelligence (AI) and Machine Learning stand as pivotal technological
advancements,
reshaping diverse domains such as computing, finance, healthcare, agriculture, music,
space, and tourism. This study focuses on the intricate realm of audio analysis within
AI, encompassing music information retrieval, generation, and classification.
Extracting meaningful features from music data poses a significant challenge, leading
to the exploration of various algorithms, including classical and hybrid neural
networks. Our investigation revolves around music genre classification, emphasizing
the effectiveness of a Multi-Layer Perceptron (MLP) compared to traditional methods
like Support Vector Classifier (SVC), Logistic Regression, and others. The evaluation
utilizes a subset of the Free Music Archive (FMA) dataset, with the proposed MLP
achieving an accuracy of 99.55% and a validation accuracy of 92.21%. The baseline
model, SVC, is replaced by MLP, showcasing its superior performance. The study
observes that image- based features outperform conventional audio-extracted features
in label classification. Integration of Flask web enables real-time music genre detection.
This paper provides an in- depth exploration of music genre classification methods,
emphasizing the efficacy of MLP and introducing a web-based detection approach.
Contents
Introduction
Scope of the project
System Architecture
Proposed system and Existing system
Proposed Technique and Existing Technique
Modules
System Requirements
Introduction
Music is the art of combining various vocal and instrumental sounds to produce a melody or
rhythm. Music can be classified into a broad range of genres, some of the most popular ones
being blues, classical, country, disco, hip hop, jazz, metal, pop, reggae, rock. The way people
consume music has also developed with the advancement of technology. Music genre
classification, a subset of music information retrieval, is a challenging and progressive task in the
AI domain. It basically involves using machine learning concepts and algorithms to recognize
the genre of a particular music audio file, the style or category of the music. Classifying the genre
of a piece of music automatically has manifold uses in this modern world. The applications are
plenty. It can be used in an audio streaming platform or app (e.g. Soundcloud, Spotify, Gaana) for
categorization and music recommendation, which then can be used to curate playlists based on the
genre. The algorithm can be simply released as a product and can be used as a music identification
app (e.g. Shazam). It can also be used in smart bots like Alexa, Google Assistant, Siri present in
our smartphones to enhance the music listening experience of the user.
SCOPE OF THE PROJECT
The goal of this project is to explore the complex field of AI-driven audio analysis, with a
particular emphasis on the classification of musical genres via sophisticated machine
learning methods. The study broadens its scope to investigate the possibility of image
based features outperforming standard audio-extracted features by examining the
efficiency of a Multi-Layer Perceptron (MLP) in contrast to conventional methods. The
scope is further expanded with the use of Flask web technology, which allows for real-
time genre recognition of music and has useful applications in audio streaming platforms,
voice assistants, and music identification apps.
SYSTEM ARCHITECTURE
EXISTING SYSTEM:
• Recognizing the increasing significance of music in people's lives, the current Music Genre Classification Model attempts to classify
audio music into genres. But with the development of technology and the accessibility of the internet, a more precise and efficient
categorization model is desperately needed.
• The current method uses spectrograms and auditory characteristics to classify genres using machine learning approaches, namely
Support Vector Machine (SVM) and Random Forest Classifier.
PROPOSED SYSTEM
• Our suggested approach redefines the classification of musical genres by utilizing machine learning and artificial intelligence (AI). Our methodology,
which focuses on the Free Music Archive (FMA) dataset, is based on using a state-of-the-art Multi-Layer Perceptron (MLP) to get better validation
results and accuracy.
• This system surpasses conventional techniques by substituting MLP for the standard Support Vector Classifier (SVC), showcasing its ability to
transform the audio analysis field. The use of Flask web enhances the application's usability and accessibility by enabling real-time recognition
of music genres.
EXISTING TECHNIQUE: -
Random Forest Classifier & Support Vector Machine (SVM):
For the purpose of classifying music genres, the current method uses Random Forest
Classifier, works based on decision trees. Random forest creates uncorrelated forest
of trees whose prediction is more accurate than that of a single tree and Support
Vector Machine (SVM), creates a hyper plane that distinguish between two different
classes. The algorithm improves the complexity of the classifier by performing
structural risk minimization to achieve good generalization performance.
These machine learning techniques classify music into genres by examining
spectrograms and acoustic characteristics. This method has helped create functioning
model, but as technology advances and more sophisticated methods are used.
Although the existing method is a good starting point, a more advanced and
comprehensive approach to music genre classification is necessary given how quickly
technology is advancing.
PROPOSED TECHNIQUE USED OR ALGORITHM USED:
MULTI-LAYER PERCEPTRON (MLP):
Our suggested method’s fundamental component is the categorization of musical genres using a Multi-Layer Perceptron
(MLP). This advanced neural network outperforms conventional techniques like logistic regression and support vector
classifier (SVC) in its ability to learn intricate patterns. Our MLP-based method, which was trained on the FMA dataset’s
complexities, achieves an astounding 99.55% accuracy and a validation accuracy of 92.21%.
The choice to give characteristics precedence over traditional extracted features highlights how well MLP captures subtle
musical subtleties. The Flask-powered web-based detection capability makes the system more useful by allowing real-time
genre recognition for a better user experience.
MODULES
o Data Collection
o Data Preparation
o Model Selection
o Model Creation for MLP
o Model Evaluation and Saving
1) Data Collection:
The endeavour starts with gathering the necessary information to categories music genres. The
first audio file in the dataset is played, and its raw data and sample rate are shown using the
librosa library. The audio files in the dataset are located using the glob function. Furthermore,
facts on the dataset are loaded from a CSV file called "datasetinfo.csv," which
contains information on several characteristics that were taken out of the audio recordings.
2) Data Preparation:
To guarantee that the gathered dataset is suitable for model training, careful preparation is
done. This entails taking care of problems including mistakes, missing data, and duplication. To
find correlations between variables, exploratory data analysis approaches are used in
conjunction with data type conversions and normalization. Next, the dataset is judiciously
divided into training kand assessment sets.
3) Model Selection:
A Multi-Layer Perceptron is the algorithm of choice for classifying musical genres (MLP). The
tensorflow/ Keras library is used to define the model architecture, which consists of many dense
layers with dropout regularization. Sparse categorical cross entropy loss and the Adam optimizer
are used to assemble the model. The choice of MLP as an efficient method for identifying
patterns in the music data is highlighted in this section.
4) Model Creation for MLP:
The Multi-Layer Perceptron (MLP) model is built using the sequential model from the Keras
package. Multiple deep layers make up the architecture, which is intended to capture complex
patterns in the collection of musical genres. Five thick layers with different numbers of units and
activation functions make up this MLP model. In the first layer, input data of shape
(x_train.shape[1],) is fed into a ReLU activation function with 512 units. After every dense layer,
dropout layers (with a dropout rate of 0.2) are inserted deliberately to improve the model's
capacity to generalize and reduce over fitting. Finding the genre with the highest probability is
done by analyzing the probabilities for each class of music genres in the final dense layer, which
has 10 units and a softmax activation function. To make training easier, the sparse categorical
cross entropy loss and Adam optimizer are included in the model compilation.
5) Model Evaluation and Saving:
Analyzing the probabilities for each class of musical genres in the last dense layer—which has
10 units and a softmax activation function will help you determine which genre has the highest
likelihood. In order to facilitate training, the model compilation includes the Adam optimizer
and sparse categorical cross entropy loss.
SYSTEM REQUIREMENTS
HARDWARE REQUIREMENTS
The hardware requirements may serve as the basis for a contract for the implementation of the system
and should therefore be a complete and consistent specification of the whole system. They are used by software
engineers as the starting point for the system design. It should what the system do and not how it should be
implemented.
•
PROCESSOR : DUAL CORE 2 DUOS.
•RAM : 4GB DD RAM
•HARD DISK : 250 GB
SOFTWARE REQUIREMENTS
The software requirements document is the specification of the system. It should include both a definition
and a specification of requirements. It is a set of what the system should do rather than how it should do it.
The software requirements provide a basis for creating the software requirements specification. It is useful
in estimating cost, planning team activities, performing tasks and tracking the teams and tracking the
team’s progress throughout the development activity.
•Operating System : Windows 7/8/10
•Platform : Vs Code/ Spyder3
•Programming Language : Python
•Front End : HTML, CSS