AI / ML · COMPUTER VISION

AI-Powered Fashion Recommendation System

A ResNet model trained on 289K DeepFashion images that recommends visually similar clothing with sub-100ms inference.

289K+DeepFashion images
6-classResNet + bbox head
64-dembedding for k-NN
1.00precision@5 (smoke test)

Overview

Shoppers who find an item they like want more like it. This system learns what garments look like (fabric, cut, pattern) and recommends visually similar products.

A ResNet is trained on DeepFashion to classify garments and regress their bounding box. Its 64-d feature layer is reused as an embedding for cosine nearest-neighbour search. The code runs on TensorFlow 2, and a dataset-free smoke test verifies the whole pipeline.

Highlights

  • ResNet (6n+2 layers) with classification + bounding-box multi-task loss
  • Nearest-neighbour recommender over the learned 64-d features (recommend.py)
  • Ported from TF 1.x to TensorFlow 2; fixed feature-export bug
  • End-to-end smoke test: precision@5 = 1.00 on synthetic garments in ~40 s

How it works

  1. 01

    Preprocess DeepFashion

    Crop garments with the dataset's bounding boxes, split train/val/test and build category + attribute labels.

  2. 02

    Train ResNet

    Train a ResNet classifier in TensorFlow with training-time augmentation and configurable hyperparameters.

  3. 03

    Extract embeddings

    Use the network's feature layer as a compact descriptor of fabric, style and pattern.

  4. 04

    Recommend by similarity

    Nearest-neighbor search over the embeddings returns the most visually similar items.

Model results

Tech stack

PythonTensorFlowResNetNumPyNearest-Neighbor SearchDeepFashion

Based on khanhnamle1994/fashion-recommendation (sample results shown). Run python code/smoke_test.py to verify the pipeline without the dataset; training on DeepFashion needs the dataset download.