Lost in Translation: Modern Neural Networks Still Struggle With Small Realistic Image Transformations

Ofir Shifman, Yair Weiss · DOI

Abstract

Despite being trained on billions of images, state-of-the-art (SOTA) neural networks like DINOv2 and Open-CLIP exhibit a surprising lack of invariance to small, realistic image translations. This paper identifies a critical vulnerability where a mere one-pixel shift can significantly alter a model's output representation. To address this, the authors introduce Robust Inference by Crop Selection (RICS), a training-free inference method that guarantees high levels of translation consistency with a negligible (~1%) trade-off in accuracy.

The Problem: Brittleness to Realistic Translations

We often assume that modern Convolutional Neural Networks (CNNs) and Vision Transformers (ViTs) are naturally invariant to small shifts—if a camera moves slightly, the AI should ideally perceive the same object. However, research reveals they are remarkably brittle.

A critical distinction exists between two types of translations:

  1. Cyclic Translations: Pixels exiting one side of the frame "wrap around" to the other. While mathematically convenient for achieving invariance, this never occurs in real-world scenarios.
  2. Realistic Translations (Crop-shifts): A camera rotates or moves slightly, causing new pixels to enter the frame while others disappear.

Even models designed for cyclic robustness often fail on realistic shifts. The authors found that a one-pixel realistic translation can change the predicted image representation for approximately 40% of test images in SOTA models. As seen in the figure below, the confidence score for a correct label can fluctuate wildly based on minor positioning.

DINOv2's output score for 'golf ball' fluctuates significantly with minor crop shifts.

Methodology: Robust Inference by Crop Selection (RICS)

Instead of attempting to retrain networks for invariance—a task that has proven difficult even with massive datasets—the authors propose changing how the network processes images during inference. The RICS Algorithm follows three steps:

  1. Scoring: For a given image, the system evaluates all possible sub-crops using a deterministic "scoring function."
  2. Selection: It identifies and selects the crop with the highest score (a local maximum).
  3. Inference: Only this specific, optimally selected crop is passed to the neural network.

By using a deterministic scoring function, the algorithm consistently picks the same physical patch of a scene even if the overall image is shifted. If the input to the network remains identical, the output is guaranteed to be consistent. The authors tested two scoring functions: RICS-rand (using a fixed random filter) and RICS-MH (using a "Mexican Hat" filter acting as a blob detector).

Key Insights: Representation Consistency

In many foundation model applications, the model's output representation (the embedding vector) is used for downstream tasks like image retrieval or zero-shot classification. If a 1-pixel shift changes that vector significantly, the entire system becomes unreliable.

Small shifts in the test image lead to inconsistent nearest-neighbor retrievals in DINOv2 and Open CLIP.

As illustrated above, minor shifts in a test image of a dung beetle cause SOTA models like DINOv2 and Open CLIP to retrieve entirely different nearest neighbors from the training set. This demonstrates that scale is not a panacea; training on billions of images (like LAION-2B) does not automatically grant translation invariance.

Experimental Results

The researchers evaluated RICS using ImageNet, PLACES365, and ImageNet-A. Key findings include:

  • Consistency Gains: While the DINOv2 baseline had a 1-NN consistency of less than 85% for 1-pixel shifts, RICS reduced the ability to "fool" the model to less than 5%.
  • Minimal Accuracy Trade-off: This massive jump in robustness came at the cost of only a ~1% drop in top-1 classification accuracy.
  • SOTA Robustness: Using DINOv2 as a base, RICS achieved over 82% accuracy on ImageNet with over 95% robustness to realistic 1-pixel shifts.
  • Theoretical Guarantees: The paper provides a theoretical lower bound for robustness, proving at least 93% adversarial robustness to 1-pixel shifts for standard crop sizes, regardless of the underlying model architecture.

Conclusion and Future Work

RICS offers a "selection hack" that allows users to wrap SOTA models in a selector to inherit their power while forcing consistency. While currently focused on integer pixel shifts, future work may explore fractional (sub-pixel) translations via upsampling. Although RICS adds a small amount of pre-processing time to calculate crop scores, it ensures that modern AI systems remain reliable under the minor geometric perturbations common in real-world deployments.

Summary updated

BibTeX
@inproceedings{shifman2024lost,
  author = {Ofir Shifman and Yair Weiss},
  title = {{Lost in Translation: Modern Neural Networks Still Struggle With Small Realistic Image Transformations}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-72890-7\_14},
}
Figure