[论文解读] AST: Audio Spectrogram Transformer
本文提出 AST,一种卷积不可用、纯注意力的音频分类模型,并在 AudioSet、ESC-50 和 Speech Commands V2 上实现了最先进的结果,得益于迁移预训练的 Vision Transformer 权重。
In the past decade, convolutional neural networks (CNNs) have been widely adopted as the main building block for end-to-end audio classification models, which aim to learn a direct mapping from audio spectrograms to corresponding labels. To better capture long-range global context, a recent trend is to add a self-attention mechanism on top of the CNN, forming a CNN-attention hybrid model. However, it is unclear whether the reliance on a CNN is necessary, and if neural networks purely based on attention are sufficient to obtain good performance in audio classification. In this paper, we answer the question by introducing the Audio Spectrogram Transformer (AST), the first convolution-free, purely attention-based model for audio classification. We evaluate AST on various audio classification benchmarks, where it achieves new state-of-the-art results of 0.485 mAP on AudioSet, 95.6% accuracy on ESC-50, and 98.1% accuracy on Speech Commands V2.
研究动机与目标
- 评估强音频分类性能是否需要卷积神经网络(CNN)。
- 开发一个仅基于注意力、在声谱图上运作并能捕捉长距离上下文的模型。
- 探索从在 ImageNet 上预训练的 Vision Transformer (ViT) 到 AST 的迁移学习。
- 在多个音频数据集上将 AST 与基于 CNN 的以及 CNN+注意力混合模型进行比较。
提出的方法
- 将对数梅尔声谱图分割成重叠的 16x16 补丁并线性投影到 768 维的补丁嵌入。
- 添加可训练的 768 维位置嵌入,并在前端拼接一个 [CLS] 标记,形成一个 12 层、12 头的 Transformer 编码器的输入。
- 使用 [CLS] 标记的输出通过具有 sigmoid 激活的线性层进行分类。
- 通过对输入通道权重求平均,并为不同输入长度对位置嵌入进行插值,将 ImageNet 预训练的 ViT 权重自适应到 AST。
- 使用 ImageNet 预训练、数据增强(mixup、类似 SpecAugment 的掩蔽)以及模型平均/集成来提升性能。
- 在平衡和完整 AudioSet 上,以及在 ESC-50 与 Speech Commands V2 上评估迁移学习效果。

实验结果
研究问题
- RQ1一个无卷积、纯注意力的模型是否能达到甚至超过基于 CNN 的以及 CNN-注意力混合架构在音频分类上的表现?
- RQ2当迁移到 AST 时,从在 ImageNet 上预训练的 Vision Transformer 进行的迁移学习是否会提升音频分类性能?
- RQ3在具有可变输入长度的多样化音频数据集(AudioSet、ESC-50、Speech Commands V2)上,AST 的表现如何?
- RQ4哪些设计选择(补丁大小/重叠、位置嵌入的自适应、补丁形状)对 AST 的性能影响最大?
主要发现
| 模型 | 架构 | 平衡 mAP | 全量 mAP |
|---|---|---|---|
| Baseline [15] | CNN+MLP | - | - |
| PANNs [7] | CNN+Attention | 0.278 | 0.439 |
| PSLA [8] (Single) | CNN+Attention | 0.319 | 0.444 |
| PSLA (Ensemble-S) | CNN+Attention | 0.345 | 0.464 |
| PSLA (Ensemble-M) | CNN+Attention | 0.362 | 0.474 |
| AST (Single) | Pure Attention | 0.347 ± 0.001 | 0.459 ± 0.000 |
| AST (Ensemble-S) | Pure Attention | 0.363 | 0.475 |
| AST (Ensemble-M) | Pure Attention | 0.378 | 0.485 |
- AST 在 AudioSet 上达到最先进的结果,集成全集 mAP 为 0.485,单模型 mAP 为 0.459。
- AST 在 AudioSet 的平衡与全量设置下均超过了此前的 CNN 与 CNN-注意力混合模型。
- 对于 ESC-50,AST-S(仅 ImageNet 预训练)达到 88.7% 的准确率,AST-P 达到 95.6% 的准确率,在两种设置下均超过了 SOTA。
- 对于 Speech Commands V2,AST-S 的准确率为 98.11%,AST-P 为 97.88%,在该任务上 ImageNet+AudioSet 的预训练并不总是必要以获得最佳性能。
- ImageNet 预训练显著提升性能,尤其是在较少领域内数据时;在评估的 ViT 权重中,基于 DeiT 的权重在 AudioSet 上取得了最佳结果。
- 通过裁剪并双线性插值进行位置嵌入自适应对于在 AST 中利用 ViT 先验很重要。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。