## 3 Proposed Method
### Multi-Attack Reference Hashing
**Fixing** all variables but **optimize**\(\mathbf{\tilde{U}}\): The optimization problem (Equation (4)) reduces to:  
\[min\,J(\mathbf{\tilde{U}}^{v})=\alpha||\mathbf{\tilde{X}}-\mathbf{\tilde{U}} \mathbf{X}||_{F}^{2}+\beta||\mathbf{\tilde{U}}||_{F}^{2}-\gamma\mathbf{tr}( \mathbf{\tilde{U}}\mathbf{X}\mathbf{X}^{\mathrm{T}}\mathbf{\tilde{U}}^{ \mathrm{T}}). \tag{5}\]  
By setting the derivation \(\frac{\partial J(\mathbf{\tilde{U}})}{\partial\mathbf{\tilde{U}}}\)=0, we have:  
\[\mathbf{\tilde{U}}=\mathbf{\tilde{X}}\mathbf{X}^{\mathrm{T}}((\alpha-\gamma) \mathbf{X}\mathbf{X}^{\mathrm{T}}+\beta\mathbf{I})^{-1}. \tag{6}\]  
**Fix** all variables but **optimize**\(\mathbf{\tilde{X}}\): Similarly, we solve the following optimization problem:  
\[min\,F(\mathbf{\tilde{X}})=\alpha||\mathbf{\tilde{X}}-\mathbf{\tilde{U}} \mathbf{X}||_{F}^{2}+\lambda||\mathbf{\tilde{X}}-\mathbf{C}\mathbf{G}||_{F}^{ 2}, \tag{7}\]  
Figure 2: The examples of hash clusters. which has a closed-form optimal solution:  
\[\mathbf{\tilde{X}}=\alpha\mathbf{\tilde{U}}\mathbf{X}+\lambda\mathbf{C}\mathbf{G}. \tag{8}\]  
**Fix** all variables but \(\mathbf{C}\) and \(\mathbf{G}\): For the cluster centroid \(\mathbf{C}\) and indicator \(\mathbf{G}\), we obtain the following problem:  
\[J_{1}(\mathbf{\tilde{U}},\mathbf{\tilde{X}})=\alpha(||\mathbf{\tilde{X}}- \mathbf{\tilde{U}}\mathbf{X}||_{F}^{2}+\beta||\mathbf{\tilde{U}}||_{F}^{2}), \tag{1}\]0  
Inspired by the optimization algorithm ADPLM (adaptive discrete proximal linear method) [45], we initialize \(\mathbf{C}=\mathbf{\tilde{X}}\mathbf{G}^{\mathrm{T}}\) and update \(\mathbf{C}\) as follows:  
\[J_{1}(\mathbf{\tilde{U}},\mathbf{\tilde{X}})=\alpha(||\mathbf{\tilde{X}}- \mathbf{\tilde{U}}\mathbf{X}||_{F}^{2}+\beta||\mathbf{\tilde{U}}||_{F}^{2}), \tag{1}\]1 \[J_{1}(\mathbf{\tilde{U}},\mathbf{\tilde{X}})=\alpha(||\mathbf{\tilde{X}}- \mathbf{\tilde{U}}\mathbf{X}||_{F}^{2}+\beta||\mathbf{\tilde{U}}||_{F}^{2}), \tag{1}\]2 \[J_{1}(\mathbf{\tilde{U}},\mathbf{\tilde{X}})=\alpha(||\mathbf{\tilde{X}}- \mathbf{\tilde{U}}\mathbf{X}||_{F}^{2}+\beta||\mathbf{\tilde{U}}||_{F}^{2}), \tag{1}\]3  
where \(X_{w}=0.950456\), \(Y_{w}=1.0\) and \(Z_{w}=1.088754\) are the CIE XYZ tristimulus values of the reference white point, and \(f(t)\) is determined by:  
\[f(t)= \begin{cases}t^{1/3},&\text{if }t>0.008856\\ 7.787t+16/116,&\text{otherwise}\end{cases} . \tag{16}\]  
Figure 3 illustrates an example of the preprocessing. Let us say we have \(N\) images in our training set. Select \(L\) images as labeled images, \(L\ll N\). The features of a single image are expressed as \(\mathbf{x}\in\mathbb{R}^{M}\), where \(M\) is the extracted feature length. The features of all images are represented as \(\mathbf{X}=\{\mathbf{x}_{1},\mathbf{x}_{2},...,\mathbf{x}_{N}\}\), where \(\mathbf{X}\in\mathbb{R}^{M\times N}\). The features of labeled images are represented as \(\mathbf{X}\in\mathbb{R}^{M\times L}\). Note that these feature matrices are normalized to zero-centered. The goal of our algorithm is to learn hash functions that map \(\mathbf{X}\in\mathbb{R}^{M\times N}\) to a compact representation \(\mathbf{H}\in\mathbb{R}^{K\times N}\) in a low-dimensional Hamming space, where \(K\) is the digits length. Our hash function is defined as:  
\[\mathbf{H}=\mathbf{W}^{\text{T}}\mathbf{X}. \tag{17}\]  
The hash function of a single image is defined as:  
\[\mathbf{h_{i}}=\mathbf{W}^{\text{T}}\mathbf{x}_{i}. \tag{18}\]  
In order to learn a \(\mathbf{W}\) that is simultaneously maximizing the empirical accuracy on the labeled image and the variance of hash bits over all images, the empirical accuracy on the labeled image is defined as:  
\[P_{1}(\mathbf{W})=\sum_{(\mathbf{x}_{i},\mathbf{x}_{j})\in\mathcal{S}}\mathbf{ E}_{ij}\mathbf{h_{i}}\mathbf{h_{j}}-\sum_{(\mathbf{x}_{i},\mathbf{x}_{j})\in \mathcal{D}}\mathbf{E}_{ij}\mathbf{h_{i}}\mathbf{h_{j}}, \tag{19}\]  
where matrix \(\mathbf{E}\) is the classification of marked image pairs, as follows:  
\[\mathbf{E}(i,j)=