← Back to learning

Mamba × TTT · IRSTD

Give updates a memory, and preserve a way back to the source model.

Continual Test-Time Domain Adaptation · CVPR 2022. Separate teacher averaging, augmentation averaging, and stochastic restoration to see what each component addresses.

About 18 min

Course chapters
Progress and notes stay in this browser.

Paper mechanism: three roles and one update order

Source model θ₀ (fixed), student θ, teacher φ
q ← teacher prediction / augmentation average
θ ← θ − η∇θ CE(q, pθ(x))
φ ← α φ + (1−α) θ
θ ← M ⊙ θ₀ + (1−M) ⊙ θ,Mⱼ ∼ Bernoulli(r)

The frozen source model's confidence determines whether augmentation averaging is enabled. The teacher provides soft pseudo-labels for the student, followed by the EMA teacher update and finally stochastic restoration of some student parameters. Restoration replaces individual elements; it does not zero the entire model.

Specify which prediction is returned and whether it is produced before or after adaptation. Restoration does not retroactively change a prediction already returned in the current round.

Original sources: CoTTA · CVPR 2022 ↗

Two kinds of averaging, two different problems

ComponentWhat it smoothsWhat it cannot guarantee
EMA teacherParameter trajectories across stepsCannot correct shared biases
Augmentation averagingDifferences between views of the same inputCannot guarantee that augmentations preserve tiny targets
Stochastic restorationThe student's forgetting of source knowledgeMay not help when the source model performs poorly in the new domain

The old state's weight decays as αᵏ. Larger α gives more smoothing, but may respond more slowly after a sudden sensor change. This demo simulates EMA alone, not full CoTTA performance.

Reconsider augmentations for single-frame IRSTD

Strong cropping, resizing, and blurring may erase targets only 2–5 pixels across. Segmentation predictions from geometric augmentations must be inverse-transformed into common coordinates before consistency or averaging; cropping also requires handling the valid overlap region.

First use the labeled source validation set to check target retention and contrast changes, then fix the rules for unlabeled testing. Do not use target-test ground truth to decide whether an image is suitable for augmentation.

Start with a CoTTA-style variant

Fix the source Mamba model and begin with normalization parameters or a decoder adapter. Use teacher probability maps under weak augmentations for consistency supervision, adding EMA and stochastic restoration separately. If the updated parameters and augmentations change, explicitly call it a CoTTA-style variant, rather than a complete reproduction of the original paper.

Record the number of student forward passes, backward passes, and teacher forward passes. End-to-end latency captures the cost better than a single backbone inference.

Pause and test your intuition

Can an EMA teacher automatically eliminate pseudo-label errors?

Connect this unit to your IRSTD work

Progress and notes stay in this browser.