Here the normalization terms of cosine similarity (L2 norm) and GAP are included in \(Z\) . We use \((i,j)\)  and \((x,y)\)  for different streams because some applications such as cross-view image retrieval [1]} may have different image sizes for two streams. \(A\)  denotes the feature map of the last convolutional layer. The superscripts \(q\)  and \(r\)  respectively denote the query and retrieved images in this paper. For each query point \((i,j)\)  in the query image, the corresponding point-specific activation map in the retrieved image is given by \(\sum _{k}A^{q}_{i,j,k}A^{r}_{x,y,k}\)  which is the contribution of features at \((i,j,x,y)\)  to the overall cosine similarity. Like CAM and Grad-CAM, bilinear interpolation is implemented to generate the contribution of each pixel pair and the full resolution map. The overall activation maps of two images are generated by a simple summation along \((i,j)\)  or \((x,y)\) , e.g. \(\sum _{i,j}(\sum _{k}A^{q}_{i,j,k}A^{r}_{x,y,k})\) . Although we only show the positive activation in the map, the negative value is also available for counterfactual explanation like [2]}.
