Perch 2.0 for tract and WASM
Google's Perch 2.0 (perch_v2) split into two files, for running in
tract in a browser or desktop app. Used by
Oversample.
| File | Size | SHA-256 |
|---|---|---|
perch_v2_embed.tract.onnx |
44,718,343 bytes | 834e554388700e6671912446e250ae78db38b9d1e758ee06931b362e009fa472 |
perch_v2_head.int8.bin |
91,433,120 bytes | 1e5500603a9a04c5ecc5c9669c09344a85af8f7c67664930062d78c91b9cbe25 |
Class names, in the order of the classifier's outputs: assets/labels.csv in
cgeorgiaw/Perch (revision c3c3c816976a6c1bb75140b8fbaef7397a6f708f).
What the files are
perch_v2_embed.tract.onnx: the embedding part of Perch 2.0. Input: 160,000 samples (5 s at 32 kHz). Outputs:embedding(1,536 values) andspatial_embedding(16 x 4 x 1,536), the classifier's input.perch_v2_head.int8.bin: the classifier for all 14,795 classes, with its prototypes stored as int8 (one scale per prototype). Layout, little-endian:PERCHHD1, u32 dim (1536), u32 classes (14795), u32 prototypes per class (4), then f32 scale[classes x 4], f32 W[classes x 4], f32 b[classes], and i8 prototypes [classes x 4][dim].logit[c] = b[c] + sum over k of W[c, k] x scale[c, k] x max over the 64 positions of (position / (its L2 norm + 1e-5)) . q[c, k]
Changes from Google's model
Made from perch_v2.onnx in justinchuby/Perch-onnx (an ONNX conversion of Google's
perch_v2 SavedModel) by the scripts in Oversample's research/perch-bench/:
split.py: kept only the graph up toembeddingandspatial_embedding, and saved the classifier's weights apart.fix_for_tract.py: folded each convolution's batch-norm multiply and add into the convolution's weights and bias, so tract 0.23 loads the model with batch size 1. The function is unchanged.export_head.py: stored the classifier's prototype matrix as int8.
Against the unchanged model (Google's TensorFlow SavedModel on 22 windows, the full ONNX file in onnxruntime on 362 more), on birds, frogs, insects, mammals and sound events: the same top class on 383 of 384 windows (the other was a tie within 0.002), logits within 0.031. Running the scripts again gives byte-identical files.
Licence
Apache License 2.0, as for Google's Perch 2.0 weights
(kaggle.com/models/google/bird-vocalization-classifier, variation perch_v2).
The files above are modified versions, as described under "Changes".
Perch 2.0 paper: "Perch 2.0: The Bittern Lesson for Bioacoustics", arxiv.org/abs/2508.04665.