Upload README.md, doc_protocol/README.md, tdoc_protocol/README.md
Browse files- README.md +75 -0
- doc_protocol/README.md +3 -0
- tdoc_protocol/README.md +3 -0
README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-nc-4.0
|
| 3 |
+
library_name: pytorch
|
| 4 |
+
pipeline_tag: image-segmentation
|
| 5 |
+
tags:
|
| 6 |
+
- document-forensics
|
| 7 |
+
- tampering-localization
|
| 8 |
+
- image-forensics
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# DiffNet
|
| 12 |
+
|
| 13 |
+
DiffNet localises tampered regions in document images. Given a document image, it predicts a per-pixel tampering
|
| 14 |
+
probability map and an image-level tampering probability.
|
| 15 |
+
|
| 16 |
+
Paper: [arXiv:2606.22285](https://arxiv.org/abs/2606.22285) · Code: <https://github.com/Mohamed-Dhouib/DiffNet>
|
| 17 |
+
|
| 18 |
+
## Weights
|
| 19 |
+
|
| 20 |
+
One folder per training protocol of the paper. Each folder contains the weights (`.safetensors`, network
|
| 21 |
+
state_dict exported with `training/export_weights.py`) and the training config (`diffnet.yaml`).
|
| 22 |
+
|
| 23 |
+
| Folder | Protocol | Inference input size | Status |
|
| 24 |
+
|---|---|---|---|
|
| 25 |
+
| `doc_protocol/` | Doc Protocol: trained on the DocTamper training set (512x512); tested on the DocTamper test sets and on T-SROIE, OSTF, Tampered-IC13, RealTextManipulation | 512 | coming soon |
|
| 26 |
+
| `tdoc_protocol/` | Syn2Real-TDoc protocol: trained on TDoc-2.8M (1024x1024) from the `doc_protocol/` weights; tested zero-shot on RTM, FindItAgain, FindIt | 1024 | coming soon |
|
| 27 |
+
|
| 28 |
+
## Download
|
| 29 |
+
|
| 30 |
+
```python
|
| 31 |
+
from huggingface_hub import hf_hub_download
|
| 32 |
+
|
| 33 |
+
repo_id = "MohamedDhouib1/DiffNet"
|
| 34 |
+
weights = hf_hub_download(repo_id, "doc_protocol/diffnet_doc_protocol.safetensors")
|
| 35 |
+
config = hf_hub_download(repo_id, "doc_protocol/diffnet.yaml")
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
## Inference
|
| 39 |
+
|
| 40 |
+
The model code is in the GitHub repository (installation details in its README):
|
| 41 |
+
|
| 42 |
+
```bash
|
| 43 |
+
git clone https://github.com/Mohamed-Dhouib/DiffNet DiffNet
|
| 44 |
+
cd DiffNet
|
| 45 |
+
pip install -r requirements.txt # after torch and mmcv, see the README
|
| 46 |
+
cd training
|
| 47 |
+
python infer.py --weights <path>/diffnet_doc_protocol.safetensors --input <image-or-folder> \
|
| 48 |
+
--output-dir <output-folder> --input-size 512
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
Use `--input-size 1024` with the `tdoc_protocol/` weights. Inference also runs on CPU (`--device cpu`). Larger
|
| 52 |
+
images are processed with non-overlapping windows of the input size, smaller ones are padded with white. For each
|
| 53 |
+
image, `infer.py` writes `<name>_prob.png` (probability x 255) and `<name>_mask.png` (probability > `--threshold`,
|
| 54 |
+
default 0.5, 0/255) and prints the image-level probability.
|
| 55 |
+
|
| 56 |
+
Training and evaluation instructions: `README.md` and `REPRODUCIBILITY.md` of the GitHub repository. Results are
|
| 57 |
+
reported in the paper.
|
| 58 |
+
|
| 59 |
+
## Citation
|
| 60 |
+
|
| 61 |
+
```bibtex
|
| 62 |
+
@inproceedings{dhouib2026efficient,
|
| 63 |
+
title={Efficient Document Tampering Localization with Multi-level Discrepancy Features and Unified DCT--Quantization Embedding},
|
| 64 |
+
author={Dhouib, Mohamed and Zhu, Ye and Vanier, Sonia and Shabou, Aymen},
|
| 65 |
+
booktitle={European Conference on Computer Vision},
|
| 66 |
+
pages={110--127},
|
| 67 |
+
year={2026},
|
| 68 |
+
organization={Springer}
|
| 69 |
+
}
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
## Licence
|
| 73 |
+
|
| 74 |
+
The weights are released under CC BY-NC 4.0 (they are initialised from the ConvNeXt-V2 ImageNet checkpoints,
|
| 75 |
+
which are CC BY-NC 4.0). The code on GitHub is MIT.
|
doc_protocol/README.md
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# doc_protocol
|
| 2 |
+
|
| 3 |
+
Weights trained under the Doc Protocol will be added to this folder.
|
tdoc_protocol/README.md
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# tdoc_protocol
|
| 2 |
+
|
| 3 |
+
Weights trained under the Syn2Real-TDoc protocol will be added to this folder.
|