Segmentation Assisted Incremental Test Time Adaptation in an Open World

Indian Institute of Science, Bengaluru, India
British Machine Vision Conference (BMVC), 2025

Abstract

In dynamic environments, unfamiliar objects and distribution shifts are often encountered which challenge the generalization abilities of deployed trained models. This work addresses Incremental Test Time Adaptation (ITTA) of Vision-Language Models (VLMs), tackling scenarios where unseen classes and unseen domains continuously appear during testing. Unlike traditional TTA approaches, where the test stream comes only from a predefined set of classes, our framework allows models to adapt simultaneously to both covariate and label shifts, actively incorporating new classes as they emerge. Towards this goal, we establish a new benchmark for ITTA, integrating single-image TTA methods for VLMs with active labeling techniques that query an oracle for samples potentially representing unseen classes during test time. We propose a segmentation assisted active labeling module, termed SegAssist, which is training-free and repurposes the VLM's segmentation capabilities to refine active sample selection, prioritizing samples likely to belong to unseen classes. Extensive experiments on several benchmark datasets demonstrate the potential of SegAssist to enhance the performance of VLMs in real-world scenarios, where continuous adaptation to emerging data is essential.

Incremental Test Time Adaptation

Consider a model deployed in the real world, navigating a dynamic environment where it encounters familiar objects in unfamiliar settings and new objects it has never seen before. Traditional TTA methods handle covariate shifts but cannot accommodate dynamically emerging new classes. We introduce ITTA, a protocol that requires the model to simultaneously:

  1. Continuously adapt to covariate shifts
  2. Recognize and incorporate new classes as they appear
  3. Operate on a single-image basis without access to batches or labeled data
  4. Maintain performance across seen classes and a growing set of dynamically incorporated unseen classes
ITTA framework overview
Figure 1. Incremental Test Time Adaptation. A test stream in the real world can consist of samples with covariate shift (painting style) and label shift (unseen classes such as Egret and Tiger). Uncertain samples are queried for active labeling; new classes are added to the seen-class set when confirmed by an oracle. SegAssist is a plug-in module that favours selection of unseen class samples for active labeling.

The table below situates ITTA among closely related research directions. ITTA is the only setting that handles all of: training-free adaptation, single-image testing, covariate shift, label shift, and a growing classification space \(\mathcal{C}_s + \mathcal{C}_u\).

Training-free TTA Covariate shift Label shift Single image Task space Methods
\(\mathcal{C}_s\)TENT, CoTTA, ROID
\(\mathcal{C}_s\)TPT, TDA, DPE
\(\mathcal{C}_s+1\)Open-world TTA
\(\mathcal{C}_s+\mathcal{C}_u\)Class Incremental Learning
\(\mathcal{C}_s+\mathcal{C}_u\)Proposed ITTA (Ours)

Table 1. Comparison of the proposed ITTA framework with existing research directions.

SegAssist: Segmentation-Assisted Active Labeling

SegAssist pipeline
Figure 2. SegAssist pipeline. Uncertain samples are further filtered by performing pixel-wise segmentation using the top-K predicted classes plus a "background" class. A sample is forwarded to the oracle for labeling only if the majority of its pixels are classified as "background", prioritizing unseen-class samples.

Step 1: Pixel-wise segmentation of uncertain samples

For an uncertain sample \(x_t\), let \(\text{top}K(x_t)\) denote the top-\(K\) class names predicted by CLIP. We define \(\mathcal{C}_\text{seg}(x_t) = \text{top}K(x_t) \cup \{\text{"background"}\}\). Using patch features \(f_t(i,j)\) from the last self-attention layer, each patch is assigned a class label:

\begin{align} \hat{y}_t(i,j) = \arg\max_{c \,\in\, \mathcal{C}_\text{seg}(x_t)} \langle f_t(i,j),\, t_c \rangle \end{align}

where \(t_c\) is the text embedding of class \(c\). Patch predictions are upsampled via bilinear interpolation to produce the full segmentation map \(S(x_t)\).

Step 2: Background ratio for active sample selection

We compute the proportion of pixels classified as "background":

\begin{align} B(x_t) = \frac{1}{|S(x_t)|} \sum_{i=1}^{|S(x_t)|} \mathbb{I}\bigl[S_i(x_t) = \text{"background"}\bigr] \end{align}

A sample \(x_t\) is selected for oracle querying only if \(B(x_t) > \alpha\), with \(\alpha = 0.95\). This ensures the limited active-labeling budget is spent primarily on genuinely novel, unseen-class samples. SegAssist requires no additional training and adds negligible computation overhead, as patch features are already computed during CLIP inference.

Incremental Class Detection Delay (ICDD)

We propose a novel metric, Incremental Class Detection Delay (ICDD), to quantify how timely an ITTA system discovers new classes. It compares the ground-truth class introduction curve \(n_\text{gt}(t)\) with the detected-class curve \(n_\text{det}(t)\) over normalized time \(t \in [0,1]\):

\begin{align} \text{ICDD} = \text{AUC}(n_\text{gt}(t)) - \text{AUC}(n_\text{det}(t)) \end{align}

A lower ICDD (closer to zero) means the system detects new classes almost as soon as they appear. A higher ICDD indicates significant detection delay and consequent performance degradation. ICDD and Harmonic Mean (HM) accuracy are complementary: ICDD captures detection timeliness while HM measures classification correctness after detection.

ICDD metric illustration
Figure 3. ICDD metric. Given a budget of 3 samples, MSP-based selection chooses 2 seen-class and 1 unseen-class sample, exhausting the budget before later new classes arrive. SegAssist prioritizes unseen samples, detecting all three new classes as they are introduced. The bottom plot shows the detection curve \(n_\text{det}(t)\) vs. ground truth \(n_\text{gt}(t)\); the shaded area is the ICDD.

Experimental Results

We evaluate SegAssist by plugging it into three VLM-based TTA baselines: ZS-Eval (zero-shot CLIP), TDA (CVPR'24), and DPE (NeurIPS'24), combined with three active labeling strategies: Random, Entropy, and MSP. Experiments are on ImageNet-R, ImageNet-A, Clipart, and Painting (DomainNet), using CLIP ViT-B/16.

Base TTA Method ImageNet-R ImageNet-Adversarial Clipart Painting
HM ↑ICDD ↓ HM ↑ICDD ↓ HM ↑ICDD ↓ HM ↑ICDD ↓
ZS-EvalRandom 49.5725.90 23.6045.33 22.0475.30 32.5468.41
Entropy 59.8921.99 21.1143.83 48.2561.88 64.3443.89
MSP 62.9217.21 24.5941.47 47.6562.04 70.5939.14
SegAssist 64.0516.01 23.9441.89 49.0861.20 71.2138.56
TDARandom 53.3325.90 16.5845.33 22.5475.30 32.6668.41
Entropy 64.0619.52 18.7844.95 58.7949.10 67.2746.08
MSP 70.3813.25 19.2743.93 58.9950.68 68.8339.31
SegAssist 70.4813.07 20.0243.93 60.2548.96 69.2041.27
DPERandom 54.9025.90 28.5245.33 23.3675.30 33.4968.41
Entropy 0.1956.05 4.4457.88 15.5080.27 0.0081.81
MSP 68.0919.64 24.6247.18 65.3549.00 71.4534.70
SegAssist 69.3916.38 33.4244.98 65.4949.00 72.4033.12

Comparison of Harmonic Mean (HM ↑) and Incremental Class Detection Delay (ICDD ↓) across active labeling and TTA methods on the ITTA benchmark, evaluated on ImageNet-R, ImageNet-Adversarial, Clipart, and Painting. SegAssist consistently improves over the MSP baseline across all settings.

BibTeX

@InProceedings{sreenivas2025segassist,
  author    = {Sreenivas, Manogna and Biswas, Soma},
  title     = {Segmentation Assisted Incremental Test Time Adaptation in an Open World},
  booktitle = {British Machine Vision Conference},
  year      = {2025}
}