Music Genre Classification Using Machine Learning Techniques

Ryyan Akhtar and Alokit Mishra · 2025

Read Music Genre Classification Using Machine Learning Techniques by Ryyan Akhtar and Alokit Mishra (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2509-01762.txt.

Introduction

Alokit Mishra and Ryyan Akhtar compare classic and deep methods for sorting songs by genre. Genre sorting powers music search, playlists, and discovery tools. The classic side uses support vector machines and grouped methods fed with hand built sound traits. The deep side uses a neural network that reads pitch charts of the audio directly. Both are tested on the widely used GTZAN song set.

The classic support vector machine wins on accuracy in this head to head test. The authors credit the small size of the data set, where built in traits curb overfitting by the larger network. Deep models can memorize small sets instead of learning broad rules. The result is a case for keeping craft based traits in real audio tools.

Catalog record

CREATORRyyan Akhtar and Alokit Mishra
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE35 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2509-01762

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Music Genre Classification Using Machine Learning Techniques Ryyan Akhtar and Alokit Mishra Abstract Music genre classification is a fundamental component of music information retrieval systems, playing a pivotal role in applications such as personalized music recommendation engines, content organization, and music discovery platforms. This research paper delves into the application of machine learning methodologies to automate the process of categorizing music genres. By leveraging computational techniques, this study seeks to analyze intricate audio features and develop models capable of accurately predicting the genre of a given music track. Moreover, this study contributes to the expanding field of research in music genre classification by examining the effectiveness of various machine learning algorithms, including support vector machines (SVM), random forests, and convolutional neural networks (CNN). The research employs the GTZAN dataset, a standard benchmark consisting of audio recordings across multiple genres. Through thorough experimentation and analysis, this paper elucidates the strengths and limitations of different approaches. We present a comparative study that, contrary to prevailing trends, demonstrates that a Support Vector Machine classifier trained on meticulously engineered audio features can outperform a Convolutional Neural Network on this widely-used dataset. The findings of this research have significant implications for the practical application of machine learning in music classification, particularly in data-constrained scenarios, and underscore the enduring value of domain-specific feature engineering. 1 Introduction Music, as a universal language, transcends cultural boundaries, evokes emotions, and shapes identities. Within the vast landscape of musical expression, genres serve as signposts, guiding listeners through diverse sonic experiences ranging from the soothing melodies of classical compositions to the pulsating rhythms of electronic dance music. The classification of music genres stands as a fundamental endeavor in the realm of musicology and technology, fueling endeavors such as personalized music recommendations, genre-specific playlists, and thematic radio stations. The automatic assignment of genre labels to music files holds significant promise for enhancing the functionality and user experience of audio streaming platforms such as Spotify and iTunes. This study embarks upon an exploration of machine learning (ML) algorithms as a means to address the intricate task of genre identification and classification. Our methodology entails the extraction of features from both the temporal and spectral domains of audio signals. These extracted features serve as inputs for training conventional machine learning models, including Logistic Regression, Random Forests, Gradient Boosting, and Support Vector Machines. The training and evaluation of these models are conducted using the GTZAN Dataset. This research endeavors to explore the intersection of music and machine learning, delving into the application of advanced algorithms to unravel the intricate tapestry of musical genres. By leveraging computational prowess, we seek to unravel the patterns, rhythms, and timbres that define each genre, paving the way for more accurate, efficient, and scalable genre classification systems. Through this journey, we aim to not only enhance the organization and discovery of music but also deepen our understanding of the multifaceted nature of musical expression. 2 Literature Review The domain of music genre classification has attracted considerable attention within the research community since the advent of the Internet. Pioneering work by Tzanetakis and Cook (2002) delved into supervised machine learning techniques, including Gaussian Mixture models and k-nearest neighbor classifiers, to address this challenge. Their exploration introduced three distinct feature sets – timbral structure, rhythmic content, and pitch content – to augment genre classification. Furthermore, Hidden Markov Models (HMMs) have been explored for music genre classification, drawing from their success in speech recognition tasks (Scaringella and Zoia, 2005; Soltau et al., 1998). The effectiveness of Support Vector Machines (SVMs) with diverse distance metrics has also been scrutinized for genre classification purposes (Mandel and Ellis, 2005). Recent progressions in deep neural networks have propelled their utility in speech and audio data analysis (Abdel-Hamid et al., 2014; Gemmeke et al., 2017). Although representing audio in the time domain for neural network input presents challenges due to high sampling rates, techniques such as spectrograms have emerged as viable alternatives, capturing both time and frequency information (Van Den Oord et al., 2016; Wyse, 2017). Harnessing convolutional neural networks (CNNs), Li et al. (2010) devised a model utilizing raw MFCC matrices as input for music genre prediction. Similarly, Lidy and Schindler (2016) employed Constant Q-Transform (CQT) spectrograms as input to CNNs for genre classification tasks. In our study, we aimed to undertake a comparative analysis between deep learning-based models, which rely solely on spectrograms for input, and traditional machine learning classifiers trained on hand-crafted features. Our emphasis was on comprehending the waveform characteristics of audio signals and subsequently extracting features. While deep neural networks persist as the prevailing and effective method for music classification, we found that Support Vector Machine (SVM) classifiers also demonstrate satisfactory performance, particularly over small to medium-sized datasets. Looking ahead, the evolving landscape of music genre classification presents exciting opportunities for further exploration and innovation. As technology continues to advance, integrating interdisciplinary approaches such as deep learning and signal processing holds promise for enhancing the accuracy and scalability of genre classification systems. Furthermore, the integration of contextual information, user preferences, and cultural factors could lead to more personalized and culturally inclusive music recommendation systems. By continuing to push the boundaries of research in this field, we can unlock new insights into the intricacies of musical expression and enrich the experience of music enthusiasts worldwide. 3 Dataset Our research leverages the GTZAN dataset, a standard benchmark in music information retrieval. This dataset provides a robust foundation for uncovering the subtle nuances that define different genres. Each WAV file is approximately 102 KB, resulting in a total dataset size of approximately 1.02 GB. Table 1: Music Genre Dataset Distribution 3.1 Original Genres The dataset is curated to include 10 diverse music genres: Blues, Classical, Country, Disco, Hip-Hop, Jazz, Metal, Pop, Reggae, and Rock. Each genre contains exactly 100 audio files, ensuring a balanced class distribution. Each audio file is a 30-second clip, fostering uniformity and facilitating robust comparative analysis. 3.2 Original Images To employ Convolutional Neural Networks (CNNs), we transformed the audio files into visual representations. We generated Mel spectrograms for each 30-second clip. A spectrogram is a visual representation of the spectrum of frequencies of a signal as it varies with time. This conversion allows us to treat the audio classification problem as an image classification task, leveraging the powerful hierarchical feature-learning capabilities of CNNs. 3.3 CSV Files To facilitate feature-based analysis with traditional machine learning models, we generated two CSV files containing comprehensive feature information extracted from the audio. • 30-Second Features: The first CSV contains aggregated statistics (mean, standard deviation, etc.) for a wide array of audio features, computed over the full 30-second duration of each track. • 3-Second Features: The second CSV expands the dataset by segmenting each 30-second track into ten non-overlapping 3-second segments. Features were extracted from each segment, effectively increasing the number of training instances tenfold. This provides more granular data and helps models learn from shorter, more varied acoustic events. 4 Methodology This section details the data preprocessing steps and the two primary modeling approaches: end-to-end learning with CNNs and feature-based learning with traditional classifiers. 4.1 Data Pre-Processing A pre-emphasis filter was applied to the raw audio signal to balance the frequency spectrum. Most audio signals, including

Read the complete text