Views
No views yet
00-damage) or an intact vehicle (01-whole),
built as a claims-triage decision-support tool — not an autonomous
adjuster. Every flagged prediction is intended to route to a human
reviewer.1import torch
2from huggingface_hub import hf_hub_download
3
4# clone github.com/pinheiro-dataworks/claim-sight for src/model.py, src/preprocessing.py
5from src.model import build_model
6from src.preprocessing import preprocess
7from src.dataset import eval_transform
8
9checkpoint_path = hf_hub_download(
10 repo_id="PinheiroDataworks/claimsight-damage-detection",
11 filename="best_resnet50.pt",
12)
13model = build_model("resnet50", pretrained=False)
14model.load_state_dict(torch.load(checkpoint_path, map_location="cpu"))
15model.eval()
16
17import cv2
18image_bgr = cv2.imread("claim_photo.jpg")
19image_rgb = preprocess(image_bgr) # same function used in training
20tensor = eval_transform(image=image_rgb)["image"].unsqueeze(0)
21probs = torch.softmax(model(tensor), dim=1).squeeze()
22print({"00-damage": probs[1].item(), "01-whole": probs[0].item()})anujms/car-damage-detection) — 2,300
images, binary folder labels only (no masks/bounding boxes), split
1,840 train / 460 validation, balanced within each split.ReduceLROnPlateau + early stopping on
validation loss. Full details, augmentation policy and reproducibility
notes: see the project README.| Metric | Value |
|---|---|
| Validation accuracy | 0.9435 |
| ROC-AUC (damage class) | 0.9858 |
| Recall — damage class (@ threshold 0.5) | 0.9565 |
| Precision — damage class (@ threshold 0.5) | 0.9322 |
| Confusion matrix (TN/FP/FN/TP) | 214/16/10/220 |
damage class is the priority metric: a false negative
(damaged vehicle classified as intact) can wrongly close a legitimate
claim, while a false positive only costs one extra human review. A
recall-priority operating point was chosen by sweeping the decision
threshold: at threshold 0.25, damage recall is
0.9870 at precision 0.9080
(vs. 0.9565 recall / 0.9322 precision at the default 0.5).| Architecture | Val. accuracy | ROC-AUC |
|---|---|---|
| resnet50 (this checkpoint) | 0.9435 | 0.9858 |
| efficientnet_b0 | 0.8870 | 0.9620 |
pytorch-grad-cam) on the last convolutional layer is used
as a weak-localization signal — a coarse heatmap of the region that
most influenced the decision. It is not pixel-level segmentation:
there is no mask ground truth in this dataset, so there is no IoU/Dice.
See the project repo's outputs/gradcam/ for overlays on both correct
and incorrect predictions, including a documented shortcut-learning
check.torch.manual_seed(42)), deterministic cuDNN settings,
pinned requirements.txt. Metadata for this exact run:1{
2 "arch": "resnet50",
3 "seed": 42,
4 "device": "cuda",
5 "phase1_epochs_ran": 8,
6 "phase2_epochs_ran": 15,
7 "best_val_loss": 0.14994667431582576,
8 "checkpoint": "models\\best_resnet50.pt",
9 "torch_version": "2.6.0+cu124",
10 "trained_at_utc": "2026-08-01T22:51:16Z"
11}