Stability-Weighted Direction Regularization Disentangles Generator Shortcuts from Detection Signal
Abstract
AI-generated image detectors often fail on unseen generators because the classifier relies on generator-specific feature directions that are predictive only on the training set. These generator-discriminative linear discriminant analysis (LDA) directions also carry real-vs-fake signal, so removing all of them after training discards detection evidence together with the shortcuts. We introduce StaR, a training-time regularizer that scores each LDA direction by its stability under leaving one training generator out and penalizes the classifier's alignment with low-stability directions, in proportion to their instability (continuous form) or below a stability threshold (thresholded form). On a CLIP detector trained on a generator-diverse corpus, the continuous form significantly improves the average out-of-distribution AUC over four benchmarks relative to the same detector trained without the penalty, and also improves over EFFORT. On a ResNet detector, the thresholded form makes out-of-distribution performance far less sensitive to the training seed, with no significant change in the mean. Post-hoc projection of the same directions onto frozen features, on the other hand, does not reproduce these training-time effects. StaR moves the classifier away from unstable generator directions while concentrating, rather than erasing, generator-discriminative structure in the features.