Uncertainty-Scaled Region Jitter for Attention-Guided Masked Autoencoders

Masked autoencoders learn visual features by hiding most of an image's patches and asking a network to repaint them. Hiding patches uniformly at random wastes effort, because many hidden patches are empty sky or plain wall that can be filled in by copying neighbouring colours. Recent methods therefore use the network's own attention to hide the object and discard the background. Those methods have two problems. The attention map is unreliable early in training, so they need a hand-tuned "warm-up" of random masking. The region they select is treated as an exact boundary, even though it is a noisy guess. Object-detection pipelines faced the same issue with noisy bounding boxes and solved it by deliberately shifting and rescaling the box during training, ideally by an amount matched to how wrong the box tends to be.

We propose to carry that lesson into self-supervised pretraining. For each image, the attention-selected region is shifted and rescaled as a single coherent block before masking. The size of the shift is set by how much the model's attention disagrees between two augmented views of the same image. When attention is unstable, as early in training or on ambiguous images, the jitter is large and masking behaves almost like random masking. When attention is stable, the jitter is small and masking targets the object. Because a shifted region straddles the object boundary, some background is kept or hidden on every step instead of being thrown away wholesale. The claim is that this single image-specific mechanism replaces the warm-up schedule, makes informed masking robust to bad attention, and preserves background context, all while still reconstructing raw pixels.

Core Claim

Informed masking should treat its own region of interest the way a well-built two-stage detector treats a proposal box: as a noisy estimate whose error distribution can be measured and sampled from. In masked image modeling, a proxy for that error is available without labels, namely the disagreement between attention maps from two views whose geometric relationship is known. We expect three effects from scaling coherent region jitter by this disagreement. First, it should match or beat attention-guided masking with a tuned random warm-up, without needing the schedule. Second, it should beat patch-level randomization that has the same per-patch masking probability, which isolates the value of moving the region as a block. Third, it should reduce reliance on background shortcuts without losing the efficiency gains of discarding patches.

Relation to Prior Work

Three papers motivate the proposal by showing that informed masking pays off. AttMask hides the patches a teacher network attends to most and reaches random-masking performance with 42% fewer epochs. AMT uses the model's own attention to hide salient patches and throw away low-attention ones, giving roughly a 1.6x speedup and 2.9–5.9% linear-probe gains over MAE. SemMAE masks within and then across learned semantic parts. All three treat the selected region as fixed. AMT's need for a random-masking warm-up is direct evidence that the selection is unreliable early in training, and that is the gap we target. ADIOS learns an adversarial occluder instead. It pays for this with extra forward and backward passes and never perturbs the masks it produces. We add no network.

The method itself comes from the region-jitter literature. RMPE trains its pose estimator on boxes sampled from the measured error distribution of a real detector rather than from uniform noise. Deep GrabCut jitters user boxes so that the network stays stable from 0.6x to 1.4x box scale. DN-DETR shows that shifting and scaling boxes speeds up training of transformer detectors. All three are supervised and have ground-truth boxes from which to measure error. Our contribution is a label-free stand-in for that error: disagreement between views.

Two papers constrain the design. StoP adds learned Gaussian noise to the positional embeddings of masked tokens, improving I-JEPA. Its authors report that it failed with pixel-reconstruction MAE, and they leave noise conditioned on image content to future work. We read that failure as a warning against making the reconstruction target's location uncertain. Our design therefore jitters which patches are hidden while keeping every target patch's position and pixels exact, so the pixel loss is unchanged. Our jitter is also conditioned on each image, which answers StoP's stated open question. Noise or Signal shows that models need the background for about 35% of correct predictions and reach 40–50% accuracy from backgrounds alone. That warns against AMT's wholesale background discarding. Region jitter is our proposed middle ground, and that paper's benchmark is how we test it.

Method

At each step, the encoder's final-layer class-token attention, as in AMT, is computed on two augmented views of an image. Both maps are warped into the original image's coordinates using the known crop parameters. Let $A_1, A_2$ be the top-$k$ attention regions in those shared coordinates. We define per-image uncertainty as $u = 1 - \mathrm{IoU}(A_1, A_2)$, which runs from 0 when the views agree to 1 when they do not.

The masked region $R$ is the top-$k$ region from the training view. It is transformed by a random translation $\delta$ and a random log-scale $\rho$ about its centroid:

$$ \delta \sim \mathcal{N}(0, (\sigma_0 u)^2 I), \qquad \rho \sim \mathcal{N}(0, (\tau_0 u)^2), $$

Here $\sigma_0$ is the maximum translation, expressed as a fraction of image width, and $\tau_0$ is the maximum log-scale spread. The transformed region is rasterized onto the patch grid. Patches inside it are masked and reconstructed in pixel space, as in MAE. A fraction of the lowest-attention patches outside it is discarded, as in AMT. The overall masking ratio is held at 75%: if the shifted region covers too few patches, random patches are added, and if it covers too many, it is subsampled.

The view-agreement measurement costs only an attention pass on a second view, which is cheap with the asymmetric encoder. The two hyperparameters $\sigma_0$ and $\tau_0$ replace AMT's warm-up length.

Research Program

The work has three parts. The first is building the method on top of a public MAE ViT-B setup with AMT-style discarding. The second is a calibration study that tests whether $u$ actually tracks attention error. Because $u$ measures disagreement between views rather than error against a true object, it needs an independent check. We will measure the IoU between attention regions and the ground-truth foreground masks of ImageNet-9 at several checkpoints and correlate that IoU with $u$. A weak correlation would undercut the motivation, and we would report it as such. The third part is the comparison and ablation suite below. Hyperparameter sweeps run on ImageNet100 with ViT-S. Headline results come from ImageNet-1k with ViT-B at 400 and 800 epochs.

Baselines

The naive reference point is vanilla MAE with 75% random masking. The file reports, through SemMAE's comparison, a linear-probe accuracy of 63.7% for MAE on ImageNet-1k. We rerun MAE ourselves under our exact schedule rather than relying on that figure.

The strongest existing competitor is AMT. It uses the same self-attention signal, the same discarding of background patches, and the same pixel objective, so it differs from our method only in having a fixed region and a hand-set warm-up. The file reports gains of 2.9–5.9% in linear probing over MAE and a 1.6x speedup. It does not give an absolute ImageNet-1k ViT-B number for AMT, so we found no reported absolute result on Lacuna for AMT and will reproduce it. To be fair to AMT, we give it the same budget of tuning runs over warm-up length that we spend on $\sigma_0$ and $\tau_0$, with identical data, epochs, discard ratio, and hardware. Beating AMT means at least matching its best tuned linear-probe and fine-tuning accuracy with no schedule, and improving on ImageNet-9's BG-GAP (the accuracy drop when an image's background is swapped for a random one) and Only-FG scores.

We also compare against SemMAE at its reported 84.5% fine-tuning and 65.0% linear-probe accuracy on ImageNet-1k, and 87.1% on CUB. SemMAE relies on an external part-learning stage, so we cite its figures rather than retune it.

Two ablations isolate the key ingredients. The first replaces coherent block jitter with independent per-patch flips that are calibrated to reproduce, image by image, the same marginal probability of each patch being masked. If this matches our method, coherence does nothing and the method reduces to a softer attention mask. The second fixes the jitter at a constant amplitude rather than scaling it by $u$, which tests whether the uncertainty scaling matters.

Why not just…?

Why not just keep AMT's random warm-up and then switch to attention masking? This is the most direct alternative, and it may well match us on ImageNet accuracy. Our claim is narrower. A global schedule cannot respond to individual images whose attention remains unreliable late in training, and it cannot keep background context once the switch happens. The experiment that settles this is the tuned AMT comparison combined with a per-image breakdown. We split images by the quartile of their late-training $u$. If gains concentrate in the high-$u$ quartile and on ImageNet-9 Mixed-Rand, per-image scaling earns its place. If AMT ties everywhere, the honest conclusion is that a schedule is sufficient.

Why not just sample masks from a temperature-softened attention distribution? This is the real threat, because it also blends informed and random masking. The matched-marginal ablation is designed to answer it directly. Softened sampling scatters hidden patches independently. Block jitter keeps the hidden region contiguous, and contiguity is what defeats copying from neighbouring patches, the same reason MAE needs a high masking ratio. If the ablation ties our method, we will report that coherence adds nothing.

Why not just rely on random resized crop, which already shifts and scales objects? Cropping moves the entire image, so the attention region moves with the object and its alignment to the object is unchanged. The medical segmentation results in White matter hyperintensity and stroke lesion segmentation and differentiation using convolutional neural networks and the results in RMPE both show that location bias persists under standard augmentation and needs explicit shifts of the target region. All of our runs keep standard cropping, so any gain we report comes on top of it.

Why not just apply StoP's positional noise to MAE? Its authors report that this fails with pixel reconstruction. We include it as a negative control. We expect our method to succeed where StoP fails precisely because reconstruction targets stay exactly where they are.

Proposed Experiments

We evaluate on ImageNet-1k with linear probing, fine-tuning, and 1%-label probing, and track accuracy against epochs to measure speed of learning. Background reliance is measured on ImageNet-9 using Only-FG, Mixed-Rand, Mixed-Next, and BG-GAP. Fine-grained transfer is measured on CUB-200 and Stanford Cars. Dense transfer is measured on COCO and LVIS detection and on ADE20K segmentation.

We add one test drawn from the jitter literature. A probe trained on clean CUB crops is evaluated on crops shifted and rescaled across Deep GrabCut's 0.6x–1.4x range, which measures whether pretraining under jittered regions yields features that tolerate sloppy boxes downstream.

The study is decisive in three places. The method must match tuned AMT without a warm-up. It must beat the matched-marginal per-patch ablation, or else the coherence argument fails. It must narrow BG-GAP relative to AMT without losing Only-FG accuracy. If the first two fail, the result reduces to a softer attention mask, and we would report it as that.