thanks for your interests in our work. I am one of the author for this work.
During training mode, our model learns to output orthogonal codes for every class (highly discriminative binary codes), very similar to discriminative face recognition model (e.g., CosFace1). Hence for out-of-sample, we just compute the hash codes of any given input.
For out-of-sample problem, there will be two case:
The data is within trained class:
The algorithm will retrieve the images with nearest hash codes. In our algorithm, the trained model is used to extract representative hash code for the query image. This will take not more than 10ms on decent GPU.
Then, we compute the hamming distance with all other hash codes in the database to find nearest match (which has shortest distance). This will take not more than 5ms on decent CPU using faiss
library with IndexBinaryFlat
, at 100k scale database. Further, for larger scale data (e.g. 1B scale), Approximate Nearest Neighbour search would be useful (see IndexBinaryIVF
in faiss
library).
The data is out of trained class:
As other supervised method, the algorithm is suboptimal on non-trained class. The time complexity is similar to previous case.
Hope this answer your questions.