semantic segmentation deep learning

**Semantic Segmentation** is the **dense prediction task where a neural network assigns a class label to every pixel in an image — producing a pixel-perfect understanding of scene structure that enables applications from autonomous driving (road vs. sidewalk vs. pedestrian) to medical imaging (tumor boundary delineation) to satellite analytics (land use classification)**. **Segmentation Taxonomy** - **Semantic Segmentation**: Every pixel gets a class label. All instances of the same class share the same label (no distinction between individual objects). - **Instance Segmentation**: Separate mask for each object instance (distinguishes car-1 from car-2). Mask R-CNN is the canonical approach. - **Panoptic Segmentation**: Combines both — stuff classes (sky, road) get semantic labels; thing classes (cars, people) get instance-level masks. Unified scene understanding. **Architecture Evolution** - **FCN (Fully Convolutional Networks)**: Replaced FC layers with convolutions, enabling dense prediction at any resolution. Skip connections from earlier layers preserve spatial detail lost during downsampling. - **U-Net**: Symmetric encoder-decoder with skip connections at every level. The encoder extracts hierarchical features; the decoder upsamples and combines with encoder features via concatenation. Originally designed for biomedical segmentation where training data is scarce. The architecture of choice for medical imaging, satellite, and diffusion model decoders. - **DeepLab v3+**: Atrous (dilated) convolutions expand the receptive field without reducing resolution. Atrous Spatial Pyramid Pooling (ASPP) captures multi-scale context by applying parallel dilated convolutions at different rates. Encoder-decoder structure with ASPP in the encoder. - **SegFormer**: Transformer-based encoder with hierarchical feature maps (no positional encoding) and a lightweight MLP decoder. Efficient and performant across scales, from small edge models to large cloud models. - **SAM (Segment Anything Model)**: Foundation model for segmentation. Pretrained on 11M images with 1B+ masks. Accepts any prompt (point, box, text) and outputs a segmentation mask. Zero-shot transfer to unseen object categories. **Training Considerations** - **Loss Functions**: Cross-entropy per pixel is standard. Dice loss handles class imbalance (common when foreground is small). Focal loss downweights easy pixels. Boundary loss penalizes boundary misalignment. - **Data Augmentation**: Random crop, flip, scale, color jitter. CutMix and ClassMix create synthetic training scenes. - **Class Imbalance**: Real scenes have extreme class imbalance (99% background, 1% tumor). Weighted loss, oversampling, and hard example mining address this. **Evaluation Metrics** - **mIoU (mean Intersection over Union)**: The standard metric. IoU = (Prediction ∩ Ground Truth) / (Prediction ∪ Ground Truth), averaged over all classes. - **Pixel Accuracy**: Percentage of correctly classified pixels. Misleading when classes are imbalanced. Semantic Segmentation is **the pixel-level scene understanding capability that transforms images from passive pictures into structured spatial maps** — providing the dense, complete scene parsing that downstream systems need for navigation, measurement, and interaction with the physical world.

Go deeper with CFSGPT

Get AI-powered deep-dives, save terms, and run advanced simulations — free account.

Create Free Account