Elamur Research

AST: Audio Spectrogram Transformer

Paper · 2021 · Yuan Gong, Yu-An Chung and James Glass

Summary

Recognizing a sound requires more than detecting a short acoustic pattern. A recording may contain several events, and the information needed to identify them can extend across time and frequency. Audio classifiers had commonly addressed this problem with convolutional neural networks, or CNNs, sometimes followed by attention to connect distant evidence. AST asks whether that conventional convolutional foundation is necessary. The authors construct an audio classifier around a standard Transformer encoder and test whether attention can perform the central representation-learning work directly on spectrogram patches.

The input is still an acoustic representation instead of an unprocessed waveform. AST converts sound into log Mel filterbank features, divides the resulting time–frequency array into overlapping regions, and projects each region into a vector. Learned position vectors describe where those regions belong. A special classification token accompanies them through the encoder, and its final representation supplies the recording-level predictions. Unlike a design that adds attention after a convolutional feature extractor, AST permits communication across the patch sequence from the beginning of encoder processing.

The training recipe is as consequential as the architecture. The authors adapt parameters learned for image classification, including the input projection and positional embeddings. Their preferred starting point is DeiT, an image Transformer whose training incorporates knowledge distilled from a CNN. This makes the central finding precise: a conventional convolutional backbone is unnecessary in the audio inference architecture under the evaluated learning procedure. It does not mean that convolutional systems contributed nothing to the preparation of the transferred parameters. The paper also acknowledges that particular projection operations admit convolutional interpretations, qualifying its use of the term convolution-free.

The experiments cover large-scale sound-event classification, environmental sound recognition, and a bounded spoken-command task. On the AudioSet evaluation split, the best combined system obtains 0.485 mean average precision, or mAP. A separate result, 0.459±0.000 mAP, belongs to the strongest individual classifier, produced by averaging checkpoint parameters. On ESC-50, the configuration initialized through both image and audio training reaches 95.6±0.4 accuracy under cross-validation. On Speech Commands V2, image initialization without the additional AudioSet stage produces 98.11±0.05 test accuracy. The different outcomes of audio pretraining show why the learning sequence must be evaluated for its destination task.

The encoder design stays fixed while recording duration and classification targets change. Controlled comparisons further show that image initialization, retained positional information, and patch overlap contribute to performance. They also expose tradeoffs: overlap lengthens the sequence and increases attention computation, while a patch arrangement that works better without pretraining may lack compatible image-trained parameters. AST therefore offers both a successful audio architecture and an account of the practical decisions supporting it. Its evidence concerns the tested classification settings; it does not establish unrestricted speech understanding, event localization, or universal superiority over convolutional alternatives.

Interesting ideas

Question a familiar dependency. A strong hybrid cannot reveal whether each of its major components is essential. AST makes the necessity of convolution experimentally testable by replacing the conventional backbone while retaining a credible training procedure. This approach applies whenever an established pipeline has accumulated components whose individual contributions are unclear. The useful experiment removes the dependency in question and gives the alternative enough support to make the comparison meaningful.

Keep the reusable middle compatible. AST changes how data enter the encoder and how predictions leave it, while preserving the standard processing blocks. Compatibility makes established implementations and pretrained parameters available. The broader engineering lesson is to identify a stable computational interface before designing specialized internal machinery. This can simplify systems that must support different input formats without maintaining a separate core for each format.

Carry arrangement information through transfer. The authors preserve learned positions by adapting their grid to the spectrogram. Random replacement performs worse, even when the other image-trained parameters remain available. Transfer should therefore examine relationships among input elements, rather than treating all positional information as expendable. Similar questions arise when moving learned representations between differently shaped documents, structured records, or spatial measurements.

Evaluate segmentation as part of the system. A patch determines which observations enter a shared local representation and how many sequence elements the encoder must process. AST tests overlap, dimensions, and size instead of assuming that image-style segmentation is automatically suitable for audio. This principle applies to text chunks, graph neighborhoods, and other partitioned inputs: segmentation changes both the evidence available to a decision procedure and the cost of using it.

Report aggregation mechanisms separately. Combining checkpoint parameters produces an individual predictor; combining outputs from independent training runs retains several predictors. AST evaluates these operations separately, preventing its strongest ensemble result from obscuring the performance of a more compact alternative. The same reporting discipline helps with rule committees, parser combinations, and repeated optimization runs, where similar descriptions of averaging can conceal different execution requirements.

Test the entire pretraining route. An intermediate learning stage can be helpful on one destination and unnecessary on another. AST benefits from AudioSet initialization on ESC-50, but the strongest command-recognition result omits that stage. A useful transfer experiment therefore compares complete learning sequences, rather than assuming that additional related data must improve the final outcome. This matters wherever representations pass through several domains before deployment.

Hold architecture steady when claiming breadth. Reusing an encoder across different durations and acoustic tasks provides stronger evidence of architectural flexibility than reporting separate task-specific designs. The input arrangement, learning schedule, and prediction layer still require documentation. The reusable principle is to make the stable part of a system explicit, then test how much variation its interfaces can absorb before the central design needs revision.

Deep dive: AST: Audio Spectrogram Transformer

AST turns sound spectrograms into patch sequences for attention, using image pretraining to improve audio classification across benchmarks. · about 37 minutes to read

How Mova uses it

Mova is a Rust system whose native language processing emphasizes explicit structure, rules, and inspectable evidence. AST supplies useful experimental and engineering ideas, but the available implementation record establishes no AST integration. The status marks below concern the proposed mechanisms and their closest documented counterparts in Mova. They are provisional judgments against an incomplete implementation record, not evidence that AST has been applied or that a proposed transfer improves Mova.

Idea: Challenge an assumed architectural requirement. Where: Introduction and AudioSet Results. Area: evaluation and architecture. Mova: вже є (README.md, regression-gated revision and measured comparisons). AST tests whether a familiar backbone is indispensable. Mova already requires evidence before accepting changes, and this suggests making component necessity an explicit experimental question for readers, repair rules, and task routing. Why Mova: a controlled removal can reveal whether a complicated mechanism contributes useful behavior or merely accompanies it. Any AST-inspired removal study would still need its own measurements.

Idea: Preserve a standard internal interface. Where: Model Architecture. Area: software architecture. Mova: частково є (docs/architecture.md, the layers interfaces and Domain trait). AST’s unchanged encoder illustrates how input adaptation can preserve reusable computation. Mova could apply this discipline when exposing its logical capabilities to new applications, keeping the task contract stable while adapting external representations. Why Mova: stable interfaces would let its logical module serve different callers without embedding each application’s assumptions in the language core.

Idea: Treat learned arrangement as transferable information. Where: ImageNet Pretraining and Impact of Positional Embedding Adaptation. Area: representation and data processing. Mova: нове, provisionally, for an explicit transfer-and-ablation mechanism of this kind; implementation is unestablished. A rule-based analogue would preserve structural relations when converting between annotation conventions, then compare that preservation with rebuilding the relations. Why Mova: transferred structure may contain useful distinctions that a format conversion otherwise discards. AST’s positional result motivates the question, but cannot establish the outcome for symbolic language structures.

Idea: Measure the consequences of segmentation. Where: Model Architecture, Impact of Patch Split Overlap, and Impact of Patch Shape and Size. Area: tokenization and evaluation. Mova: частково є (en/src/french_rules.rs and the recorded French tokenizer evaluations). Mova already measures language-specific segmentation behavior. A further experiment could compare how alternative document or sentence partitions affect downstream frames, retrieval, and reading results. Why Mova: a partition can preserve local correctness while losing the context needed for interpretation. AST offers an experimental pattern, not evidence for a particular textual partition.

Idea: Separate parameter averaging from decision combination. Where: AudioSet Results. Area: statistics and system composition. Mova: частково є (peta/tools/treeagree/README.md, evidence-based agreement among parser outputs). Mova combines analyses through written rules, whereas AST distinguishes averaging parameters from averaging predictions. Mova could document each combination mechanism with its own execution and evidence contract rather than grouping them under agreement. Why Mova: the distinction prevents a combined output from being mistaken for an improvement in each participating parser or rule set.

Idea: Compare complete learning sequences. Where: Results on ESC-50 and Speech Commands. Area: training and evaluation. Mova: частково є (tools/enrich/README.md, separated study, review, learning, and assessment stages). A proposed comparison could test whether an additional reviewed corpus or dictionary stage helps each destination reader, instead of assuming cumulative preparation is always beneficial. Why Mova: the same extra knowledge or supervision may support one task while distracting another. AST’s differing audio-pretraining outcomes make this a concrete hypothesis worth checking.

Idea: Demonstrate breadth with a stable core. Where: Introduction and Results on ESC-50 and Speech Commands. Area: architecture evaluation. Mova: частково є (docs/architecture.md, shared language processing beneath several students and readers). Mova could make shared-core claims more testable by recording exactly which parser, frame reader, and global rules stay fixed across tasks. Why Mova: this would distinguish reusable language competence from success obtained through separate task-specific mechanisms. Existing shared components provide a starting point, not a complete controlled demonstration.

Idea: Use cross-domain resemblance as a proposal generator. Where: ImageNet Pretraining. Area: representation and transfer. Mova: нове, provisionally, for a systematic compatibility test before importing a learned component. AST exploits compatible array and encoder interfaces despite different source meanings. Mova could similarly inspect whether a mathematical or linguistic representation has an admissible correspondence to another domain before proposing reuse. Why Mova: this could direct exploration toward structurally compatible components while keeping semantic equivalence a separate obligation.

Idea: Make transfer adapters independently inspectable. Where: ImageNet Pretraining. Area: data contracts. Mova: частково є (docs/hybrid-system.md, explicit assumptions and failure behavior between layers). AST separates channel adaptation, position adaptation, and classifier replacement. An analogous Mova adapter could state which fields are preserved, transformed, discarded, or reinitialized when external observations enter a native representation. Why Mova: a transparent logical module needs to expose what an interface changes before downstream rules rely on the result.

Idea: Normalize at a declared boundary. Where: ImageNet Pretraining. Area: numerical data processing. Mova: нове, provisionally, for a shared normalization contract across imported numerical features; the implementation record does not establish one. AST specifies the target distribution of its spectrogram inputs. Mova could require similarly explicit units and normalization metadata for any statistical feature imported into a logical decision. Why Mova: hidden rescaling can alter thresholds while leaving the apparent rule unchanged. The proposal concerns interface discipline, not adopting AST’s audio normalization values.

Idea: Reuse representation parameters while replacing task labels. Where: ImageNet Pretraining. Area: modular learning. Mova: частково є (docs/architecture.md, separation between shared levels and domain-specific solving). AST discards the image classifier while retaining reusable computation. Mova could apply the analogous distinction when adapting a learned scorer: preserve only the components justified as general, and rebuild decisions tied to a previous label inventory. Why Mova: task-specific categories should not silently become assumptions of a general logical module.

Idea: Compare transferred components individually. Where: Impact of ImageNet Pretraining and Impact of Positional Embedding Adaptation. Area: ablation design. Mova: вже є (README.md and docs/architecture.md, measured gates and regression checks). AST’s positional experiment illustrates a more specific use of this principle: preserve most of a transferred system while changing a single representation component. Why Mova: this can help identify whether an imported dictionary feature, graph relation, or parser repair actually supplies the improvement attributed to a larger update.

Idea: Test initialization quality rather than compatibility alone. Where: Impact of ImageNet Pretraining. Area: training diagnostics. Mova: частково є (docs/training.md as described in README.md, held-out self-study and experiment journals). AST compares compatible image-trained starting points and finds different audio outcomes. Mova could compare alternative admitted supervision histories or parameter initializations under the same destination evaluation. Why Mova: loading successfully proves format compatibility, while usefulness requires behavior measured on the intended task.

Idea: Expose recognition–cost tradeoffs. Where: Impact of Patch Split Overlap. Area: resource-aware evaluation. Mova: частково є (docs/architecture.md, jobs with resource estimates, and tools/twin). AST connects a recognition benefit to the longer sequence that produces it. Mova could report the analogous cost of broader retrieval, additional reader passes, or larger reasoning branches alongside answer quality. Why Mova: an increase in explored evidence should be judged against the resources needed to obtain it.

Idea: Search representations under realistic resource constraints. Where: Impact of Patch Shape and Size. Area: experimental design. Mova: частково є (docs/hybrid-system.md, bounded execution, and tools/enrich/README.md, bounded preparation). AST’s preferred patch shape depends in part on available pretrained weights. Mova could record similar dependencies when choosing between a theoretically attractive representation and one supported by existing dictionaries, annotations, or verified adapters. Why Mova: documenting these constraints prevents an engineering compromise from becoming an unjustified claim of intrinsic optimality.

Idea: Separate native architecture from learning ancestry. Where: ImageNet Pretraining. Area: provenance. Mova: вже є (docs/architecture.md, teacher-separated assessment; tools/dictindex/README.md, source and review provenance). AST’s attention-based audio computation can still inherit information through CNN-assisted image training. Mova should preserve the analogous distinction between what runs natively and what supplied its supervision or knowledge. Why Mova: this keeps claims about deterministic inference compatible with an honest account of external teaching.

Idea: Keep imported predictions distinct from facts. Where: Model Architecture and the AudioSet classification setup. Area: knowledge admission. Mova: вже є (prag/src/frames.rs, typed evidential information; world/src/knowledge.rs, assertion gates). A hypothetical audio adapter should introduce a classifier observation with its origin and score, instead of an unconditional world fact. Why Mova: a predicted sound category does not establish the cause of that sound or authorize a downstream action. AST supplies category scores, not a native logical proof.

Idea: Add a bounded command interface only through configured capabilities. Where: Results on ESC-50 and Speech Commands. Area: operational integration. Mova: частково є (docs/hybrid-system.md, configured native deputy capabilities). AST suggests a possible acoustic front end for a limited command inventory, while Mova already has bounded task concretization. The acoustic stage itself is unestablished. Why Mova: a declared mapping from recognized category to configured operation could extend an interface without pretending that command classification supplies general spoken understanding.

Idea: Repeat stochastic experiments and report variability. Where: AudioSet Results and Results on ESC-50 and Speech Commands. Area: statistics. Mova: частково є (README.md, identical-run requirements; prag/src/eval.rs, uncertainty reporting). Mova’s deterministic repetition checks address reproducibility, whereas AST’s changed-seed runs examine training variability. Mova could report these as distinct checks wherever a training procedure has stochastic choices. Why Mova: identical inference and stable learning outcomes answer different reliability questions.

Idea: Distinguish data-scale conditions. Where: Dataset and Training Details and AudioSet Results. Area: evaluation. Mova: частково є (documented held-out evaluation and bounded corpus measurements in tools/dictindex/README.md). AST evaluates both balanced and full audio training conditions. Mova could measure whether a new rule learner or dictionary-assisted scorer retains value when the admitted training material is reduced. Why Mova: this would reveal dependence on corpus volume without confusing small destination data with an absence of prior knowledge.

Idea: Keep balancing separate from evaluation distribution. Where: Dataset and Training Details. Area: data sampling. Mova: нове, provisionally, for a controlled comparison of balancing strategies in dictionary or rule-learning queues. AST applies balanced sampling in its full AudioSet training procedure. Mova could test whether sampling rare constructions more often improves their learned treatment while retaining an unchanged evaluation set. Why Mova: a free dictionary and explicit grammar both need coverage beyond frequent cases, but reweighting must not conceal ordinary-use regressions.

Idea: Test robustness to partial evidence. Where: Dataset and Training Details and Results on ESC-50 and Speech Commands. Area: robustness evaluation. Mova: нове, provisionally, for an AST-inspired controlled masking study on native representations. Spectrogram masking motivates a symbolic experiment that hides selected observations and checks whether a reader abstains, reports a gap, or answers from remaining evidence. Why Mova: the important question is whether missing information produces an honest limitation. It would be an experiment in logical robustness, not a direct transfer of audio augmentation.

Idea: Apply synthetic combinations only when labels remain meaningful. Where: Dataset and Training Details. Area: data augmentation. Mova: нове, provisionally, as an explicit admissibility test for mixed training examples. AST uses mixup in audio classification, but combining texts or world states does not automatically preserve their interpretations. Mova could require a declared rule for composing examples and expected outputs before admitting synthetic combinations. Why Mova: this transfers the experimental caution while respecting the semantic constraints of rule-based learning.

Idea: Match metrics to the prediction contract. Where: Dataset and Training Details and Results on ESC-50 and Speech Commands. Area: evaluation. Mova: вже є (docs/architecture.md, task-specific assessments; tools/dictindex/README.md, scoped measurements). AST uses mAP for clip tagging and accuracy for category decisions. Mova should likewise avoid collapsing parse quality, frame extraction, retrieval coverage, and answer correctness into an unexplained headline. Why Mova: each measure should identify the behavior an application can actually rely on.

Idea: Use validation for selection and reserve assessment for reporting. Where: Results on ESC-50 and Speech Commands, Speech Commands training procedure. Area: evaluation hygiene. Mova: вже є (README.md and docs/architecture.md, held-out gates and release assessment boundaries). AST selects the command classifier with validation data before reporting test accuracy. Mova’s frozen assessment policy already expresses the relevant separation. Why Mova: preserving it during self-study prevents improvement procedures from learning the answers they are supposed to be assessed against.

Idea: Preserve output scope through downstream composition. Where: Model Architecture and AudioSet Experiments. Area: evidence typing. Mova: частково є (docs/hybrid-system.md, distinct tool receipts, proofs, and learned knowledge). A recording-level audio category should retain that scope when passed into a graph or worker report. It should not become an event timestamp, transcript, or explanation. Why Mova: typed observations let the logical module compose supported claims while exposing the missing steps between recognition and interpretation.

Idea: Measure convergence separately from execution economy. Where: AudioSet Results and Impact of Patch Split Overlap. Area: performance analysis. Mova: частково є (tools/twin and documented job resource logging). AST reports fewer destination-training epochs while acknowledging sequence-related computation. Mova could similarly separate search iterations, elapsed execution, memory demand, and final quality rather than using a single count as an efficiency claim. Why Mova: fewer steps can still be expensive, and resource evidence should match the practical decision being made.

The problem and its context

Recognizing categories from structured sound

The paper addresses audio classification: assigning category labels to a recording from its acoustic content. Its examples span environmental events and short spoken commands. The common computational problem is to build a useful representation of sound and then use that representation to distinguish the relevant categories.

The authors describe a progression away from manually designed features towards learned mappings from spectrograms to labels. A spectrogram arranges acoustic information along time and frequency-related axes. That arrangement creates an opportunity for learned processing, but it also raises a design question: which assumptions should the architecture impose before it has seen the training data?

CNNs supplied a successful answer. They process local regions with shared operations, bringing locality and translation-related assumptions into representation learning. The paper presents these inductive biases as reasons convolution was considered suitable for spectrograms. An inductive bias is a preference built into the system’s design; it helps determine which patterns are easier to learn.

A preference for local structure does not automatically explain how distant observations should interact. Sound recognition can require context beyond a small region. The authors therefore describe the growing use of attention in audio systems as an attempt to connect information across the recording, supplementing what convolutional processing already provides.

Why hybrids leave an unanswered question

The earlier systems discussed in the paper combine convolution and attention in several ways. Some first extract convolutional features and then process them with a Transformer. Others place both forms of computation inside repeated blocks. Still others use attention mechanisms that are simpler than a full Transformer encoder.

These arrangements demonstrate the usefulness of attention in conjunction with convolution. They do not determine whether attention requires the convolutional representation beneath it. A successful hybrid could depend critically on both parts, or its attention component could be capable of doing more than the architecture allows it to attempt.

AST turns that uncertainty into the paper’s main experiment. The conventional convolutional feature stack is removed. Spectrogram patches enter the attention-based encoder through a linear projection, allowing the encoder to organize their relationships without first receiving a deep CNN representation.

The novelty claim consequently needs its architectural context. The authors are not claiming to have introduced attention to audio processing. They identify AST as the first audio classifier built purely around attention in the relevant sense: it lacks the conventional convolutional backbone retained by the earlier audio systems they discuss.

From language sequences to spatial patches

The encoder comes from Attention Is All You Need. That work originally introduced the Transformer for language processing. AST uses the encoder portion because its task is classification, rather than generation of an output sequence through a decoder.

The closer input-design precedent is Vision Transformer. Its central relevance is that an image can be partitioned into patches and represented as a sequence suitable for Transformer processing. A spectrogram is also an array, even though its axes and contents have different meanings.

The authors additionally draw on the image-Transformer direction represented by DeiT and Tokens-to-Token ViT. These precedents make an attention-based audio architecture plausible. AST’s experiments then determine which choices remain useful when the input represents sound.

This is not an argument that an image and a spectrogram mean the same thing. It is an argument about computational compatibility. Both can supply local arrays, patch projections, positional representations, and a sequence of vectors. That shared organization creates a route for transferring learned computation across modalities.

The practical obstacle of training data

The paper does not treat architectural plausibility as sufficient. The authors identify data demand as a problem for Transformers and cite the original ViT study’s observation about image training beyond 14 million examples. Their audio datasets do not provide a comparable quantity of destination-specific training material.

Image initialization addresses this obstacle. Earlier audio work had already reused ImageNet-trained CNN parameters. AST follows that transfer-learning strategy while changing the architecture being transferred. Existing image-trained weights make the experiment practical without requiring the authors to reproduce large-scale image training themselves.

This context matters when interpreting the smaller-data results. AST’s limited destination audio data are supplemented by information learned elsewhere. The experiments therefore test whether image learning can make an attention-based audio classifier effective, not whether strong audio classification emerges from very little total learning experience.

The paper’s question combines architecture and preparation: can an established attention encoder, adapted to spectrograms and initialized appropriately, replace a conventional CNN audio backbone? The reported benchmarks provide a positive answer within those conditions.

The method, step by step

AST contains a straightforward sequence of transformations. The acoustic front end constructs a spectrogram. Patch extraction converts its grid into local units. A projection makes those units compatible with the encoder. Positions preserve their arrangement, and the classification token supplies a designated representation for prediction.

AST processing from sound to categories

The steps in order.

AST processing from sound to categoriesStep 1: Compute log Mel acoustic features1. Compute log Mel acoustic featuresStep 2: Extract overlapping spectrogram regions2. Extract overlapping spectrogram regionsStep 3: Project regions into patch vectors3. Project regions into patch vectorsStep 4: Attach positions and classification token4. Attach positions and classification tokenStep 5: Encode interactions through attention5. Encode interactions through attentionStep 6: Convert classification representation into label scores6. Convert classification representation into label scores

Construct the acoustic input

The recording has duration t seconds. The authors calculate 128-dimensional log Mel filterbank features using a Hamming window lasting 25ms, with a new window every 10ms. The resulting array represents acoustic content over successive time positions.

The paper expresses its input dimensions as:

128 × 100t

Here, 128 denotes the feature-axis size. The symbol t is recording duration in seconds, and 100t denotes the stated time-axis dimension. The multiplication sign separates the dimensions of the spectrogram instead of defining an additional learning operation.

The Transformer therefore receives a representation derived from the waveform. The paper’s use of end-to-end classification concerns learning the spectrogram-to-label mapping. It does not eliminate acoustic preprocessing or claim that every representation choice is learned directly from waveform samples.

For transfer training, the spectrogram distribution is normalized to have dataset mean 0 and standard deviation 0.5. These values belong to the input preparation procedure. They should be distinguished from patch dimensions and encoder dimensions, which describe different parts of the system.

Make local regions into sequence elements

Each standard patch spans 16×16 spectrogram positions. The preferred extraction has overlap of 6 in both directions. As a consequence, adjacent patch inputs share some acoustic evidence rather than dividing the array into completely disjoint pieces.

The authors give the patch-count expression:

N = 12⌈(100t − 16) / 10⌉

N is the number of extracted patches, and t again measures duration in seconds. The ceiling operation, written with ⌈ and ⌉, takes the next integer when necessary. The remaining constants belong to the paper’s chosen feature and patch arrangement.

This expression describes patch tokens. A separate classification token is subsequently inserted into the sequence. Its purpose differs from the local acoustic tokens, so the patch count should not be confused with a count of every encoder input element.

Square patches create a sequence drawn from a grid. Moving through that sequence does not simply mean moving forward through the recording: patches also differ along the feature axis. Position information must therefore identify a spatial arrangement, instead of treating the sequence as an ordinary chronological list.

The paper also supplies a worked positional example using a 12×100 audio patch grid for a 10-second recording. That example and the patch-count expression should remain as stated. They are not a license to invent a padding or edge-handling rule that the methodological discussion does not specify.

Learn the patch representation

The values in each region are flattened and linearly projected to a vector with dimension 768. This learned mapping is the patch embedding layer. It translates a small acoustic array into the representation format used throughout the encoder.

The projection can combine values inside its own patch. It does not itself supply a deep hierarchy of interactions among distant regions. Those wider relationships become available through attention after the patches enter the encoder.

A trainable positional vector of dimension 768 is added to each projected patch. The content vector and the position vector thus share a representation width and can be combined directly. Their functions remain conceptually different: the patch projection describes the observed region, while the positional component identifies its placement.

This design puts local structure into the input without requiring a conventional convolutional feature stack. AST does not abandon locality entirely. It changes where local evidence is assembled and how the architecture subsequently connects that evidence across the recording.

Reserve a representation for classification

A special [CLS] token is placed before the acoustic patches. Its final encoder output becomes the representation used by the classifier. It is a learned participant in sequence processing, not an additional spectrogram region.

The encoder allows information from the acoustic tokens to influence that designated output. A linear prediction layer then converts the representation into category scores using sigmoid activation. For AudioSet, this supports predicting several sound labels for the same recording.

The paper does not require the classifier to produce words or a transcript. Nor does the classification token independently explain the decision. Its role is to supply a learned representation from which the output layer can predict the task’s categories.

This distinction prevents a common confusion about sequence architectures. Processing an ordered or spatially organized input does not imply producing an output with the same structure. AST consumes time–frequency information but is evaluated on recording-level labels.

Use the established encoder design

The encoder width is 768, and its structure contains 12 layers with 12 attention heads. The authors deliberately retain the standard Transformer encoder instead of introducing specialized audio blocks.

That choice serves reproducibility and transfer. Familiar encoder implementations are available in TensorFlow and PyTorch, while matching the image architecture permits reuse of learned parameters. The scientific contribution lies mostly in adapting the input and demonstrating the resulting system, rather than in redesigning attention.

Global interaction is available early because attention is not postponed until after a deep convolutional stack. Patches can participate in sequence-wide computation from the encoder’s initial layers. This is an architectural opportunity to use long-range context, rather than evidence that every prediction necessarily depends on distant patches.

The authors qualify the architecture’s terminology. A large-kernel convolution with an appropriate stride can express the patch projection, and an internal projection can be viewed as a 1×1 convolution. Their distinction concerns the absence of the usual multilayer CNN organization. The phrase convolution-free identifies that architectural contrast.

Transfer the image-trained input projection

Image-trained parameters expect 3 input channels, while the spectrogram has a single channel. The authors average the corresponding channel weights in the patch projection to create the audio version.

Their stated intention is to retain useful image-trained input processing without maintaining redundant spectrogram channels. This is a concrete adaptation at the representation boundary. It allows the transferred encoder to receive vectors of the expected width despite the different original data format.

The image prediction layer is not retained. Its categories do not match the audio task, so the authors initialize a new classification layer. The transfer procedure consequently separates reusable representation learning from the source task’s output decisions.

The preferred initialization is the distilled DeiT configuration trained with 384×384 images. The paper reports 87M parameters and 85.2% ImageNet 2012 top-1 accuracy for that source system. Those values characterize the image-trained starting point; they are not additional audio evaluation results.

Resize learned positional information

Image positions cannot be copied indiscriminately because the spectrogram grid has a different shape. The authors preserve the learned arrangement through cutting and interpolation.

For the image example, the patch grid is written as:

24 × 24 = 576

The factors 24 and 24 give the image-grid dimensions for the stated patching arrangement. The value 576 is the corresponding number of image patch positions. The equation describes the source positional layout before audio adaptation.

For the audio example, the authors cut one dimension and interpolate the other to obtain the 12×100 positional grid. Their preferred method uses bilinear interpolation. The positional embedding associated with [CLS] is reused directly.

DeiT’s image training includes two classification tokens. The authors combine them by averaging for the audio system’s single classification-token interface. This adaptation concerns the transferred token representation, alongside the separate reshaping of patch positions.

The value of positional transfer is tested rather than assumed. Reinitializing those vectors leaves other transferred parameters intact, permitting a controlled comparison of how much retained arrangement information contributes.

Optimize for the destination task

AudioSet training follows the PSLA procedure, including initialization, augmentation, and aggregation. The loss is binary cross-entropy, and optimization uses Adam. Balanced sampling is included for the full training condition.

Augmentation includes mixup with ratio 0.5 and masking of spectrogram regions. The stated maximum mask lengths are 192 time frames and 48 frequency bins. These operations diversify the acoustic inputs presented during learning without changing the encoder design.

The destination tasks use different learning schedules and augmentation combinations, described with their results below. This is important to the architectural claim: the encoder stays consistent, but successful transfer does not require identical optimization settings everywhere.

The authors also make an official AST implementation available. Its existence supports reproduction of the complete procedure, including details that a compact architectural account cannot fully specify. The paper’s central method remains the spectrogram interface, attention encoder, and image-to-audio adaptation.

Experiments and results

The evaluation combines AudioSet, ESC-50, and Speech Commands V2. These benchmarks test different acoustic contents and label decisions. Keeping their procedures separate is essential: a tagging metric over event categories and accuracy over a command inventory are not interchangeable measures.

The paper compares AST with earlier systems and also reports several AST aggregation settings. The most prominent result is not always the most relevant implementation target. Individual predictors, checkpoint-averaged predictors, and ensembles must remain identifiable throughout the comparison.

AudioSet and the full training condition

AudioSet comprises over 2 million recordings taken from YouTube videos. Each clip lasts 10 seconds, and its annotations draw from 527 sound categories. The balanced training split contains 22k examples, the full split 2M, and evaluation uses 20k.

These are weak recording-level annotations. They indicate sounds present in a clip without requiring the classifier to recover detailed event boundaries. The task is therefore well matched to AST’s recording representation and multilabel output.

The primary measure is mAP. Average precision evaluates ranking quality for a category, and the mean combines category-level performance. This differs from measuring whether a single highest-scoring class matches a single answer for every recording.

For full-set training, the batch size is 12 and the initial learning rate is 1e-5. The schedule lasts 5 epochs. Following the 2nd epoch, the learning rate is halved every epoch. The authors repeat the experiment with different random seeds and report the stated mean and standard deviation.

At the last epoch, the result is 0.448±0.001 mAP. Averaging checkpoint parameters across training yields 0.459±0.000 mAP. This averaging produces the strongest individual system reported by the authors without enlarging its architecture.

Full AudioSet aggregation comparison, evaluation mAP

Output ensembles obtain the strongest results, while checkpoint averaging improves the individual predictor.

Full AudioSet aggregation comparison, evaluation mAPLast training checkpoint: 0.448Last training checkpoint0.448Averaged checkpoint parameters: 0.459Averaged checkpoint parameters0.459Ensemble-S: 0.475Ensemble-S0.475Ensemble-M (this paper): 0.485Ensemble-M (this paper)0.485
The numbers
System or settingmAP
Last training checkpoint0.448
Averaged checkpoint parameters0.459
Ensemble-S0.475
Ensemble-M (this paper)0.485

Ensemble-S combines the outputs of separate runs that share experimental settings but differ in random seed. The reported evaluation result is 0.475 mAP. Its benefit comes from retaining independently trained predictors at inference.

Ensemble-M adds runs using different patch-splitting settings. Its 0.485 mAP is the best full-data AudioSet result. The ensemble contains 6 predictors, compared with 10 in the earlier PSLA ensemble discussed by the authors.

The paper reports stronger AST performance than PSLA across corresponding settings. Both use ImageNet initialization and the same broad learning pipeline, which makes the architectural comparison more informative than one confounded by completely different preparation.

The convergence observation is also scoped to destination training. AST is trained for 5 epochs, whereas the cited hybrid procedure uses 30 epochs. That comparison supports the authors’ account of rapid convergence; it is not a measurement of total computation including image pretraining.

AudioSet with reduced destination data

The balanced split is described as about 1% of the full AudioSet training data. It tests whether the architecture remains effective when audio-specific training material is relatively limited.

The initial learning rate is 5e-5. Training runs for 25 epochs, with halving every 5 epochs after the 10th epoch. For parameter averaging, the authors use checkpoints from the last 20 epochs.

The reported individual result is 0.347±0.001 mAP. Ensemble-S obtains 0.363, while Ensemble-M obtains 0.378 on the evaluation split. The authors report that these settings outperform the corresponding earlier best system.

The balanced-data Ensemble-M contains 11 predictors. Diversity comes from random seeds, transferred image weights, positional adaptation choices, and patch splitting. This broader aggregation condition belongs with the result rather than being omitted from a headline comparison.

The experiment supports effectiveness with limited destination audio, but image initialization remains part of the system’s preparation. It therefore cannot be used to claim equivalent success from the balanced audio split alone.

Environmental classification on ESC-50

ESC-50 contains 2,000 environmental recordings, each lasting 5 seconds, organized into 50 categories. Evaluation uses 5-fold cross-validation, with 1,600 training examples available in each fold.

AST-S receives image initialization without the extra AudioSet stage. AST-P receives initialization from both ImageNet and AudioSet. The distinction concerns additional audio training, not whether all parameters began randomly.

The paper reports earlier comparison accuracies of 86.5% without additional audio pretraining and 94.7% with AudioSet pretraining. AST-S reaches 88.7±0.7 accuracy, while AST-P reaches 95.6±0.4.

ESC-50 environmental classification, cross-validation accuracy

AST improves on the cited comparison within each additional-audio condition.

ESC-50 environmental classification, cross-validation accuracyEarlier comparison without extra audio: 86.5Earlier comparison without extra audio86.5AST-S: 88.7AST-S88.7Earlier comparison with AudioSet initialization: 94.7Earlier comparison with AudioSetinitialization94.7AST-P (this paper): 95.6AST-P (this paper)95.6
The numbers
System or settingaccuracy %
Earlier comparison without extra audio86.5
AST-S88.7
Earlier comparison with AudioSet initialization94.7
AST-P (this paper)95.6

Both configurations use frequency and time masking, Adam optimization, and batch size 48. Training lasts 20 epochs. The starting learning rate is 1e-4 for AST-S and 1e-5 for AST-P.

After the 5th epoch, the learning rate is multiplied by 0.85 each epoch. The experiment is repeated three times, and the reported values include the corresponding standard deviations.

The findings show that the transferred architecture can adapt with a small task-specific training set. They also show a substantial benefit from AudioSet preparation within this experiment. Whether the same additional stage helps a different task remains an empirical question.

Command classification on Speech Commands V2

Speech Commands V2 contains 105,829 recordings of 35 command categories. Each recording lasts 1 second. The splits contain 84,843 training examples, 9,981 validation examples, and 11,005 test examples.

This is a bounded spoken-language classification task. The system chooses among a declared inventory; it is not assessed on transcribing arbitrary utterances. That task definition is essential when interpreting the accuracy.

The earlier comparison without extra audio pretraining is a time-channel separable CNN with 97.4% test accuracy. Another cited CNN reaches 97.7% after additional training on 200 million YouTube audio examples. These figures belong to different preparation conditions.

AST-S obtains 98.11±0.05 test accuracy. The authors also evaluate AST-P, but report that the extra AudioSet initialization is unnecessary because AST-S performs better. The paper does not supply a prose numerical value for AST-P that would support reconstructing that comparison quantitatively.

Speech Commands V2 command classification, test accuracy

Image-initialized AST exceeds both cited convolutional comparisons.

Speech Commands V2 command classification, test accuracyEarlier CNN without extra audio: 97.4Earlier CNN without extra audio97.4Earlier CNN with extra audio: 97.7Earlier CNN with extra audio97.7AST-S (this paper): 98.11AST-S (this paper)98.11
The numbers
System or settingaccuracy %
Earlier CNN without extra audio97.4
Earlier CNN with extra audio97.7
AST-S (this paper)98.11

The augmentation combines time masking, frequency masking, random noise, and mixup. Training uses Adam with batch size 128 and initial learning rate 2.5e-4. After the 5th epoch, the learning rate is multiplied by 0.85 each epoch.

Training runs for a maximum of 20 epochs, with the authors choosing the checkpoint based on its performance on the validation set. They then report test accuracy, repeating the experiment three times. This separates checkpoint selection from the final assessment split.

Across the benchmarks, input durations include 1 second, 5 seconds, and 10 seconds. The same encoder architecture serves these settings, although the prediction targets, preparation history, and optimization schedules vary. That is evidence of architectural reuse rather than evidence that a single unchanged trained system solves every task.

What the ablations show

Most ablations use balanced AudioSet to limit computation. Checkpoint parameter averaging is retained, while output ensembles are omitted. This makes the controlled comparisons easier to interpret: differences are not attributed to an unspecified number of combined predictors.

The paper’s discussion establishes the direction of several effects without stating every table entry in prose. These findings support qualitative conclusions about the tested design choices. They do not support invented numerical effect sizes.

Image learning is a practical foundation

AST initialized from ImageNet performs better than randomly initialized AST on both AudioSet training conditions. The advantage is greater with the smaller destination training set.

This supports the motivation behind cross-modal transfer. In spite of the different meanings of images and spectrograms, useful learned computation survives the adaptation. The result is stronger than mere compatibility: the transferred parameters improve measured audio behavior.

It does not identify a single cause of that improvement. The transferred system includes input projection, positional information, and encoder parameters. The overall initialization comparison establishes the value of the package, while additional experiments are needed to isolate its parts.

Nor does the result show that the Transformer’s demand for data has disappeared. The learning history now includes image data. AST addresses limited audio training through transfer rather than demonstrating that prior learning is unnecessary.

The source checkpoint is part of the design

The authors compare image-trained starting points associated with ViT-Base, ViT-Large, and DeiT. They adapt the architecture where necessary so that AST can use the respective parameters.

The distilled DeiT configuration that performs best on ImageNet in their comparison also gives the strongest AudioSet initialization. This makes checkpoint selection an experimentally consequential choice rather than a purely logistical one.

The observation should not be promoted into a universal rule linking image accuracy and audio transfer. The candidates differ in their preparation and architectural properties. The study establishes the ordering of the tested alternatives, not an invariant across future checkpoints.

It also clarifies the system’s ancestry. The preferred image training includes CNN-based distillation. The deployed audio architecture can lack a conventional CNN backbone while still benefiting from knowledge that passed through a CNN during earlier learning.

Positional information survives a change of domain

Replacing transferred positions with random vectors reduces performance relative to adapting the learned grid. Yet that partially transferred system still beats one whose parameters are completely random.

These outcomes support complementary conclusions. Encoder and projection parameters remain useful without the original positions, but the positions contribute additional transferable information. Treating them as disposable would lose part of the benefit.

The authors interpret this as evidence for preserving spatial knowledge. In AST, position is not merely an index needed to satisfy an interface. Its learned representation carries information that remains helpful after reshaping the grid for sound.

Bilinear interpolation and nearest-neighbor interpolation produce similar outcomes in the reported comparison. Thus, retaining learned positions matters more clearly than choosing between those interpolation alternatives. The experiment supports the adaptation principle more strongly than a claim that its preferred interpolation is uniquely necessary.

Overlap buys accuracy at a computational cost

Increasing overlap improves the reported balanced and full AudioSet results. Shared regions give the encoder multiple local views of acoustic evidence and change the relationships between neighboring patch inputs.

However, overlap also increases sequence length. The authors explicitly note that the associated attention computation grows quadratically with that length. A recognition gain therefore arrives with a resource consequence that cannot be inferred from patch dimensions alone.

AST still exceeds the earlier comparison without overlapping patches, according to the paper. Overlap helps the preferred configuration, but it is not the sole condition making attention-based audio classification competitive.

Different patch-splitting settings also contribute to the mixed ensemble. This is consistent with using representation variation to obtain complementary predictors. The paper does not establish a per-recording account of which splitting rule supplies each ensemble benefit.

Patch shape exposes a transfer constraint

The authors compare square regions with rectangular patches arranged chronologically. A 128×2 patch spans the feature dimension and covers a narrow temporal region, giving the sequence a more directly temporal organization.

At the stated area of 256, the rectangular representation performs better than 16×16 squares when both are trained without pretraining. This matters because it prevents an interpretation in which the final square geometry is simply proven best for audio.

The practical choice changes when available initialization is considered. The authors do not have compatible image-trained parameters for the rectangular arrangement. Square patches therefore remain the preferred overall configuration under their transfer strategy.

This is a useful example of interacting design decisions. Representation geometry and learning history cannot always be optimized independently. The strongest from-scratch segmentation need not produce the strongest transferable system.

The patch-size comparison also finds better performance with smaller regions. These experiments use no overlap. The result suggests value in finer acoustic units, but the sequence-length cost prevents turning it into an unrestricted recommendation to keep shrinking patches.

Limitations

Constraints the authors state

The paper explicitly identifies data demand as a disadvantage of attention-based training. Its successful response is image initialization. As a result, the reported effectiveness does not imply that the same architecture learns equally well from limited audio with randomly initialized parameters.

Computational growth with longer sequences is another stated constraint. Increasing overlap expands the number of tokens and raises attention overhead quadratically. Variable-length support describes what the architecture can accept, not a constant resource requirement.

The preferred patch geometry is also constrained by available pretrained parameters. The rectangular alternative performs better in the described from-scratch comparison, but cannot use a matching image-trained starting point. The chosen representation is therefore a practical joint decision about segmentation and transfer.

The authors additionally qualify their terminology about convolution. Some operations can be written as convolutions, even though the architecture lacks the conventional CNN stack. Their conclusion concerns the necessity of that stack, rather than the impossibility of expressing any computation in convolutional form.

Boundaries a reader should retain

The evaluated output is a set of recording categories or a command category. The experiments do not establish temporal event localization, unrestricted transcription, audio generation, or conversational understanding. These tasks require different outputs and corresponding evidence.

The presence of a time axis does not change this scope. AST can process where information occurs in the spectrogram without being trained or evaluated to report event boundaries. A classifier’s internal access to temporal structure is not equivalent to a localization result.

Attention also does not automatically provide a trustworthy explanation. The architectural motivation concerns access to distant context. The paper does not demonstrate that inspecting attention supplies a complete or faithful account of why a category was selected.

The same caution applies to architecture reuse. The common encoder spans several benchmarks, but its learned parameters and surrounding training conditions need not be identical. The evidence supports a reusable design, not a universal checkpoint requiring no destination adaptation.

Aggregation changes the practical claim

The best AudioSet headline belongs to an ensemble. It must remain distinct from the result of the individual checkpoint-averaged predictor. Parameter averaging preserves an individual architecture, whereas output averaging requires the participating predictors.

This distinction affects reproducibility and application decisions. A reader interested in the strongest benchmark score should examine the ensemble construction. A reader considering an individual implementation needs the corresponding individual result and resource measurements.

The ESC-50 training labels also require care. The condition without additional audio data still uses image initialization. It is not equivalent to beginning from random parameters, even though the comparison separates systems according to extra audio preparation.

Speech Commands uses validation-based selection and a declared command inventory. Its reported test accuracy should not be extended to continuous speech, a different vocabulary, or an untested recording environment.

Efficiency is incompletely characterized

The paper observes quick destination-training convergence and contrasts epoch schedules with an earlier hybrid. An epoch count does not by itself measure elapsed training time, memory use, or energy. Those quantities depend on the computation performed during each pass and on implementation conditions.

Image initialization also embodies prior computation. Reusing an available checkpoint is practical, but the destination-training schedule does not describe the cost of producing that checkpoint from the beginning.

Similarly, the paper does not establish deployment suitability through latency, memory, or power measurements. Its architectural simplicity and recognition results are relevant, but a constrained application would still need measurements for the selected configuration.

The ablations make this especially clear. Finer or more overlapping patches may improve recognition while increasing sequence processing. The relevant engineering decision requires both recognition quality and resource evidence.

Benchmark evidence is substantial but conditional

The repeated runs characterize variability associated with the experiments’ random seeds. They do not measure every possible shift in acoustic conditions, recording equipment, label distributions, or operating populations.

Most controlled design studies use balanced AudioSet. Their findings are informative, but not every design ordering is shown to hold under every destination task. The different usefulness of AudioSet pretraining already demonstrates that transfer outcomes depend on the destination.

The paper also does not supply a dedicated investigation of calibration or of how reliable individual confidence scores are. Strong aggregate classification performance does not turn every returned score into a guarantee about a particular recording.

Its defensible conclusion remains significant: under the reported preparation and learning procedures, a standard attention encoder can support strong audio classification without a conventional CNN backbone. Claims about universal architectural dominance, complete interpretability, or deployment economy would require further evidence.

What came after

AST’s later citations extend across audio learning, multimodal systems, and broader discussions of sequence architectures. The available records identify titles and citation relationships but do not describe the citing works’ detailed methods or results. As a result, they establish research directions and connections without proving that each work adopts AST’s encoder or transfer procedure.

SSAST is the clearest named continuation. Its title explicitly couples self-supervised learning with the audio spectrogram Transformer. That identifies a development toward learning audio representations without making ordinary supervised category prediction the sole organizing description. The citation record does not specify its learning objective, so no particular masking, reconstruction, or contrastive mechanism can be attributed to it here.

Efficient Training of Audio Transformers with Patchout places training efficiency at the center of its title. That connects naturally to a pressure visible in AST: patch sequences provide flexible input units but can become computationally expensive. The record identifies Patchout as the later work’s named approach, without explaining its mechanics. It therefore supports a continuation of the efficiency question, not a numerical comparison or a claimed implementation detail.

ImageBind names the goal of connecting inputs through a common embedding space. This is broader than AST’s image-to-audio parameter transfer. AST adapts computation learned from images into an audio classifier; a shared-space objective concerns relationships among representations. The citation connects these themes, but does not establish exactly how ImageBind uses AST.

InternVideo2 concerns scaling foundation systems for multimodal video understanding. Its title places the discussion in a setting with more than an isolated audio classification output. AST’s relevance belongs to the surrounding question of perceptual representation. The citation information does not identify a particular AST component, training route, or benchmark role inside the later work.

GAMA names audio understanding and complex reasoning as its intended scope. This moves beyond assigning categories to recordings towards an audio–language system. The title establishes that broader research aim, while leaving the technical connection to AST unspecified. AST’s own classification experiments should not be retrospectively described as demonstrations of those broader abilities.

Revisiting Audio-language Pretraining identifies general-purpose audio representation as its target. That continues a question left open by AST’s benchmark breadth: how should audio representations be learned for reuse beyond a particular classification destination? The listed record supplies no experimental comparison, so it cannot establish whether the later approach confirms or replaces AST’s preparation strategy.

Distilling an End-to-End Voice Assistant addresses a voice-assistant setting and explicitly names the absence of instruction-training data in its title. This is a different system-level problem from AST’s bounded command inventory. The citation indicates a connection to later voice research, but does not show whether AST provides a component, a comparison, or background motivation.

FAST concerns action tokenization for vision-language-action systems. Both research contexts make the choice of sequence units consequential, but the represented objects differ: AST patches describe acoustic regions, while FAST’s title concerns actions. A thematic connection through tokenization should not be mistaken for evidence that the later method derives its design from spectrogram patching.

Transformers for Tabular Data Representation surveys Transformer applications to another structured input format. AST supplies a relevant example of adapting a sequence-processing architecture beyond ordinary language. The citation establishes its presence in that broader discussion, without identifying a particular taxonomy or conclusion assigned to it by the survey.

Hierarchically Gated Recurrent Neural Network pursues sequence processing through a recurrent design, as its title indicates. Its citation is a reminder that later reference does not necessarily mean architectural adoption. AST may be relevant to a comparison or motivation without determining the later architecture; the available record does not resolve that role.

The Rise and Potential of Large Language Model Based Agents extends the citation context to an agent survey. That establishes scholarly reach beyond sound classification, but it does not make AST an agent method. Across these citations, the continuing questions concern reusable representations, structured input interfaces, and the cost of sequence processing. Exact claims of inheritance or improvement require the later works’ methods and results, instead of their citation relationship alone.

Cite

Cite as Yuan Gong, Yu-An Chung and James Glass. 2021. AST: Audio Spectrogram Transformer. Interspeech (USB).

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.21437/interspeech.2021-698

@inproceedings{gong2021ast,
  title = {{AST: Audio Spectrogram Transformer}},
  author = {Yuan Gong, Yu-An Chung and James Glass},
  booktitle = {Interspeech (USB)},
  year = {2021},
  doi = {10.21437/interspeech.2021-698},
  eprint = {2104.01778},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.21437/interspeech.2021-698}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/gong-2021-ast-audio-spectrogram-transformer/