spectral hashing based training