One Click on an Object Outside the 80-Class Vocabulary: How Promptable Segmentation Moved the Target from Training Labels to Inference Time
1. Where the Target Lives When It Is Frozen at Training Time
1.1 The question that organizes this tutorial
Ask a segmentation model what it is segmenting, and the honest answer is often: "whichever of the categories I was trained on happens to be in the image." For semantic and instance segmentation that answer is not an implementation detail — it is the task definition. The target of the segmentation is a category list, chosen once at training time, and inference can only pick among its entries.
This tutorial is built around a single question: where is the segmentation target defined? We will look at two answers. In the traditional formulation, the target lives in a category list frozen at training time; in the promptable formulation, the target is whatever an inference-time prompt says it is. Everything else — the models, the datasets, the benchmark numbers — is scenery. Before we can appreciate what promptable segmentation changed, we need to see how thoroughly the traditional formulation is welded to its category list.
1.2 FCN: the category list is literally the output layer
Start with the semantic side. Fully Convolutional Networks for semantic segmentation (Long, Shelhamer & Darrell, 2014) framed segmentation as dense per-pixel classification over a fixed label set: the network appends "a 1×1 convolution with channel dimension 21 to predict scores for each of the PASCAL classes (including background) at each of the coarse output locations" — 21 being the 20 PASCAL VOC object classes plus background — and is trained with a per-pixel multinomial logistic loss. Every pixel ends up with a probability distribution over exactly those 21 classes, and inference can only report the class with the highest score among them. The paper reports 62.2% mean IU on PASCAL VOC 2012, state of the art at the time.FCN
If you come from a software background, this structure should feel familiar: the output layer is like an enum compiled into a binary. The enum's cases were fixed when the program was built; at runtime the program can only reference cases that exist at compile time, and adding a case means recompiling — here, retraining. The category list is baked into the network's final layer, not consulted from outside.
The two structural facts we need — fully convolutional processing and per-pixel outputs — are visible in the paper's architecture and result figures:

Caption: The FCN skip-architecture as a DAG: layer grids (pooling and prediction layers) connected by solid/dashed/dotted lines show how coarse, high-layer information (stride 32) is combined with fine, low-layer information (stride 16/8) to produce the per-pixel prediction layer — the minimal structural support for the "dense per-pixel classification" point.FCN

Caption: FCN's qualitative results on PASCAL: columns show the FCN-8s color-coded per-pixel class map, the previous state-of-the-art (SDS), the ground-truth class map, and the input image — the output form is "each pixel labeled with one class from a fixed category set." The bottom row is a single failure case (lifejackets in a boat read as people), which Section 2 uses to show how the label set bounds the output.FCN
1.3 Mask R-CNN: masks carry class labels at instance level
The instance side makes the same point with a different output structure. Mask R-CNN (He et al., ICCV 2017) extends detection with a parallel mask branch: for each region of interest, the network outputs a class label, a bounding box, and a per-instance mask — an output space of the form (class id, box, mask) over COCO's K = 80 classes. The category binding is explicit in the mask branch itself: it "can predict K masks per RoI, but we only use the k-th mask, where k is the predicted class by the classification branch." In other words, the mask a user finally sees was selected by a class id that had to come from the trained classifier's label set.Mask R-CNN
The framework figure shows the parallel heads, and the qualitative figure shows the consequence: every mask on screen carries a category label from the fixed vocabulary.

Caption: The Mask R-CNN framework for instance segmentation: an input image flows through a convolutional backbone; region proposals are aligned to features; three parallel heads then predict the class label, the bounding box, and a per-instance mask — a category-bound output structure at instance level. No FPN/RPN/RoIAlign internals are read from this figure.Mask R-CNN

Caption: Mask R-CNN results on the COCO test set: each detected instance is shown with a colored mask, a bounding box, a category name, and a confidence score — masks literally carry class labels from the fixed training-time vocabulary.Mask R-CNN
1.4 The formal shape of this family
A recent foundation-model survey formalizes the whole family in one equation: generic image segmentation is the case where the input space is just the image — in its notation, the prompt set P is empty (P = ∅). We will unpack that notation in the final chapter; for now the point is that the entire family shares one shape: its target is a category set chosen at training time, and inference can only score or select among it.
That is the first answer to our opening question. In FCN and Mask R-CNN, the target of segmentation is a category list fixed at training time. Which raises the question the rest of this tutorial answers: what happens when the object you want to segment is not on the list?
2. Why an Object Outside the List Is Unreachable
2.1 The limit follows from the formulation, not the model
The limitation is worth stating precisely, because it is often misdiagnosed as a quality problem. It is not. FCN's output layer has exactly 21 channels; Mask R-CNN's mask branch emits K = 80 binary masks per region and discards all but the k-th. There is no channel for "the thing I am pointing at," because that thing was never a training category — and no amount of capacity, data, or tuning can manufacture one. Reaching an unseen category requires extending the label set and retraining; the output space is bound to the training-time class list by construction.
Caption: Where the structural limitation comes from: the category list is baked into the output layer at training time, the output space is restricted to it, and inference can only score or select within the trained classes — an object outside the list (orange node) is unreachable without retraining.
The FCN paper itself contains a small, honest illustration of exactly this — recall the output maps from Section 1. One of its qualitative results is a failure row: "the net sees lifejackets in a boat as people." A lifejacket is not a PASCAL class, so the closest entry in the list wins. It is a single example, not a systematic claim — but a precise one: the label set bounds what the network can output, and the output is whatever the network can be forced to say within that set.
2.2 The vocabulary is closed by design
The survey that formalized this family says it outright: pre-promptable models "remain limited to a fixed set of predetermined tasks, e.g., joint semantic, instance, and panoptic segmentation, with a closed vocabulary." That phrase — closed vocabulary — is the survey's name for what we have been describing from primary sources: a task whose target set was sealed at training time.FMSurvey
One terminological note before we move on: "closed-set" is not a term FCN or Mask R-CNN themselves use. It is an interpretive label, but it is anchored in primary quotes — the fixed 21-channel output layer, per-pixel classification, the k-th mask selection. When we call the traditional formulation closed-set, we are naming exactly what those quotes describe.
2.3 The historical workaround: point at the object
If the formulation cannot reach an arbitrary object, users found another way around it — not by fixing the formulation, but by bypassing the category list entirely. GrabCut (Rother, Kolmogorov & Blake, 2004) let a user specify the target directly at interaction time: "The user drags a rectangle loosely around an object. The object is then extracted." No category is involved anywhere; the target is a rectangle drawn over the image when the tool runs.GrabCut

Caption: GrabCut's (2004) interaction-to-result workflow, three examples: the user drags a rectangle loosely around the object (flower, person, alpaca), and the object is then extracted onto a white background — the target is specified by the user at interaction time, not chosen from a category list. The figure shows rectangles only, no strokes.GrabCut
This is the fact that sharpens everything that follows: users have been able to point at arbitrary objects since 2004. So what did promptable segmentation actually change? If the answer were "inventing pointing," the story would end here. It did not — and the next chapter shows where the real boundary lies.
3. Pointing at Objects Is Twenty Years Old
3.1 A lineage, not an invention
Interactive segmentation — user hints specifying the target at interaction time — is roughly two decades old, and it evolved steadily. GrabCut (2004) took a loose rectangle plus optional foreground/background strokes and ran a per-image graph-cuts optimization. By 2021, Reviving Iterative Training with Mask Guidance (RITM) had made it a mature deep-learning tool: a feedforward model takes encoded click channels and, in its iterative variant, the previous step's mask as a third input channel, and refines the mask as the user adds clicks.RITM And in 2023, Segment Anything (SAM) took the same gesture — a point — and made it the interface of a general, trained task. The lineage over the same source photograph makes the continuity visible:

Caption: The interactive-segmentation lineage as designed: a horizontal timeline GrabCut 2004 → RITM 2021 → SAM drawn over the same source photograph, with a bracket reading "per-image interactive tool" over the first two panels and "general task formulation" over SAM, plus a time arrow with year ticks. The three are continuous in "the user points at the target"; what changes is the framing.
The RITM figure shows what the mature tool looked like: a user fixing an existing mask with corrective clicks.

Caption: RITM (2021) mask correction: left column, "inaccurate external mask + corrective clicks" — positive (green) and negative (red) clicks; right column, the corrected mask. A tool-level illustration of mature click-based interactive segmentation before SAM; no architecture or click-encoding claims.RITM
3.2 Tool vs. task formulation: where the boundary is
So where exactly does the boundary sit? The SAM paper draws it itself, in the paragraph contrasting its pre-training with interactive segmentation: "unlike interactive segmentation whose aim is to eventually predict a valid mask after enough user input, our aim is to always predict a valid mask for any prompt."SAM
Meta's announcement of Segment Anything puts the same boundary in plain language. Before SAM, it explains, "there were two classes of approaches" to segmentation. The first, interactive segmentation, allowed "segmenting any class of object" but "required a person to guide the method by iteratively refining a mask." The second, automatic segmentation, handled "specific object categories defined ahead of time" but required "substantial amounts of manually annotated objects to train," along with the compute and expertise to train the model. "Neither approach provided a general, fully automatic approach to segmentation." Then the one-liner that structures the whole shift: "SAM is a generalization of these two classes." It takes the interactive side's freedom (any object) and the automatic side's convenience (no per-image human guidance) and folds them into a single trained model.MetaBlog
The survey agrees on terminology: it classifies clicks, scribbles, boxes, and polygons as visual prompts under promptable image segmentation, and observes that while the term "prompt" is relatively new, promptable image segmentation itself has been studied for many years — the formal way of saying that pointing is old, and the umbrella framing is new.
3.3 What the old tools could not do
The distinction the exam will test is this: interactive methods were per-image tools. The user's hint is consumed by an optimization or a forward pass that runs on that one image; nothing general is learned from it, and the interaction does not transfer to the next image or the next object. The hint lives and dies with the single image it was drawn on.
Promptable segmentation changes the framing, not the gesture: the same point or box becomes the input to a task — a trained function that must return a valid mask for any prompt, on any image, with no category set anywhere in the definition. Pointing was not invented in 2023; what was invented is the decision to treat pointing as a task specification rather than a per-image workaround.
So users have pointed at arbitrary objects since 2004, but only per image. The promptable shift is a change of framing — from a one-off tool to a trained, general task. Which brings us to the chapter that matters most: what exactly is the task that SAM is trained to solve?
4. The Promptable Task
4.1 The task, defined in the paper's own words
The SAM paper translates the idea of a prompt from NLP to segmentation, and the definition is best quoted verbatim, because every later claim in this tutorial rests on it:
"a prompt can be a set of foreground / background points, a rough box or mask, free-form text, or, in general, any information indicating what to segment in an image. The promptable segmentation task, then, is to return a valid segmentation mask given any prompt."
Note what is absent: no category set, no label list, no class to predict. The target is whatever the prompt indicates. The paper also defines what "valid" means — a requirement that looks trivial until you notice its consequence: "even when a prompt is ambiguous and could refer to multiple objects ..., the output should be a reasonable mask for at least one of those objects." The model is not required to guess the user's intention perfectly; it is required to always answer with a plausible mask. That is a very different contract from "classify each pixel into one of 21 classes."SAM
Meta's blog states the same definition in plainer words — "We trained SAM to return a valid segmentation mask for any prompt" — and the official repository ships exactly this interface: SamPredictor.predict() takes points or boxes and returns masks.
The paper's own overview figure makes the definition visible: prompts drawn on the image drive the mask outputs.

Caption: The SAM paper's task–model–data overview: panel (a) makes the promptable task itself visible — point, box, and mask prompts overlaid on an image, each driving a mask output; panel (b) is the Segment Anything Model; panel (c) is the SA-1B data engine. This figure establishes the "prompt specifies the target" intuition; no architecture internals are read from panel (b), and no quantitative claims are made from it.SAM
As of this writing, the SAM-era definition remains the canonical one: the recent literature on promptable segmentation is dominated by model successors and downstream applications, not by formulation-level revisions — so this task definition is the one to learn.
4.2 The space of prompts
A recent survey of prompt engineering for SAM organizes "what an inference-time prompt is" into a three-branch taxonomy: geometric prompts (points, boxes, masks), textual semantic prompts (class descriptions, part-level semantics), and multimodal fusion prompts (vision-language alignment, cross-modal attention). Its own interface-level description is the cleanest summary of the formulation: these inputs give "flexible control over the segmentation process without additional training."PromptSurvey

Caption: The geometric branch of the prompt taxonomy: point-based, box-based, and mask-based interaction modalities guiding SAM to segment a target. The figure depicts the geometric branch only — the textual and multimodal branches of the full taxonomy are carried by the survey's text, not by this figure.PromptSurvey
One cross-check worth knowing for the exam: the foundation-model survey cuts the same space along a different axis — by interaction paradigm, classifying interactive (visual prompts: clicks, scribbles, boxes), referring (textual prompts: a linguistic phrase), and few-shot (image-mask pairs) segmentation as the sub-families of promptable image segmentation. These two taxonomies are not in conflict; they are two legitimate ways of slicing the same space. The modality axis (geometric/textual/multimodal) and the paradigm axis (interactive/referring/few-shot) agree on the one fact that matters here: spatial prompts and text are distinct prompt classes, and points/boxes/masks are the core spatial family.FMSurvey
4.3 What the formulation buys: decoupling what from how
If you have a software background, the survey's formalization of this task reads like a function signature. It models segmentation as learning a mapping over the input space X = I × P — the image domain times a collection of prompts. In other words, the task is segment(image, prompt): the prompt is a runtime argument, not a compile-time constant. In the traditional formulation the "prompt" (the class list) was fixed when the model was built; here it is supplied per call.
That single change is what decouples what to segment from how to segment. "What to segment" is decided at inference, by the prompt — point at the alpaca, and the alpaca is the target. "How to segment" — the mapping from image plus prompt to mask — is learned once during training, and generalizes. This is the interface/implementation separation in miniature: the interface (any prompt specifying a target) is stable and open, while the implementation (the trained model) can be swapped, scaled, or retrained without redefining the task.
In the promptable task, then, the target mask is defined by the prompt at inference time; no category set is needed at all. The natural next question is empirical: does this formulation actually work — can one trained model really answer any prompt with a valid mask? That is what the next chapter shows with SAM.
5. SAM in Practice
5.1 Zero-shot transfer: masks for image types never seen in training
The formulation promises open-set behavior: a model that answers prompts about anything, including objects and image types it never saw during training. SAM's evaluation makes that promise concrete. The paper evaluates SAM on a suite of 23 diverse segmentation datasets — underwater imagery, egocentric video frames, medical images, indoor scenes — image distributions far from SA-1B's training data, and the results are presented as mask overlays on samples from each dataset:

Caption: Qualitative zero-shot evidence: a grid of samples from the 23 diverse segmentation datasets used to evaluate SAM, each image overlaid with masks produced by SAM — covering image distributions (underwater, egocentric, medical, indoor) never seen during training. No per-dataset numbers are read from the figure.SAM
The numbers behind this figure are worth quoting with their qualifier — they are as reported in the paper, not independently re-verified. On a single-point benchmark, SAM "yields higher results on 16 of the 23 datasets, by as much as ≈47 IoU" compared with RITM; and with an "oracle" that picks the best of SAM's three candidate masks, it outperforms RITM on all datasets. The abstract summarizes the direction: SAM is "designed and trained to be promptable, so it can transfer zero-shot to new image distributions and tasks," often "competitive with or even superior to prior fully supervised results."SAM
5.2 Compositional prompting: a detector's boxes as prompts
The open-set behavior is not limited to points. The paper demonstrates a compositional use: feed the output of another model as the prompt. "If one has a bounding box detector for cats, cat instance segmentation can be solved by providing the detector's box output as a prompt to our model." The target — which cat, where — comes from the inference-time prompt; the segmentation itself comes from SAM. Figure 7 of the paper shows this on LVIS: ViTDet's box predictions are fed to SAM as box prompts, and SAM produces instance masks for the detected objects:

Caption: Zero-shot instance segmentation on LVIS v1: ViTDet's box predictions are fed to SAM as box prompts, and SAM produces masks from those boxes (with ground truth for comparison) — the compositional "detector boxes as prompts" case. The figure makes no standalone quantitative claim and does not support a general "SAM beats ViTDet" reading.SAM
This is the open-set formulation in its purest form: the "class" of the target is whatever the detector happened to find — not a category the segmenter was trained to name.
5.3 The shipped artifact
None of this is a paper-only fantasy. The official repository — the same project, Apache-2.0 licensed — states the interface in its README: "The Segment Anything Model (SAM) produces high quality object masks from input prompts such as points or boxes," and exposes it as a few lines of code: set an image, call predict() with the prompt, get masks.SAMRepo
The repository's demo assets show real inference output. The first is the canonical point-prompt case — a single green dot, a mask:

Caption: Official repo demo: a 3×4 grid of photographs (a bird on grass, a person with a backpack, a person holding a bottle, a "ZURICH" wall sign), each overlaid with red mask outlines and green point markers; rows show a coarse mask, a finer mask, and a zoom-in detail. A direct visual of "point prompt defines the target mask"; only point markers are visible, so no box/text prompt claims are made.SAMRepo
The second shows what dense output looks like — every region of a street scene covered by a mask:

Caption: Official repo demo: a street scene (a tram, a glass shelter, buildings and trees) overlaid with many semi-transparent colored segmentation masks — what dense mask output looks like. Note the right edge is slightly cropped (the banner text is cut off), and the colored regions carry no category semantics.SAMRepo
Behind this interface is the training corpus, whose scale the paper states in its abstract: "over 1 billion masks on 11M licensed and privacy respecting images." And Meta's announcement gives the open-set phrasing in official language: SAM "can generate masks for any object in any image, even including objects and image types that it had not encountered during training."MetaBlog
SAM, then, is the concrete embodiment of the promptable formulation: a single trained model answers point, box, and mask prompts with valid masks, and its zero-shot results are exactly the open-set behavior the formulation promises. Both sides are now concrete — the closed-set family and the promptable family. The final chapter puts them side by side.
6. Side by Side: Where the Target Is Defined, and the Closed Set Becomes an Open Set
6.1 The comparison, in one table
Everything in this tutorial reduces to one contrast: where the segmentation target is defined. The table below puts the two formulations next to each other, using the primary-source facts we have established.
| Traditional formulation (semantic / instance segmentation) | Promptable formulation (SAM) | |
|---|---|---|
| What the model must know at training time | A fixed category list — FCN: 21 PASCAL classes; Mask R-CNN: COCO K = 80 | A prompt interface (points, boxes, rough masks); no category set at all |
| Output space | Per-pixel class maps; per-instance (class id, box, mask) | A mask that answers the prompt |
| Who decides the target | The dataset's label list, chosen before training | The user, at inference time |
| Reaching a new object | Extend the label set and retrain | Just point at it — zero-shot |
| Formal shape (survey notation) | X = I × P with P = ∅; outputs tied to vocabulary C | X = I × P with a provided P; methods "do not directly predict classes" |
The formalization in the last row is the survey's unified account: segmentation is a mapping over input space X = I × P (image × prompts) to output space Y = M × C (masks × semantic categories). Generic image segmentation is the case where P is empty — the image alone determines the output, and the output vocabulary is closed. Promptable image segmentation is the case where P is provided, and "PIS methods only generate segmentation masks closely related to the prompts and do not directly predict classes" — the target is whatever the prompt points at, not a class from a list.FMSurvey
6.2 Both families in one frame
The survey's taxonomy figure shows the two families in a single image — the top row is the closed-set world, the bottom row the promptable world:

Caption: The survey's task taxonomy, both sides of the dichotomy in one figure: the top row, Generic Image Segmentation (GIS) — (a) semantic, (b) instance, (c) panoptic; the bottom row, Promptable Image Segmentation (PIS) — (d) interactive (a point prompt and an "object worn on the head" annotation), (e) referring (linguistic-phrase driven), (f) few-shot (support image + query image with image-mask pair).FMSurvey
The survey's own roadmap places this dichotomy in the field's larger organization — a structural map, not an argument:

Caption: The survey's roadmap: from the emergence of segmentation knowledge in foundation models, the field branches into a GIS line (Semantic / Instance / Panoptic) and a PIS line (Interactive / Referring / Few-shot), with future directions on the right. Structural context only — it does not itself contrast training-time labels with inference-time prompts.FMSurvey
6.3 Terminology, sorted
One exam trap remains: the relationship between interactive, referring, and promptable segmentation. The cleanest way to hold it: promptable is the umbrella — the task of returning a valid mask for any prompt. Interactive (visual prompts: clicks, scribbles, boxes), referring (textual prompts: a linguistic phrase), and few-shot (image-mask pairs) are sub-families under that umbrella, distinguished by prompt type along the survey's paradigm axis. The prompt-engineering survey's modality axis — geometric vs. textual vs. multimodal — is a complementary way of cutting the same space; both axes agree that spatial prompts and text are distinct classes, so your point/box/mask and text classifications must stay consistent whichever axis you use.
The historical subtlety to remember: interactive segmentation predates the word "prompt" by decades, and it stayed a per-image tool. Promptable segmentation takes that same interaction and promotes it to the task definition — which is why SAM can honestly be called "a generalization" of the interactive and the automatic approaches, rather than the inventor of pointing.
6.4 From a closed set to an open set
The whole shift fits in one sentence: the segmentation target moved from a training-time category list to an inference-time prompt — and with it, the task went from a closed set of categories to an open set of objects specified on the fly.
That is the answer to the question this tutorial opened with. In FCN and Mask R-CNN, the target lives in a category list compiled at training time, and inference can only pick among it — an object outside the list is structurally unreachable. In promptable segmentation, the target lives in the prompt you give the model when it runs: a point, a box, a rough mask — anything that says what to segment. SAM is the proof that the formulation works: one trained model, any prompt, valid masks for objects it never saw in training. Pointing was never the hard part; deciding that the prompt — not the label list — defines the target, was.
References
The core sources cited in this tutorial are listed below; read the originals for deeper study:
- Segment Anything (Kirillov et al., Meta AI Research) — arXiv:2304.02643
- Fully Convolutional Networks for Semantic Segmentation (Long, Shelhamer & Darrell) — arXiv:1411.4038
- Mask R-CNN (He et al., ICCV 2017) — arXiv:1703.06870
- GrabCut — Interactive Foreground Extraction using Iterated Graph Cuts (Rother, Kolmogorov & Blake, SIGGRAPH 2004) — Microsoft Research publication page
- Reviving Iterative Training with Mask Guidance for Interactive Segmentation (RITM, Sofiiuk et al., ICIP 2022) — arXiv:2102.06583
- Image Segmentation in Foundation Model Era: A Survey — arXiv:2408.12957
- facebookresearch/segment-anything (official SAM repository, Apache-2.0) — https://github.com/facebookresearch/segment-anything
- Prompt Engineering in Segment Anything Model: Methodologies, Applications, and Emerging Challenges — arXiv:2507.09562
- Introducing Segment Anything: Working toward the first foundation model for image segmentation (Meta AI blog, 2023-04-05) — https://ai.meta.com/blog/segment-anything-foundation-model-image-segmentation/