HACKER Q&A
📣 mgl

How to build an image search service?


What are the modern and practical image hashing algorithms which can be used to build an image search engine from scratch?


  👤 dropbox_miner Accepted Answer ✓
Don't do image hashing please. Do this:

1. Get CLIP embeddings for text & images 2. Put them in a vector database (Pinecone.io or something similar)

It's unreasonably effective. Checkout this search engine: https://same.energy/


👤 james-revisoai
Here are the types of images your users might be searching for:

Examples of a class of objects - say "Lion" - your best friend is CLIP, trained on captions and naturally weighted towards popular images.

Conceptual ideas, abstract levels - 'Beautiful painting' - CLIP is ok here, but it's not really optimised for that and most 'beautiful paintings' are not labelled as such, but rather something like 'Glowing fields of joy'. Fear not, Conceptual-CLIP has your back! It can nab these.

Diagrams/slides/technical/things with text - Your SOL beyond word match, tbh. If your image doesn't have words, maybe OCR it?

Pictures of specific things like people or logos - to "find similar" you'll want to embed old style image features like corners, SIFT features etc. Note that an iceberg with a clear sky is identical to a desert with a clear sky to this approach.


👤 kacperlukawski
Let me share an article I wrote: https://medium.com/@lukawskikacper/how-to-implement-a-visual... It uses Qdrant and ResNet embeddings to do that. Sources are included if you want to go straight to the implementation.

Qdrant is a Rust-based vector database: https://qdrant.tech/ According to benchmarks that's the fastest vector DB available.



👤 goodSteveramos
Take a look at SIFT and SURF for reverse image search or image comparison.

https://en.m.wikipedia.org/wiki/Scale-invariant_feature_tran...

If you want to search with a natural language description then you will need to tag your images or use object detection to generate tags.


👤 agencies
Here's a write-up from a relatively small/personal perspective

https://blog.qwertyforce.dev/posts/similar_image_search