Project
LiveMusic Genre Classification
A 10-class music genre classifier built on EfficientNet-B0, AST, and CNNs with Mel Spectrograms and ESC-50 augmentation — strengthened with ensemble learning and test-time augmentation.
Music genre classification is a classic deep-learning problem with a classic failure mode: models memorize the training set, and the first unseen song wrecks the accuracy. This project was an attempt to build a classifier that generalizes — a 10-class genre model where the wins came from augmentation and ensembles, not from a cleverer architecture alone.
The pipeline: audio is converted to Mel Spectrograms, learned on a fusion of image-style CNNs and audio-specific encoders, and evaluated with test-time augmentation so the final prediction averages over many views of the same clip rather than trusting a single pass.
Approach
- Backbones — EfficientNet-B0 and CNNs for the spectrogram views, alongside the Audio Spectrogram Transformer (AST) for attention-based audio modeling.
- Augmentation — ESC-50 based augmentation to expand the training distribution and reduce overfitting on genre-specific artifacts.
- Ensemble + TTA — ensemble learning across model variants, plus test-time augmentation that averages predictions over augmented copies of each clip. The combination consistently improved classification accuracy over any single model.
Tools
Built in PyTorch with Librosa for audio feature extraction, Transformers for the attention-based backbones, timm for pretrained vision models, and Matplotlib for inspecting the spectrograms and error cases. The AST encoder is what pushed the model beyond the pure-CNN ceiling — and the honest takeaway was that robustness came more from the augmentation and ensembling than from any single architecture choice.