What Car Is This? โ Expanded EfficientNet-B0
A locally trained vehicle classifier covering 239 model families across 42 manufacturers. Its 346 leaf labels combine 196 original generation categories and 150 added model-only families. Generation and year fields are null for the added families; it does not infer trims or invent production years.
Status: 30 expanded-training epochs completed; calibration, held-out test, safetensors export and exported CPU inference verified on October 18, 2026. Original implementation code, acquisition/preparation, training, evaluation and inference modules are included. No external inference service is used.
Measured held-out results
Evaluated on 11,683 images, after checkpoint selection on a separate validation split and calibration on 4,677 separate images.
| Metric | Result |
|---|---|
| Leaf top-1 | 92.17% |
| Leaf top-5 | 98.16% |
| Leaf macro F1 | 0.9073 |
| Manufacturer accuracy | 95.60% |
| Model accuracy | 92.85% |
| Generation accuracy (3,833 generation-labeled images only) | 92.17% |
| Expected calibration error | 0.0117 |
New CompCars source: 7,850 test images, 92.17% leaf top-1.
Original RIOTU source: 3,833 test images, 92.17% leaf top-1.
Final-epoch validation top-1 was 92.24%; it is distinct from test accuracy.
Full metrics, per-class results, confusion and calibration figures are under evaluation/.
These are project-specific splits, not a claim of performance on an unmodified
official benchmark. One expanded seed was trained; uncertainty intervals,
additional seeds and architecture comparisons have not been measured.
Architecture and training
EfficientNet-B0 with a 346-way linear classifier, 4,450,774 parameters. RGB images are resized to 255 pixels on their short side, center cropped to 224 ร 224 and normalized with ImageNet means/stds for inference. Training uses random resized crops, horizontal flips and color jitter.
Stage 1 trained the original 196-way model for 30 epochs from torchvision EfficientNet-B0 IMAGENET1K_V1 initialization. Expanded training warms the backbone and matching classifier rows from that local checkpoint, initializes new rows, and starts a fresh optimizer. All original and new training images are replayed.
Expanded configuration: seed 43, batch 24, AdamW, initial LR 0.0001, weight decay
0.01, cosine scheduling, label smoothing 0.05, inverse-square-root class weights
computed from training counts, gradient clipping 1.0, AMP and validation-loss
checkpoint selection. Training resumed from a completed epoch without changing
configuration or splits. All 30 epochs completed; the exported best checkpoint
comes from epoch 30. See configs/ and evaluation/training-history.json.
Hardware: local RTX 3060 12 GB, Windows 11, Python 3.12.14, PyTorch 2.7.1+cu126.
The combined 54,512 retained photos are split into 33,473 training, 4,679 validation, 4,677 calibration and 11,683 test images. Original assignments stay fixed; CompCars official-test examples remain test-only. Exact and full/mirrored perceptual duplicate groups are isolated across splits, with ambiguous conflicts quarantined. This does not guarantee detection of arbitrary crops, repeated photo sessions or the same physical vehicle appearing in different photographs.
Inference
This is a custom torchvision/PyTorch model, not a Transformers AutoModel.
Download this repository with huggingface_hub.snapshot_download, install
requirements.txt, then run from the downloaded directory:
python -m carid.inference --artifacts . --device cpu --image your-car.jpg
Python API:
from PIL import Image
from carid.inference import Predictor
predictor = Predictor('.', device='cpu')
result, attention = predictor.predict(Image.open('your-car.jpg'), explain=False)
print(result['prediction'])
Top-five probabilities use temperature 0.749894; rejection threshold is 0.710338. Make/model scores sum the corresponding leaf probabilities. Rejection was calibrated in-distribution only: unsupported cars and non-car images can still receive high confidence.
Reproduction
The independent carid/ implementation includes acquisition, hash verification,
preparation, duplicate grouping, training, calibration, evaluation and export.
Prepare the RIOTU v1 data using carid.acquire, scripts/verify_download.py and
carid.prepare with its recorded taxonomy overrides. Prepare the Kaggle expansion
using scripts/bootstrap_compcars.py, scripts/select_expansion.py,
carid.expanded_acquire and carid.expanded_prepare. Obtain datasets separately
under their source terms; no data are included here.
Train the original configuration first, then the expanded configuration:
python -m carid.train --config configs/efficientnet_b0.yaml
python -m carid.train --config configs/expanded_efficientnet_b0.yaml
The expanded config pins the exact original checkpoint checksum. A fresh local reproduction may have a different checkpoint serialization/hash; explicitly record that new warm-start checksum in a separately named reproduction config. Do not claim its hash or results match this release until verified. Exact bitwise results across platforms/library versions are not guaranteed.
Intended use, rights and limitations
Non-commercial educational vehicle-recognition research. Coverage reflects limited source geography/era/viewpoints, including a 2015-era expansion corpus; current-year coverage, open-set detection and robust real-world performance are not established. The demo's AI-generated sample is illustrative, not evaluation evidence. Grad-CAM is diagnostic attention, not proof of the model's reasoning. Do not use for safety, enforcement, insurance or identity decisions.
Code: MIT. Weights: non-commercial research only, with source restrictions and attribution in LICENSE.md. Training sources: RIOTU Kaggle v1 (CC BY-NC 4.0) and CompCars Kaggle v1, subject to original CompCars terms. No dataset images are redistributed. The mirror's unknown license does not override the publisher's restrictions. See the weight notice for citations.
Training manifest SHA256: cdd9e621bd686868486e73050e77bc3bd34fde97b68cda10ff9bf9a3ca1466ed.
Best training checkpoint SHA256: 6b92195d96a898d507f0d0a2b34b3801dd75715f1b3a93da8f43180c163f7522.
Exported file integrity: checksums.json.
- Downloads last month
- 5,100