0
0
Computer Visionml~12 mins

Semantic segmentation vs instance segmentation in Computer Vision - Model Approaches Compared

Choose your learning style9 modes available
Model Pipeline - Semantic segmentation vs instance segmentation

This pipeline compares two popular image segmentation tasks: semantic segmentation and instance segmentation. Both divide an image into meaningful parts, but semantic segmentation labels each pixel by class, while instance segmentation also separates individual objects of the same class.

Data Flow - 5 Stages
1Input Image
1 image x 256 height x 256 width x 3 channelsRaw color image input1 image x 256 height x 256 width x 3 channels
A photo showing multiple dogs and cats in a park
2Preprocessing
1 image x 256 x 256 x 3Resize and normalize pixel values to 0-11 image x 256 x 256 x 3
Image pixels scaled from 0-255 to 0-1
3Feature Extraction
1 image x 256 x 256 x 3Convolutional layers extract visual features1 image x 64 x 64 x 128 features
Edges, textures, and shapes detected in image
4Semantic Segmentation Head
1 image x 64 x 64 x 128Predict class label for each pixel1 image x 256 x 256 x number_of_classes
Pixels labeled as 'dog', 'cat', 'background'
5Instance Segmentation Head
1 image x 64 x 64 x 128Detect and segment individual object instancesList of masks with shape 256 x 256 per instance
Separate masks for each dog and cat in image
Training Trace - Epoch by Epoch
Loss:
1.2 |************
0.8 |********
0.5 |*****
0.35|****
0.25|***
Epochs ->
EpochLoss ↓Accuracy ↑Observation
11.20.45Initial training with high loss and low accuracy
50.80.65Model starts learning to segment classes better
100.50.80Good improvement in pixel classification accuracy
150.350.88Model accurately segments most objects
200.250.92Converged with high accuracy and low loss
Prediction Trace - 5 Layers
Layer 1: Input Image
Layer 2: Feature Extraction
Layer 3: Semantic Segmentation Head
Layer 4: Instance Segmentation Head
Layer 5: Final Output
Model Quiz - 3 Questions
Test your understanding
What is the main difference between semantic and instance segmentation?
ASemantic segmentation labels each pixel by class, instance segmentation also separates individual objects
BSemantic segmentation detects objects, instance segmentation classifies images
CInstance segmentation only works on black and white images
DSemantic segmentation groups all images into one class
Key Insight
Semantic segmentation assigns a class to every pixel, useful for understanding overall scene layout. Instance segmentation goes further by separating each object, enabling detailed object-level analysis. Training shows loss decreasing and accuracy increasing, indicating the model learns to segment images well.