Instructions to use mohsin416/fashion-attribute-lab with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mohsin416/fashion-attribute-lab with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="mohsin416/fashion-attribute-lab") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("mohsin416/fashion-attribute-lab", dtype="auto") - Notebooks
- Google Colab
- Kaggle
Fashion Attribute Lab
Fashion Attribute Lab is an experimental multi-task computer-vision checkpoint for fashion product attribute extraction.
The model predicts seven attributes from a product image:
- Gender
- Master category
- Subcategory
- Article type
- Base colour
- Season
- Usage
Model Status
This repository contains an experimental checkpoint, not the primary production model.
The experiment investigates whether spatial colour features, mild class balancing, test-time augmentation, and validation-tuned consistency thresholds can improve an already strong fashion attribute classifier.
Architecture
The model uses:
- CLIP ViT-B/32 image encoder
- Seven task-specific classification heads
- Global HSV and RGB colour statistics
- Spatial colour-grid features
- Hierarchical residual connections
- Article-type-to-gender residual connection
- Validation-selected test-time augmentation
- Lightweight consistency correction
Dataset
ashraq/fashion-product-images-small
| Split | Percentage |
|---|---|
| Training | 70% |
| Validation | 15% |
| Test | 15% |
The held-out test set contains 6,611 images.
Corrected Test Metrics
| Metric | Result |
|---|---|
| Average Accuracy | 87.87% |
| Average Macro F1 | 67.94% |
| Average Weighted F1 | 87.47% |
| Average Top-3 Accuracy | 98.13% |
| Exact-Match Accuracy | 41.75% |
| Test Samples | 6,611 |
Exact-match accuracy requires all seven attributes to be correct for the same image.
Per-Attribute Results
| Attribute | Accuracy | Macro F1 | Weighted F1 | Top-3 Accuracy |
|---|---|---|---|---|
| Gender | 91.98% | 81.11% | 91.79% | 99.76% |
| Master Category | 99.56% | 86.59% | 99.47% | 99.94% |
| Subcategory | 96.58% | 76.25% | 96.41% | 99.71% |
| Article Type | 88.49% | 66.56% | 87.81% | 98.12% |
| Base Colour | 70.29% | 37.05% | 69.05% | 90.55% |
| Season | 76.06% | 77.31% | 75.92% | 99.02% |
| Usage | 92.10% | 50.74% | 91.83% | 99.83% |
Raw Model Metrics
The following metrics were calculated before consistency correction.
| Metric | Result |
|---|---|
| Average Accuracy | 87.84% |
| Average Macro F1 | 67.61% |
| Average Weighted F1 | 87.45% |
| Average Top-3 Accuracy | 98.13% |
| Exact-Match Accuracy | 41.48% |
Raw and corrected metrics are reported separately for transparency.
Inference Configuration
- Test-time augmentation enabled:
True - Consistency thresholds selected using validation data only
- Final test data was not used for threshold selection
- Single-image average latency: 12.92 ms
- Single-image P95 latency: 13.74 ms
- Latency measured on an NVIDIA Tesla P100 GPU
Production Decision
This experimental checkpoint achieved measurable but relatively small gains over the existing production checkpoint.
The simpler production model was retained because it provides nearly equivalent predictive performance with:
- Lower inference latency
- A simpler inference pipeline
- Lower deployment complexity
- Easier maintenance
- Better alignment with the existing application
This repository is preserved as an optimization experiment and reproducible research checkpoint.
Repository Files
model.pt
config.json
label_maps.json
consistency_rules.json
consistency_thresholds.json
metrics.json
README.md
Loading
This repository contains a custom PyTorch architecture and cannot be loaded directly with AutoModelForImageClassification.from_pretrained().
The project implementation must:
- Load
config.json - Load
label_maps.json - Initialize
AutoCatalogFinalClassifier - Load
model.pt - Generate global and spatial colour features
- Apply TTA when enabled
- Optionally apply the saved consistency thresholds
Intended Use
This checkpoint is intended for:
- Fashion attribute-classification experiments
- Multi-task learning analysis
- Colour-feature research
- Test-time augmentation evaluation
- Performance-versus-latency comparisons
- Reproducible portfolio experimentation
Limitations
- Rare colour and usage classes remain difficult
- Base-colour labels may be visually ambiguous
- TTA increases single-image inference latency
- Performance may decrease on marketplace images outside the training distribution
- Season and usage are not always directly visible from an image
- The model is not intended to infer personal attributes about people
The gender label represents the dataset's product-target category, not the gender of a person.
Version
Name: AutoCatalogAI
Version: spatial-tta-experiment
Role: Experimental checkpoint
Architecture: AutoCatalogFinalClassifier
Base encoder: openai/clip-vit-base-patch32
TTA: True
Test samples: 6,611
- Downloads last month
- -
Model tree for mohsin416/fashion-attribute-lab
Base model
openai/clip-vit-base-patch32