All Projects → taprosoft → music-genre-classification

taprosoft / music-genre-classification

Licence: other
Zalo AI Challenge - Music Genre Classification

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to music-genre-classification

Music-Genre-Classification
Automatic Music Genre Classification with Machine Learning Techniques
Stars: ✭ 49 (+113.04%)
Mutual labels:  music-information-retrieval, music-genre-classification
Music-Genre-Classification
Genre Classification using Convolutional Neural Networks
Stars: ✭ 27 (+17.39%)
Mutual labels:  music-information-retrieval, music-genre-classification
Awesome Deep Learning Music
List of articles related to deep learning applied to music
Stars: ✭ 2,195 (+9443.48%)
Mutual labels:  music-information-retrieval, music-genre-classification
UnityProminentColor
Tool to gather main colors of an image using Unity.
Stars: ✭ 40 (+73.91%)
Mutual labels:  image-classification
Parametric-Contrastive-Learning
Parametric Contrastive Learning (ICCV2021)
Stars: ✭ 155 (+573.91%)
Mutual labels:  image-classification
Food-Categories-Classification
This repository contains the dataset and the source code for the classification of food categories from meal images.
Stars: ✭ 48 (+108.7%)
Mutual labels:  image-classification
BottleneckTransformers
Bottleneck Transformers for Visual Recognition
Stars: ✭ 231 (+904.35%)
Mutual labels:  image-classification
CV
本仓库将使用Pytorch框架实现经典的图像分类网络、目标检测网络、图像分割网络,图像生成网络等,并会持续更新!!!
Stars: ✭ 72 (+213.04%)
Mutual labels:  image-classification
encrypted-skin-cancer-detection
Detecting skin cancer in encrypted images with TensorFlow
Stars: ✭ 27 (+17.39%)
Mutual labels:  image-classification
Modulo7
A semantic and technical analysis of musical scores based on Information Retrieval Principles
Stars: ✭ 15 (-34.78%)
Mutual labels:  music-information-retrieval
food-detection-yolov5
🍔🍟🍗 Food analysis baseline with Theseus. Integrate object detection, image classification and multi-class semantic segmentation. 🍞🍖🍕
Stars: ✭ 68 (+195.65%)
Mutual labels:  image-classification
awesome-computer-vision-models
A list of popular deep learning models related to classification, segmentation and detection problems
Stars: ✭ 419 (+1721.74%)
Mutual labels:  image-classification
Resolvedor-de-Sudoku
Resolver Sudoku de genina.com
Stars: ✭ 17 (-26.09%)
Mutual labels:  image-classification
Kaggle-Cdiscount-Image-Classification-Challenge
No description or website provided.
Stars: ✭ 15 (-34.78%)
Mutual labels:  image-classification
img classification deep learning
No description or website provided.
Stars: ✭ 19 (-17.39%)
Mutual labels:  image-classification
chitra
A multi-functional library for full-stack Deep Learning. Simplifies Model Building, API development, and Model Deployment.
Stars: ✭ 210 (+813.04%)
Mutual labels:  image-classification
Billion-scale-semi-supervised-learning
Implementing Billion-scale semi-supervised learning for image classification using Pytorch
Stars: ✭ 81 (+252.17%)
Mutual labels:  image-classification
Custom-CNN-based-Image-Classification-in-PyTorch
No description or website provided.
Stars: ✭ 41 (+78.26%)
Mutual labels:  image-classification
rps-cv
A Rock-Paper-Scissors game using computer vision and machine learning on Raspberry Pi
Stars: ✭ 102 (+343.48%)
Mutual labels:  image-classification
memento
Organize your meme image cluster in a better format using OCR from the meme to sort them using tesseract along with editing memes by segmenting them using OpenCV within a directory
Stars: ✭ 70 (+204.35%)
Mutual labels:  image-classification

Zalo AI Challenge - Music Genre Classification

This repository contains my source code for the Zalo Music Genre Classification challenge. This solution reached top 3 in the Private Leaderboard with a single model (not using model ensemble / stacking). For more info about this challenge visit https://challenge.zalo.ai/portal/music/

Quick Start

  1. Install required packages with pip install -r requirements.txt
  2. Download Zalo Music Genre dataset here and place under the data/ directory
  3. Run ./preprocess.sh to extract and generate spectrogram from the training data (can be very time-intensive - depend on your CPU)
  4. Run ./train.sh to train new model from scratch or download the pre-trained model here (place under the model/ directory)
  5. Run ./predict.sh to get prediction result with new data

Data preprocessing

Before training the classification model, we have to tranform raw data from audio samples into more meaningful representations. Librosa has several methods for extracting various useful audio features: STFT (Short-Time Fourier Transform), Mel-spectrogram, MFCC (Mel-frequency cepstral coefficients), CQT (Constant-Q Transform), Harmonic-Percussive spectrogram, Chromagram, ... More detail about these features can be found in this demo notebook from librosa git repo.

In this project, the src/preprocess.py script provided convenient wrapper functions to extract audio features using librosa and save them into grayscale image. These images can be stacked later in different combinations to find the best features to discriminate song's genres. Take a look at this file if you want to tweak which features to compute.

The pre-trained model provided in this repo was trained on Harmonic-Percussive spectrogram as the input features. The aim of the Harmonic/Percussive separation is to decompose the original music signal to the harmonic (i.e. pitched instruments) and the percussive (non pitched instruments, percussion) parts of the signal. These decomposed components could enclose important information about the music genre.

HPSS

Model

Model architectures are defined in src/model.py. This script provided helper functions to build different types of DL model: ResNet with varied depths (ResNet18, RestNet34, etc.), CRNN (CNN - LSTM hybrid) and a simple CNN. You can experiment with these models to select the best one for your task. The pre-trained model is a ResNet18 variant with input shape of (128, 1024, 2) (height, width, channel)

Input of the CNN models is a list of sliced spectrogram extracted from an audio sample. Final label for a song will be computed by weighted average the probability over each slice.

Experiments

Below is what I found during my experiments:

  • ResNet18 was the most suitable architecture considering both performance (validation accuracy) and training time.
  • For imbalanced dataset, weighted loss and data upsampling play important role in getting better generalization.
  • Weighted average over the sliced spectrograms also help improve prediction accuracy.

Todo

Some interesting directions to experiment with...

  • Ensemble different model types
  • Train models with fine-tuning
  • Better data sampling with augmentation

Helpful Resources

Here are some resources I found helpful for this challenge:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].