β οΈ Deprecated β see perchv2-pytorch instead
These weights are no longer the recommended way to use this project. The main repo now provides a PyTorch backbone built by converting Google's actual released ONNX graph directly (via onnx2torch) β confirmed 1.00000000 cosine similarity against onnxruntime's own output, and fully differentiable. That approach needs the original perch_v2.onnx file (get it from justinchuby/Perch-onnx or see the main repo README for details).
The weights on this page are kept only as legacy/ in that repo, for reference β not recommended for new use. See why below.
What this is
Unofficial, community-converted PyTorch weights for Google's Perch v2 bioacoustic foundation model, built by hand-reconstructing the architecture in timm's tf_efficientnet_b3 and copying over weights converted from the original JAX/Flax SavedModel. Not produced or endorsed by Google.
- Architecture:
timmtf_efficientnet_b3, single-channel input (in_chans=1), classification head stripped β returns a pooled 1536-dim embedding. - File:
perch_v2_backbone_timm.ptβ backbone weights only (no classification head).
Known limitation β why this is deprecated
Earlier validation reported 0.80 whole-network cosine similarity, attributed to numerical error accumulating across blocks. That explanation was incomplete. Further investigation found and fixed two real architectural bugs (a stem padding mismatch and a missing convolution bias, both confirmed directly against the ONNX graph), bringing cosine similarity up to **0.97**.
That still wasn't the full picture. A later three-way comparison β real ONNX output, the onnx2torch-converted backbone, and this timm backbone β found this backbone sitting at a relative L2 error of ~0.23β0.29 against the true model, despite the reassuring-looking ~0.97 cosine similarity. Cosine similarity measures an angle between vectors; it can look close to 1.0 while the actual magnitude of the error stays large. This showed up concretely: a linear probe trained on this backbone's frozen embeddings converged slower and to a lower accuracy than one trained on the ONNX-converted backbone's embeddings, on the same task.
A further architectural bug was identified (blocks 5, 8, and 18 also use asymmetric padding, the same class of issue as the original stem bug) but attempting to fix it caused an unexplained regression, so it was left unfixed. Whether this is the source of the remaining L2 gap is an open question β full details in legacy/README.md.
If you need accurate, trainable Perchv2 backbone, use the ONNX-converted backbone in the main repo instead β not these weights.
License
Apache 2.0, inherited from the original Perch v2 release. See NOTICE in the main repo for the full derivative-work attribution.