A model property where outputs remain unchanged under specified transformations of the input.
Invariance is a fundamental property in machine learning describing a model whose outputs remain constant when its inputs undergo specific transformations. A classifier is translation-invariant if it produces the same label regardless of where an object appears in an image; it is rotation-invariant if orientation changes don't affect predictions. This property is distinct from equivariance, where outputs transform predictably alongside inputs rather than staying fixed. Invariance is desirable whenever the transformations in question carry no meaningful information for the task at hand — the identity of a handwritten digit, for instance, does not depend on its position on the page.
In practice, invariance is built into models through architectural choices or training procedures. Convolutional neural networks achieve approximate translation invariance by sharing weights across spatial positions and applying pooling operations that discard precise location information. Data augmentation — randomly applying rotations, flips, crops, or color jitter during training — encourages a model to learn invariances empirically rather than encoding them structurally. More recent approaches, such as group-equivariant networks and self-supervised contrastive learning, offer principled frameworks for targeting specific invariances while preserving others that matter for the task.
Invariance is central to a model's ability to generalize from training data to the real world, where inputs naturally vary in ways irrelevant to the underlying concept. However, over-enforcing invariance can destroy useful signal: a model that is fully rotation-invariant cannot distinguish the digit '6' from '9'. Choosing which invariances to build in — and which to avoid — is therefore a core design decision. Understanding the invariance structure of a model also has implications for robustness and adversarial vulnerability, since inputs that exploit non-invariant dimensions can cause dramatic prediction failures despite appearing perceptually identical to humans.