Histogram of gradients of Time-Frequency Representations for Audio scene detection

Alain Rakotomamonjy, Gilles GassoarXiv 2015

Abstract

This paper addresses the problem of audio scenes classification and contributes to the state of the art by proposing a novel feature. We build this feature by considering histogram of gradients (HOG) of time-frequency representation of an audio scene. Contrarily to classical audio features like MFCC, we make the hypothesis that histogram of gradients are able to encode some relevant informations in a time-frequency representation: namely, the local direction of variation (in time and frequency) of the signal spectral power. In addition, in order to gain more invariance and robustness, histogram of gradients are locally pooled. We have evaluated the relevance of the novel feature by comparing its performances with state-of-the-art competitors, on several datasets, including a novel one that we provide, as part of our contribution. This dataset, that we make publicly available, involves 19 classes and contains about 900 minutes of audio scene recording. We thus believe that it may be the next standard dataset for evaluating audio scene classification algorithms. Our comparison results clearly show that our HOG-based features outperform its competitors.

Introduction

Audio Scene Classification (ASC) is the task of identifying the environment in which an audio signal was recorded—the "where am I?" problem of machine listening. Unlike speech recognition, which focuses on a single clear signal, ASC requires a machine to identify complex environments (like a "busy street," "cafe," or "train station") composed of a messy overlap of many individual sound events.

The traditional "gold standard" for audio features, Mel-Frequency Cepstral Coefficients (MFCCs), was designed for speech. While powerful, MFCCs often fail to capture the structural "texture" of a scene—specifically how the spectral power changes over time and frequency. This paper proposes that we need features capable of encoding the shape and direction of sound energy to better distinguish between similar-sounding environments.

Methods

The authors propose a pipeline that borrows successful techniques from computer vision, treating audio spectrograms as images to extract structural features.

The proposed feature extraction pipeline.

The process involves four key stages:

  1. Constant-Q Transform (CQT): Instead of a standard spectrogram, the system uses CQT to represent the audio signal. CQT uses a log-scale frequency axis, which better aligns with human hearing and the harmonic structure of sound.
  2. Image Pre-processing: The Time-Frequency Representation (TFR) is treated as a 512x512 image. A mean filter (smoothing) is applied to reduce noise and highlight dominant structures.
  3. HOG Extraction: This is the core innovation. The system calculates the gradient (the direction and intensity of change) for every "pixel" in the spectrogram. These are binned into histograms that represent the local orientation of energy.
  4. Pooling: To ensure the system isn't too sensitive to exact timing, these histograms are "pooled" or averaged over specific regions (Time, Frequency, or Blocks).

Capturing Spectral Direction

Traditional features struggle with "chirps"—signals where frequency changes over time. Because HOG measures the angle of gradients, it natively captures the slope of these sounds. For example, a rising pitch creates a diagonal gradient that HOG can uniquely identify, whereas MFCCs might only capture the instantaneous energy distribution.

Comparison between the CQT spectrogram (left) and its HOG representation (right).

Key Results and Insights

The HOG-based features were evaluated on several benchmarks, including the Litis Rouen dataset, a major contribution of this paper featuring 19 classes and roughly 1,500 minutes of audio. The system achieved an impressive 92% precision on this dataset.

In the D-case Challenge, the HOG feature achieved a Mean Average Precision (MAP) of 0.75, significantly beating the 0.53 achieved by standard MFCCs. One of the most surprising findings was that "marginalized" HOG (averaging histograms across the entire time or frequency axis) often performed better than raw, localized HOG. This suggests that the global distribution of orientations in a scene is a more robust fingerprint than the specific timing of events.

HOG proved particularly robust in transportation scenes (bus, car, train), where it recognized specific time-frequency signatures with nearly 100% accuracy. By treating audio as an image, the authors leverage the fact that audio scenes have "textures" similar to visual scenes.

Conclusion

While HOG is excellent at capturing the global "feel" of a scene, it still faces challenges with "mixed" environments that share similar background textures, such as quiet streets versus pedestrian markets. Future work may explore more sophisticated pooling strategies and hierarchical taxonomies to further improve classification accuracy. Nonetheless, the HOG-based approach represents a significant step forward in capturing the directional dynamics of complex audio environments.

Summary updated

BibTeX
@misc{rakotomamonjy2015histogram,
  author = {Alain Rakotomamonjy and Gilles Gasso},
  title = {{Histogram of gradients of Time-Frequency Representations for Audio scene detection}},
  year = {2015},
  eprint = {1508.04909},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1508.04909},
}
Figure