GenShield: An All-in-One Open Source Framework for AI-Generated Image Detection and Repair
A Peking University team has open sourced GenShield, unifying AI-generated image detection and artifact correction in a single autoregressive framework with 98.8% detection accuracy


GenShield: An All-in-One Open Source Framework for AI-Generated Image Detection and Repair
A Peking University team has open sourced GenShield, unifying AI-generated image detection and artifact correction in a single autoregressive framework with 98.8% detection accuracy
As AI-generated images grow ever more realistic, "is this image real or AI-generated?" is becoming an increasingly hard question to answer. A further challenge: if an AI-generated image has unnatural artifacts, can we do more than just flag it — can we actually fix it? A research team from Peking University and other institutions has proposed GenShield — an open source framework that unifies detection and correction within a single closed loop.
What Is GenShield
GenShield is a unified framework built on an autoregressive architecture that handles both detection of AI-generated images and artifact correction within the same model. Rather than simply judging "real or fake," it can point out where the problem is, why it is a problem, and go a step further by repairing the image into a more natural state.

The core idea of the GenShield framework: detection and correction are not two isolated tasks, but ones that reinforce each other.
Three Core Capabilities
Explainable Detection
The model doesn't just output a real/fake verdict; it also generates a description of the image content and the reasoning behind its artifact analysis. Think of it this way: it doesn't just tell you "this image is AI-generated," it also explains "because the finger structure is unnatural and the lighting directions are inconsistent."
Controllable Artifact Correction
Based on the diagnostic information, the model performs targeted repairs on the abnormal regions of an image while preserving the subject's semantics and overall structure as much as possible.
Multi-Step Self-Repair (Visual CoT)
Like a human who "checks first, edits next, then reviews again," the model performs multiple rounds of diagnosis and repair. Once the image is natural enough, the model automatically outputs "no obvious artifacts found" and stops.

The model runs multiple "diagnose-repair" cycles until the image looks natural.
Training Data: GenShield-Set
The team built a companion dataset, GenShield-Set, consisting of two parts:
- GenShield-Set-Detect: for training explainable detection, containing real images and AI-generated images along with structured detection answers
- GenShield-Set-Correct: for training artifact correction, containing more than 10,000 high-quality "flawed image - repaired image" pairs
Experimental Results
On the AI-generated image detection task:
- Achieves 98.8% average accuracy and 99.8% A.P. on the Holmes-Set benchmark
- Outperforms a variety of non-LLM and LLM-based detection methods
On the artifact correction task:
- Compared against methods such as GPT-Image, FLUX-Pro, and Qwen-Image-Edit
- Achieves lower residual artifact scores on dimensions such as structural consistency, physical consistency, and local distortion
- Delivers the best or leading results on objective metrics such as HPSv3, CLIP-Score, and PickScore
Technical Highlight: VCoT Curriculum Learning
Training proceeds in two stages:
Stage one: the model simultaneously learns explainable detection and instruction-guided correction, establishing a stable prior for real-image generation.
Stage two: detection remains part of training, while correction is upgraded to multi-round self-repair. Given a potentially problematic image, the model first generates diagnostic text, then repairs the image based on the diagnosis, looping until the image is natural enough.
This design creates positive feedback between detection and correction: detection helps locate abnormal regions, and correction in turn sharpens the model's sensitivity to artifacts.
Project Resources
- Paper title: GenShield: Unified Detection and Artifact Correction for AI-Generated Images
- Paper link: https://arxiv.org/abs/2605.16122
- Code repository: https://github.com/zhipeixu/GenShield
Who Is It For
- Content moderation teams: batch-detect AI-generated content across platforms
- News organizations: verify image authenticity
- Security research: study AI image forensics and anti-forgery techniques
- Trustworthy AI systems: integrate detection + correction into generation pipelines to improve output quality