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
- 01
Preprocess DeepFashion
Crop garments with the dataset's bounding boxes, split train/val/test and build category + attribute labels.
- 02
Train ResNet
Train a ResNet classifier in TensorFlow with training-time augmentation and configurable hyperparameters.
- 03
Extract embeddings
Use the network's feature layer as a compact descriptor of fabric, style and pattern.
- 04
Recommend by similarity
Nearest-neighbor search over the embeddings returns the most visually similar items.
Model results
Tech stack
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.





