Segmentation mask
A segmentation mask is an image-shaped array that assigns each pixel or spatial element to a class, object, region, or corresponding segmentation value.
Deep Learning with R, Third Edition
A segmentation mask is a spatial label representation identifying the pixels belonging to an object or region in an image.
- How it is used
- Serves as the pixel-level training target and predicted output for pet segmentation and prompted object segmentation.
- How deep it goes
- Defines integer pixel labels, works through paired loading and prediction, and contrasts masks with boxes; defers Segment Anything decoder details.
- Examples
- Uses pet-photo trimaps, side-by-side predicted and target masks, and point- or box-prompted masks of fruit.
- What you can do after
- Build it from scratch with paired pet masks, or apply it via Segment Anything to produce prompted object masks.
Read how Deep Learning with R, Third Edition explains segmentation mask →
Deep Learning with Python, Third Edition
An image-shaped target annotation for segmentation where each pixel stores the class or region of the corresponding input pixel.
- How it is used
- Represents image content at pixel level for supervised segmentation and object-specific mask prediction.
- How deep it goes
- Explains label values, file pairing, array shapes, visualization, and preprocessing, but defers detailed mask-decoder internals.
- Examples
- Uses Oxford-IIIT Pets masks, three integer labels, fruit-object prompts, candidate masks, and overlaid visualizations.
- What you can do after
- Build it from scratch by preparing single-channel targets and training an encoder-decoder model to reconstruct input-sized masks.
Read how Deep Learning with Python, Third Edition explains segmentation mask →
Geometry for Programmers
An image mask is a 3D image whose cells indicate, typically with a single bit, whether corresponding spatial regions belong to a selected object or structure.
- How it is used
- Models selected spatial regions so Boolean and morphological operations can be applied to volumetric image data.
- How deep it goes
- Defines voxel membership and outlines Boolean operations, while deferring segmentation details and extended mask information.
- Examples
- Uses filled voxel models, Boolean intersection, unification, subtraction, and distance-valued mask extensions.
- What you can do after
- Apply Boolean intersection, unification, and subtraction to voxel models and combine them with dilation or erosion.
Read how Geometry for Programmers explains segmentation mask →
Deep Learning with PyTorch, Second Edition
A labeled image-like boolean map indicating which pixels belong to the target region in segmentation.
- How it is used
- Supports semantic segmentation by marking target pixels for training and extracting potential nodule candidates.
- How deep it goes
- Defines binary pixel labeling and demonstrates generated-mask storage, but does not detail mask quality metrics or model internals.
- Examples
- Uses binary nodule masks generated from 2D CT slices with SAM point prompts.
- What you can do after
- Builds paired CT-image and mask datasets for fine-tuning automatic segmentation models.
Read how Deep Learning with PyTorch, Second Edition explains segmentation mask →
Related concepts
- 3D imagekind of · A 3D image is a three-dimensional sampled representation of geometry or spatial data arranged as image-like values.
- SAMused by · SAM, or Segment Anything Model, is a pretrained promptable computer-vision model that generates segmentation masks for objects in images.
- Intersection over Unionmeasured by · Intersection over Union is the ratio of the intersection area or volume of two regions to the area or volume of their union.
- voxelequivalent to · A voxel is a discrete volumetric element, typically cubical, used to represent spatial data or occupancy in a three-dimensional grid.
- labelequivalent to · A label is an assigned target value, category, or reference annotation associated with an item, used to identify its expected outcome or support learning and evaluation.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.



