# Music Similarity Detection Through Comparative Imagery Data
## 1 Introduction
While there is a need to improve the legal definition as to how musical plagiarism is defined for a specific type and level of musical similarity, it is desirable for us to make technical progress that can provide analytical tools to assist in legal processes. While there is little doubt that we need to develop advanced AI technology for detecting music plagiarism, it is necessary for us to address a number of technical challenges, including the following:  
1. As mentioned above, apart from melodic features, there is a vast feature space for us to explore in order to identify other features or combinations of features that can help detect music plagiarism. 2. There is an insufficient amount of legally verified data on music plagiarism for training ML models to detect music plagiarism or to identify or formulate useful feature specifications in detecting music plagiarism. 3. Music plagiarism is a serious allegation, and any ML model designed for suggesting such an allegation has to be treated with caution. How to interpret and explain ML predictions is a generally challenging topic commonly referred to as _explainable AI_. In this paper, we present a study on developing ML models to detect music similarity patterns. We addressed the first challenge, C1, by analyzing and visualizing different features in terms of their similarity and dissimilarity in a number of known cases where the level of music similarity is relatively certain. This allowed us to focus our data collection and model development efforts on these indicative features. Meanwhile, we developeddifferent sub-models for different features and trained an ensemble model to integrate these sub-models to make decisions collectively, avoiding over-reliance on a single feature. To address the second challenge, C2, we created a dataset for the training and validation of ML models, while keeping the data of known cases for independent testing outside the development workflow. Inspired by feature-based analysis and visualization in addressing C1, we proposed a novel method for training ML models to detecting music similarity based on comparative imagery. Information-theoretical analysis indicates that the space of such comparative imagery has much lower entropy than the space of the original music signal data for creating the imagery, suggesting that training ML models requires less data in the former than the latter. Data visualization has played an indispensable role in explainable AI, the comparative imagery used for testing an ML model provided an effective means for humans to scrutinize and interpret the judgment of the ML model, hence enhancing the explainability of the ML model. In particular, when we applied the trained ML model to a collection of AI-generated music, we were often not sure about the correctness of the similarity patterns detected by the model. By visualizing the comparative images for individual features, we were able to reason how the model made its decision. In summary, the contributions of this work include the following:  
1. A broad analysis of the relationship between music feature similarity and music similarity in the context of copyright infringement and plagiarism [addressing C1]. 2. A novel method for using comparative imagery as intermediate data to train ML models to detect music similarity, while improving the interpretability of model predictions [addressing C2 and C3]. 3. An ensemble approach to develop an ML model for music similarity detection, which enables a long-term modular approach for results analysis, performance monitoring, and improvement of sub-models [addressing C2]. 4. A set of experiments where the ensemble model is applied to different testing data, including independent data differing significantly from the training data, known plagiarism data, and a collection of AI-generated music, demonstrating the feasibility and merits of the proposed method [addressing C1, C2, and C3]. In the remainder of this paper, we first describe the technical methods used in different parts of this work in Section 2.