← Back to learning

Mamba × TTT · IRSTD

Why can reducing uncertainty also reinforce mistakes?

Tent: Fully Test-Time Adaptation by Entropy Minimization · ICLR 2021. A minimal adaptation objective and an entry point for understanding background collapse in IRSTD.

About 20 min

Course chapters
Progress and notes stay in this browser.

Paper mechanism: change only a small subset of parameters

L_ent = − (1/B) Σᵦ Σ꜀ pᵦ꜀ log pᵦ꜀
(γ, β) ← (γ, β) − η ∇γ,βL_ent

The source model is already trained, and neither source data nor target labels are accessed at test time. The classic BN setup uses target-batch statistics and optimizes channelwise affine γ and β while fixing most weights. The model constructs its update signal from its own prediction entropy.

This provides no calibration guarantee. Entropy asks how certain an answer is, not whether it is correct. Convolutional BN with batch=1 can still compute statistics over spatial dimensions; pixel correlation and background bias are the concerns, not a universal inability to compute statistics.

Original sources: Tent · ICLR 2021 ↗

Is your binary segmentation loss correct?

H(p) = −p ln p − (1−p) ln(1−p),p=σ(z)
∂H/∂z = p(1−p) ln((1−p)/p)

For a single-channel sigmoid, include both foreground p and background 1−p. Computing only −p log p is incomplete; applying softmax over a single channel always yields 1, with zero entropy.

For an independent logit, p<0.5 is pushed lower, p>0.5 is pushed higher, and the gradient at p=0.5 is zero. Real networks share parameters, so each pixel's update is also influenced by other pixels.

Why are tiny targets especially vulnerable?

A 3×3 target in a 256×256 image occupies only about 0.0137%. Mean pixel entropy mainly reflects the background. If a weak target starts at p=0.4, entropy minimization may push it toward 0. Confident all-background predictions also have very low entropy.

Build an honest baseline in your model

  1. Reproduce the frozen source model's segmentation and object-level metrics, and save θ₀.
  2. Inspect BN/LN and list the parameters actually updated and the optimizer state.
  3. Compare source-only and norm-affine entropy using the same checkpoint, without also changing the decoder.
  4. Fix the step count, learning rate, and output timing; report per-image resets and cumulative adaptation separately.
  5. Plot Pd, Fa, and entropy over samples, examining long empty-background stretches and target reappearance.

Pause and test your intuition

What does a decrease in mean entropy tell you?

Connect this unit to your IRSTD work

Progress and notes stay in this browser.