Views
No views yet
Encoder only. This repository contains the 32KHz BEATs backbone from thesed-birdcode-ablation-ssl_beats_clip_pseudorun. The classification head from that run is not included, and there is nolabel_map.json. See Relationship to the source checkpoint.
1from avex import load_model
2backbone = load_model("esp_aves2_sed_birdcode_beats_encoder", device="cuda")https://www.earthspecies.org/about-us#supporthttps://github.com/earthspecies/avexTBAhttps://github.com/microsoft/unilm/tree/master/beats| Setting | Value | What it is |
|---|---|---|
audio_config.sample_rate | 32000 | the rate audio must be delivered at |
audio_config.target_length_seconds | 5.0 | clip length (160,000 samples) |
init_config.sample_frequency | 16000 | a parameter of the fbank extractor — do not change |
sample_frequency is not a declaration of the incoming audio's rate. It fixes
the analysis window (25 ms x 16000 = 400 samples), the hop (160 samples), and
the mel filterbank (257 FFT bins x 128 mels). All three are frozen in this
checkpoint as the buffers backbone.fbank.window (400,) and
backbone.fbank.mel_fb (257, 128). Setting it to 32000 rebuilds them at
(800,) and (513, 128), and the checkpoint then fails to load with a
size mismatch on both.sample_frequency to 32000 — will not load at all.avex to be installed.pip install avexuv add avexavex, so load it by
checkpoint_path. AVEX resolves hf:// URIs directly:1import torch
2from avex import load_model
3from avex.configs import AudioConfig, ModelSpec
4
5REPO = "EarthSpeciesProject/esp-aves2-sed-birdcode-ablation-ssl-beats-clip-pseudo-encoder"
6CKPT = f"hf://{REPO}/esp-aves2-sed-birdcode-ablation-ssl-beats-clip-pseudo-encoder.safetensors"
7
8spec = ModelSpec(
9 name="beats",
10 pretrained=False,
11 device="cuda",
12 # See train_config.yaml for the full init_config; sample_frequency stays 16000.
13 audio_config=AudioConfig(
14 sample_rate=32000,
15 representation="raw",
16 normalize=False,
17 target_length_seconds=5,
18 ),
19)
20
21backbone = load_model(spec, device="cuda", checkpoint_path=CKPT, return_features_only=True)252/252 params matched, 0 unexpected in the load log. load_model
detects that the checkpoint has no classifier and selects embedding mode
automatically, so return_features_only=True is optional.1# audio_tensor: (batch, 160000) float waveform at 32 kHz (5.0 s)
2with torch.no_grad():
3 tokens = backbone(audio_tensor)
4 # Shape: (batch, 496, 768) -- 62 time patches x 8 frequency patches
5
6# Fixed-size embedding
7embedding = tokens.mean(dim=1) # (batch, 768)t * 8 + f. To keep the frequency
structure, regroup before pooling:1b, n, d = tokens.shape
2freq_concat = tokens.reshape(b, n // 8, 8, d).mean(1).reshape(b, -1) # (batch, 6144)(batch, 6144) readout is the representation the source run's discarded
head consumed, so it is a good starting point for downstream probes. Note it is
not one of AVEX's built-in aggregation modes ("mean" / "max" /
"cls_token" / "none" all collapse time and frequency together into 768).1from avex.configs import ProbeConfig
2from avex.models.probes import build_probe_from_config
3
4probe_config = ProbeConfig(
5 probe_type="linear",
6 target_layers=["last_layer"],
7 aggregation="mean",
8 freeze_backbone=True,
9 online_training=True,
10)
11
12probe = build_probe_from_config(
13 probe_config=probe_config,
14 base_model=backbone,
15 num_classes=10, # your number of classes
16 device="cuda",
17)label_map.json is provided.sed-birdcode-ablation-ssl_beats_clip_pseudo stored its
backbone under an encoder._model.backbone.* prefix and carried a
Linear(6144, 7475) head as top-level classifier.{weight,bias}. Publishing
this encoder involved exactly two changes, both lossless for the backbone:encoder._model.backbone.* -> backbone.*, matching
avex.models.beats_model.Model.strict=True load and by comparing forward-pass outputs.6144 = 8 x 768), applied per time patch and pooled over
time. It is not published here and is not required to use these embeddings.TBA — the pseudo-label source and dataset composition for this ablation are
not recorded in the artifacts used to build this repository. The label space
was 7,475 taxa spanning birds, insects, and amphibians.TBAclip_pseudo), as one arm of a SED ablation study.TBATBA — see train_config.yaml for the inference-time model
configuration. That file is a model spec for loading, not a full training
config, so it does not record optimizer or schedule settings.TBA — this is an ablation checkpoint and has not been evaluated on the
ESP-AVES2 benchmark suite. Do not assume parity with released ESP-AVES2 models.TBATBATBAdeep_norm=True, no
label predictor. 252 weight tensors.(batch, 496, 768) for a 5.0 s clip at 32 kHzTBATBA — no publication is associated with this ablation checkpoint. For the
ESP-AVES2 model family, cite:1@inproceedings{miron2025matters,
2 title={What Matters for Bioacoustic Encoding},
3 author={Miron, Marius and Robinson, David and Alizadeh, Milad and Gilsenan-McMahon, Ellen and Narula, Gagan and Chemla, Emmanuel and Cusimano, Maddie and Effenberger, Felix and Hagiwara, Masato and Hoffman, Benjamin and Keen, Sara and Kim, Diane and Lawton, Jane K. and Liu, Jen-Yu and Raskin, Aza and Pietquin, Olivier and Geist, Matthieu},
4 booktitle={The Fourteenth International Conference on Learning Representations},
5 year={2026}
6}TBATBAhttps://github.com/earthspecies/avex/issuesgagan@earthspecies.org