Collect item imagery and metadata
Assemble a catalogue of item images and any available metadata, and standardise image sizes and formats before embedding.
Recommend by visual similarity. Inspect nearest-user preferences.
Visual recommendation systems use item visual features (for example image embeddings) combined with behavioural signals to suggest items that look similar or match user taste. Key engineering concerns include building reliable embeddings, scalable nearest-neighbour search, cold-start for new items, and evaluation with ranking metrics such as precision@K and NDCG.
Learning concept · Not a validated service
Visual recommendation systems use item visual features (for example image embeddings) combined with behavioural signals to suggest items that look similar or match user taste. Key engineering concerns include building reliable embeddings, scalable nearest-neighbour search, cold-start for new items, and evaluation with ranking metrics such as precision@K and NDCG.
A proposed application: surface visually similar catalogue items to shoppers who expressed interest in an image, while keeping a human-curated review in the loop for safety and merchandising rules. This starter code does not include image processing or production search components.
Assemble a catalogue of item images and any available metadata, and standardise image sizes and formats before embedding.
Extract image embeddings using a pre-trained CNN or a dedicated image model and store them for fast retrieval.
Start with nearest-neighbour retrieval (Faiss or cosine similarity) over embeddings and optionally re-rank using purchase signals or business rules.
Measure precision@K and NDCG on held-out interactions and inspect visual mismatches, cold-start and catalogue duplicates manually.
The supplied starter constructs a small user-item rating table, computes cosine similarity between users, finds the most similar user to a target, and recommends items that the neighbour rated but the target user has not seen. It uses only numeric ratings and no visual features or image embeddings.
matrix = ratings.pivot_table(index="user", columns="item", values="rating").fillna(0)
user_similarity = pd.DataFrame(
cosine_similarity(matrix),
index=matrix.index,
columns=matrix.index,
)The code implements a simple user-based collaborative filtering baseline using explicit ratings; it contains no image loading, feature extraction, or visual embeddings, so it does not implement visual recommendation as titled. The tiny hard-coded dataset and single neighbour lookup cannot validate ranking metrics or production behaviour.
A proposed extension is to replace the rating table with an item image corpus, compute image embeddings (for example with a ResNet or CLIP model), use Faiss for nearest-neighbour retrieval, and combine visual similarity with purchase or click signals for ranking.
This is a potential application pathway, not a delivered product. The supplied starter does not implement this service or validate it with real users.
Networkers Home runs this topic inside its AI Engineer Course, with placement support and hands-on labs.