Commercial Plane Family Classifier

Fine-tuned MobileNetV4 (mobilenetv4_conv_medium) classifying 16 commercial aircraft families from planespotting photos and camera crops.

Trained on the nyuuzyou/aircraft-images dataset with heavy field corruptions (blur, crops, noise, contrast, weather shift) to make predictions robust to phone photos and landing approaches.

Performance

  • Pristine Test Accuracy: ~93.2%
  • Field-Sim Test Accuracy: ~93.1%
  • Macro-F1: ~0.904

Supported Aircraft Families (16 Classes)

  1. Airbus A220
  2. Airbus A310
  3. Airbus A320
  4. Airbus A330
  5. Airbus A340
  6. Airbus A350
  7. Airbus A380
  8. Boeing 737
  9. Boeing 747
  10. Boeing 757
  11. Boeing 767
  12. Boeing 777
  13. Boeing 787
  14. Bombardier CRJ
  15. Embraer E-Jet
  16. McDonnell Douglas MD-80/90

Field Test


Quickstart (Inference with PyTorch & timm)

import torch
import timm
from torchvision import transforms
from PIL import Image
from huggingface_hub import hf_hub_download

REPO_ID = "t1an-xyz/plane-classifier"

# 1. Download checkpoint from Hugging Face
ckpt_path = hf_hub_download(repo_id=REPO_ID, filename="plane_classifier_checkpoint.pt")
ckpt = torch.load(ckpt_path, map_location="cpu", weights_only=False)

classes = ckpt["classes"]
model_name = ckpt["model_name"]
img_size = ckpt.get("img_size", (256, 256))
norm_mean = ckpt.get("norm_mean", (0.485, 0.456, 0.406))
norm_std = ckpt.get("norm_std", (0.229, 0.224, 0.225))

# 2. Reconstruct timm model & load weights
model = timm.create_model(model_name, pretrained=False, num_classes=len(classes))
model.load_state_dict(ckpt["state_dict"])
model.eval()

# 3. Preprocess image
preprocess = transforms.Compose([
    transforms.Resize(img_size),
    transforms.ToTensor(),
    transforms.Normalize(mean=norm_mean, std=norm_std),
])

img = Image.open("plane.jpg").convert("RGB")
input_tensor = preprocess(img).unsqueeze(0)

# 4. Predict
with torch.no_grad():
    logits = model(input_tensor)
    probs = torch.softmax(logits, dim=1)[0]

top3_indices = torch.topk(probs, k=3).indices.tolist()
for idx in top3_indices:
    print(f"{classes[idx]}: {probs[idx]:.2%}")
Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for t1an-xyz/plane-classifier

Finetuned
(2)
this model

Dataset used to train t1an-xyz/plane-classifier