AudioMosaic: Contrastive Masked Audio Representation Learning
Code: https://github.com/HanxunH/AudioMosaic
Pretrained encoder: hanxunh/AudioMosaic-vit-b16-pretrained
AudioMosaic — AudioSet-20K Classifier
This is the AudioMosaic ViT-B/16 encoder fine-tuned on the AudioSet-20K balanced split for multi-label audio tagging over 527 classes.
| Metric | Value |
|---|---|
| mAP (AS-20K eval) | 42.53 |
Model Details
- Architecture: ViT-B/16 with linear classifier head
- Embedding dim: 768, Depth: 12, Heads: 12
- Input: log-mel spectrogram of size 1024 × 128
- Patch size: 16 × 16
- Pooling: average over patch tokens
- Classes: 527 (AudioSet ontology)
- Fine-tuning: 60 epochs, BCE loss, layer-wise LR decay (0.65), SpecAugment (time/freq mask 20%)
Model Usage
import sys, torch
from huggingface_hub import snapshot_download
local_dir = snapshot_download("hanxunh/AudioMosaic-vit-b16-finetune-as20k")
sys.path.insert(0, local_dir)
from load_model import load_classifier
model = load_classifier(device="cuda")
# Forward a log-mel spectrogram batch of shape [B, 1, 1024, 128]
fbank = torch.randn(2, 1, 1024, 128).cuda()
with torch.no_grad():
logits = model(fbank) # [B, 527]
probs = logits.sigmoid() # multi-label probabilities
The release contains:
model.safetensors— fine-tuned classifier weightsconfig.json— architecture hyperparametersmodeling.py— vendored model architecture (no need to install AudioMosaic)load_model.py— convenience loader
Required dependencies: torch, timm, torchlibrosa, safetensors, huggingface_hub.
Citation
@inproceedings{huang2026audiomosaic,
title={AudioMosaic: Contrastive Masked Audio Representation Learning},
author={Hanxun Huang and Qizhou Wang and Xingjun Ma and Cihang Xie and Christopher Leckie and Sarah Erfani},
booktitle={ICML},
year={2026}
}