Ike Lim← All projects

Case Study

GenreAI

A neural-network music-genre classifier trained on engineered audio features.

Jun 2024

PythonTensorFlowKeraslibrosaJupyter

The problem

Can a lightweight neural network tell musical genres apart from audio alone? GenreAI was my deep dive into audio ML - building a genre classifier from feature extraction up, rather than throwing a large model at raw waveforms.

The approach

librosa extracts a comprehensive feature set from each track: MFCCs, chroma STFT, RMS, spectral features, zero-crossing rate, harmony and tempo. A TensorFlow/Keras neural network trains on these features over the GTZAN benchmark dataset - 1,000 audio tracks across 10 genres, from blues and classical to jazz and rock.

Notebook plots of audio features extracted with librosa - MFCCs, chroma and spectral views of a track
Feature extraction over the GTZAN dataset

The outcome

After extensive experimentation and hyperparameter tuning, the model reached 99.67% classification accuracy. The entire project is open source on GitHub - code, trained model and replication instructions included.

GTZAN Benchmark Comparison

GenreAI - 99.67%

Capsule Neural Network99.91%
GenreAI99.67%
Classical ML (k-NN)92.04%
Typical CNN88.00%

GenreAI achieves 99.67% classification accuracy on the GTZAN 10-genre benchmark, approaching the highest published results while outperforming representative classical machine learning and standard CNN baselines.

Learnings

Feature engineering did the heavy lifting: the performance gains came from richer audio-feature extraction and systematic tuning, not from a bigger network.