TruFor Phase-2 Localization Checkpoints

This repository stores phase-2 localization checkpoints trained with the official TruFor PyTorch implementation. TruFor detects and localizes manipulated regions in images using RGB and Noiseprint++ features.

Training summary

  • Architecture: TruFor localization network (detconfcmx, SegFormer-B2 backbone)
  • Training datasets: IMD2020, CASIA 2.0 revised, and CocoGlide
  • Training crop: 512 x 512
  • Epochs: 30
  • Optimizer: SGD
  • Initial learning rate: 0.005
  • Batch size: 1 per GPU
  • Hardware: NVIDIA GeForce RTX 2080 Ti (11 GiB)
  • Validation maximum crop: 1024 x 1024

Final recorded validation results:

  • Loss: 0.657
  • Best avg_p-F1_smooth: 0.5505
  • Class IoU: [0.90797067, 0.17650062]

Files

  • weights/best.pth.tar: best checkpoint selected by avg_p-F1_smooth
  • weights/checkpoint.pth.tar: final epoch-30 resume checkpoint
  • config/trufor_ph2.yaml: training configuration
  • logs/trufor_ph2_gpu1.log: complete training log
  • code/: the locally patched training/device-placement files and launchers
  • SHA256SUMS: checkpoint integrity hashes

Loading

These are native TruFor/PyTorch checkpoints, not Transformers checkpoints. Use them with the TruFor training/inference code. For phase-2 inference, place the selected checkpoint at weights/trufor_ph2/best.pth.tar, or pass the path through the project's TEST.MODEL_FILE configuration option.

How to use

To use or modify this work locally, install Git LFS and run git clone https://huggingface.co/benjaik/trufor-ph2. Use weights/best.pth.tar for inference or further fine-tuning with the upstream TruFor code (copy it to TruFor_train_test/weights/trufor_ph2/best.pth.tar, or set TEST.MODEL_FILE to its downloaded path); use weights/checkpoint.pth.tar when resuming the completed training run. The included configuration, patched files, and training log can be copied and adapted for a new dataset or experiment, subject to the included TruFor and CMX license terms.

Local compatibility changes

The accompanying files document changes needed on the training server:

  • consistent CUDA placement for model, inputs, labels, losses, and resumed optimizer state;
  • corrected eight malformed CASIA list entries;
  • validation crops limited to 1024 pixels to fit an 11 GiB GPU;
  • a dedicated CUDA-10.2-compatible Conda environment.

License and attribution

The upstream TruFor license permits informational and nonprofit use and imposes additional restrictions. This repository does not relicense the original code or weights. Review LICENSE.txt, LICENSE_CMX.txt, and the upstream repository before use or redistribution.

TruFor paper: TruFor: Leveraging All-Round Clues for Trustworthy Image Forgery Detection and Localization, CVPR 2023.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support