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

Ofir Shifman, Yair Weiss

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

Introduction

Despite the massive scale of modern computer vision models, they remain surprisingly fragile to minute perturbations. A common assumption in the field is that training on billions of images—as seen with models like DINOv2 or Open-CLIP—confers a degree of translation invariance. However, recent research demonstrates that even these heavyweights can flip their predictions or significantly alter their internal representations when an image is shifted by as little as a single pixel. This fragility poses a significant challenge for reliable deployment in real-world scenarios where camera jitter or slight movement is inevitable.

The Problem: Realistic vs. Cyclic Translations

The core issue lies in the distinction between "cyclic" shifts—where pixels wrap around the image boundaries like a torus—and "realistic" shifts. In a realistic translation, a camera moves slightly, causing some pixels to exit the frame and new ones to enter. While architectural modifications can solve cyclic invariance, they often fail to address these standard realistic translations.

DINOv2's output score for "golf ball" fluctuates significantly as the crop's horizontal location changes by just a few pixels.

As shown in the figure above, the confidence score for a "golf ball" in a DINOv2 model varies wildly based on the crop's horizontal position. A shift of just one or two pixels can lead to a drastic drop in the probability assigned to the correct class, highlighting the inherent instability of the classification head in state-of-the-art models.

Robust Inference by Crop Selection (RICS)

To combat this, the authors propose Robust Inference by Crop Selection (RICS). RICS is a training-free inference wrapper that ensures consistency by changing how input crops are selected. Instead of a fixed center crop or random cropping, RICS uses a deterministic scoring function to evaluate all possible sub-crops of an image.

  1. Deterministic Scoring: The algorithm assigns a score to every possible crop using a fixed function, such as a "Mexican Hat" filter (RICS-MH) or a fixed random hash (RICS-rand).
  2. Local Maxima Selection: It identifies "local maxima"—crops that score higher than their immediate neighbors.
  3. Consistency Guarantee: Because the scoring function is deterministic and depends only on the pixels within the crop, if a specific crop is selected for an image, it is mathematically likely to be selected again if the larger source image is shifted. This ensures the model receives identical input pixels, leading to identical outputs.

Key Insights: Scale is Not a Silver Bullet

A striking finding of this research is that increasing the size of the training dataset does not automatically solve translation fragility. Models trained on 2 billion images (like Open-CLIP) are nearly as vulnerable to 1-pixel shifts as much smaller models like ResNet50. This suggests that the problem is fundamental to the way current architectures process spatial information.

Small shifts in crop location lead to different nearest-neighbor representations in the training set for both DINOv2 and Open-CLIP.

This representation instability is illustrated in the figure above. For a "dung beetle" image, shifting the crop by just one pixel causes the model to retrieve entirely different nearest neighbors from the training set. This indicates that the internal "understanding" of the image shifts significantly, even if the top-1 classification label remains correct.

Key Results and Performance

RICS provides a massive leap in stability with minimal overhead. For DINOv2, a 1-pixel shift typically results in a different representation 40% of the time; RICS reduces this failure rate to less than 5%. Furthermore, it achieves approximately 95% adversarial consistency against shifts specifically designed to break the model.

The trade-off for this robustness is a very modest decrease in top-1 accuracy (roughly 1%). This is a small price to pay for the provable consistency it provides. Additionally, when adjusted for cyclic shifts, RICS achieves 100% robustness, outperforming specialized architectures designed specifically for that purpose.

Conclusion

RICS demonstrates that robustness to realistic translations can be achieved without expensive retraining or complex architectural changes. By focusing on the consistency of the input selection process, we can stabilize even the largest pre-trained models, making them more reliable for real-world applications. Future work may extend this approach to fractional pixel shifts and larger translation magnitudes.

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