Introduction
Identifying "musical versions"—such as covers, live performances, or remixes of the same underlying composition—is a core challenge in music information retrieval (MIR). Accurate version matching is essential for applications ranging from copyright management to music recommendation. However, the field faces two major hurdles. First is the label mismatch: ground truth data is almost always labeled at the track level, yet real-world applications frequently require matching at the segment level (e.g., identifying a 15-second clip). Second is the "all-to-all" fallacy: most existing models assume that if two tracks are versions, every part of Track A should match every part of Track B. In reality, a cover might feature a completely different intro or an extended bridge. Forcing a model to align these non-matching parts during training introduces noise that severely degrades performance.
To address these challenges, this paper introduces CLEWS (Contrastive Learning from Weakly-labeled Segments), a novel method that learns from short audio segments using only track-level labels. By combining a "best-pair" distance reduction strategy with a modified supervised contrastive loss, CLEWS achieves state-of-the-art results on full tracks and a massive performance leap in matching short audio snippets.
Methodology: The CLEWS Architecture
The CLEWS framework introduces two primary innovations to overcome the limitations of traditional track-level matching:
1. Segment Distance Reduction (bpwr-r)
To train on segments using only track-level labels, the authors needed a mechanism to aggregate a matrix of segment-to-segment distances into a single track-to-track score. They introduce Best Pair Without Replacement (bpwr). Instead of averaging all distances, the algorithm iteratively finds the best-matching pair of segments, masks them out so they cannot be reused, and moves to the next best pair.
This approach allows the model to focus on the "essence" of the songs—the parts that actually match—while ignoring structural deviations like added solos or differing track lengths. The authors note that partial matching is crucial; by allowing the model to ignore unaligned segments, it learns a much more robust representation of the musical core.
2. Modified Supervised Contrastive Loss
Traditional classification losses (like cross-entropy) struggle with sparse data, often failing when there are only a few examples of a specific version. Contrastive learning is better suited for the long-tail distribution of music libraries. The team adapted the "Alignment and Uniformity" (A&U) loss for a supervised setting with three key modifications:
- Decoupling: They strictly separated the terms for "positives" (versions) and "negatives" (different songs), preventing the gradient of one from interfering with the other.
- Euclidean Geometry: While most contrastive losses operate on a hypersphere using cosine similarity, the authors found that native Euclidean distance in a 1024-dimensional space provided superior results for this task.
- Smoothing ($\epsilon$): A hyper-parameter was added to smooth the potential between negative pairs, preventing the model from over-focusing on "easy" negatives. Furthermore, their reduction for negative pairs acts similarly to "hard negative mining," forcing the model to distinguish between very similar-sounding but distinct songs.
Datasets and Evaluation
The study evaluated CLEWS on two major benchmarks:
- DiscogsVI-YT (DVI): A large-scale dataset of 500k tracks reflecting real-world distributions, where most songs only have a couple of versions.
- SHS100k-v2 (SHS): A standard benchmark, though noted by the authors to be somewhat biased due to an unrealistically high number of versions per song (averaging 12, compared to DVI's 2).
Key Results
CLEWS establishes new State-of-the-Art (SOTA) benchmarks across multiple evaluation settings:
- Track-Level Performance: On the DVI dataset, CLEWS achieved a Normalized Average Rank (NAR) of 2.70, significantly outperforming the previous best of 3.69 (DVINet+).
- Segment-Level Breakthrough: The model's most impressive gains are in segment matching. When querying 20-second segments, previous SOTA models saw their performance collapse. CLEWS, however, achieved a Mean Average Precision (MAP) of 0.754, obliterating the next best baseline (ByteCover1/2), which trailed at 0.363.
- Robustness: CLEWS remains highly effective even down to 10-second snippets—a duration where most competing models degrade to random guessing.
Limitations and Future Directions
While highly effective, the "bpwr" reduction is computationally more complex than simple averaging. However, runtime analyses confirm it remains well within the limits for production use. Additionally, the loss function's hyper-parameters exhibit a trade-off between different metrics (e.g., NAR vs. MAP), suggesting they must be tuned based on the specific end-user application. Finally, while this paper focuses strictly on music, the authors suggest that these strategies for weakly-labeled segments could be broadly applicable to other domains, such as video retrieval or bioacoustics.
Summary updated