Handbag attribute CNN trained from scratch
One custom CNN with four convolutional blocks (8,16,32,64 channels), GroupNorm/ReLU, a shared 128-unit dense layer, and ten classification heads. No pretrained weights or pretrained features. Every parameter was trained. Inputs are 96ร96 grayscale sketches, white-padded and normalized to [-1,1]. Predictions return classes and uncalibrated softmax confidence.
Measured results
Mean attribute test accuracy: 44.87%. Mean macro F1: 0.385. All ten attributes correct: 0.0%.
| Attribute | Accuracy | Macro F1 |
|---|---|---|
| angle | 86.8% | 0.868 |
| bag_type | 75.0% | 0.722 |
| strap_type | 61.8% | 0.582 |
| closure | 28.9% | 0.233 |
| hardware | 42.1% | 0.297 |
| material | 30.3% | 0.148 |
| color | 13.2% | 0.058 |
| structure | 31.6% | 0.305 |
| shape | 25.0% | 0.204 |
| size | 53.9% | 0.432 |
Test comprises 41 original sketches from 21 bags. Color and material are often not observable from line drawings. Unseen holdout labels count as errors. Augmented rows do not represent independent bags.
Split and training
Dataset: kwongnon/handbag-sketch-dataset-100x, revision 98d85555d5f2e6d782599b8c73f0d27ff4c67456. Training: 19,300 rows from 193 original sketches/97 bags; validation: 42 originals/21 bags; test: 41 originals/21 bags. All variants stay with their parent bag. Bag IDs, parents, URLs, sketch hashes and original photo duplicates are audited across splits. Only sketches enter the model.
Two AdamW configurations trained from random initialization, maximum 35 epochs and patience six. Selection used validation mean macro F1. Winner: learning rate 0.001, weight decay 0.0001, best epoch 13 (19 epochs run). Every parameter tensor changed from initialization; recorded in selected_configuration.json. Test evaluated after selection. This fixed test set was used in earlier project experiments, so a new external holdout is recommended for final independent assessment.
Run the complete notebook
Open kwongnon_handbag_scratch_cnn_training.ipynb locally or in Colab, run every cell and authenticate for private dataset access. The notebook includes data loading/audit, random architecture, training, validation, test metrics, saving, single-image inference, and private upload. Metrics in this card come from the training run saved alongside the checkpoint.
Run scripts
pip install -r requirements.txt
hf auth login
hf download kwongnon/handbag-sketch-dataset-100x --repo-type dataset --revision 98d85555d5f2e6d782599b8c73f0d27ff4c67456 --local-dir dataset
python train.py --data dataset --output run --device cpu
CPU was used for the recorded run. GPU support depends on your installed PyTorch build.
Single-image inference
from PIL import Image
from network import Predictor
predictor = Predictor('model.pt')
print(predictor.predict(Image.open('my-sketch.png')))
To download this private checkpoint, use huggingface_hub.snapshot_download('kwongnon/handbag-sketch-attributes-scratch-cnn') after authentication; network.py must be available on your Python import path.
The private repository contains actual trained model.pt weights, exact train-only label mappings, complete training code, notebook, split audit, trial histories and evaluation reports. Dataset content is not republished here.
Intended use and limitations
Research and prototyping of handbag attributes from isolated sketches. This is a custom PyTorch multi-head model, not a standard Transformers image-classification pipeline. Use the included Predictor.
The dataset contains only 139 independent bags. The 100ร training augmentation increases image variants, not independent examples. The small test set makes these metrics uncertain. Grayscale sketches do not reliably reveal real color, material or hardware finish. Some target values, including test material shearling/fur and color red, are absent from training; the model cannot emit classes outside its training mappings. Missing labels are ignored during training. The literal category none is a valid class.
Reported confidence is maximum softmax probability, not a calibrated probability of correctness. The resize to 96ร96 can remove fine details. Generalization to other sketch styles, photographs, or additional bag categories has not been established.
Provenance and access
Original source: leixiang25/handbag-sketch-dataset. Training uses the private augmented derivative kwongnon/handbag-sketch-dataset-100x. Follow the source dataset's access conditions and applicable rights. This card does not grant a new license or permissions over the source images. The model repository remains private.