## 2 Methodology
### Similarity Score Calculation for Similarity Ranking  
Previous sub-sections discuss six feature channels (\(S\)), with similarity measures \(S_{L}\), \(S_{a}\), \(S_{b}\), \(S_{d}\), \(S_{co}\), and \(S_{in}\). In general, for a class \(c\) with multiple feature channels, class similarity is calculated as:  
\[S_{c}=\sum_{f}w_{f}S_{f} \tag{9}\]  
\[\sum_{f}w_{f}=1 \tag{10}\]  
where \(w_{f}\) is the weight of a feature channel \(f\). Table 1 shows the \(w_{f}\) values used in this study.  
It is worth pointing out that their sum equals one, which ensures that \(S_{c}\) is in [0, 1] range. For a query-test pair with \(n\)-shared classes, the total similarity score is calculated as:  
\[S_{sim}=\sum_{c}^{n}w_{c}S_{c} \tag{11}\]  
\[S_{sim}=\frac{S_{sim}}{\sum_{c}^{n}w_{c}} \tag{12}\]  
where \(w_{c}\) are class weights shown in Table 2.  
It should be noted that, unlike channel-wise similarity estimates, the similarity score \(S_{sim}\) does not naturally fall in [0, 1] range. In general, \(S_{sim}\) depends on the number of shared classes \(n\), which varies from one to the number of classes in the query image. The highest score would be obtained via a pair of images with all possible classes having a perfect similarity among all features--which, for the weights in Table 2, amounts to 34. In practice, it is extremely rare to have objects with all fifteen different classes present in both images and where the similarity scores are much lower. Whereas a percentage similarity measure can be obtained using (12), it is less meaningful when understood as the similarity score due to the fact that an image pair with fewer classes and with low \(w_{c}\) but high \(S_{c}\) will have higher \(S_{sim}\) than another pair with many important classes but slightly lower \(S_{c}\). Thus, we propose to use \(S_{sim}\), rather than \(S_{sim}\) as the scores for ranking.  
In order to calculate a rank-r matching rate for a query image, its scores \(S_{sim}\) with all test images are calculated and sorted in descending order. This is performed with the \(r\) highest score test images returned for match checking, as per the following:  
\[\text{rank-r}=\begin{array}{c}\{1\;if\;true\;match\;in\;r\\ 0\;otherwise\end{array} \tag{13}\]  
Most popular rank-r metrics are rank-1, rank-5, and rank-10. In order to evaluate method performance on a dataset with multiple queries, the rank-r accuracy is averaged for all queries. The main disadvantage of utilizing a rank-r metric is that it requires a single match in \(r\), which is usually the simplest to perform among the possible tests. Thus, it does not contain information about other possible matches and does not reflect the ability of the method to capture complicated matches. As such, in order to address this problem, the mean average precision (mAP) metric is often used along with rank-r when there is more than one correct match in the test set [7,25]. In addition, this is calculated as:  
\[mAP=\frac{1}{n_{q}}\sum_{i}\frac{1}{n_{TPi}}\sum_{j}\frac{m_{ij}}{j} \tag{14}\]  
\[m_{ij}=\begin{array}{c}\{cumulative\;number\;of\;true\;matches\;for\;query\; i\;found\;at\;step\;j\\ 0\;otherwise\end{array} \tag{15}\]  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Parsing Class** & **Hair, Socks, Face, Legs, Arms** & **Hat, Gloves, Sunglasses, Shoes** & **Scarf** & **Pants** & **Upper Clothes** \\ \hline Weight & 1 & 2 & 3 & 6 & 8 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Class \(w_{c}\) weights determining the class importance in similarity score calculations.  
where \(n_{q}\) is the number of queries in a query set, and \(n_{\mathit{TPi}}\) is the number of true matches for an \(i\)th query in the test set.