SPICE (pitch estimation)
SPICE (Self-supervised Pitch Estimation) is a neural network that estimates the fundamental frequency of monophonic audio without being trained on any pitch labels. It was developed at Google Research by Beat Gfeller and colleagues, published in 2020, and released as a TensorFlow Hub module.[1:1] Trained only on unlabelled singing, it matched the supervised CREPE on a singing benchmark but fell behind it on instrument recordings.[1:2] Its approach, learning pitch from pairs of transposed copies of the same audio, was developed further by PESTO.[2:1]
Background
Supervised neural pitch detection algorithms need audio annotated with pitch at a fine resolution in time and frequency, which is tedious and difficult to make. CREPE got round this with a dataset made by resynthesizing monophonic recordings to a known fundamental frequency.[1:3] SPICE instead avoids labels altogether.
Method
SPICE starts from the observation that people, musicians included, find relative pitch much easier to judge than absolute pitch. Its encoder is shown two versions of the same signal, one shifted in pitch by a random but known amount, and is trained so that the difference between its two outputs is proportional to the shift. It thus learns relative pitch with no labels.[1:4] A small calibration step on synthetic sounds then turns relative pitch into absolute pitch, so no manually labelled data is needed at any stage.[1:5]
The input is frames of the constant-Q transform, on whose logarithmic frequency axis a pitch shift is a simple translation; this is not true of the mel spectrogram. The authors note that the mapping can mislead on contrived sounds such as a Shepard tone.[1:6] Instead of a hand-set threshold for deciding whether a frame is voiced, SPICE adds a small output trained to predict its own pitch error, which serves as a confidence.[1:7]
Evaluation
SPICE was trained on SingingVoices, an in-house set of 88 tracks (185 minutes) of pop singing, and evaluated on MIR-1k, 1000 tracks of Chinese pop singing, and on MDB-stem-synth, resynthesized instrument recordings.[1:8] Its raw pitch accuracy was 90.6% on MIR-1k, against 90.1% to 90.7% for the two sizes of CREPE and 86.6% for SWIPE. On MDB-stem-synth it reached 89.1%, against 92.7% to 93.1% for CREPE and 90.7% for SWIPE. A version reduced to 180,000 parameters reached 90.4% and 87.9%.[1:2] Most of its extra errors came from instruments whose energy lies mainly above the fifth harmonic, a timbre unlike the singing it was trained on.[1:9]
Trained on MIR-1k with its backing tracks mixed in, SPICE kept 81.6% accuracy with the backing as loud as the voice (0 dB), against 80.8% for the full CREPE model and 27.2% for SWIPE.[1:10]
Later work
PESTO (2023) replaced SPICE's regression with classification over pitch bins and reached 96.1% on MIR-1k and 94.6% on MDB-stem-synth, against SPICE's 90.6% and 89.1%.[2:1][2:2] In a community benchmark of 19 pitch trackers on degraded recordings, SPICE scored 0.602, behind CREPE and PESTO but ahead of pYIN.[3:1][3:2]
- ^ ↗ spice-release ^a ^b ↗ spice-results ^ ↗ spice-why ^ ↗ spice-method ^ ↗ spice-calibration ^ ↗ spice-cqt ^ ↗ spice-confidence ^ ↗ spice-data ^ ↗ spice-instrument-errors ^ ↗ spice-noise Gfeller, Beat; Frank, Christian; Roblek, Dominik; Sharifi, Matt; et al. (2020). SPICE: Self-Supervised Pitch Estimation. IEEE/ACM Transactions on Audio, Speech, and Language Processing. https://doi.org/10.1109/TASLP.2020.2982285 https://arxiv.org/abs/1910.11664.
- ^a ^b ↗ pesto-vs-spice ^ ↗ pesto-results Riou, Alain; Lattner, Stefan; Hadjeres, Gaëtan; Peeters, Geoffroy (2023). PESTO: Pitch Estimation with Self-supervised Transposition-equivariant Objective. Proceedings of the 24th International Society for Music Information Retrieval Conference (ISMIR 2023). Milan. https://arxiv.org/abs/2309.02265.
- ^ ↗ bench-scope ^ ↗ bench-ranking Nieradzik, Lars. Pitch Detection Benchmark (README, version 2.1). GitHub: lars76/pitch-benchmark. https://github.com/lars76/pitch-benchmark.