Multi-Task Image Classification
One ResNet-50 backbone, four classification heads: colour, type, season and gender from a single product shot.

What it is
What it does
Instead of four separate models, a shared ImageNet-pretrained ResNet-50 feeds four linear heads that predict product attributes simultaneously. The notebook covers the full loop: EDA, label encoding, training, evaluation and inference on live Amazon listings pulled straight off the web.
Why it exists
I didn't want four models for four labels on the same dress (colour, type, season, category). One backbone sees the fabric once; four tiny heads vote. Less training, same signal, and the seasonal correlation actually helps.
Repo Amit-kr26/Multi-Task-Image-ClassificationStack PyTorch · ResNet-50 · Multi-Task Learning · torchvision
How it is built
Four-task heads
MultiTaskModel replaces ResNet-50's fc with Identity and attaches Linear heads for gender (5 classes), baseColour (44), season (4) and articleType (119).
Balanced data prep
The Kaggle Fashion Product Images dataset is null-filtered across all four label columns and sampled to 5,000 rows (seed 42), split 4,000 train / 1,000 test.
Deliberately light transforms
Resize to 224×224, ImageNet normalisation, nothing else. Augmentation was skipped so head-level differences stay attributable to the multi-task setup rather than preprocessing luck. A custom Dataset wrapper skips missing image files by index-wrapping instead of crashing.
Joint loss
Training minimises the unweighted sum of four CrossEntropyLoss terms. Simple, and enough since heads share the backbone rather than competing gradients.
Out-of-distribution check
Final cells fetch real Amazon product photos via requests + PIL and decode predictions end to end, an honest test beyond the held-out split.
How the pieces connect
Drawing is wider than the frame. Drag to pan.
Also filed under ML / DL