How Data Augmentation Shapes Neural Representations of Natural Images

Tianxiao He, Alex H Williams, Sarah E HarveyNeurIPS 2026

TL;DR

We all know data augmentation boosts neural network accuracy, yet two models with identical test scores can view the world in completely different ways. By mapping hidden-layer activations into a mathematical "shape space" that strips away arbitrary rotations and scalings, the authors reveal that dialing up data augmentation steers internal representations along remarkably smooth, predictable paths. Better yet, measuring the geometric angles between these paths lets you predict which models will team up to make the best ensembles.

What Problem Does This Paper Address?

If you train a vision model with random cropping, and another with Gaussian noise, both might hit the exact same validation accuracy. Relying solely on top-line performance metrics masks how different training choices sculpt a network's internal computations.

Traditionally, intuition says data augmentation works by "collapsing" augmented views of the same image onto a single point so the model learns invariance. However, that doesn't tell us how training with augmentations—especially out-of-distribution ones like heavy noise—reshapes the underlying representational geometry of clean, unaltered images. Furthermore, comparing two neural networks is notoriously tricky because hidden units have no natural one-to-one correspondence; a simple rotation of activations in high-dimensional space looks completely different in standard Euclidean coordinates, even if it carries the exact same linearly decodable information.

Methods

To compare networks fairly, the authors pass $M$ clean "probe" images from the test set through trained models (such as ResNet-18 and Vision Transformers) and record hidden-layer activations as $M$-point clouds in $N$-dimensional space.

Instead of standard similarity metrics like Centered Kernel Alignment (CKA), they turn to differential geometry and Riemannian shape distance—a true mathematical metric that measures the shortest angular deformation between two point clouds after centering, normalizing scale, and optimally aligning them via orthogonal transformations (rotations and reflections).

Embedding neural representations into Riemannian shape space

While shape metrics have recently been used to track how representations evolve layer-by-layer within a single network, the novel leap here is applying Riemannian geometry across ensembles of models as hyperparameters change. Starting from an un-augmented baseline model, the authors compute:

  • Shape geodesics and angles: Smooth paths across the shape manifold induced by gradually increasing augmentation strength, and the tangent angles between paths of different augmentation families (e.g., rotation vs. color jitter).
  • Landmark displacements: Because shape space aligns the actual point clouds rather than abstract similarity matrices, the authors can track individual "landmarks" (specific test images) to see which inputs get amplified or attenuated by a given augmentation.

Datasets

The authors use two standard vision benchmarks (no new datasets are introduced):

  • CIFAR-10: Used for end-to-end training of models across various augmentation types and parameter grids, evaluated on $M = 10,000$ clean test-set probe images.
  • ImageNet: Used for fine-tuning pretrained ResNet-18 and ViT models to verify that the geometric findings generalize to larger-scale natural images.

Key Insights and Ideas

  • Alignment reveals hidden order: Even if two networks start from the exact same random seed and differ only by a tiny dose of Gaussian noise, comparing their raw activations in Euclidean space looks like chaotic static. Once orthogonally aligned in shape space, dialing up augmentation strength traces out smooth curves and 2D surfaces.
  • Random seeds provide "natural units": How do you compare 10 degrees of rotation to a 0.1 noise variance? Comparing augmentation-induced shape distance against the baseline variability caused by changing the initialization seed establishes an intrinsic, unit-free scale for hyperparameter strength.
  • Geometric diversity drives ensemble gains: In a shape space of roughly $10^6$ dimensions, two random directions are almost guaranteed to be orthogonal ($90^\circ$). Yet different augmentations steer representations at acute angles ($61^\circ$ to $78^\circ$), clustering by type (e.g., geometric vs. photometric). Crucially, wider angles between two augmentation trajectories mean the models learned more diverse representations—which directly predicts bigger accuracy boosts when ensembling them.
  • Augmentations distort clean images non-uniformly: Looking at individual landmark displacements shows that a small subset of clean images shifts dramatically while most barely budge, with early layers reacting to low-level features like bright backgrounds and diagonal edges.

Key Results

  • Decoding hyperparameters from clean images: Using leave-one-out ridge regression on aligned ResNet-18 layer 2 shapes, the authors accurately predicted the exact augmentation strength used during training from clean test images alone—achieving $R^2 = 0.853$ for Gaussian noise ($\sigma$) and $R^2 = 0.860$ for patch Gaussian cutout size ($C$). Without orthogonal alignment, decoding collapsed entirely ($R^2 = -0.274$ and $-0.067$).
Figure 2: Orthogonal alignment reveals well-behaved DA trajectories in representation shape space that are not present without alignment. Using ResNet-18 layer 2 responses to 10,000 CIFAR-10 test set images from models trained with the same seed, pairwise representation distances show coherent organization across augmentation strengths only when the alignment step is included. (a, b) We compare additive Gaussian noise, parameterized by noise level σ, with patch Gaussian, parameterized by a cutout width C and within-patch noise variance s. (c, d) Distance matrices compare aligned and unaligned shape distances for Gaussian noise and patch Gaussian data augmen- tations at various strengths. (e, f) MDS-PCA visualizations of these distances reveal smooth, ordered trajectories in shape space, and for patch Gaussian, an organized two-parameter surface over (C, s), which disappear when orthogonal alignment is not performed. (g, h) True vs. predicted augmentation hyperparameters from leave-one-out ridge regression on aligned representation shapes of clean probe images. Points near the diagonal indicate accurate decoding of augmentation strength from shape.
  • Crossing the seed threshold: For both ResNet-18 and ViT trained with patch Gaussian augmentation, representational changes remained comparable to random seed-to-seed noise until within-patch noise hit $s \approx 0.2$, after which augmentation effects dominated.
  • Predicting ensemble boosts: Across eight classic augmentation families, the mean geodesic angle between pairs of augmentation trajectories positively correlated with soft-voting ensemble accuracy improvements ($r = 0.500$ in ResNet-18 layer 2.1, rising to $r = 0.707$ in the penultimate AvgPool layer, with consistent trends across ViT and ImageNet).

Limitations and Future Work

The experiments focus exclusively on image classification, classical hand-crafted augmentations, and post-hoc snapshots of a fixed set of test images. Computing exact Riemannian shape distances—which requires finding optimal orthogonal alignments—also becomes computationally expensive for wide convolutional layers, requiring dimensionality reduction on the activation matrices beforehand.

Looking ahead, the authors suggest extending this geometric lens to other modalities, larger foundation models, learned augmentation policies, and step-by-step training dynamics. Ultimately, shape-space trajectories could serve as a general compass for hyperparameter tuning, regularizer selection, and fine-tuning—especially when validation accuracy plateaus and masks meaningful differences under the hood.

Summary updated

Abstract

Data augmentation is widely recognized for improving generalization in deep networks, yet its impact on the geometry of learned representations remains poorly understood. In this work, we characterize how different data augmentation strategies reshape internal representations in vision models. Using tools from shape analysis, we embed network hidden representations into a metric space where distance is invariant to scaling, translation, rotation and reflection. We show that increasing augmentation strength leads to well-behaved trajectories in this space, and that different augmentation types steer representations in distinct directions. Moreover, we investigate how neural representation shapes are distorted along data augmentation trajectories, and show that insights from neural geometry can predict which representations provide the most improvement when ensembling models. Our results reveal shared geometric patterns across architectures and seeds, and suggest that analyzing shape-space trajectories offers a principled tool for understanding and comparing data augmentation methods.
BibTeX
@inproceedings{he2026how,
  author = {Tianxiao He and Alex H Williams and Sarah E Harvey},
  title = {{How Data Augmentation Shapes Neural Representations of Natural Images}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=eiZLHRQOAE},
}
Figure