1 Ilyass Moummad, 1,2 Kawtar Zaher, 3 Lukas Rauch, 1 Alexis Joly
1 INRIA, LIRMM, Université de Montpellier, France
2 Institut National de l’Audiovisuel, France
3 University of Kassel, Germany
This repository demonstrates a simple, training-free baseline for retrieval of images and audio. It works by combining deep pre-trained features with traditional hashing steps — PCA, random orthogonal projection, and a thresholding operation — to produce compact binary codes.
The resulting Hashing-Baseline produces compact binary codes that:
This setup provides a straightforward reference for comparing more complex or learned hashing methods on large datasets.
The Hashing-Baseline pipeline consists of four main steps:
Feature Extraction
Extract high-dimensional features from images or audio using pre-trained models.
Dimensionality Reduction with PCA
Apply Principal Component Analysis (PCA) to reduce feature dimensionality while retaining key semantic information.
Random Orthogonal Projection and Binarization
Project PCA-reduced features with a random orthogonal matrix and binarize by checking whether values are greater than 0, resulting in compact 16-bit hash codes.
Retrieval
Perform similarity search in Hamming space using the binary codes.
This simple pipeline shows that even standard hashing techniques can preserve semantic similarity when applied on strong pretrained features, without any additional training.
The figure below shows two query images from the Flickr25K dataset and their 5 nearest neighbors, retrieved using features from a SimDINO ViT-B/16 model pretrained on ImageNet-1K (100 epochs).
This demonstrates that Hashing-Baseline preserves semantic similarity, even with compact 16-bit codes.
image/ — Contains code for image retrieval hashing.
Supports datasets: cifar10, flickr25k, and coco.
Supported models: dfn and DINOv2/SimDINOv2 via their checkpoints (.pth).
See image/README.md for detailed instructions.
audio/ — Contains code for audio retrieval hashing.
Supports datasets: esc50, gtzan, and speechcommands.
Supports models: clap, ced, and dasheng.
See audio/README.md for detailed instructions.
git clone https://github.com/ilyassmoummad/hashing-baseline
cd hashing-baseline
python -m venv envhashingbaseline
source envhashingbaseline/bin/activate
python -m pip install -r requirements.txt
image or audio).@misc{hashingbaseline,
title={Hashing-Baseline: Rethinking Hashing in the Age of Pretrained Models},
author={Ilyass Moummad and Kawtar Zaher and Lukas Rauch and Alexis Joly},
year={2025},
eprint={2509.14427},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2509.14427},
}
5 commits
Python
100.0%
1 Ilyass Moummad, 1,2 Kawtar Zaher, 3 Lukas Rauch, 1 Alexis Joly
1 INRIA, LIRMM, Université de Montpellier, France
2 Institut National de l’Audiovisuel, France
3 University of Kassel, Germany
This repository demonstrates a simple, training-free baseline for retrieval of images and audio. It works by combining deep pre-trained features with traditional hashing steps — PCA, random orthogonal projection, and a thresholding operation — to produce compact binary codes.
The resulting Hashing-Baseline produces compact binary codes that:
This setup provides a straightforward reference for comparing more complex or learned hashing methods on large datasets.
The Hashing-Baseline pipeline consists of four main steps:
Feature Extraction
Extract high-dimensional features from images or audio using pre-trained models.
Dimensionality Reduction with PCA
Apply Principal Component Analysis (PCA) to reduce feature dimensionality while retaining key semantic information.
Random Orthogonal Projection and Binarization
Project PCA-reduced features with a random orthogonal matrix and binarize by checking whether values are greater than 0, resulting in compact 16-bit hash codes.
Retrieval
Perform similarity search in Hamming space using the binary codes.
This simple pipeline shows that even standard hashing techniques can preserve semantic similarity when applied on strong pretrained features, without any additional training.
The figure below shows two query images from the Flickr25K dataset and their 5 nearest neighbors, retrieved using features from a SimDINO ViT-B/16 model pretrained on ImageNet-1K (100 epochs).
This demonstrates that Hashing-Baseline preserves semantic similarity, even with compact 16-bit codes.
image/ — Contains code for image retrieval hashing.
Supports datasets: cifar10, flickr25k, and coco.
Supported models: dfn and DINOv2/SimDINOv2 via their checkpoints (.pth).
See image/README.md for detailed instructions.
audio/ — Contains code for audio retrieval hashing.
Supports datasets: esc50, gtzan, and speechcommands.
Supports models: clap, ced, and dasheng.
See audio/README.md for detailed instructions.
git clone https://github.com/ilyassmoummad/hashing-baseline
cd hashing-baseline
python -m venv envhashingbaseline
source envhashingbaseline/bin/activate
python -m pip install -r requirements.txt
image or audio).@misc{hashingbaseline,
title={Hashing-Baseline: Rethinking Hashing in the Age of Pretrained Models},
author={Ilyass Moummad and Kawtar Zaher and Lukas Rauch and Alexis Joly},
year={2025},
eprint={2509.14427},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2509.14427},
}
5 commits
Python
100.0%