Downloads · 30 days
66
24% of all-time downloads
hanxunh/AudioMosaic-vit-b16-pretrained
AudioMosaic-vit-b16-pretrained is a audio classification model from hanxunh. Use it for the audio classification task on the model card, and read the license before you ship it in a product. It is set up for AudioMosaic. The card lists the license as mit.
<div align="center" <a href="https://arxiv.org/abs/2605.14231" target="blank"<img src="https://img.shields.io/badge/arXiv-b5212f.svg?logo=arxiv" alt="arXiv"</a <a href="https://huggingface.co/collections/hanxunh/audio…
Downloads · 30 days
66
24% of all-time downloads
All-time downloads
272
Public
Parameters
86.1M
344 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors344 MB · 100%
From the Hugging Face model README
AudioMosaic: Contrastive Masked Audio Representation Learning
Code: https://github.com/HanxunH/AudioMosaic
AudioMosaic is a self-supervised audio foundation model that combines masked learning with contrastive training (NT-Xent) over mel-spectrogram patches. The model is pretrained on AudioSet-2M and transfers to a wide range of downstream audio tasks.
import sys, torch
from huggingface_hub import snapshot_download
# Download the self-contained release (architecture + weights + loader)
local_dir = snapshot_download("hanxunh/AudioMosaic-vit-b16-pretrained")
sys.path.insert(0, local_dir)
from load_model import load_pretrained_encoder
model = load_pretrained_encoder(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():
features = model.forward_encoder(fbank) # [B, num_patches+1, 768]
The release contains:
model.safetensors — encoder weightsconfig.json — architecture hyperparametersmodeling.py — vendored model architecture (no need to install AudioMosaic)load_model.py — convenience loaderRequired dependencies: torch, timm, torchlibrosa, safetensors, huggingface_hub.
@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}
}