liveBook · Manning

Segmentation mask

As explained in Deep Learning with PyTorch, Second Edition

A labeled image-like boolean map indicating which pixels belong to the target region in segmentation.

A segmentation mask is an image-like map that labels each pixel according to whether it belongs to a target region. In binary semantic segmentation, true pixels identify nodule candidates and false pixels identify uninteresting healthy tissue. section 15.2

Masks pair with the original CT slices to form a training dataset. They provide ground-truth regions for fine-tuning a model such as SegFormer, while avoiding the cost of manually annotating every pixel. section 15.6.3

A practical mask dataset includes:

  • A CT image and its corresponding mask, stored with matching filenames or metadata. section 15.6.3
  • A binary representation in which true values mark the target region and false values mark background tissue. section 15.2

Generating a mask with SAM

A point placed at a suspected nodule center can prompt SamPredictor to produce a mask. The resulting mask is converted to an image and saved alongside the CT slice for later fine-tuning.

How Deep Learning with PyTorch, Second Edition covers it

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 it assumes
Assumes basic image classification familiarity while introducing pixel-level labeling through nodule and healthy-tissue examples.
What you can do after
Builds paired CT-image and mask datasets for fine-tuning automatic segmentation models.
How it connects
Connects semantic segmentation with instance segmentation, object detection, SegFormer, U-Net, Mask R-CNN, and DeepLab.

Also explained in

Compare how 4 books explain segmentation mask →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with PyTorch, Second Edition. The section links point to the parts of the book it draws on.