Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔎FerretNet: Efficient Synthetic Image Detection via Local Pixel Dependencies

Shuqiao Liang, Jian Liu, RenZhang Chen, Quanlong Guan

license paper

Visualization

📢 News

  • [2025.09.25] We have released the code, dataset and pre-trained model of FerretNet!
  • [2025.09.18] FerretNet has been accepted by NeurIPS 2025! 🎉🎉🎉

📝 Introduction

  • We released two new test dataset: Synthetic-Pop and Synthetic-Aesthetic, more detail see 👉detailed tutorial.
  • We discussed the artifacts in synthetic images caused by latent variable sampling and decoding (showing as texture discontinuities, excessive smoothing, and other local anomalies). Based on this and the local pixel correlations of the Markov Random Field, we proposed a method to reconstruct synthetic images using local pixels, enabling the revelation of abnormal artifacts. Building upon the proposed synthetic image artifact extraction method, we introduce FerretNet, a lightweight neural network with only 1.1M parameters, which is trained from scratch using ProGAN-4cls. It achieves an average detection accuracy of 97.1% across synthetic images from 20+ generative models.

🚀 Usage

1. Installation

  • Clone the repo:

    git clone https://github.com/xigua7105/FerretNet.git
    cd FerretNet
    
  • Environment setup:

    PyTorch matplotlib Tensorboard

    FerretNet works with Python 3.10+ and PyTorch 2.0+.

    conda create -n ferretnet python=3.10
    conda activate ferretnet
    pip install -r requirements.txt
    

2. QuickStart

  • Download pre-trained model ferretnet-b-median-3.pth.
  • To quickly detect whether an image is AI-synthesized, run:
    python demo_image.py --cfg_path configs/Test.yaml
    
  • To quickly detect whether a video is AI-synthesized, run:
    python demo_video.py --cfg_path configs/Test.yaml
    

3. Image Analysis

  • We provide visualization tools for analyzing image in the "analysis" folder.
    python -m analysis.generate_images --image_dir path_to_your_image_dir --gen_mode v1
    

4. Model Zoo

  • ⬇️ All checkpoints and configs can download from our Baidu Disk link.

📝 Results

  • Results on ForenSynths.
    Results 1
  • Results on Diffusion-6-class.
    Results 2
  • Results on Synthetic-Pop.
    Results 3
  • Results on VAR. Evaluate ACC and AP on images generated by the autoregressive model VAR. The data can be downloaded from our Baidu Disk link.
    MethodVAR
    NPR82.9 / 83.7
    FreqNet95.3 / 98.7
    FatFormer83.9 / 91.1
    FerretNet (Ours)97.8 / 99.9
  • More sota methods comparison. Updating... The reported results correspond to the average ACC and AP across four datasets: ForenSynths, Diffusion-6-cls, Synthetic-Pop, and Synthetic-Aesthetic.
    MethodsRefImage sizeParamsFLOPsFPSACC / AP
    CO-SPYCVPR 2025384²963.05M644.80G26.376.5 / 83.8
    FatFormerCVPR 2024224²492.59M269.92G88.686.1 / 91.0
    FreqNetAAAI 2024256²1.85M2.58G200.279.2 / 86.8
    NPRCVPR 2024256²1.44M2.29G720.986.5 / 89.4
    SAFEKDD 2025256²1.44M2.29G770.296.8 / 99.3
    FerretNet (Ours)NeurIPS 2025256²1.06M2.38G772.197.1 / 99.6
  • More details can be found in 👉detailed results.

🥰 Train

👍 Acknowledgements

🌟 Citation

  • If the code, dataset and paper help your research, please cite our paper:

License

This project is released under the Apache 2.0 license. Please see the LICENSE file for more information.

About

[NeurIPS 2025] Official implementation of FerretNet: Efficient Synthetic Image Detection via Local Pixel Dependencies

Resources

Stars

25 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages