Downloads · 30 days
9
20% of all-time downloads
georgeven/songmae-micro-32x4
songmae-micro-32x4 is a feature extraction model from georgeven. Use it when you need embeddings to search or compare text. It is set up for transformers. The card lists the license as mit.
SongMAE is a masked autoencoder pretrained for high-resolution birdsong representation learning. This Micro checkpoint uses patches spanning 32 mel bins and 4 spectrogram time bins, producing one embedding every 20 ms.
Downloads · 30 days
9
20% of all-time downloads
All-time downloads
45
Public
Parameters
1.7M
6.7 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors6.7 MB · 100%
From the Hugging Face model README
SongMAE is a masked autoencoder pretrained for high-resolution birdsong representation learning. This Micro checkpoint uses patches spanning 32 mel bins and 4 spectrogram time bins, producing one embedding every 20 ms.
The model was pretrained for 500,000 steps on the XCL subset of BirdSet, derived from 528,422 Xeno-Canto recordings totaling 7,562 hours. We first made the 95/5 training/validation split, then removed recordings from downstream evaluation birds from the training set.
pip install "transformers>=4.36" "librosa>=0.10" safetensors
import numpy as np
from transformers import AutoModel
model = AutoModel.from_pretrained(
"georgeven/songmae-micro-32x4",
trust_remote_code=True,
).to("cuda")
embeddings = model.embed_file("bird.wav")
print(embeddings["clip_embedding"].shape) # (512,)
print(embeddings["token_embeddings"].shape) # (time, 512)
print(embeddings["token_grid"].shape) # (time, 4, 128)
print(embeddings["timestamps_ms"].shape) # (time, 2)
np.savez("bird_songmae_micro_32x4.npz", **embeddings)
Remove .to("cuda") to run on CPU. embed_audio(waveform, sample_rate) accepts a mono NumPy waveform directly.
Raw forward() accepts normalized log-mel tensors shaped (batch, 1, 128, 1000) and returns the encoder sequence as last_hidden_state.
-58.69395667478683 and standard deviation 20.184339052439707.token_embeddings concatenates these into 512 dimensions; clip_embedding is their mean across time.The checkpoint is intended as a compact frozen encoder for birdsong retrieval, visualization, clustering, and downstream probes. It is not a species classifier and does not generate audio. Field conditions and taxa unlike the pretraining distribution may require validation or adaptation. Long recordings are processed as independent 5-second contexts, so representations do not attend across context boundaries.
xcl_micro_500k_p32x4_c010model_step_499999.pth11e5a4969f9218b2c76647d585c2ac82e1196172b91514d4800f5d08ecbd0444