Audio-Based Music Classification with DenseNet and Data Augmentation

Wenhao Bian, Jie Wang, Bojin Zhuang, Jiankui Yang, Shaojun Wang, Jing Xiao

Abstract

Automatic music genre classification is a fundamental challenge in Music Information Retrieval (MIR), essential for organizing large-scale digital libraries. This paper presents a high-performance approach that leverages Densely Connected Convolutional Networks (DenseNet) for audio processing. By combining DenseNet’s efficient feature reuse with targeted audio data augmentation—specifically pitch shifting and time overlapping—and an SVM-based ensemble method, the proposed system achieves state-of-the-art results on the FMA-small and GTZAN datasets.

Introduction

As digital music libraries grow toward the petabyte scale, manual categorization by human experts has become impossible. Automatic music genre classification powers the recommendation engines used by millions daily. However, the field faces two major hurdles: the scarcity of high-quality labeled audio data and the architectural mismatch between standard computer vision models and audio spectrograms. While Convolutional Neural Networks (CNNs) have revolutionized image recognition, spectrograms possess unique structural properties that require specialized architectural considerations.

Methodology

The researchers propose a three-pronged strategy to enhance classification performance:

1D-CNN DenseNet Architecture

Unlike standard 2D convolutions used in image processing, this approach employs 1D convolutions where the kernel spans the entire frequency range at once. This design is more "musically plausible," as it captures harmonic relationships across the full frequency axis. The model utilizes DenseNet blocks, where each layer receives feature maps from all preceding layers. This architecture encourages feature reuse and mitigates the vanishing gradient problem, making it more efficient than traditional ResNet architectures for smaller MIR datasets.

Audio-Specific Data Augmentation

To address data scarcity, the authors tripled their dataset size using two primary techniques:

  1. Time Overlapping: Creating segments with a 50% window overlap.
  2. Pitch Shifting: Shifting the pitch of songs by a half-tone, which generates new training samples while preserving the original genre characteristics.
Visual representation of data augmentation techniques: (a) Time overlapping at 50% and (b) Pitch shifting.

SVM Stacking Ensemble

Because songs are processed in 2.56s segments, the model requires a robust method to determine the final genre for an entire track. Rather than relying on simple majority voting, the authors utilized a Support Vector Machine (SVM) to "stack" the features extracted from these segments. This ensemble method led to a noticeable accuracy bump (from 59.4% to 63.0% in baseline tests) compared to standard aggregation methods.

Experimental Results

The proposed DenseNet model was evaluated on two prominent benchmarks:

  • FMA-small: A modern dataset of 8,000 tracks across 8 genres. The model achieved 68.9% accuracy, significantly outperforming previous transfer learning and CNN approaches (typically 51–56%).
  • GTZAN: The classic benchmark of 1,000 tracks. The model achieved 90.2% accuracy, placing it among the top-performing models for this dataset.

An ablation study highlighted that the combination of architecture and augmentation was the "secret sauce," with the jump from a basic CNN (63.0%) to the final DenseNet model (68.9%) demonstrating the value of these integrated techniques.

Discussion and Future Work

The success of this approach underscores the power of feature reuse in DenseNet and the importance of how segment-level data is aggregated. While the results are impressive, the authors identify several areas for future exploration. They plan to investigate "every layer expression" to improve model interpretability and understand exactly what musical features the DenseNet identifies. Additionally, they suggest that these techniques could be adapted for more complex multi-label tagging tasks beyond simple genre classification.

Summary updated

Abstract

In recent years, deep learning technique has received intense attention owing to its great success in image recognition. A tendency of adaption of deep learning in various information processing fields has formed, including music information retrieval (MIR). In this paper, we conduct a comprehensive study on music audio classification with improved convolutional neural networks (CNNs). To the best of our knowledge, this the first work to apply Densely Connected Convolutional Networks (DenseNet) to music audio tagging, which has been demonstrated to perform better than Residual neural network (ResNet). Additionally, two specific data augmentation approaches of time overlapping and pitch shifting have been proposed to address the deficiency of labelled data in the MIR. Moreover, an ensemble learning of stacking is employed based on SVM. We believe that the proposed combination of strong representation of DenseNet and data augmentation can be adapted to other audio processing tasks.
BibTeX
@inproceedings{bian2019audio,
  author = {Wenhao Bian and Jie Wang and Bojin Zhuang and Jiankui Yang and Shaojun Wang and Jing Xiao},
  title = {{Audio-Based Music Classification with DenseNet and Data Augmentation}},
  booktitle = {PRICAI},
  year = {2019},
  url = {https://openreview.net/forum?id=rRdD0m6IjN},
}
Figure