Skip to content

SYS-02 · Stats AI · 2026

Multimodal Reverse Image Search

A reverse image search system that finds visually similar animals from either a photo or a text description — CLIP embeddings, nearest-neighbour search in Qdrant Cloud, and an LLM-written summary of the match.

ROLE — Contributor — embedding pipeline, vector search, search logic, LLM layer and Streamlit app

animal images indexed
5,000+
search modes: text & image
2
nearest neighbours per query
16
LLM fallback tiers
3

Sub-systems

  1. MOD-015,000+ images

    Embedding pipeline

    CLIP ViT-B/32 embeddings generated for 5,000+ animal images in Google Colab and uploaded to Qdrant Cloud, with image path and animal type stored as payload.

  2. MOD-02top-16 results

    Vector similarity search

    The query embedding runs a nearest-neighbour search in Qdrant; the animal type is read from the top result's payload and matching images are resolved from their stored paths.

  3. MOD-032 modes

    Multimodal queries

    The same CLIP model embeds either a selected image or typed text into one shared space, so a single index serves both image-to-image and text-to-image search.

  4. MOD-043-tier fallback

    LLM summary layer

    LangChain calls Google Gemini for a 100-word summary of the identified animal, falling back to Gemini 2.5 Flash and then Groq (Llama 3.1 8B) if a provider fails.

Overview

A visual search application: pick an animal image or type an animal's name, and the system returns the most similar images from its index, identifies the animal, and — when an LLM key is available — writes a short summary about it.

Architecture

  • Offline: CLIP embeddings for the image set computed in Google Colab and uploaded to a Qdrant Cloud collection.
  • Query: the selected image or the entered text is encoded into a query embedding with the same CLIP model.
  • Retrieval: nearest-neighbour similarity search in Qdrant returns the top 16 matches with their payloads.
  • Resolution: the animal type comes from the first result's payload; images are loaded from the stored image paths.
  • Generation: the identified animal is passed to an LLM (Gemini, with Gemini 2.5 Flash and Groq Llama 3.1 fallbacks) for a summary.
  • Interface: a Streamlit app with image and text search inputs and a results grid.

Engineering decisions

  • One CLIP model for both images and text, so a single vector index powers two search modes.
  • Embeddings are precomputed offline; at runtime the app only needs to embed the query.
  • Image path and animal type live in the Qdrant payload, so every result resolves directly to an image and a label.
  • An ordered LLM provider fallback chain keeps summaries available when one provider fails.
  • Model, embeddings and the database client are loaded once and cached with Streamlit resource caching.

Technology

  • Python
  • CLIP (ViT-B/32)
  • sentence-transformers
  • PyTorch
  • Qdrant Cloud
  • LangChain
  • Google Gemini
  • Groq (Llama 3.1)
  • Streamlit
  • Google Colab