Add phase 3: README.md
Browse files
README.md
CHANGED
|
@@ -9,12 +9,13 @@ tags:
|
|
| 9 |
- pytorch
|
| 10 |
---
|
| 11 |
|
| 12 |
-
# TruFor Phase-2
|
| 13 |
|
| 14 |
-
This repository stores phase-2 localization
|
| 15 |
-
|
| 16 |
-
TruFor
|
| 17 |
-
Noiseprint++
|
|
|
|
| 18 |
|
| 19 |
## Training summary
|
| 20 |
|
|
@@ -34,33 +35,52 @@ Final recorded validation results:
|
|
| 34 |
- Best `avg_p-F1_smooth`: 0.5505
|
| 35 |
- Class IoU: `[0.90797067, 0.17650062]`
|
| 36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
## Files
|
| 38 |
|
| 39 |
- `weights/best.pth.tar`: best checkpoint selected by `avg_p-F1_smooth`
|
| 40 |
- `weights/checkpoint.pth.tar`: final epoch-30 resume checkpoint
|
|
|
|
|
|
|
| 41 |
- `config/trufor_ph2.yaml`: training configuration
|
|
|
|
| 42 |
- `logs/trufor_ph2_gpu1.log`: complete training log
|
|
|
|
| 43 |
- `code/`: the locally patched training/device-placement files and launchers
|
| 44 |
- `SHA256SUMS`: checkpoint integrity hashes
|
| 45 |
|
| 46 |
## Loading
|
| 47 |
|
| 48 |
These are native TruFor/PyTorch checkpoints, not Transformers checkpoints.
|
| 49 |
-
Use them with the TruFor training/inference code.
|
| 50 |
-
|
| 51 |
-
through the project's
|
|
|
|
|
|
|
| 52 |
|
| 53 |
## How to use
|
| 54 |
|
| 55 |
To use or modify this work locally, install Git LFS and run
|
| 56 |
`git clone https://huggingface.co/benjaik/trufor-ph2`. Use
|
| 57 |
-
`weights/best.pth.tar` for inference
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
`
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
license terms.
|
| 64 |
|
| 65 |
## Local compatibility changes
|
| 66 |
|
|
|
|
| 9 |
- pytorch
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# TruFor Phase-2 and Phase-3 Checkpoints
|
| 13 |
|
| 14 |
+
This repository stores phase-2 localization and phase-3 detection/confidence
|
| 15 |
+
checkpoints trained with the official
|
| 16 |
+
[TruFor](https://github.com/grip-unina/TruFor) PyTorch implementation. TruFor
|
| 17 |
+
detects and localizes manipulated regions in images using RGB and Noiseprint++
|
| 18 |
+
features.
|
| 19 |
|
| 20 |
## Training summary
|
| 21 |
|
|
|
|
| 35 |
- Best `avg_p-F1_smooth`: 0.5505
|
| 36 |
- Class IoU: `[0.90797067, 0.17650062]`
|
| 37 |
|
| 38 |
+
### Phase 3: detection network and confidence estimator
|
| 39 |
+
|
| 40 |
+
- Initialization: phase-2 `weights/best.pth.tar`
|
| 41 |
+
- Frozen modules: Noiseprint++, backbone, and localization head
|
| 42 |
+
- Trained modules: confidence head and detection head
|
| 43 |
+
- Training datasets: IMD2020, CASIA 2.0 revised, and CocoGlide
|
| 44 |
+
- Training crop: 512 x 512
|
| 45 |
+
- Epochs: 100
|
| 46 |
+
- Batch size: 4 per GPU
|
| 47 |
+
- Validation maximum crop: 1024 x 1024
|
| 48 |
+
- Final validation loss: 0.538
|
| 49 |
+
- Best `avg_det_bacc`: 0.5981
|
| 50 |
+
- Final class IoU: `[0.90785598, 0.08274118]`
|
| 51 |
+
|
| 52 |
## Files
|
| 53 |
|
| 54 |
- `weights/best.pth.tar`: best checkpoint selected by `avg_p-F1_smooth`
|
| 55 |
- `weights/checkpoint.pth.tar`: final epoch-30 resume checkpoint
|
| 56 |
+
- `weights/phase3/best.pth.tar`: best phase-3 detection/confidence checkpoint
|
| 57 |
+
- `weights/phase3/checkpoint.pth.tar`: final epoch-100 phase-3 resume checkpoint
|
| 58 |
- `config/trufor_ph2.yaml`: training configuration
|
| 59 |
+
- `config/trufor_ph3_gpu2.yaml`: phase-3 training configuration
|
| 60 |
- `logs/trufor_ph2_gpu1.log`: complete training log
|
| 61 |
+
- `logs/trufor_ph3_gpu2.log`: concise phase-3 training log
|
| 62 |
- `code/`: the locally patched training/device-placement files and launchers
|
| 63 |
- `SHA256SUMS`: checkpoint integrity hashes
|
| 64 |
|
| 65 |
## Loading
|
| 66 |
|
| 67 |
These are native TruFor/PyTorch checkpoints, not Transformers checkpoints.
|
| 68 |
+
Use them with the TruFor training/inference code. Use
|
| 69 |
+
`weights/phase3/best.pth.tar` for complete localization, confidence, and image
|
| 70 |
+
detection inference by passing its path through the project's
|
| 71 |
+
`TEST.MODEL_FILE` configuration option. Use the top-level
|
| 72 |
+
`weights/best.pth.tar` as phase-2 initialization when retraining phase 3.
|
| 73 |
|
| 74 |
## How to use
|
| 75 |
|
| 76 |
To use or modify this work locally, install Git LFS and run
|
| 77 |
`git clone https://huggingface.co/benjaik/trufor-ph2`. Use
|
| 78 |
+
`weights/phase3/best.pth.tar` for complete inference with the upstream TruFor
|
| 79 |
+
code by setting `TEST.MODEL_FILE` to its downloaded path. Use
|
| 80 |
+
`weights/best.pth.tar` to initialize another phase-3 run, and use the matching
|
| 81 |
+
`checkpoint.pth.tar` file when resuming training. The included configurations,
|
| 82 |
+
patched files, and training logs can be copied and adapted for a new dataset or
|
| 83 |
+
experiment, subject to the included TruFor and CMX license terms.
|
|
|
|
| 84 |
|
| 85 |
## Local compatibility changes
|
| 86 |
|