TL;DR
Rotation is a staple data augmentation technique for one-class classification (OCC), but it acts as a double-edged sword. This paper reveals a massive correlation ($r > 0.9$) between a model's ability to predict rotation and its anomaly detection performance. To address this, the authors introduce a two-stage framework to filter out "rotation-agnostic" images that sabotage training by masquerading as anomalies.
The Problem: Transformation Bias in OCC
One-class classification (OCC) is the task of learning to identify "normal" data when you only have examples from a single class during training—such as finding a defective part on a factory line. A popular self-supervised trick is to rotate training images and instruct the model that these rotated versions are "anomalies."
However, this assumes that rotation always shifts the data distribution. The authors point out a major flaw in this assumption: transformation bias. Some images, like a bird in the sky or a top-down view of a car, look perfectly "normal" even when rotated. The authors term these Rotation-Agnostic Images (RAIs). If we label a rotated RAI as an anomaly, we feed the model noisy, conflicting labels, which degrades its ability to define a clean boundary for what is truly normal.
A Two-Stage Solution
To solve this, the authors propose a novel two-stage framework to estimate the "transformation distribution" of a dataset. Essentially, the goal is to figure out which rotations are "semantics-preserving" (still look normal) versus "semantics-shifting" (look like anomalies).
- Stage I: Contrastive Pre-training: The model learns general features using standard augmentations (like cropping and color jitter) but excludes rotation. This creates a clean "reference set" of what normal features look like.
- Stage II: Instance-aware Transformation Distribution Estimation:
- Data Preparation: Every image is rotated by 0°, 90°, 180°, and 270°.
- Sampling: A learnable layer uses a "competing-to-win" strategy (via Gumbel-softmax) to pick the rotation that most closely matches the original distribution.
- Density Matching: The model uses Maximum Mean Discrepancy (MMD) to align the distribution of these sampled images with the reference set from Stage I.
To prevent the model from simply picking the original 0° image every time, the authors introduce xy-shuffle, a technique that reorganizes candidate pools to ensure the sampling process remains unbiased.
Key Insights: The "Aha" Correlation
The most striking finding in the paper is the near-perfect linear relationship (Pearson's $r > 0.9$) between rotation prediction accuracy and OCC performance.
If a model cannot tell which way is "up" for a certain class, it will inevitably struggle to use rotation as a proxy for anomalies in that class. The effectiveness of a pretext task depends entirely on whether that transformation is already inherent in the dataset. If a dataset naturally contains objects in various orientations (high ratio of RAIs), using rotation as a self-supervised anomaly task is counterproductive.
Key Results
Evaluated on standard benchmarks like CIFAR-10, CIFAR-100, and MvTec-AD, the proposed method consistently outperformed existing state-of-the-art models by identifying and handling RAIs correctly.
- CIFAR-10: The "CSI + ours" approach achieved an average AUROC of 94.8%, improving upon the standard CSI baseline.
- CIFAR-100: Reached 92.6% AUROC, a significant jump over previous methods like GOAD (74.5%).
- Qualitative Success: The model successfully identified RAIs (like centered frogs or top-down ships) and non-RAIs (like side-profile horses), proving it can "understand" the orientation bias of a dataset without human labels.
Limitations and Future Work
While highly effective, the two-stage process requires more training time and computational overhead than single-stage methods. Furthermore, the success of the second stage relies heavily on the quality of the representations learned in the first stage; if initial contrastive learning fails to capture meaningful features, density matching will falter. Future work could explore more complex, non-geometric transformations (like style transfer or frequency-based augmentations) to see if this "two sides" principle applies universally.
Summary updated