PANNs CNN14 (AudioSet) β Core ML
PANNs CNN14 (Cnn14_mAP=0.431, Kong et al. 2020, 527-class AudioSet tagging; Zenodo 3987831) for Core ML on Apple devices.
Converted from the same verified reference used by the schism-mlx MLX ports. Two variants per model:
| File | Precision | Compute units | max logit diff |
|---|---|---|---|
Cnn14_fp16.mlpackage |
FLOAT16 | ALL (ANE) | 1.3e-2, top-5 identical on tested clips |
Cnn14_fp32.mlpackage |
FLOAT32 | CPU+GPU | 2.9e-6 |
Verified on-device-equivalently via coremltools on an M5 Max, against the reference implementation on real audio. fp16 is ANE-eligible and recommended for iPhone / iPad; fp32 is the tight-parity fallback.
Download
.mlpackage bundles must be materialized as real files β the Core ML
compiler rejects the symlinks that a default snapshot_download creates in
the Hugging Face cache:
from huggingface_hub import snapshot_download
path = snapshot_download("schism-audio/cnn14-audioset-coreml", local_dir="./cnn14-audioset-coreml")
(or hf download schism-audio/cnn14-audioset-coreml --local-dir ./cnn14-audioset-coreml). Swift hosts
downloading files directly are unaffected.
I/O contract
- input
logmel:(1, 1001, 64)float32 β librosa-style log-mel (32 kHz, n_fft 1024, hop 320, 64 mels, 50β14000 Hz,10*log10(clamp(mel, 1e-10))) of a 10 s window - output
logits:(1, 527)float32 β apply sigmoid; multi-label - longer audio: 10 s windows, aggregate scores
DSP frontend (host-side)
The Core ML graph contains the network only. The host implements the audio
frontend and must match schism_mlx.audio numerically β
test_vectors_*.npz in this repo holds deterministic input/output pairs
(float32; match within ~1e-4 relative to be interchangeable with what these
models were verified against). No chunking layer is needed for full tracks β CNN14 accepts any input length natively (windowing only sets score granularity). A validated Swift
implementation (Accelerate; modules SchismDSP and SchismPipeline) is
available at
schism-audio/schism-dsp,
tested against these exact vectors.
License
CC-BY-4.0, inherited from the source checkpoint. Model by Qiuqiang Kong et al. (PANNs). Core ML conversion by schism-audio.
- Downloads last month
- 19