All projects

Search by picture · 2025

Image Retrieval System

You give it one photo and it ranks 10,000 others by how similar they look. It uses no labels and no deep learning, just a careful description of each image and a way of measuring how far apart two descriptions are.

78% top-5 recall on 10,000 images

Step 1 · describe

Describing an image

A computer can't compare two photos directly. So I cut each image into a grid and reduced every cell to its average colour. Put those colours one after another and the photo becomes a list of numbers, called a descriptor.

Two photos with similar descriptors have similar colours in similar places. That is what makes it work, and also its biggest weakness.

The colours are the real averages from this photo. The grid is simplified to 4 by 4 to show the idea.

Step 2 · compare

Measuring similarity

The same descriptors give different results depending on how you measure the distance between them, so I tried several and compared them.

Step 3 · look at what comes back

Results

Results are shown exactly as the system returned them, best match on the left. The photos come from the research image set the project was tested on.

Design

System design

  1. Extractorturns each image into a descriptor
  2. Indexstores all 10,000 descriptors
  3. Rankermeasures distance and sorts
  • Python
  • MATLAB

I built the extractor, index and ranker as separate parts. That meant I could change the descriptor without touching the ranking, or swap the distance measure without rebuilding the index, and test each change on its own.

A content-based image retrieval system achieving 78% top-5 recall on a 10,000-image dataset, using descriptor-based feature extraction and cosine similarity ranking.

  • Feature extractor, index and ranker built as independent components, allowing isolated parameter tuning at each stage