百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
F

FOCAL

> 编程语言
开源

重新思考图像伪造检测和定位

99 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

重新思考图像伪造检测和定位

FOCAL

An official implementation code for paper "Rethinking Image Forgery Detection via Soft Contrastive Learning and Unsupervised Clustering"

IoU performance comparison with SOTAs on six cross-domain testsets.

Table of Contents

  • Background
  • Dependency
  • Usage
  • Citation

Background

Image forgery detection aims to detect and locate forged regions in an image. Most existing forgery detection algorithms formulate classification problems to classify pixels into forged or pristine. However, the definition of forged and pristine pixels is only relative within one single image, e.g., a forged region in image A is actually a pristine one in its source image B (splicing forgery). Such a relative definition has been severely overlooked by existing methods, which unnecessarily mix forged (pristine) regions across different images into the same category.

First row: input pristine and forged images. Second row: forgery masks, where pristine (α1, α2, and α3) and forged (β1 and β2) regions are labeled black and white, respectively.

To resolve this dilemma, we propose the FOrensic ContrAstive cLustering (FOCAL) method, a novel, simple yet very effective paradigm based on contrastive learning and unsupervised clustering for image forgery detection. Specifically, FOCAL 1) utilizes pixel-level contrastive learning to supervise the high-level forensic feature extraction in an image-by-image manner, explicitly reflecting the above relative definition; 2) employs an on-the-fly unsupervised clustering algorithm (instead of a trained one) to cluster the learned features into forged/pristine categories, further suppressing the cross-image influence from training data; and 3) allows to further boost the detection performance via simple feature-level concatenation without the need of retraining.

Our proposed FOCAL framework utilizes contrastive learning to supervise the training phase, while employing an unsupervised clustering algorithm in the testing phase.

Extensive experimental results over six public testing datasets demonstrate that our proposed FOCAL significantly outperforms the state-of-the-art competing algorithms by big margins: +24.8% on Coverage, +18.9% on Columbia, +17.3% on FF++, +15.3 on MISD, +15.0% on CASIA, and +10.5% on NIST in terms of IoU. The paradigm of FOCAL could bring fresh insights and serve as a novel benchmark for the image forgery detection task.

Qualitative comparison of forgery detection results on some representative testing images.

Dependency

  • torch 1.9.0
  • scikit-learn 1.2.1
  • torch_kmeans 0.2.0

Usage

  • For training:
bash
python main.py --type='train'
  • For testing:
bash
python main.py --type='test_single'

FOCAL will detect the images in the demo/input/ and save the results in the demo/output/ directory.

  • For prepare the training/test datasets:
bash
python main.py --type='flist' --path_input 'demo/input/' --path_gt 'demo/gt/' --nickname 'demo'

Note: The pretrained FOCAL can be downloaded from Google Drive.

Note: To facilitate reproduction, we provide the download link of test datasets used in the FOCAL experiments: Columbia, Coverage, CASIA, NIST, MISD, FFpp. Please follow relevant licenses and use them for research purposes only.

Citation

If you use this code for your research, please cite the reference:

@article{focal,
  title={Rethinking Image Forgery Detection via Soft Contrastive Learning and Unsupervised Clustering},
  author={H. Wu and Y. Chen and J. Zhou and Y. Li},
  journal={IEEE Transactions on Dependable and Secure Computing},  
  volume={22},
  number={6},
  pages={6296--6308},
  year={2025},
  doi={10.1109/TDSC.2025.3583167}
}

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Python

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言