Downloads · 30 days
0
KrIthIn-108/fashion-product-classifier-vit
fashion-product-classifier-vit is a machine learning model from KrIthIn-108. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This repository contains a custom multi-task Vision Transformer (ViT) fine-tuned for fashion product attribute classification.
Downloads · 30 days
0
Access
Public
Updated Sep 15, 2026
Repo size
1 GB
Likes
1
Public
Click a slice to open those files.
.pth1 GB · 100%
From the Hugging Face model README
This repository contains a custom multi-task Vision Transformer (ViT) fine-tuned for fashion product attribute classification.
The pretrained base model used is:
google/vit-base-patch16-224
The original pretrained ViT provides the shared visual representation. Its weights were then fine-tuned on the cleaned Fashion Product Images (Small) dataset to adapt the model specifically for fashion product labeling.
The model uses a shared ViT backbone with five task-specific classification heads.
Input Image
│
│ 224 × 224 RGB
▼
┌──────────────────────────────┐
│ google/vit-base-patch16-224 │
│ Shared ViT Backbone │
└──────────────┬───────────────┘
│
│ 768-dimensional features
▼
┌────────┼────────┬────────────┬───────────┐
▼ ▼ ▼ ▼ ▼
Master SubCategory ArticleType BaseColour Usage
Head Head Head Head Head
│ │ │ │ │
▼ ▼ ▼ ▼ ▼
4 cls 26 cls 54 cls 46 cls 7 cls
224 × 224The model produces five independent classification outputs from the same shared visual representation:
| Task | Number of Classes |
|---|---|
| Master Category | 4 |
| Sub Category | 26 |
| Article Type | 54 |
| Base Colour | 46 |
| Usage | 7 |
This design allows a single image to receive multiple related fashion attributes in one forward pass.
The model was not trained from scratch.
Instead:
google/vit-base-patch16-224.The final checkpoint therefore represents the fine-tuned custom multi-task model, not the original Google ViT checkpoint.
Training was performed in Google Colab using a Tesla T4 GPU.
Main configuration:
Optimizer : AdamW
ViT learning rate : 2e-5
Classification heads LR : 1e-4
Weight decay : 0.01
Batch size : 32
Epochs : 4
Mixed precision (AMP) : Enabled
Scheduler : CosineAnnealingLR
Early stopping : Used
The final class-weighted model achieved:
Average Test Macro F1: 75.45%
Task-level Macro F1:
Master Category : 99.91%
Sub Category : 92.21%
Article Type : 88.37%
Base Colour : 37.50%
Usage : 59.28%
Macro F1 was used as the primary comparison metric because the dataset contains significant class imbalance.
The model is designed for fashion product image labeling, particularly for e-commerce and online catalog workflows.
Given a product image, it can automatically generate structured fashion attributes such as:
{
"masterCategory": "...",
"subCategory": "...",
"articleType": "...",
"baseColour": "...",
"usage": "..."
}
The application layer built around this model additionally supports Top-K predictions with confidence scores.
This model is a classifier, not an object detector.
It is designed primarily for one fashion product per image. Images containing multiple products or complete outfits may produce mixed or ambiguous predictions because the model generates one set of attributes for the complete image.
The associated application also uses a separate CLIP-based clothing/non-clothing guardrail before sending an image to this ViT classifier. CLIP is not part of this uploaded ViT checkpoint.
The uploaded checkpoint:
class_weighted_vit_model.pth
contains the trained state of the custom multi-task ViT, including the fine-tuned backbone and task-specific classification heads.
This model is intended for: