Interactive segmentation models cut out an object from an image after a user clicks on it. They are now routinely compressed for phones by knowledge distillation, which means training a small "student" network to imitate a large "teacher." Both the teachers and the compressed students are trained and scored with clicks placed by a script at the exact center of the largest error region. Real people do not click like that. A 1,800-person user study found that human clicks land on average 15% of the object's diagonal away from that scripted point, and moving a click by a few pixels can drop a model from 95% to 60% IoU (TETRIS). No one has measured whether distillation makes this fragility better or worse, and current distillation methods do nothing to address it.
The proposal is to change what the student imitates. Instead of copying the teacher's mask for one exact click, the student copies the teacher's average mask over a distribution of human-like click positions around that click. As a second task, it predicts how much the teacher's mask varies under that jitter, a per-pixel stability map. The averaging smooths out the teacher's own sharp failures, so the student could in principle be less fragile than its teacher. The stability head gives the shared decoder an extra training signal and also tells the interface, at no extra cost, where a click is risky. In short, we distill the teacher's response to the whole neighborhood of human clicks, not its answer to one robotic click, and we train stability prediction as an auxiliary task alongside the mask.
Core Claim
We claim that prompt-in-the-loop distillation with click-marginalized teacher targets and an auxiliary stability head yields an on-device student whose worst-case sensitivity to click placement is lower than that of both the standard distilled student and the teacher. We also claim it keeps mask accuracy under scripted clicks and boxes, and that it runs in one decoder pass.
The method builds directly on EdgeSAM. EdgeSAM distills the Segment Anything Model (SAM) into a CNN student. It feeds corrective point prompts, sampled from regions where the student and teacher disagree, into both models during training. It showed this beats encoder-only distillation as in MobileSAM by 1–2 mIoU on COCO and LVIS. EdgeSAM gives us the training loop. What it lacks is any model of how humans actually click: its prompts are sampled by error-region heuristics, and its robustness under the TETRIS protocol has never been reported. MobileSAM matters here as a cautionary result. It found that naively coupling random prompts into distillation was noisy (0.72 vs 0.75 mIoU for decoupled encoder distillation). Our averaging over click positions is a structured version of the prompt noise MobileSAM found harmful, so we must show it helps rather than repeats that failure.
Mechanism
Let $x$ be an image, $c$ a click (or box) placed by the scripted simulator, and $q(\delta)$ a distribution of human placement offsets. We set the scale of $q$ to TETRIS's mean deviation of 15% of the instance diagonal and restrict samples to stay within the error region the click is meant to fix. If the TETRIS user clicks can be obtained, we fit $q$ to them directly. Let $m_T(x,c)$ be the teacher's per-pixel mask probability. The student's targets are
$$\bar m_T(x,c) = \mathbb{E}_{\delta\sim q}\, m_T(x, c+\delta), \qquad v_T(x,c) = \mathrm{Var}_{\delta\sim q}\, m_T(x, c+\delta),$$
estimated with $K$ Monte Carlo samples. The student has a shared decoder with two heads, a mask $m_S$ and a stability map $v_S$, and is trained with
$$\mathcal{L} = \mathcal{L}_{\text{mask}}(m_S(x,c), \bar m_T) + \lambda\, \mathcal{L}_{\text{stab}}(v_S(x,c), v_T),$$
where $\mathcal{L}_{\text{mask}}$ is the binary cross-entropy plus Dice loss used in EdgeSAM, and $\lambda$ weights the auxiliary head.
Two facts keep this cheap. First, SAM's image embedding is computed once per image and can be cached. Second, its mask decoder is light (about 4 ms in MobileSAM's measurements), so the $K$ extra teacher queries cost only decoder passes. The student is always fed the unperturbed click. Robustness therefore has to be built into its weights, and at inference it cannot fall back on extra decoder passes.
Multi-task learning is a means here, not the goal. The stability head is an auxiliary task in the sense of Situ et al. and Doersch et al.: its role is to shape the shared decoder's representation. Because mask and stability losses have very different scales and may conflict, we log the cosine similarity between the two tasks' gradients on the shared decoder. If the conflict is substantial, we apply the magnitude homogenization from RotoGrad, not its full rotations, since the decoder is small. We deliberately do not expand into a many-task student covering depth, matting and text. That three-way combination is the obvious one, but it stacks the open problems of Li & Bilen and JointDistill on top of EdgeSAM without a sharp claim to test.
Research Program
The first study is purely diagnostic, and its result is useful whichever way it comes out. Using the TETRIS benchmark and its IoU-D measure (the gap between best- and worst-case IoU as the click moves within a region), we compare SAM ViT-H, MobileSAM and EdgeSAM. This answers whether distillation amplifies or dampens click fragility. Neither MobileSAM nor EdgeSAM reports such numbers.
The second study trains the proposed student. We use EdgeSAM's RepViT-M1 architecture, its 1% SA-1B training subset and its encoder-distillation checkpoint. Only the prompt-in-the-loop stage changes, so any difference comes from the targets. We extend perturbation from points to box corners, since boxes are EdgeSAM's other prompt type.
The third study tests whether the stability map is useful at inference. In a simulated-user loop with human-like click noise, the interface nudges each suggested click toward low-variance pixels within the error region. We measure the number of clicks needed to reach 85% and 90% IoU (NoC@85, NoC@90).
Baselines
The naive reference point is the teacher itself, SAM ViT-H, evaluated with the same perturbed clicks. It is the bar we are trying to clear on robustness despite being roughly 30x slower on device according to EdgeSAM's measurements. Below it sits MobileSAM, the encoder-only distilled student. It is the strongest argument that prompt-aware distillation is unnecessary, and it reports 0.75 mIoU in its own setting.
The strongest existing method is EdgeSAM, retrained by us from the same encoder checkpoint, data subset and number of iterations, using its released recipe. On COCO and LVIS it reports surpassing MobileSAM and EfficientSAM by an average of 1–2 mIoU and closely matching SAM with box prompts. For robustness to human clicks: no reported result found on Lacuna for EdgeSAM's IoU-D or for any distilled SAM on TETRIS. To beat it, our student must show lower IoU-D and better NoC@90 under human-like clicks on TETRIS, GrabCut, Berkeley and DAVIS, while staying within 0.5 mIoU of EdgeSAM on COCO/LVIS box prompts with scripted clicks. A robustness gain bought with a clear accuracy loss does not count.
Two ablations isolate the key ingredients. The first is EdgeSAM with click jitter: corrective clicks are perturbed by the same $q$, but the target is the teacher's single mask at the jittered click, and the number of teacher decoder queries per step is matched ($K$). Any gap between this and our method is attributable to averaging the teacher rather than to seeing jittered inputs. The second is our method with $\lambda=0$, which isolates the auxiliary stability task. All variants receive the same tuning budget, a small sweep over learning rate and, where relevant, $K$, $\lambda$ and the scale of $q$, chosen on a held-out SA-1B split, never on test benchmarks.
Why not just…?
Why not just jitter the clicks during distillation? This is the most serious threat, because it is simple and plausibly captures most of the gain. Our distinction is that jitter alone trains the student to reproduce the teacher's answer at each nearby click, including the teacher's spikes. The averaged target instead asks for one stable answer across the whole neighborhood. Whether that difference matters is an empirical question, settled by the matched-query jitter ablation in the Baselines. If jitter matches averaging on IoU-D, the averaging contribution is void, and the paper's claims reduce to the diagnostic study and the stability head.
Why not just average the student's own predictions over several jittered clicks at test time? The student's decoder is cheap, so ensembling $K$ passes is feasible on a GPU and also produces a variance map. It is a real competitor. We report it at $K=4$ and $K=8$ with measured on-device latency. Our case against it is twofold. First, it multiplies decoder cost on phones, where EdgeSAM's 26 ms budget is the selling point. Second, it averages the student's errors, not the teacher's knowledge. If test-time ensembling matches our single-pass student at equal latency, we will say so.
Why not just fine-tune with ground-truth masks under click noise and skip the teacher? SA-1B has masks, so robust supervised fine-tuning is possible. However, a single ground-truth mask carries no information about which neighborhood clicks are ambiguous, for example the pepperoni-versus-pizza case in TETRIS. The teacher's variance under jitter does carry that information. We run this variant with the same data and schedule. If it matches us, the teacher's averaged response adds nothing over labels.
Why not just add text or scribble prompts to remove ambiguity? UniFSS shows that class-aware prompts reduce semantic confusion, and SegNext shows that dense scribble maps reach 91.75 mIoU on HQSeg-44K versus 86.16 for SAM. These richer prompts complement our method rather than replace it. Clicks remain the cheapest and most common input, and placement noise affects any spatial prompt. Folding scribbles into the same averaging scheme is a natural follow-up, but it is outside this study.
Proposed Experiments
Training uses 1% of SA-1B with cached teacher embeddings. Evaluation uses TETRIS (IoU-D, plus worst-case IoU from TETRIS's adversarial click placements); GrabCut, Berkeley and DAVIS (NoC@85 and NoC@90 under scripted and human-like click simulators); SA-1K and COCO/LVIS (mIoU with box and point prompts, comparable to EdgeSAM's reporting); and latency on a 2080 Ti and an iPhone-class device. iCMFormer's reported 90% IoU on Berkeley with fewer than two scripted clicks serves as a reference for the full-size, non-distilled state of the art (iCMFormer).
There are three decisive checks. The first is whether our student's IoU-D on TETRIS falls below the teacher's. That is the clearest sign that averaging removed the teacher's spikes rather than merely copying them, and if it fails, the central story weakens to "matches the teacher." The second is whether averaged targets beat matched-query jitter by a margin larger than the spread across three random seeds. The third is whether the stability head is calibrated, meaning its predicted variance correlates with the measured IoU change when the click is moved. A further question is whether click guidance based on it lowers NoC@90 for noisy simulated users. If the head is uncalibrated, it is dropped and the auxiliary-task claim is retracted. The success criterion throughout is a robustness gain at unchanged mask accuracy and single-pass latency.
References
- TETRIS: Towards Exploring the Robustness of Interactive Segmentation
- EdgeSAM: Prompt-In-the-Loop Distillation for SAM
- Faster Segment Anything: Towards Lightweight SAM for Mobile Applications
- Assisting Main Task Learning by Heterogeneous Auxiliary Tasks with Applications to Skin Cancer Screening
- Multi-task Self-Supervised Visual Learning
- RotoGrad: Gradient Homogenization in Multi-Task Learning
- Knowledge Distillation for Multi-task Learning
- JointDistill: Adaptive Multi-Task Distillation for Joint Depth Estimation and Scene Segmentation
- Beyond mask: Rethinking guidance types in few-shot segmentation
- Rethinking Interactive Image Segmentation with Low Latency, High Quality, and Diverse Prompts
- Interactive Image Segmentation with Cross-Modality Vision Transformers