# Deep Class-Guided Hashing for Multi-Label Cross-Modal Retrieval
## 3 Methodology
### Optimization
\begin{table}
\begin{tabular}{c c c c c c c c c c} \hline \hline \multirow{2}{*}{**Task**} & \multirow{2}{*}{**Methods**} & \multicolumn{3}{c}{**MIFRLICKR-25K**} & \multicolumn{3}{c}{**NUS-WIDE**} & \multicolumn{3}{c}{**MS COCO**} \\ \cline{3-10}  & & **16 bits** & **32 bits** & **64 bits** & **16 bits** & **32 bits** & **64 bits** & **16 bits** & **32 bits** & **64 bits** \\ \hline \multirow{4}{*}{Img2 Txt} & DCGH-_P-V_ & 0.8154 & 0.8258 & 0.8412 & 0.6678 & 0.6910 & 0.7122 & 0.6562 & 0.7116 & 0.7447 \\  & DCGH-_X-V_ & 0.7902 & 0.8288 & 0.8457 & 0.6723 & 0.6893 & 0.6989 & 0.6273 & 0.6718 & 0.7096 \\  & DCGH-_V_ & 0.8164 & 0.8430 & 0.8604 & 0.6867 & 0.7021 & 0.7158 & 0.7077 & 0.7428 & 0.7722 \\  & DCGH (present study) & **0.8245** & **0.8482** & **0.8633** & **0.6869** & **0.7038** & **0.7214** & **0.7120** & **0.7492** & **0.7737** \\ \hline \multirow{4}{*}{Txt2 Img} & DCGH-_P-V_ & 0.8087 & 0.8192 & 0.8313 & 0.6890 & 0.7127 & 0.7304 & 0.6614 & 0.7259 & 0.7592 \\  & DCGH-_X-V_ & 0.7853 & 0.8184 & 0.8329 & 0.6848 & 0.6985 & 0.7079 & 0.6256 & 0.6784 & 0.7183 \\ \cline{1-1}  & DCGH-_V_ & 0.8022 & 0.8229 & 0.8351 & 0.7001 & 0.7147 & 0.7321 & 0.7065 & 0.7456 & 0.7774 \\ \cline{1-1}  & DCGH (present study) & **0.8108** & **0.8297** & **0.8413** & **0.7014** & **0.7153** & **0.7329** & **0.7072** & **0.7536** & **0.7786** \\ \hline \hline \end{tabular}
\end{table} 
Table 6: mAP results of DCGH and its variants on MIRFLICKR-25K, NUS-WIDE, and MS COCO. The best results are shown in bold. ### Training and Encoding Time

To investigate the efficiency of the model, we compared the training time and encoding time of the DCGH algorithm with other Transformer-based cross-modal hashing algorithms on the MIRFLICKR-25K dataset using 32-bit binary codes, with the results shown in Figure 10. During the optimization of the DCGH model, a proxy loss algorithm was proposed, which has a time complexity of \(O(NC)\), and \(C\) is the number of categories. Additionally, the time complexities for the pairwise loss and variance constraint were \(O(N^{2})\) and \(O(\lambda NC)\), respectively. Here, \(\lambda\) represents the ratio of the number of related data-proxy pairs to the total number of data-proxy pairs, with \(\lambda\) being less than 1. Therefore, the total time complexity of our algorithm is \(O\big{(}NC+\lambda NC+N^{2}\big{)}\), which is approximately equal to \(O(N^{2})\). As shown in Figure 10a, compared with several other state-of-the-art methods, our training time is average, and since the training process of these methods is offline, the training time does not affect the performance of the method. As shown in the comparison of encoding time in Figure 10b, the encoding time of all methods is within the millisecond range, indicating that our method achieves comfortable encoding time. Figure 10: Training time and Encoding time of DCGH on MIRFLICKR-25K. (**a**) Training time. (**b**) Encoding time. Figure 9: Parameter sensitivity of \(\alpha\) and \(\beta\) on the MIRFLICKR-25K, NUS-WIDE, and MS COCO datasets. The code length is 64. ### Visualization

To explore the ability of our model to bridge the semantic gap between different modalities, we used the T-sne [51] technique to project discrete hash codes into a two-dimensional space on three public datasets. As shown in Figure 11, different colored points represent data from different modalities. As we can see, the data from the text modality and the image modality are aligned very well. To explore the quality of the hash codes and the intra-class aggregation, we selected samples from seven different single-label categories in the NUS-WIDE dataset and performed T-sne visualization on 16-bit hash codes using the DCHMT, SCH, and DCGH methods. The results are shown in Figure 12; the different colored dots represent different single-label category data. Through comparison and analysis, we can see that our method can obtain higher quality and more intra-class aggregated binary hash codes due to the joint training of the model with proxy loss, pairwise loss, and variance constraint terms.