LEGO: LoRA-Enabled Generator-Oriented Framework for Synthetic Image Detection

Yutong Xiao, Ran Ran, Jiwei Wei, Shuchang Zhou, Ke Liu, Zheng Ziqiang, Caiyan QinarXiv 2026

TL;DR

LEGO (LoRA-Enabled Generator-Oriented Framework) shifts the paradigm of synthetic image detection away from the failing hunt for a single "universal artifact." By training specialized, plug-and-play LoRA modules for individual generator families and combining them via an adaptive routing mechanism, LEGO achieves state-of-the-art generalization on out-of-distribution benchmarks using less than 10% of the training data required by traditional methods.

What Problem Does This Paper Address?

As generative AI models (GANs, Diffusion models, etc.) rapidly evolve, detecting synthetic images has become a game of cat-and-mouse. Most existing detectors try to find "universal artifacts"—common digital fingerprints shared across all fake images.

However, the authors observe a critical flaw in this assumption: as the diversity of image generators grows, the overlap of these common features shrinks. Forcing a model to learn a single universal representation leads to poor generalization on unseen generators. Conversely, focusing only on unique, generator-specific artifacts causes the model to overfit to known forgery patterns. LEGO addresses this dilemma by explicitly modeling generator-specific unique artifacts in a modular, scalable architecture.

Methods

LEGO is built upon a frozen OpenCLIP (ViT-L/14) visual backbone and introduces a clever two-stage training strategy inspired by the modularity of LEGO bricks:

  1. Generator-Specific LoRA Specialization: Instead of updating the entire network, the authors insert low-rank adaptation (LoRA) blocks into the self-attention layers of the CLIP backbone. Each LoRA block is trained independently on a dataset from a single generator family (e.g., Stable Diffusion, ProGAN, or ADM). This allows individual blocks to become "experts" at capturing the unique artifact subspaces of specific generators without interfering with each other.
  2. Generator-Aware Router Alignment: The specialized LoRA blocks are frozen and placed into a "LoRA Hub." A lightweight Multi-Layer Perceptron (MLP) router is then trained on a mixed dataset (GenMix). The router learns to predict continuous "LoRA Merge Weights" ($\pi$) based on the input image's features. These weights dynamically blend the outputs of the LoRA experts into an Integrated LoRA representation, which is then fed into a Forgery Detection Head.

To make the router robust to cross-generator ambiguity, the authors introduce a fake-fake interpolation strategy (similar to Mixup) during this second stage, forcing the router to output soft, continuous distributions rather than hard, one-hot classifications.

Figure 2: Overview of the proposed LEGO framework. LEGO is built upon a frozen CLIP backbone and trained in two stages. In Generator-Specific LoRA Specialization, each LoRA branch is individually optimized on a single-generator subset to capture distinctive artifact patterns. In Generator-Aware Router Alignment, the specialized branches are frozen and integrated into a LoRA Hub, while a router learns to predict the LoRA Merge Weight under mixed-generator training. The resulting Integrated LoRA is injected into the backbone, and the representation is refined by the Forgery Detection Head for prediction.

Datasets

  • Training: The model uses a highly restricted, low-cost training setup consisting of fewer than 30,000 images from three compact subsets of the GenImage dataset: Stable Diffusion v1.4, ProGAN, and ADM.
  • Evaluation: To test real-world generalization, the authors evaluated LEGO on two massive, unseen benchmarks:
  • AIGIBench: A comprehensive benchmark covering 18 diverse subsets, including deepfake-style manipulations (BlendFace, FaceSwap) and recent open-source generation tools.
  • Chameleon: A challenging, in-the-wild dataset containing perceptually deceptive samples with broad semantic variations.

Key Insights and Ideas

  • Avoiding Destructive Interference: Training a single model on highly heterogeneous generator distributions often causes gradient conflicts. By isolating the initial learning phase to single-generator subsets, LEGO prevents different artifact distributions from canceling each other out.
  • Subspace Interpolation: The artifact space isn't discrete. By using a soft softmax routing mechanism, LEGO can smoothly interpolate between different LoRA experts. This geometric flexibility allows the framework to remain highly robust when encountering hybrid or entirely unseen next-generation generators.
  • Plug-and-Play Scalability: Much like real LEGO bricks, when a new generator emerges in the wild, researchers can simply train a new isolated LoRA block and update the router, completely bypassing the need to retrain the entire detector from scratch.

Key Results

Despite using less than 10% of the training data of prior state-of-the-art (SOTA) methods and training for only 5 epochs per stage, LEGO demonstrated remarkable efficiency and accuracy:

  • AIGIBench: LEGO achieved the highest overall performance with a 80.2% mean Accuracy and 89.6% mean Average Precision (AP), notably outperforming strong baselines like AIDE and Effort. It showed massive gains on complex deepfake subsets like FaceSwap and InSwap.
  • Chameleon (In-the-wild): LEGO achieved a SOTA 83.6% Accuracy and 92.8% AUC, outperforming the recent HiDA-Net by 4.5 percentage points in accuracy.
  • High Efficiency, Low Variance: As shown in the paper's evaluation metrics, LEGO maintains a much lower performance variance across diverse datasets, proving it doesn't rely on a few high scores to mask weaknesses elsewhere.
Figure 1: Comparison of detector efficiency and generalization. Left: data-efficiency–performance trade-off using ACC on Chameleon. Right: mean–standard-deviation comparison across AIGIBench subsets.

Limitations and Future Work

While highly effective, the authors note a clear trade-off regarding the number of LoRA branches ($K$). Increasing the number of specialized branches provides a finer partition of the synthetic artifact space and yields stronger detection capabilities, but it also scales up the training and optimization complexity of the router. Future work will likely explore how to scale the LoRA Hub efficiently to handle hundreds of distinct generator families without bottlenecking the routing mechanism.

Summary updated

BibTeX
@misc{xiao2026lego,
  author = {Yutong Xiao and Ran Ran and Jiwei Wei and Shuchang Zhou and Ke Liu and Zheng Ziqiang and Caiyan Qin},
  title = {{LEGO: LoRA-Enabled Generator-Oriented Framework for Synthetic Image Detection}},
  year = {2026},
  eprint = {2605.04445},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.04445},
}
Figure