Skip to content

This project uses AI for analyzing songs. With the customized and trained model and the website with Flask you can classify music genres.

Notifications You must be signed in to change notification settings

gastonduault/Music-Classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Music Genre Classification with AI🎶

The music-classifier model classifies music genres based on audio signals. It was fine-tuned on the music_genres_small dataset.

This project leverages the Wav2Vec2 model from Facebook, a state-of-the-art transformer-based architecture for audio processing, to classify music genres. The model is fine-tuned on a dataset of music samples to predict the genre of a given audio file.

The repository includes:

  • Preprocessing of audio data.
  • Flask service for a website for try the model
  • Training scripts for fine-tuning the Wav2Vec2 model.
  • Model evaluation and performance analysis.
  • Deployment of the trained model for real-world predictions.

Getting Started

Prerequisites

  • Python 3
  • pip install transformers werkzeug flask torch librosa

Run API Flask


🖥️ Access the Model

➡️ Fine-Tuned Model gastonduault/music-classifier

Metrics

  • Validation Accuracy: 75%
  • F1 Score: 74%
  • Validation Loss: 0.77

📊 Dataset

The dataset used for training is lewtun/music_genres_small from Hugging Face's datasets library. It contains diverse audio tracks labeled with genres.

Classes:

  • Electronic
  • Rock
  • Punk
  • Experimental
  • Hip-Hop
  • Folk
  • Chiptune / Glitch
  • Instrumental
  • Pop
  • International

📂 Repository Structure

  • training.py: Script for training and evaluating the Wav2Vec2 model (with Google colab).
  • prediction.py: Script to make predictions on new audio files using the trained model.
  • app.py: Python API with Flask framework for testing the model.

The interface of testing

img.png

About

This project uses AI for analyzing songs. With the customized and trained model and the website with Flask you can classify music genres.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published