# Image segmentation

> Canonical: https://skillalmanac.com/glossary/image-segmentation | Last verified: 2026-11-25 | Index status: index-eligible

Image segmentation is a computer vision task that partitions an image into groups of pixels, for example labelling each pixel with a class or outlining each separate object, instead of only naming what the picture contains.

Also called: semantic segmentation, instance segmentation, panoptic segmentation, segmentation deep learning, image segmentation deep learning.

## In plain language

Image segmentation answers the question of which pixels belong to what. Where a classifier says there is a dog in the photo, and a detector draws a box around it, segmentation traces the dog's outline, so every pixel is marked as dog, grass or sky. It is used where exact shapes matter, such as separating a tumour from healthy tissue in a scan or road from pavement in a driving camera. There are several kinds: some label classes without instance IDs, so separated cars can form disconnected regions with the same class label, while instance methods distinguish each car. Supervised methods commonly use pixel-labelled training images, which can be costly to annotate; other methods, such as graph-based segmentation, do not require such a training set, and it can fail on lighting or objects it has not seen.

## Technical definition

IBM describes three forms. Semantic segmentation assigns a class to every pixel without separating individual objects. Instance segmentation delineates the exact shape of each object instance. Panoptic segmentation combines both. Long, Shelhamer and Darrell show that convolutional networks trained end to end, pixels to pixels, can do semantic segmentation by converting classification networks into fully convolutional networks that accept inputs of any size and produce outputs of matching size. Mask R-CNN, by He and colleagues, extends Faster R-CNN with a branch that predicts an object mask alongside the bounding-box branch, for instance segmentation.

## How it shows up when you use agents

Coding agents such as Claude Code, Codex and Cursor do not segment images themselves. They can write code that calls a segmentation model, wire it into a pipeline, or run the library's evaluation script. The result is usually a mask: an array the size of the image in which each pixel holds a class number or an object ID. When an agent says it "found the objects", ask whether it produced boxes or masks, because the two answer different questions.

What breaks when this is misunderstood: people choose the wrong kind. Semantic class labels do not encode separate object identities. Touching same-class objects may form one connected region, while separated objects may form several; connected-region counts are not guaranteed object counts. Instance segmentation distinguishes object instances. Panoptic segmentation combines both. Another common slip is to judge a model on a handful of attractive examples. A next action is to inspect masks on awkward images, such as poor light, overlapping objects and unusual angles, and to check the training labels the model was built from. See [computer vision](/glossary/computer-vision) for the wider field and [convolutional neural network](/glossary/convolutional-neural-network) for the network type behind the fully convolutional approach.

The inspected example cards are adjacent image and dataset checks, not demonstrations of segmentation.

## Common confusions

- **Segmentation versus object detection.** Detection places a bounding box around each object. IBM describes instance segmentation as object detection that produces exact shape masks instead of rough boxes.
- **Semantic versus instance segmentation.** Semantic segmentation labels every pixel with a class but does not separate individual objects. Instance segmentation outlines each object separately and ignores background "stuff".
- **Segmentation versus image classification.** Classification gives one label for a whole image. Segmentation gives a label, or a mask, at the level of pixels.
- **Myth.** Segmentation needs a special kind of network that cannot reuse classification work. The FCN paper converts existing classification networks into segmentation networks and fine-tunes them.

## Worked examples in this catalogue

### [image-spec-check](https://skillalmanac.com/skills/skill-almanac/image-spec-check)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Exported images checked against your own spec table, with exact advice on what to resize, crop, re-export or replace.

Why it exercises the concept: Adjacent: it checks file properties against rules you write, and it does not look at what is in the image. It does not segment anything.

### [huggingface-datasets](https://skillalmanac.com/skills/huggingface/huggingface-datasets)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Hugging Face datasets read through the Dataset Viewer API: metadata, rows, search and filters.

Why it exercises the concept: Adjacent: supervised segmentation often uses pixel-labelled images. The Dataset Viewer workflow lets you inspect dataset rows and metadata; it does not itself demonstrate segmentation training or prediction.

### [split-leakage-check](https://skillalmanac.com/skills/skill-almanac/split-leakage-check)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Checks of train, validation and test files for duplicates, shared groups, time and label leakage, printing JSON.

Why it exercises the concept: Adjacent: a segmentation dataset still needs a clean split, and near-duplicate images, such as frames from one video, can sit on both sides. The skill can inspect supplied tabular IDs or groups, but explicitly misses image similarity and transformations; listing image paths alone does not detect near-duplicate frames.

## Related terms

- [Computer vision](https://skillalmanac.com/glossary/computer-vision.md)
- [Convolutional neural network (CNN)](https://skillalmanac.com/glossary/convolutional-neural-network.md)
- [Deep learning](https://skillalmanac.com/glossary/deep-learning.md)
- [Supervised learning](https://skillalmanac.com/glossary/supervised-learning.md)
- [Training data](https://skillalmanac.com/glossary/training-data.md)
- [Multimodal AI](https://skillalmanac.com/glossary/multimodal-ai.md)

## Sources

- [What is image segmentation?](https://www.ibm.com/think/topics/image-segmentation), IBM (accessed 2026-11-24)
- [Fully Convolutional Networks for Semantic Segmentation](https://arxiv.org/abs/1411.4038), arXiv (Long, Shelhamer and Darrell) (accessed 2026-11-24)
- [Mask R-CNN](https://arxiv.org/abs/1703.06870), arXiv (He, Gkioxari, Dollar and Girshick) (accessed 2026-11-24)
- [felzenszwalb: graph-based image segmentation](https://scikit-image.org/docs/stable/api/skimage.segmentation.html#skimage.segmentation.felzenszwalb), scikit-image (accessed 2026-11-25)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-25. [Glossary index](https://skillalmanac.com/glossary.md).
