arXiv:2611.02408cs.SDNov 2026

Manuscript Offprint

arXiv:2611.02408

Deployment-constrained key estimation with a DSP-guided transformer reranker

Pardis Noorzad

Abstract

Local music applications estimate key during library import and benefit from an analyzer that is small, fast, and runs in-process. We start from a compact chroma-template key analyzer that fits this budget but lags behind learned references. Learned systems reach higher accuracy, but their installed model and runtime dependencies can occupy tens to hundreds of megabytes. We present key lime, a 21.5k-parameter DSP-guided transformer reranker with a 115 KB model artifact and a 76.7 MB installed footprint, including the extracted ONNX Runtime. It adds 0.32 ms per track to deterministic DSP scoring. Trained from labels on 4,040 FMAK tracks, with 449 tracks for validation and 1,000 disjoint FMAKv2 tracks held out for evaluation, it improves MIREX from 61.08 to 73.55 ± 0.46 and exact accuracy from 52.30 to 67.07 ± 0.65 over three seeds (mean ± population SD). It approaches a same-manifest local madmom KeyCNN reference at 74.16 MIREX. A 12-parameter circular input stage matches the accuracy range of a 468-parameter linear input projection.

Keywords: music information retrieval, key estimation, local-first software, audio analysis

1 Introduction

Local music applications such as Cueport¹ display estimated musical keys during library import. Because this analysis runs in-process on the user’s laptop [1], the estimator’s footprint matters as much as its accuracy: it must add little binary size and few runtime dependencies, and finish fast enough that importing thousands of tracks remains practical. Compact chroma-template methods [2, 3, 4] meet this budget. Our Rust analyzer, trail mix², computes tempo, beat-position, key, and waveform summaries locally; only key is evaluated here. Its key scorer reaches 61.08 MIREX on our 1,000-track FMAKv2 holdout, compared with 74.16 for local madmom KeyCNN [5]. S-KEY [6] reports 72.1 and 73.2 MIREX on the full 5,489-track protocol. This key gap motivates adding a small learned component while retaining the broader DSP analyzer. We call the deterministic trail mix key scorer KL-DSP and the learned reranker KL-FMAK. Madmom and S-KEY occupy 174 MB and 436 MB when installed (Table 3).

We introduce key lime, a transformer with 21,528 parameters, exported as a 115 KB ONNX file that adds 0.32 ms per track to DSP scoring. It reranks the 24 DSP key scores using frame-level chroma context. The selected model uses an identity-initialized DSP-score projection and a circular input convolution as low-cost structural choices. The ablation in Table 2 shows that the frame-sequence branch accounts for the measured accuracy gain. Circular input and identity initialization were not distinguishable at three seeds. The circular

This work has been submitted to the IEEE for possible publication. Copyright may be transferred without notice, after which this version may no longer be accessible.

¹https://usecueport.com

²https://github.com/djpardis/trailmix/releases/tag/key-lime-paper-v1 input shares weights over pitch classes, giving the input stage a transposition-equivariant form related in spirit to the transposition objectives of STONE and MT 2^{2} [7, 8]. Training uses 4,040 labeled FMAK tracks, selects checkpoints on 449 disjoint FMAK validation tracks, and reports final and diagnostic results on a sealed 1,000-track FMAKv2 holdout.

Over three seeds, KL-FMAK raises held-out MIREX from 61.08 to 73.55 ± 0.46, approaching the local madmom reference at 74.16 on the same files. Its 76.7 MB installed footprint, dominated by ONNX Runtime, is 2.3× smaller than madmom’s and 5.7× smaller than S-KEY’s; the model file itself is 115 KB. Published S-KEY and madmom scores use the full 5,489-track protocol and provide context for the local same-manifest results.

Our contributions are: (i) a compact DSP-guided transformer reranker for a DSP key scorer; (ii) a held-out, three-seed evaluation against DSP and local madmom with paired-bootstrap and McNemar tests; and (iii) an ablation separating the sequence branch, circular input, identity initialization, and distillation, together with measured model, runtime, and installed footprints.