# EditGuard **Repository Path**: nosferatu/EditGuard ## Basic Information - **Project Name**: EditGuard - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-09-25 - **Last Updated**: 2024-09-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README
Image Alt Text

EditGuard: Versatile Image Watermarking for Tamper Localization and Copyright Protection

CVPR 2024

[Xuanyu Zhang](https://xuanyuzhang21.github.io/), [Runyi Li](https://villa.jianzhang.tech/people/runyi-li-%E6%9D%8E%E6%B6%A6%E4%B8%80/), [Jiwen Yu](https://vvictoryuki.github.io/website/), [Youmin Xu](https://zirconium2159.github.io/), [Weiqi Li](https://villa.jianzhang.tech/people/weiqi-li-%E6%9D%8E%E7%8E%AE%E7%90%A6/), [Jian Zhang](https://jianzhang.tech/) School of Electronic and Computer Engineering, Peking University [![arXiv](https://img.shields.io/badge/arXiv--.svg)](https://arxiv.org/pdf/2312.08883.pdf) [![Home Page](https://img.shields.io/badge/Project_Page--blue.svg)](https://xuanyuzhang21.github.io/project/editguard/) [![CVPR camera-ready](https://img.shields.io/badge/Camera_Ready--red)](https://openaccess.thecvf.com/content/CVPR2024/papers/Zhang_EditGuard_Versatile_Image_Watermarking_for_Tamper_Localization_and_Copyright_Protection_CVPR_2024_paper.pdf)
## News - 🎉🎉🎉 Our code has been released. Our project is still being updated. - 🎉🎉🎉 Congratulations on EditGuard being accepted by CVPR 2024! Our open-source project is making progress, stay tuned for updates! ## Installation ``` pip install -r requirements.txt ``` ## Online Demo ``` cd code python app.py ``` ## Testing Download the [testing dataset](https://drive.google.com/file/d/1s3HKFOzLokVplXV65Z6xcsBJ9qI91Qfv/view?usp=sharing) and place it in the "./dataset/valAGE-Set" and "./dataset/valAGE-Set-Mask". Download the pre-trained [checkpoint](https://drive.google.com/file/d/1w4e1gpdInAv7Lj_NQ7EGgmMuInyfUYgi/view?usp=sharing) and put it in the "./checkpoints". ``` cd code python test.py -opt options/test_editguard.yml --ckpt ../checkpoints/clean.pth ``` To extract the tampered masks: ``` python maskextract.py --threshold 0.2 ``` ## Training Download the [COCO2017](http://images.cocodataset.org/zips/train2017.zip) dataset and modify the path of the training dataset in the config file. **Stage 1:** Train the BEM and BRM. ``` python train_bit.py -opt options/train_editguard_bit.yml ``` **Stage 2:** First modify the checkpoint path of pretrained BEM and BRM in Line 87 "pretrain_model_G: " of "train_editguard_image.yml". Then, please run: ``` python train.py -opt options/train_editguard_image.yml ``` ## Introduction ![](./asserts/intro.png) We propose a versatile proactive forensics framework **EditGuard**. The application scenario is shown on the left, wherein users embed invisible watermarks to their images via EditGuard in advance. If suffering tampering, users can defend their rights via the tampered areas and copyright information provided by EditGuard. Some supported tampering methods (marked in blue) and localization results of EditGuard are placed on the right. Our EditGuard can achieve over **95\%** localization precision and nearly **100\%** copyright accuracy. ## Results Our EditGuard can pinpoint pixel-wise tampered areas under different AIGC-based editing methods. ![](./asserts/result.png) ## Extension Our EditGuard can be easily modified and adapted to video tamper localization and copyright protection.
Original Video
Watermarked Video
Tampered Video
Predicted Mask
11ori 11wm 11tamper 11mask
13ori 13wm 13tamper 13mask
tennisori tenniswm tennistamper tennismask
umori umwm umtamper ummask
tennisori tenniswm tennistamper tennismask
## Bibtex ``` @inproceedings{zhang2024editguard, title={Editguard: Versatile image watermarking for tamper localization and copyright protection}, author={Zhang, Xuanyu and Li, Runyi and Yu, Jiwen and Xu, Youmin and Li, Weiqi and Zhang, Jian}, booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition}, pages={11964--11974}, year={2024} } ```