Skip to main content
QUICK REVIEW

[Paper Review] Kapre: On-GPU Audio Preprocessing Layers for a Quick Implementation of Deep Neural Network Models with Keras

Keunwoo Choi, Deokjin Joo|arXiv (Cornell University)|Jun 19, 2017
Music and Audio ProcessingComputer Science4 references57 citations
TL;DR

Kapre provides Keras layers for on-GPU audio preprocessing (Mel-spectrogram, normalization, noise) to streamline deep learning workflows in music/audio tasks, with a benchmark showing ~20% extra training time but storage/prototyping benefits.

ABSTRACT

We introduce Kapre, Keras layers for audio and music signal preprocessing. Music research using deep neural networks requires a heavy and tedious preprocessing stage, for which audio processing parameters are often ignored in parameter optimisation. To solve this problem, Kapre implements time-frequency conversions, normalisation, and data augmentation as Keras layers. We report simple benchmark results, showing real-time on-GPU preprocessing adds a reasonable amount of computation.

Motivation & Objective

  • Motivate and enable on-GPU audio preprocessing within Keras to simplify and speed up audio model prototyping.
  • Implement differentiable time-frequency representations and related preprocessing (Mel-spectrogram, normalization) as trainable Keras layers.
  • Assess the computational overhead of on-GPU audio preprocessing during training to understand trade-offs for large-scale models.

Proposed method

  • Implement time-frequency conversions as Keras layers (Spectrogram via 2D convolutions initialized with DFT kernels).
  • Extend Spectrogram to Mel-spectrogram with a trainable mel-scale matrix.
  • Provide Normalization2D to normalize data per frequency, time, channel, data, and batch.
  • Include Filterbank layer configurable for mel/log/linear scales and random initialization.
  • Add AdditiveNoise for data augmentation with trainable or randomizable noise gain (applied in training).
  • Demonstrate integration in a simple CNN and benchmark training time with/without Kapre preprocessing.

Experimental results

Research questions

  • RQ1Can on-GPU audio preprocessing layers in Kapre provide a quick and storage-efficient pipeline for audio models in Keras?
  • RQ2What is the empirical added computational overhead of integrating Kapre preprocessing during training, and how does it scale with model size?

Key findings

  • Kapre enables end-to-end preprocessing in Keras, including Mel-spectrogram, normalization, and Gaussian noise as trainable layers.
  • In a 5-layer CNN experiment, on-GPU preprocessing added about 20% training time compared to training without preprocessing.
  • The experiment used a 30-second mono signal (32 kHz) and a small network (157,336 parameters) to assess overhead.
  • The proposed approach supports quick prototyping and potential storage savings by avoiding precomputed spectrograms.
  • Kapre demonstrates that preprocessing can be integrated with minimal disruption to training dynamics for larger networks.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.