window_id int64 1 1.73M | recording_id int64 1 189k | start_s float32 0 10.8k | end_s float32 5 10.8k | xc_id int64 3 809k | filename stringlengths 7 12 | ebird_code stringlengths 4 8 | ebird_code_secondary listlengths 0 22 | call_type stringlengths 1 117 ⌀ | sex stringclasses 7
values | quality stringclasses 3
values | latitude float64 -57.21 84.5 ⌀ | longitude float64 -179.99 180 ⌀ | genus stringlengths 3 18 | species_group stringclasses 87
values | taxon_order stringclasses 41
values | duration_s float64 0.28 10.8k | license stringclasses 7
values | embedding list |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 1 | 0 | 5 | 208,209 | XC208209.ogg | ostric2 | [
"rucnig1"
] | call | null | A | -22.677 | 28.2629 | struthio | ostriches | struthioniformes | 26.736 | //creativecommons.org/licenses/by-nc-sa/4.0/ | [
0.00003826618194580078,
0.3623046875,
-0.1051025390625,
0.0474853515625,
-0.075439453125,
-0.07733154296875,
0.02899169921875,
0.1312255859375,
0.1016845703125,
-0.1339111328125,
-0.1947021484375,
-0.10394287109375,
0.05572509765625,
0.041748046875,
-0.055908203125,
-0.0026569366455078... |
2 | 1 | 5 | 10 | 208,209 | XC208209.ogg | ostric2 | [
"rucnig1"
] | call | null | A | -22.677 | 28.2629 | struthio | ostriches | struthioniformes | 26.736 | //creativecommons.org/licenses/by-nc-sa/4.0/ | [
-0.08319091796875,
0.33447265625,
-0.08734130859375,
0.059906005859375,
-0.0941162109375,
0.0115203857421875,
-0.05731201171875,
0.163330078125,
0.10595703125,
-0.066650390625,
-0.0968017578125,
-0.1510009765625,
0.0723876953125,
0.0169677734375,
-0.07891845703125,
0.0533447265625,
-... |
3 | 1 | 10 | 15 | 208,209 | XC208209.ogg | ostric2 | [
"rucnig1"
] | call | null | A | -22.677 | 28.2629 | struthio | ostriches | struthioniformes | 26.736 | //creativecommons.org/licenses/by-nc-sa/4.0/ | [
-0.070556640625,
0.263427734375,
-0.092041015625,
0.08026123046875,
-0.0789794921875,
-0.0175323486328125,
-0.062408447265625,
0.14599609375,
0.083740234375,
-0.06329345703125,
-0.0999755859375,
-0.159912109375,
0.1302490234375,
0.09173583984375,
-0.08782958984375,
-0.01751708984375,
... |
4 | 1 | 15 | 20 | 208,209 | XC208209.ogg | ostric2 | [
"rucnig1"
] | call | null | A | -22.677 | 28.2629 | struthio | ostriches | struthioniformes | 26.736 | //creativecommons.org/licenses/by-nc-sa/4.0/ | [
-0.026885986328125,
0.287353515625,
-0.12054443359375,
0.10595703125,
-0.08465576171875,
-0.0005655288696289062,
-0.04364013671875,
0.13427734375,
0.052032470703125,
-0.09527587890625,
-0.08062744140625,
-0.1590576171875,
0.093017578125,
0.034149169921875,
-0.06549072265625,
-0.0021419... |
5 | 1 | 20 | 25 | 208,209 | XC208209.ogg | ostric2 | [
"rucnig1"
] | call | null | A | -22.677 | 28.2629 | struthio | ostriches | struthioniformes | 26.736 | //creativecommons.org/licenses/by-nc-sa/4.0/ | [
-0.044525146484375,
0.291259765625,
0.002166748046875,
0.0211639404296875,
-0.06365966796875,
0.03912353515625,
-0.034881591796875,
0.177001953125,
0.12841796875,
-0.1519775390625,
-0.11529541015625,
-0.1768798828125,
0.13671875,
0.1982421875,
-0.0116729736328125,
0.03936767578125,
-... |
6 | 1 | 25 | 30 | 208,209 | XC208209.ogg | ostric2 | [
"rucnig1"
] | call | null | A | -22.677 | 28.2629 | struthio | ostriches | struthioniformes | 26.736 | //creativecommons.org/licenses/by-nc-sa/4.0/ | [
0.051666259765625,
-0.09716796875,
-0.022125244140625,
0.102783203125,
0.004058837890625,
-0.033416748046875,
0.024200439453125,
-0.07513427734375,
-0.05609130859375,
-0.051177978515625,
-0.08172607421875,
-0.127197265625,
0.058929443359375,
0.397216796875,
-0.0494384765625,
0.02993774... |
7 | 2 | 0 | 5 | 208,128 | XC208128.ogg | ostric2 | [] | call | null | A | -22.6085 | 28.2996 | struthio | ostriches | struthioniformes | 4.656 | //creativecommons.org/licenses/by-nc-sa/4.0/ | [
0.1375732421875,
0.27978515625,
0.068115234375,
-0.1121826171875,
-0.0692138671875,
0.2230224609375,
-0.035064697265625,
-0.1002197265625,
0.08477783203125,
0.0667724609375,
0.0156402587890625,
-0.003971099853515625,
-0.07342529296875,
0.1434326171875,
-0.1651611328125,
-0.120056152343... |
8 | 3 | 0 | 5 | 673,753 | XC673753.ogg | ostric2 | [
"piebar1",
"ruvwar2",
"laudov1"
] | call | uncertain | C | -26.9306 | 26.2697 | struthio | ostriches | struthioniformes | 11.65 | //creativecommons.org/licenses/by-nc-sa/4.0/ | [-0.13818359375,0.447021484375,0.043121337890625,0.0257415771484375,-0.1175537109375,-0.039276123046(...TRUNCATED) |
9 | 3 | 5 | 10 | 673,753 | XC673753.ogg | ostric2 | [
"piebar1",
"ruvwar2",
"laudov1"
] | call | uncertain | C | -26.9306 | 26.2697 | struthio | ostriches | struthioniformes | 11.65 | //creativecommons.org/licenses/by-nc-sa/4.0/ | [-0.048553466796875,0.43212890625,0.0687255859375,-0.002147674560546875,-0.093505859375,-0.110534667(...TRUNCATED) |
10 | 3 | 10 | 15 | 673,753 | XC673753.ogg | ostric2 | [
"piebar1",
"ruvwar2",
"laudov1"
] | call | uncertain | C | -26.9306 | 26.2697 | struthio | ostriches | struthioniformes | 11.65 | //creativecommons.org/licenses/by-nc-sa/4.0/ | [0.158447265625,0.2318115234375,0.08868408203125,-0.045745849609375,-0.0556640625,-0.014213562011718(...TRUNCATED) |
BirdSet XCL: Perch v2 embeddings
Perch v2 embeddings (1536-D, pooled; not the spatial embedding) for every recording in the BirdSet XCL Xeno-canto snapshot: 528,422 recordings, 9,734 species, 5,710,481 non-overlapping 5 s windows. Recording metadata (foreground and background species, call type, location, quality, recordist, license, …) is included, so the embeddings can be used without downloading BirdSet.
The data comes in two equivalent forms:
| path | what | use with |
|---|---|---|
embeddings/XCL_shard_XXXX.parquet |
one row per 5 s window: ids, offsets, label metadata, embedding (float16[1536]) |
pandas / pyarrow / 🤗 datasets |
recordings.parquet |
one row per recording: metadata, duration, window count, shard |
pandas |
hoplite_db/ |
perch-hoplite SQLite + USearch DB (ANN index, inner product): hoplite.sqlite (0.6 GB, recordings + windows + metadata) and usearch.index (18.4 GB, all 5,710,481 window embeddings, f16) |
perch_hoplite |
window_id is the same in all of them (hoplite window id = USearch key). Embedding shard XCL_shard_XXXX
holds the recordings of BirdSet archive XCL/XCL_shard_XXXX.tar.gz (the shard column), so a species'
windows can be read without fetching every file.
How the embeddings were made
- Audio: BirdSet XCL
.oggfiles (32 kHz), stereo downmixed to mono by channel mean. - Windows: non-overlapping 5 s windows from t = 0. The last, incomplete window is zero-padded at the end,
so window k covers [5k, 5k+5) s and
end_sof the last window can exceedduration_s. - Preprocessing and model as in
perch_hoplite.zooTaxonomyModelTF.batch_embed(presetperch_v2, GPU SavedModel, Kaggle version 2): per-window mean removal and peak normalisation to 0.25, then theserving_defaultsignature; the pooledembeddingoutput is stored as float16. Checked against hoplite's ownmodel.embed(max abs difference 2e-4). - Code:
code/in this repo (embed_xcl.py= embedding,backfill_meta.py,build_index.py,export_parquet.py).
Columns
Window table (embeddings/*.parquet): window_id, recording_id, start_s, end_s, xc_id, filename
(XC<id>.ogg, the BirdSet file name), ebird_code (foreground species), ebird_code_secondary (background
species, list), call_type, sex, quality, latitude, longitude, genus, species_group, taxon_order,
duration_s, license, embedding.
Recording table (recordings.parquet): recording_id, filename, xc_id, shard, ebird_code,
ebird_code_secondary, call_type, sex, quality, microphone, license, recordist, local_time,
latitude, longitude, genus, species_group, taxon_order, meta_length_s (BirdSet length),
duration_s (decoded), num_windows, decode_error.
Usage
The snippets use xcl_embeddings.py (included in this repo). Float16 Parquet needs
pyarrow >= 15.
Embeddings for one species or one file (Parquet, no hoplite)
import xcl_embeddings as xe
root = xe.download(local_dir := "xcl_perch_v2", shards=[]) # just recordings.parquet (~15 MB)
rec = xe.recordings(root)
shards = rec.loc[rec.ebird_code == "amerob", "shard"].unique().tolist()
root = xe.download(local_dir, shards=shards) # only the shards that hold this species
t = xe.windows_for_species(root, "amerob") # pyarrow Table
emb = xe.to_numpy(t) # float16 [n, 1536]
meta = t.drop_columns(["embedding"]).to_pandas()
t = xe.windows_for_file(root, "XC208209.ogg") # windows of one recording, time order
Plain pandas works too:
import pandas as pd, numpy as np
df = pd.read_parquet("xcl_perch_v2/embeddings/XCL_shard_0001.parquet", filters=[("ebird_code", "==", "ostric2")])
emb = np.stack(df.embedding.to_numpy())
hoplite DB (filters + approximate nearest-neighbour search)
Downloads ~19 GB. Embeddings are read from the USearch index (the SQLite file holds metadata only). Opened read-only, the index is memory-mapped, so opening takes about a second and doesn't need 18 GB of RAM.
import xcl_embeddings as xe
root = xe.download("xcl_perch_v2", shards=[], hoplite=True)
db = xe.open_hoplite(f"{root}/hoplite_db")
db.ui.expansion_search = 256 # recommended search scope (see below)
ids, emb = xe.hoplite_species(db, "amerob")
wins, emb = xe.hoplite_file(db, "XC208209.ogg")
neighbours = xe.hoplite_search(db, emb[0], k=20) # [(window_id, inner product), ...]
Search speed. Approximate nearest-neighbour search over all 5.7 M windows is fast, even with a wider search
scope: at expansion_search = 256, a single query takes 11 ms (2.5 ms once the index pages are in memory) and
a batch of 100 queries takes 0.03 s, with 99.7% recall@10. We recommend 256. The read-only open uses usearch's default of 64 (98.9% recall), so set it
after opening, as above. Exact search is far slower: 1.5 s per query with db.ui.search(q, count=10, exact=True), or
~80 s when scanning the Parquet files.
| search | 100 queries | recall@10 |
|---|---|---|
expansion_search = 64 (default when opened read-only) |
0.02 s | 0.989 |
expansion_search = 256 (recommended) |
0.03 s | 0.997 |
expansion_search = 512 |
0.06 s | 0.999 |
exact search (usearch exact=True) |
22 s | 1.0 |
Measured on 32 CPU cores with the files on local NVMe, k = 10, 100 random query windows. Script: code/bench_search.py.
Pairing with audio from BirdSet XCL
If you have BirdSet XCL locally (datasets.load_dataset("DBD-research-group/BirdSet", "XCL", trust_remote_code=True),
which extracts the .ogg files into the HF datasets cache):
paths = xe.birdset_audio_index() # {'XC208209.ogg': '/…/downloads/extracted/<hash>/XC208209.ogg', …}
# or, from the loaded dataset: paths = xe.birdset_audio_index_from_dataset(ds["train"])
row = meta.iloc[0]
audio = xe.load_window_audio(paths[row.filename], row.start_s, row.end_s) # float32, 32 kHz, 160000 samples
Without BirdSet, the original recording is at https://xeno-canto.org/<xc_id>.
License and attribution
The recordings belong to their recordists on xeno-canto and are under per-recording
Creative Commons licenses (the license column), many of them non-commercial (BY-NC, BY-NC-SA, BY-NC-ND).
Treat the embeddings as derived from those recordings and respect each recording's license. Please cite BirdSet
(Rauch et al., 2024, arXiv:2403.10380), Perch v2 (van Merriënboer et al., 2025), and xeno-canto.
- Downloads last month
- 156