My Project on Music Genre Classification Using Deep Learning

BackerLeader posted 1 min read

Hi everyone! I recently finished a project that allowed me to thoroughly explore the intersection between signal processing and **deep learning.

The goal was clear: to create an AI capable of classifying music genres, not by analyzing the audio directly, but by “teaching it to see” the music through spectrograms.

️ How did I do it? The workflow:

  • Data Engineering: I used the GTZAN dataset and developed my own script based on yt-dlp to expand the corpus with contemporary genres such as Trap, Lofi, and Reggaeton.

  • Critical Preprocessing: I implemented a pipeline with Librosa to normalize the audio, trim silences, and transform the waveforms into 128/128px Mel spectrograms. The music was officially converted into RGB images!

  • CNN Architecture: I designed a Convolutional Neural Network (CNN) with Conv2D layers, MaxPooling to reduce dimensionality, and Dropout to prevent overfitting.

  • Results: I achieved an overall accuracy of 80%. The most satisfying part was seeing how the model reached an F1-Score of 1.00 for the Lofi genre, validating the quality of the custom dataset.

Lessons learned:
It’s not always about having the most complex model. I learned that data cleaning and standardization (such as precisely trimming clips to 30 seconds) are just as critical as the network architecture.
Although I initially planned to do fine-tuning, I decided to first consolidate the base architecture to ensure solid learning of the fundamental features of the new genres. We’re still learning!

More Posts

Dashboard Operasional Armada Rental Mobil dengan Python + FastAPI

Masbadar - Mar 12

I’m a Senior Dev and I’ve Forgotten How to Think Without a Prompt

Karol Modelskiverified - Mar 19

Defending Against AI Worms: Securing Multi-Agent Systems from Self-Replicating Prompts

alessandro_pignati - Apr 2

Your AI Doesn't Just Write Tests. It Runs Them Too.

Kevin Martinez - May 12

How I Built and Compared a Custom CNN vs MobileNetV2 for Boat Image Classification

Ezinne Anne Emilia - May 23, 2025
chevron_left

Related Jobs

View all jobs →

Commenters (This Week)

3 comments
2 comments

Contribute meaningful comments to climb the leaderboard and earn badges!