Image Classification
Keras
LiteRT
TF-Keras
Safetensors
English
efficientnetv2-s
efficientnetv2
fgic
transfer-learning
gem-pooling
focal-loss
swa
grad-cam
calibration
temperature-scaling
computer-vision
tensorflow.js
Eval Results (legacy)
Instructions to use 0xgr3y/Arch-Building-Image-Classification with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use 0xgr3y/Arch-Building-Image-Classification with Keras:
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://0xgr3y/Arch-Building-Image-Classification") - Notebooks
- Google Colab
- Kaggle
Download config.json from 0xgr3y/Arch-Building-Image-Classification: direct link, hf CLI and curl.
- Browser
- Download file 3.71 kB
-
https://huggingface.co/0xgr3y/Arch-Building-Image-Classification/resolve/dc1f28a60ac427d42042cbca18a8d692a0eb5f09/config.json
- Command line
-
hf download hf://0xgr3y/Arch-Building-Image-Classification@dc1f28a60ac427d42042cbca18a8d692a0eb5f09/config.json
-
curl -L -o config.json https://huggingface.co/0xgr3y/Arch-Building-Image-Classification/resolve/dc1f28a60ac427d42042cbca18a8d692a0eb5f09/config.json
3.71 kB
| { | |
| "model_type": "densenet121", | |
| "base_model": "densenet121", | |
| "task": "image-classification", | |
| "num_labels": 8, | |
| "id2label": { | |
| "0": "barn", | |
| "1": "bridge", | |
| "2": "castle", | |
| "3": "mosque", | |
| "4": "skyscraper", | |
| "5": "stadium", | |
| "6": "temple", | |
| "7": "windmill" | |
| }, | |
| "label2id": { | |
| "barn": 0, | |
| "bridge": 1, | |
| "castle": 2, | |
| "mosque": 3, | |
| "skyscraper": 4, | |
| "stadium": 5, | |
| "temple": 6, | |
| "windmill": 7 | |
| }, | |
| "input_shape": [ | |
| 320, | |
| 320, | |
| 3 | |
| ], | |
| "preprocessing": { | |
| "mode": "densenet_preprocess_input", | |
| "mean": [ | |
| 123.675, | |
| 116.28, | |
| 103.53 | |
| ], | |
| "std": [ | |
| 58.395, | |
| 57.12, | |
| 57.375 | |
| ], | |
| "channel_order": "RGB" | |
| }, | |
| "training_info": { | |
| "dataset_source": "World Architectural Buildings (13440 images, 8 classes, balanced)", | |
| "dataset_size": 13440, | |
| "split_ratio": [ | |
| 0.8, | |
| 0.1, | |
| 0.1 | |
| ], | |
| "split_seed": 42, | |
| "phases": [ | |
| { | |
| "name": "Phase 1 - Feature Extraction (Head)", | |
| "optimizer": "AdamW", | |
| "lr": 0.001, | |
| "epochs_max": 25, | |
| "epochs_actual": 1, | |
| "val_accuracy": 0.8921, | |
| "val_loss": 1.2231, | |
| "train_accuracy": 0.5318, | |
| "cutmix_mixup": true, | |
| "label_smoothing": 0.1, | |
| "early_stop_reason": "myCallback val_acc >= 0.85" | |
| }, | |
| { | |
| "name": "Phase 2 - Selective Fine-Tuning", | |
| "optimizer": "DiscriminativeAdamW", | |
| "lr": 0.0003, | |
| "epochs_max": 50, | |
| "epochs_actual": 6, | |
| "val_accuracy": 0.9204, | |
| "val_loss": 0.6171, | |
| "train_accuracy": 0.911, | |
| "unfreeze": "conv4_block+conv5_block (BN frozen)", | |
| "discriminative_lr": { | |
| "conv4_block": 0.1 | |
| }, | |
| "cutmix_mixup": false, | |
| "label_smoothing": 0.05, | |
| "early_stop_reason": "myCallback val_acc >= 0.92" | |
| }, | |
| { | |
| "name": "SWA Post-Training", | |
| "epochs": 10, | |
| "lr": 0.0001, | |
| "bn_update": true, | |
| "bn_update_steps": 100, | |
| "val_accuracy": 0.9658, | |
| "val_loss": 0.4256, | |
| "method": "Izmailov et al., UAI 2018" | |
| } | |
| ], | |
| "metrics": { | |
| "train_accuracy": 0.9988, | |
| "val_accuracy": 0.9658, | |
| "test_accuracy": 0.9688, | |
| "test_loss": 0.4485, | |
| "tta_accuracy": 0.968, | |
| "overfitting_gap": 0.03, | |
| "test_correct": 1302, | |
| "test_total": 1344, | |
| "macro_precision": 0.9691, | |
| "macro_recall": 0.9688, | |
| "macro_f1": 0.9687, | |
| "per_class_f1": { | |
| "barn": 0.9674, | |
| "bridge": 0.9645, | |
| "castle": 0.9735, | |
| "mosque": 0.9735, | |
| "skyscraper": 0.9794, | |
| "stadium": 0.96, | |
| "temple": 0.9668, | |
| "windmill": 0.9647 | |
| }, | |
| "per_class_recall": { | |
| "barn": 0.9702, | |
| "bridge": 0.9702, | |
| "castle": 0.9821, | |
| "mosque": 0.9821, | |
| "skyscraper": 0.9881, | |
| "stadium": 0.9286, | |
| "temple": 0.9524, | |
| "windmill": 0.9762 | |
| }, | |
| "checkpoint_comparison": { | |
| "best_phase2_swa": { | |
| "val_accuracy": 0.9658, | |
| "val_loss": 0.4256, | |
| "rank": 1 | |
| }, | |
| "best_phase2": { | |
| "val_accuracy": 0.9204, | |
| "val_loss": 0.6171, | |
| "rank": 2 | |
| }, | |
| "best_phase2_ema": { | |
| "val_accuracy": 0.8936, | |
| "val_loss": 0.8183, | |
| "rank": 3 | |
| }, | |
| "best_phase1": { | |
| "val_accuracy": 0.8921, | |
| "val_loss": 1.2231, | |
| "rank": 4 | |
| } | |
| } | |
| } | |
| }, | |
| "version": "v6", | |
| "license": "apache-2.0", | |
| "github": "https://github.com/arcxteam/arch-building-classifier", | |
| "author": { | |
| "name": "Saugani", | |
| "email": "team@greyscope.xyz" | |
| } | |
| } |