Abstract
The criteria for measuring music similarity are important for developing a flexible music recommendation system. Some data-driven methods have been proposed to calculate music similarity from only music signals, such as metric learning based on a triplet loss using tag information on each musical piece. However, the resulting music similarity metric usually captures the entire piece of music, i.e., the mixing of various instrumental sound sources, limiting the capability of the music recommendation system, e.g., it is difficult to search for a musical piece containing similar drum sounds. Towards the development of a more flexible music recommendation system, we propose a music similarity calculation method that focuses on individual instrumental sound sources in a musical piece. By fully exploiting the potential of data-driven methods for our proposed method, we employ weakly supervised metric learning to individual instrumental sound source signals without using any tag information, where positive and negative samples in a triplet loss are defined by whether or not they are from the same musical piece. Furthermore, assuming that each instrumental sound source is not always available in practice, we also investigate the effects of using instrumental sound source separation to obtain each source in the proposed method. Experimental results have shown that (1) unique similarity metrics can be learned for individual instrumental sound sources, (2) similarity metrics learned using some instrumental sound sources are possible to lead to more accurate results than that learned using the entire musical piece, (3) the performance degraded when learning with the separated instrumental sounds, and (4) similarity metrics learned by the proposed method well produced results that correspond to perception by human senses.
Introduction
Most contemporary music recommendation systems analyze songs as holistic, mixed audio signals. While effective for identifying broad genres or moods, this approach fails when users have preferences for specific components, such as a particular drum "vibe" or piano style. Two primary challenges hinder more granular systems: the prohibitive cost of manually tagging instruments across vast catalogs and the signal interference caused by overlapping frequencies in a standard mix. This research addresses these issues by proposing a method to calculate music similarity based on individual instrumental sounds.
Methodology
The proposed approach utilizes weakly supervised metric learning to bypass the need for manual tags. Instead, it leverages track-based similarity as a proxy for ground truth.
Workflow and Architecture
The process begins by dividing musical pieces into 3-second segments, which are then converted into mel-spectrograms. A Convolutional Neural Network (CNN) is employed to extract feature representations. The model is trained using a triplet loss strategy, involving an anchor segment, a positive sample (from the same track), and a negative sample (from a different track). The objective is to minimize the distance between the anchor and positive samples in a 128-dimensional embedding space while maximizing the distance to the negative sample.
Crucially, separate networks are trained for different instruments (drums, bass, piano, guitar). To evaluate real-world applicability where clean instrument stems are unavailable, the researchers also tested the system using audio separated by Spleeter, an AI-based source separation tool.
Dataset
The study used the Slakh dataset, which provides both mixed tracks and original individual instrument stems. The training set comprised 180 musical pieces (7,200 segments), while the testing set included 19 pieces (199 segments).
Results and Discussion
The experimental results demonstrated that the model successfully captures unique features for specific instruments rather than just general song similarity.
Objective Evaluation
The model achieved high accuracy (84%–93%) in clustering segments from the same track using original stems. Notably, identifying tracks based on drums (93.68%) or piano (92.17%) was sometimes more accurate than using the entire mixed track (90.52%). However, a "separation tax" was observed: performance declined when using AI-separated audio due to artifacts and "bleeding" between sources.
Subjective Evaluation
Human listening tests involving 13 participants showed that the model's similarity rankings aligned well with human perception for Mixed (80.8%), Bass (76.9%), and Guitar (71.2%) categories. The lower agreement for Piano (55.8%) suggests that similarity for this instrument is more subjective due to variations in style and register.
Conclusion
This research proves that unique similarity metrics can be learned for individual instruments without manual supervision. While source separation artifacts remain a bottleneck for widespread application to commercial music, the results pave the way for more flexible recommendation engines. Future work will explore "joint optimization," where source separation and metric learning are trained simultaneously to mutually improve performance.
Summary updated