Car Damage Photo Integrity v9 — AI Edit Detection and Image Forgery Localization
A PyTorch research model for detecting and localizing AI-edited regions in car-damage photos. It focuses on localized inpainting that adds, removes or exaggerates vehicle damage, and returns a tamper heatmap, an image-level suspicion score and a threshold-based flag.
Use it to explore image manipulation detection, diffusion inpainting detection and vehicle-photo integrity with the supplied local inference code. It does not assess damage severity, estimate repair costs or prove fraud. Fully AI-generated scenes are a documented weak case.
Author: Sai Charan Obuladinne · Framework: PyTorch · Weights: Safetensors · Declared repository license: Apache-2.0; see the upstream-data caveat below.
Who is this model for?
- Computer-vision developers exploring image manipulation detection with local PyTorch inference.
- Image-forensics researchers studying image forgery localization and tamper heatmaps.
- Generative-image researchers evaluating localized edits produced by diffusion inpainting.
- Automotive-image developers exploring vehicle-photo integrity alongside separate car-damage detection systems.
Download the checkpoint and inference code using the quick-start below. The model returns an image-level suspicion score and a localization heatmap; it does not assess damage severity or certify authenticity.
Quick-start: local PyTorch inference
This is a custom LocNet model. It does not load through the v4/v5 transformers.pipeline("image-classification") interface.
Create a Python environment and install the inference dependencies:
python -m venv .venv
# Linux/macOS:
source .venv/bin/activate
# Windows PowerShell alternative:
# .venv\Scripts\Activate.ps1
python -m pip install torch torchvision timm safetensors pillow numpy huggingface_hub
Choose the appropriate PyTorch build for your hardware. Download the four runtime files and run an authorized non-sensitive photo:
hf download obuladinnesai/car-damage-photo-integrity-v9 model.safetensors config.json inference.py model_v9.py --revision 4b7b6ea59cc125119794b2f5a49efb966ec3e5ff --local-dir car-damage-v9
cd car-damage-v9
python inference.py /path/to/photo.jpg --device cpu --condition upload --heatmap heat.png
The pinned revision makes the example reproducible. Later releases may require a different revision and updated instructions. The download uses the public checkpoint; no HF token is required for this public release.
The upload condition resizes the image to a maximum side of 1600 pixels, then re-encodes as JPEG quality 85. It uses the corresponding published threshold. jpeg_q90 re-encodes every photo as JPEG quality 90 and is the default condition. native is available but is not recommended for benchmark comparisons because file-format differences affected the original evaluation.
Python usage
Run from the downloaded repository folder:
from inference import load_model, score_image
net, cfg, device = load_model(device="cpu")
result = score_image(net, cfg, device, "photo.jpg", condition="upload")
print({key: result[key] for key in ("score", "threshold", "flagged", "condition")})
heatmap = result["heatmap"]
Inputs and outputs
| Item |
Meaning |
| Input |
RGB-convertible image, such as JPEG or PNG; use relevant car-damage photos for domain evaluation |
score |
Mean of the 256 highest stride-2 map logits; higher indicates greater model suspicion of editing |
threshold |
Condition-specific operating threshold from config.json |
flagged |
Whether the score meets or exceeds that threshold |
heatmap |
Floating-point map in [0, 1] at the preprocessed image dimensions |
heat.png |
Grayscale visualization saved by the CLI when requested |
The CLI prints one JSON line per image, including image, score, threshold, flagged, condition, and max_heat. Scores can be negative and are not fraud probabilities. Heatmap values are model outputs, not independently verified masks or calibrated probabilities. A photo below threshold is not certified authentic.
Runtime verification
The released weights at the pinned revision loaded and completed CPU inference on an artificial 384×256 RGB smoke-test image in Python 3.12 on Linux. The CLI returned JSON and saved a matching-size heatmap. This verifies basic execution only; the artificial image is not an accuracy test.
Tested core packages: PyTorch 2.14.1+cpu, torchvision 0.29.1+cpu, timm 1.0.30, Safetensors 0.8.0, Pillow 12.3.0, NumPy 2.5.2, huggingface_hub 2.1.1. GPU/MPS execution, large-image resource requirements and benchmark reproduction were not independently tested in this check.
Published evaluation: detection at a 2% benchmark false-positive rate
The following are author-reported results on eval_v6: 600 real CarDD validation/test photos and 1,240 positive images (1,140 localized edits plus 100 SDXL fully generated scenes). The report states that source photos are separate from training; this was not independently audited here.
| Condition |
Positive images detected (TPR) |
AUROC |
| All images re-encoded as JPEG quality 90 |
85.3% |
0.948 |
| Maximum side 1600 px + JPEG quality 85 |
81.6% |
0.933 |
For each condition, the threshold was set separately using the 600 real evaluation images, to flag 12 of them (2%). This is an empirical benchmark operating point, not a guarantee of a 2% false-positive rate on future photos. It is not overall accuracy. New deployment data need separate calibration and evaluation.
Read the full v7/v9 report. Download the HTML file and open it locally if the Hub does not render it.
The released v9 checkpoint and inference code are available in this repository. Any statement in an earlier report that v9 weights are unreleased is outdated.
Small edits, compression and fully generated scenes
Reported detection rates in the upload condition:
| Subgroup |
Detection rate |
| Small localized edits (0.5–3% of image area) |
61.3% |
| Medium localized edits (3–12%) |
90.3% |
| Large localized edits (12–35%) |
97.1% |
| Fully generated SDXL scenes (100 images) |
41.0% |
Results cover the reported generators and preprocessing conditions; they do not establish performance on every editor or a general-purpose authenticity task.
Architecture and scoring
- Encoder: ConvNeXt-Tiny (
timm/convnext_tiny.fb_in22k), initialized from ImageNet-22k according to the training description.
- Noise-residual stream: fixed SRM high-pass filters plus learned filters.
- Decoder: FPN/U-Net-style fusion, producing a one-channel edit-logit map at stride 2.
- Image score: mean of the top 256 map logits.
- Size: 29,427,715 parameters in the published configuration; approximately 118 MB of FP32 Safetensors weights.
The network operates in one pass on the preprocessed resolution. The upload preprocessing can resize before inference. The loader constructs the custom architecture with pretrained=False and loads the released state dictionary.
Training data and reproducibility
The author describes training with CarDD-train inpaints produced with Stable Diffusion 1.5, SDXL, Kandinsky 2.2 and LaMa, plus synthetic small paste-back edits. Real-photo sources are reported as CarDD, Open Images and 1,500 private photos that are not released. Source permissions and private-photo provenance need confirmation from the owner.
The recorded overall inpaint count is 3,298, while the current per-editor counts sum to 3,293; this discrepancy needs reconciliation. Do not treat either as an independently audited count.
The released checkpoint is described as training step 16,000 of 20,000, using pixel-level BCE and Dice loss plus an image-level loss. Training and evaluation scripts are in code/. The repository does not bundle all source data, generated images, masks or third-party model repositories.
Intended use and limitations
Suitable for research and developer experiments in image forgery localization, AI-edit detection and car-photo integrity. This model finds suspicious edited regions; it does not detect physical damage severity or estimate repair cost.
- Human review remains necessary; outputs are not forensic proof of editing, fraud or authenticity.
- Small edits and fully generated scenes are important failure cases.
- Performance can change across domains, devices, compression, edit tools and newer generators.
- The published threshold was selected on evaluation real images; validate on a separate relevant set before adopting an operating threshold.
- No independent mask-quality benchmark, calibrated probability claim, or production deployment validation is established by the rates above.
- Do not use the output alone for adverse decisions about people or claims.
- Use images you are authorized to process. For private material, choose an approved local workflow rather than uploading it to a public demo.
Licensing and data permissions
The repository declares Apache-2.0. This declaration does not establish permission for every upstream dataset or private photo.
The shawnmichael/CarDD mirror lists Apache-2.0, but the original CarDD licensing form requires permission for research use, commercial use and redistribution. Consult the original terms and the owner's permission records before representing the model or its examples as commercially cleared. The implications for this release require confirmation; this card does not resolve them.
Version navigation
The v5 repository contains earlier code and reports, plus a nested copy of v9 weights. Its root weights are v5, not v9. V6–v8 weights are not released according to that card.
V9 adds localized-edit detection and heatmaps. Earlier whole-image classifiers serve a different task; this is not a universal upgrade for fully synthetic-image detection.
Feedback
Test the checkpoint locally and share reproducible feedback in Community discussions. Include the checkpoint revision, preprocessing condition, dependency versions, relevant image provenance and observed output. Do not upload sensitive personal, employer or claim material. Authorized failure cases are useful alongside successful examples.
Preprocessing check (Oct 13, 2026): one real CC BY 3.0 car-damage photo scored under JPEG q90 and upload preprocessing, both correctly not flagged. See reports/v9_preprocessing_check.html.
Preprocessing sanity check
On October 13, 2026, one authorized, unedited CC BY 3.0 car-damage image was tested under two preprocessing conditions:
| Condition |
Score |
Threshold |
Result |
Max heat |
| JPEG Q90 |
-5.03 |
4.19 |
Not flagged |
0.010 |
| Upload preprocessing |
-3.27 |
4.19 |
Not flagged |
0.053 |
Both conditions produced effectively blank heatmaps and completed successfully on CPU in approximately 10 seconds. This is a single-image preprocessing sanity check, not a new accuracy benchmark.
View the full preprocessing report