A shopper uploads a photo and wants similar products that are currently available.
Connect image embeddings to catalog freshness, attribute constraints, and relevance evaluation.
01. Define what similar means
A photo may express category, shape, color, brand, or a specific item. Clarify whether the system should find duplicates, visually similar alternatives, or products matching both image and text. These are distinct retrieval goals.
Start with a pretrained image representation and a nearest-neighbor baseline. A text–image model can support combined language and visual queries, but general semantic similarity does not guarantee fine-grained catalog relevance. Evaluate on your product domain before choosing a representation.
02. Build the ingestion and query paths
Catalog ingestion validates images, extracts item metadata, computes embeddings, and publishes versioned index snapshots. A query service validates the uploaded image, generates its embedding, retrieves candidates, and reranks using attributes and business eligibility.
Keep item IDs separate from image IDs because an item may have several views. Deduplicate near-identical results and aggregate image matches to product results. Apply current inventory and visibility rules before responding; a vector match alone is not authorization to show a product.
03. Estimate capacity and freshness
For 10 million images with 512-dimensional float32 vectors, raw vector storage is 20.48 GB. Index structures, metadata, replicas, and multiple versions add to that figure. Compression trades retrieval fidelity for memory; measure exact-versus-approximate recall on representative queries.
New products should enter a small update index while a larger snapshot is rebuilt, if the chosen index design supports that approach. Merging candidate lists must use compatible scores. Switching the encoder without rebuilding compatible item vectors can silently destroy relevance.
04. Evaluate ambiguous queries and failure cases
Use human judgments that distinguish exact product matches from acceptable alternatives. Report retrieval recall, ranking quality, availability, and performance across lighting, backgrounds, occlusion, and product categories. Clicks alone are affected by position and exposure.
A photo containing several objects may require the user to select the intended object, or a detector to propose regions. If the upload cannot be processed, retain a text-search path. Follow-up: when color dominates but users care about shape, adjust supervision and evaluation rather than assuming a larger index will fix the objective.
Practice the follow-up
Describe how you would distinguish a model relevance failure from an approximate-index recall failure.
Connect this to embedding geometry.
Sources & further reading
Radford et al.: language-supervised visual models. The interview scenario, calculations, and proposed design choices are illustrative.
Continue your preparation
Choose a connected learning path or browse more ML system design questions. Read our editorial method and attribution policy.