Manuscript Offprint

arXiv:2609.09477

LeCor: Learning to Be Corrected by Meta-Learned Test-Time Training for Interactive 3D Lung-Tumour Segmentation

Yi Luo, Yike Guo, Wenxuan Li, Zongwei Zhou, Rui Zhang, Kai Ding

Yi Luo 1^{1}, Yike Guo 2^{2}, Wenxuan Li 3^{3}

Zongwei Zhou 3^{3}, Rui Zhang 4(⊠)^{4(\boxtimes)}, and Kai Ding 2(⊠)^{2(\boxtimes)}

1^{1} Department of Biomedical Engineering, Johns Hopkins University

2^{2} Department of Radiation Oncology and Molecular Radiation Sciences, Johns Hopkins University

3^{3} Department of Computer Science, Johns Hopkins University

4^{4} Department of Surgery, University of Minnesota

ruizhang@umn.edu, kai@jhu.edu

Abstract. Delineating lung tumours on computed tomography (CT) takes a considerable share of the time spent on radiotherapy planning, and a contour proposed by a model can be refined interactively by the clinician. Promptable foundation models such as SAM 3 support this workflow by writing each correction into a session memory that conditions the remaining slices, while the model weights stay fixed. On 690 test cases from five public CT cohorts, fine-tuning SAM 3 on lung tumours raises the Dice obtained from a single point prompt from 0.298 to 0.757, and seven rounds of corrections raise it further to 0.765, but under memory conditioning alone the accuracy on slices the annotator has not touched stops improving after six rounds. We therefore treat each correction as a training signal and propose LeCor, which performs test-time training on a small set of case adapters that are reset for every case and meta-learned such that a single gradient step driven by a click improves the slices that were not clicked. On the 133 test cases that span at least eight slices, LeCor raises the Dice reached after seven correction rounds from 0.787 with the fine-tuned model to 0.827, reduces the number of cases that never reach a Dice of 0.80 from 47 to 27, and reaches in three correction rounds the accuracy that the fine-tuned model attains in seven.

Keywords: Interactive segmentation; Test-time training; Meta-learning; Foundation models; Lung cancer; Radiotherapy planning

1 Introduction

Radiotherapy for lung cancer requires the gross tumour volume to be delineated on the planning CT. Manual delineation takes roughly 16 to 22 minutes per case, and when eleven radiation oncologists delineated the same tumours, the three dimensional variation between them was about 1 cm at one standard deviation.

Y. Luo et al.

[33,34,37]. Fully automatic segmentation with the reference method nnU-Net [12] still leaves every contour to be reviewed and edited by a clinician before it is used. Clinical workflows have therefore converged on an interactive workflow in which the model proposes a contour and the clinician refines it. For thoracic organs at risk and for lung tumours, editing model proposals was faster and more consistent than manual delineation [19,38,37,9], and starting from an automatic contour reduced the variability between observers in most of the intervention studies. [39]. This work addresses interactive segmentation in which the clinician supplies corrections as clicks and the model revises its prediction after each one.

Promptable foundation models have made this workflow inexpensive. The Segment Anything Model (SAM) [15] segments an object from a point or box prompt, SAM 2 [28] extends it to video by carrying a memory of previously segmented frames, and SAM 3 [3] builds on the same memory architecture. Treating the slice axis of a CT volume as time turns volumetric segmentation into a tracking problem, and this is how these models are applied to 3D medical images [30,46,22]. The click is encoded into the session memory, and every slice decoded afterwards attends to that memory, so that a single correction can improve slices that the annotator never touched. However, the weights of the model stay fixed for the whole session. Each correction is consumed as a conditioning input; its contribution is bounded by what the memory can carry and is not retained in the parameters of the model.

Test-time training offers a different mechanism, in which the parameters of the model are updated on the test input itself. The original formulation trains on a self-supervised task defined on the test image [35], and TENT minimises the entropy of the model's own predictions [40]. A recent formulation for language models goes further and trains the model end to end so that its initialisation is optimised for the update it will make at test time [36]. Interactive segmentation is a particularly favourable setting for test-time training, because the user supplies supervision of ground truth quality. Optimisation at click time accordingly has a long history in interactive segmentation. These approaches range from backpropagating the interaction loss to the inputs or auxiliary latent variables of a frozen network [13,31], through updating the model parameters directly from user corrections [16] and, to adapting the model online at inference time in medical imaging [43,29]. These methods share a common property. The update is a fixed optimisation procedure applied at test time, whose loss, step size and parameter subset are set by hand and whose objective is to fit the pixels that were clicked. The training of the model does not control how the rest of the volume responds to such a step, so whether a correction improves the untouched slices depends on the region of parameter space that the fine-tuned model occupies.

In this work we propose to train an interactive segmentation model for medical images to be corrected, so that a click improves not only the slice on which it is placed but the segmentation of the whole lesion. We refer to this formulation as LeCor (learning to be corrected). We retain the structure of test-time optimisation, namely a gradient step on a small parameter subset driven by the click, and make the response of the model to that step a training objective. A small set of adapters termed case adapters is reset at the start of every case and forms the only part of the model that changes during a session. Their initial values and step sizes are meta-learned so that one gradient step taken on the clicked slices improves the prediction on the slices that were not clicked. To our knowledge, this is the first meta-learned test-time training method for interactive medical image segmentation, in which the update triggered by a correction is itself learned rather than designed. On 133 held-out lung tumours from five public cohorts LeCor continues to improve through all seven correction rounds where memory conditioning saturates, and after the seventh round it stands 4.00 percentage points of Dice (points hereafter) above the fine-tuned model evaluated with the same seven rounds and 2.82 points above the same update with a fixed step. Three rounds of LeCor reach the accuracy that the fine-tuned model reaches in seven. Controlled comparisons attribute the gain to the update itself rather than to the added parameters, and to the meta-learned initialisation rather than to the learned step sizes. From the standard initialisation every fixed step above 0.01 is harmful, yet the meta-learned initialisation is updated with benefit at steps three times larger, so meta-training has not found a better optimiser but has placed the case adapters where a large step is informative about the rest of the lesion. The approach treats a correction as a training signal rather than only as a prompt, and the same mechanism holds potential for other anatomies, imaging modalities and memory based foundation models.

References (46)