
AST-Restore
2,595 ops65.4M params
A Transformer encoder applied to overlapping patches of an audio spectrogram, for audio classification.
Audio and speech · 303 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
About this model's family
The Audio Spectrogram Transformer (AST) is an audio classification model that the paper presents as the first convolution-free, purely attention-based model for the task. The question behind it was whether the reliance on a CNN is necessary, or whether networks based purely on attention are sufficient for good performance in audio classification.
The audio waveform is converted into a spectrogram of log Mel filterbank features, which is split into a sequence of 16×16 patches with an overlap of 6 in both the time and the frequency dimension. Each patch is flattened to a patch embedding of size 768 by a linear projection layer. The paper notes that, strictly speaking, this patch embedding layer can be viewed as a single convolution layer with a large kernel and stride size. The Transformer encoder has an embedding dimension of 768, 12 layers and 12 heads, and its output for the [CLS] token serves as the representation of the audio spectrogram. The model card on the Hugging Face Hub describes it as equivalent to ViT, but applied on audio.
That similarity lets the authors transfer knowledge from an ImageNet-pretrained ViT, with a cut and bilinear interpolation method that adapts the positional embedding. The paper reports 0.485 mAP on AudioSet, 95.6% accuracy on ESC-50 and 98.1% accuracy on Speech Commands V2. AST also supports variable-length inputs and can be applied to different tasks without any change of architecture.
Key idea. AST applies a Transformer encoder directly to patches of an audio spectrogram, giving a convolution-free, purely attention-based model for audio classification.
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
@misc{gong2021astaudiospectrogramtransformer,
title={AST: Audio Spectrogram Transformer},
author={Yuan Gong and Yu-An Chung and James Glass},
year={2021},
eprint={2104.01778},
archivePrefix={arXiv},
primaryClass={cs.SD},
url={https://arxiv.org/abs/2104.01778},
}