## 3 TruMuzic: Deep Learning and Data Provenance-based Plagiarism-Detection
### Optimization Using Deep Learning-Based Weight Adjustment  
Music similarity score calculation is a complex task. Hence, we need an advanced solution to accurately evaluate similarity that adjusts the weights of features used in the model. As such, we used a multimodal approach to train our model, where four levels of similarity are provided by music experts as the ground truth and provide the similarity scores for the four features used in the first phase of TruMuzic's process. As shown by experimental results using a linear regression-based approach, we were able to find the proper weight distribution of similarity features in our model. In this subsection, we explain our deep learning-based classification solution in this regard. Our model uses the ground truth of similarity levels generated by the experts as training data to learn each individual feature's weight, as shown in Figure 2. To generate ground truth training data, we first developed a dataset of paired songs along with a questionnaire. The questionnaire was used to label the similarity of each paired song, more details of which are provided in Appendix A.  
Figure 2: Deep neural network-based weight-adjustment function. Neural networks are composed of interconnected layers of computational units called neurons. These networks transform data until the right weights and correct classifications are found, so the network outputs good predictions. The neurons multiply an initial value with randomly generated weights, and as we train the model on more paired songs with their similarity level, the model adjusts the weights of each neuron's biases based on the output results. The network functions according to an iterative learning process that adjusts the values of the weights of the network each time in reference to the ground truth as shown in Algorithm 4. This process continues until the right combinations of weights are found. ```
Input: Similarity scores of four features for given data songs \(Q\) and \(P\). Weights generated through ground truth-based classification. Desired results of the comparisons \(R_{d}\). Default (zero) weights Output: Final weights of given four features to adjust the final similarity scores (\(w_{1}\), \(w_{2}\), \(w_{3}\), \(w_{4}\)) Function: 1. Cost function \(E^{p}=C\) (\(D^{p}\), \(M\) (\(Z^{p}\), \(W\))) 1. Error computation of the outputs 2. Average of the errors \(E^{p}\)
2. Multiply the weighted/backpropagated error with the unit derivative (bias) Steps: 3. Implementation of the cost function 4. Compute the error of the output 5. Pass the error backward and weight it along each edge 6. At unit: Multiply 7. While the error is not equal to \(R_{d}\) 8. Repeat steps 1-4, 9. End while 10. Return \(w_{1}\), \(w_{2}\), \(w_{3}\), \(w_{4}\)
```  
**Algorithm 4** DNN-based weight distribution  
As shown in Figure 3, the feature similarity results, \(S_{n}\), \(S_{p}\), \(S_{c}\), and \(S_{pr}\), are produced by comparing two songs, \(Q\) and \(P\). Moreover, these similarity results are at first just the initial values of neurons along with their randomly given weights. In the recursive process, the final output of all the values based on their weights is computed and compared with the desired output \(\mathrm{R_{d}}\). Moreover, based on the differences between the desired output and the output produced by the modules, the weights are adjusted in each iteration. Biases (\(\mathrm{B_{1}}\) and \(\mathrm{B_{2}}\)) of the module also contain weight values, which help in making weight adjustments. We use a backpropagation algorithm to achieve the desired combinations of weights in the neural network. Backpropagation consists of applying the chain rule to all possible paths in our network. It is a dynamic programming-based algorithm that reuses intermediate results to calculate gradients. After this, it transmits the intermediate errors backward. The algorithm implements a function \(Xn=Fn\) (\(Wn\), \(Xn-1\)), where \(Xn\) is the output vector representing the similarity between two songs.