Skip to main content
Back

Australian Researchers Build RAPTA to Stop Stable Diffusion From Copying Training Images

A new training-time prompt augmentation scheme paired with a zero-training multimodal detector cuts diffusion memorization by up to 65 percent.

Pro

  • New paper introduces RAPTA and ADMCD to fight text-to-image diffusion memorization.
  • RAPTA uses a detector to build region-aware prompt variants sampled during training.
  • ADMCD fuses ViT, CLIP, and ResNet features through a small Transformer for zero-training copy detection.
  • Copy rate drops 64.9 percent relative to Stable Diffusion 2.1 base while FID stays competitive.
  • Fused similarity stays 0.87 to 0.97 across ten photometric and geometric attacks where SSIM and ORB fail.
  • Tradeoff: CLIP Score falls from around 28 to 23, signaling looser prompt adherence.

Text-to-image diffusion models have a well-documented habit of quietly reproducing chunks of their training data. That is a legal and privacy problem when the copied content is a photograph, a piece of art, or a face from a scraped dataset. A team from the University of Western Australia, University of Melbourne, and Curtin University has proposed a two-part pipeline that attacks the problem from both ends: a training-time prompt augmentation that discourages memorization, and an inference-time detector that catches copies when they do appear. Both parts are described in the paper Mitigating Memorization in Text-to-Image Diffusion via Region-Aware Prompt Augmentation and Multimodal Copy Detection.

Why diffusion models copy in the first place

Large overparameterized models are trained on web-scale, weakly curated pairs of captions and images, and strong text-image alignment encourages the model to anchor on specific caption-image pairs, while high capacity enables memorization of distinctive instances. The result ranges from near-pixel duplicates of training images to subtler style-level echoes.

Most existing defenses act at inference time by scrambling the prompt: random token or number insertion, BLIP-based paraphrasing, or Gaussian noise on CLIP embeddings. These lower copying but tend to break prompt-image coherence, and they do nothing about the memorization baked in during training. Detection is equally messy. Single-view scores like SSIM, LPIPS, ORB keypoint matching, and CLIP cosine similarity each capture only one facet of image likeness, and there is no large labeled dataset of diffusion copy pairs to train a proper classifier on.

RAPTA: teaching the model that one caption is not the only truth

Region-Aware Prompt Augmentation (RAPTA) sits inside the training loop. For each training image, it runs an off-the-shelf Faster R-CNN detector to find salient objects, then converts those detections into new captions that stay faithful to what is actually in the image.

The mechanics are straightforward:

  1. Run the detector on the training image, keep the top-M boxes above a confidence threshold, and merge overlaps with non-maximum suppression.
  2. Discretize each box center onto a 3x3 grid to produce a coarse position token like top-left or bottom-right.
  3. Instantiate a small template set that fills in the base prompt with object class and position, producing variants like "[base prompt], with a [class] in the [position]".
  4. Score every variant with CLIP against the image, convert the scores into a temperature-controlled sampling distribution, and draw one variant per iteration to condition the denoiser.

The point is that each training image now sees many grounded descriptions across iterations instead of memorizing one caption-image pair. Because CLIP filters out variants that drift from the image content, semantic alignment survives. The diffusion loss itself is unchanged.

ADMCD: three views are better than one

Attention-Driven Multimodal Copy Detection (ADMCD) is a zero-training detector. For any generated image and candidate reference, it extracts three embeddings and fuses them:

  • Patch-level geometry from a Vision Transformer, anchoring spatial layout.
  • Global semantics from CLIP, invariant to color and illumination shifts.
  • Texture cues from a ResNet backbone, resilient to noise and blur.

The three streams are linearly projected into a shared space, stacked, and passed through a small Transformer encoder for attention-based fusion, producing an L2-normalized fused vector. Detection is then a two-step thresholding rule:

  1. If fused cosine similarity exceeds tau_1 = 0.938, flag as a copy.
  2. For flagged pairs, compute a weighted sum of the three stream similarities (weights 0.24, 0.38, 0.38) and threshold at tau_2 = 0.970 to distinguish a retrieve/exact copy from a style copy.

No downstream classifier is trained. The thresholds and weights come from validation sweeps on an in-house set of 1,200 query-reference pairs (roughly 25 retrieve/exact, 200 style copies, 1,000 non-copies).

Numbers that matter

The authors evaluate on LAION-10k with three diffusion backbones: the DCR baseline, CompVis LDM-T2I, and Stable Diffusion 2.1 base. Copy rates measured by ADMCD:

MethodCopy rateFIDCLIP ScoreKID
DCR3.27.930.52.9
LDM-T2I5.310.433.23.1
SD 2.1 base7.48.327.83.3
RAPTA2.68.123.11.6

RAPTA achieves the lowest copy rate at 2.6, a relative reduction of 18.8, 50.9, and 64.9 percent versus DCR, LDM-T2I, and SD 2.1-base respectively, while FID stays comparable and KID improves. The one clear tradeoff is a lower CLIP Score of 23.1 versus 27.8 to 33.2, reflecting the tension between text-image similarity and suppressing replication. In other words, aggressively discouraging exact reproduction slightly loosens how tightly the output tracks the caption.

Robustness where single metrics fall apart

Copy detectors have to survive photometric and geometric attacks that adversaries or benign editors might apply. Across ten perturbations including Gaussian noise, blur, Poisson noise, salt-and-pepper, speckle, 20 percent crop, horizontal and vertical flips, 10 percent occlusion, and 30-degree rotation, ADMCD stays in the range 0.871 to 0.974 under noise-based corruptions. For comparison, ORB collapses to 0.110 under occlusion and SSIM drops to 0.207 on rotation.

The design intuition is that attention-based fusion down-weights a failing stream so no single weakness dominates the score. When texture is destroyed by blur, patch geometry and global semantics keep the fused signal intact. When geometry is scrambled by rotation, texture and semantics take over.

What is actually new here

The framing shift is worth calling out. Prior work treated copying as binary and mostly patched it at inference time. This paper argues replication is graded, from exact duplication to style mimicry, and splits mitigation from detection into two independent modules that plug into any existing diffusion pipeline.

The other genuinely useful contribution is ADMCD as a general similarity measure. Because the fused score aligns better with human judgment than SSCD, DreamSim, or LPIPS and holds up under corruption, it is a plausible drop-in for anyone building dataset audit tools, license-compliance checkers, or dataset deduplication passes for generative training runs. The paper does not currently ship a public code release, so practitioners wanting to reproduce it will have to reimplement from the algorithms and thresholds given in the paper.