0% found this document useful (0 votes)
106 views

Chapter 6. Image Segmentation

The document discusses image segmentation techniques. It covers fundamentals of image segmentation including partitioning an image into regions based on discontinuity or similarity of intensity values. Traditional techniques include edge-based and region-based segmentation. Point, line, and edge detection are also discussed. Various edge models are presented including step edges, ramp edges, and roof edges. Traditional image segmentation algorithms generally rely on discontinuity or similarity of intensity values.

Uploaded by

Đình Hạnh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
106 views

Chapter 6. Image Segmentation

The document discusses image segmentation techniques. It covers fundamentals of image segmentation including partitioning an image into regions based on discontinuity or similarity of intensity values. Traditional techniques include edge-based and region-based segmentation. Point, line, and edge detection are also discussed. Various edge models are presented including step edges, ramp edges, and roof edges. Traditional image segmentation algorithms generally rely on discontinuity or similarity of intensity values.

Uploaded by

Đình Hạnh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 83

TRƯỜNG ĐẠI HỌC BÁCH KHOA HÀ NỘI

XỬ LÝ ẢNH TRONG CƠ ĐIỆN TỬ


Machine Vision

Giảng viên: TS. Nguyễn Thành Hùng


Đơn vị: Bộ môn Cơ điện tử, Viện Cơ khí

Hà Nội, 2021 1
Chapter 6. Image Segmentation

1. Fundamentals
2. Point, Line, and Edge Detection
3. Thresholding
4. Image Segmentation Using Deep Learning

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 2


1. Fundamentals

➢ Let R represent the entire spatial region occupied by an image. We may view
image segmentation as a process that partitions R into n subregions, R1, R2, …,
Rn, such that:

where Q(Rk) is a logical predicate defined over the points in set Rk and  is the null
set.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 3


1. Fundamentals

➢ Two regions Ri and Rj are said to be adjacent if their union forms a connected
set.
➢ The regions are said to disjoint If the set formed by the union of two regions is
not connected.
➢ The fundamental problem in segmentation is to partition an image into regions
that satisfy the preceding conditions.
➢ Segmentation algorithms for monochrome images generally are based on one
of two basic categories dealing with properties of intensity values: discontinuity
and similarity.
▪ Edge-based segmentation
▪ Region-base segmentation
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 4
1. Fundamentals

(a) Image of a constant intensity region. (b) Boundary based on intensity discontinuities. (c) Result of
segmentation. (d) Image of a texture region. (e) Result of intensity discontinuity computations (note
the large number of small edges). (f) Result of segmentation based on region properties.
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 5
1. Fundamentals

❖ Traditional Image Segmentation techniques

6
Chapter 6. Image Segmentation

1. Fundamentals
2. Point, Line, and Edge Detection
3. Thresholding
4. Image Segmentation Using Deep Learning

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 7


2. Point, Line, and Edge Detection

➢ Detecting sharp, local changes in intensity


➢ The three types of image characteristics: isolated points, lines, and edges
➢ Edge pixels: the intensity of an image changes abruptly
➢ Edges (or edge segments): sets of connected edge pixels
➢ Edge detectors: local image processing tools designed to detect edge pixels

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 8


2. Point, Line, and Edge Detection

➢ A line:
▪ a (typically) thin edge segment
▪ the intensity of the background on either side of the line is either much higher
or much lower than the intensity of the line pixels.
▪ “roof edges”
➢ Isolated point: a foreground (background) pixel surrounded by background
(foreground) pixels.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 9


2. Point, Line, and Edge Detection

❖ Background
➢ an approximation to the first-order derivative at an arbitrary point x of a one-
dimensional function f(x)

x = 1 for the sample preceding x and x = -1 for the sample following x.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 10


2. Point, Line, and Edge Detection

❖ Background
➢ an approximation to the first-order derivative at an arbitrary point x of a one-
dimensional function f(x)

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 11


2. Point, Line, and Edge Detection

❖ Background
➢ The forward difference

➢ The backward difference

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 12


2. Point, Line, and Edge Detection

❖ Background
➢ The central difference

➢ The second order derivative based on a central difference

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 13


2. Point, Line, and Edge Detection

❖ Background

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 14


2. Point, Line, and Edge Detection

❖ Background
➢ For two variables

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 15


2. Point, Line, and Edge Detection

❖ Background

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 16


2. Point, Line, and Edge Detection

❖ Background
➢ Spatial filter kernel

Where zk is the intensity of the pixel whose spatial location


corresponds to the location of the kth kernel coefficient.

A general 3x3 spatial filter kernel. The


w’s are the kernel coefficients (weights).
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 17
2. Point, Line, and Edge Detection

❖ Detection of Isolated Points


➢ Laplacian

➢ Detected points

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 18


2. Point, Line, and Edge Detection

❖ Detection of Isolated Points


➢ Example

(a) Laplacian kernel used for point detection. (b) X-ray image of a turbine blade with a porosity manifested
by a single black pixel. (c) Result of convolving the kernel with the image. (d) Result of using Eq. (10-15)
was a single point (shown enlarged at the tip of the arrow).
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 19
2. Point, Line, and Edge Detection

❖ Line Detection
➢ EXAMPLE: Using the Laplacian for line detection.

(a) Original image. (b) Laplacian image; the magnified section shows the positive/negative double-line effect
characteristic of the Laplacian. (c) Absolute value of the Laplacian. (d) Positive values of the Laplacian.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 20


2. Point, Line, and Edge Detection

❖ Line Detection
➢ EXAMPLE: Detecting lines in specified directions.

Line detection kernels. Detection angles are with respect to the axis system in above figure,
with positive angles measured counterclockwise with respect to the (vertical) x-axis.
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 21
2. Point, Line, and Edge Detection

❖ Line Detection
➢ EXAMPLE: Detecting lines in specified directions.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 22


2. Point, Line, and Edge Detection

❖ Edge Models
➢ A step edge ➢ A ramp edge ➢ A roof edge

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 23


2. Point, Line, and Edge Detection

❖ Edge Models

A 1508x1970 image showing (zoomed)


actual ramp (bottom, left), step (top,
right), and roof edge profiles. The
profiles are from dark to light, in the
areas enclosed by the small circles. The
ramp and step profiles span 9 pixels and
2 pixels, respectively. The base of the
roof edge is 3 pixels.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 24


2. Point, Line, and Edge Detection

❖ Edge Models

(a) Two regions of


constant intensity
separated by an ideal
ramp edge. (b) Detail
near the edge, showing
a horizontal intensity
profile, and its first and
second derivatives.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 25


2. Point, Line, and Edge Detection

➢ EXAMPLE: Behavior of the first and second derivatives in the region of a noisy
edge.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 26


2. Point, Line, and Edge Detection

➢ EXAMPLE: Behavior of the first and second derivatives in the region of a noisy
edge.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 27


2. Point, Line, and Edge Detection

❖ Edge Detection
➢ The three steps performed typically for edge detection are:
▪ Image smoothing for noise reduction.
▪ Detection of edge points.
▪ Edge localization.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 28


2. Point, Line, and Edge Detection

❖ Basic Edge Detection


➢ The Image Gradient and Its Properties

Magnitude:

The direction of the gradient vector:

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 29


2. Point, Line, and Edge Detection

❖ Basic Edge Detection


➢ EXAMPLE: Computing the gradient.

Using the gradient to determine edge strength and direction at a point. Note that the edge
direction is perpendicular to the direction of the gradient vector at the point where the
gradient is computed. Each square represents one pixel.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 30


2. Point, Line, and Edge Detection

❖ Basic Edge Detection


➢ Gradient Operators

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 31


2. Point, Line, and Edge Detection

❖ Basic Edge Detection


➢ Gradient Operators

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 32


2. Point, Line, and Edge Detection

➢ Kirsch compass kernels

Kirsch compass kernels. The edge direction of strongest response of each kernel is labeled below it.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 33


2. Point, Line, and Edge Detection

➢ EXAMPLE: Illustration of the 2-D gradient magnitude and angle.

The Sobel absolute value response of the two components of the gradient
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 34
2. Point, Line, and Edge Detection

➢ EXAMPLE: Illustration of the 2-D gradient magnitude and angle.

Gradient angle image


Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 35
2. Point, Line, and Edge Detection

➢ EXAMPLE: Illustration of the 2-D gradient magnitude and angle.

The original image smoothed using a 5x5 averaging kernel prior to edge detection.
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 36
2. Point, Line, and Edge Detection

➢ EXAMPLE: Illustration of the 2-D gradient magnitude and angle.

Diagonal edge detection. (a) Result of using the Kirsch kernel in Fig. 10.15(c) . (b)
Result of using the kernel in Fig. 10.15(d) . The input image in both cases was Fig.
10.18(a) .
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 37
2. Point, Line, and Edge Detection

❖ Basic Edge Detection


➢ Combining the Gradient with Thresholding

(a) Result of thresholding Fig. 10.16(d) , the gradient of the original image.
(b) Result of thresholding Fig. 10.18(d) , the gradient of the smoothed image.
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 38
2. Point, Line, and Edge Detection

❖ Basic Edge Detection


➢ The Canny Edge Detector: three basic objectives
▪ Low error rate
▪ Edge points should be well localized
▪ Single edge point response

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 39


2. Point, Line, and Edge Detection

➢ The Canny Edge Detector: three basic objectives


▪ The Gaussian function:

▪ convolving f and G:

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 40


2. Point, Line, and Edge Detection

➢ The Canny Edge Detector:

(a) Two possible orientations (b) Range of values (shaded) of (c) The angle ranges of the edge
of a horizontal edge (shaded) , the direction angle of the edge normals for the four types of edge
in a 3x3 neighborhood. normal for a horizontal edge. directions in a 3x3 neighborhood.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 41


2. Point, Line, and Edge Detection

➢ The Canny Edge Detector:


▪ Non maximum suppression: finding the pixel with the maximum value in an
edge

r = αb + (1−α)a

Non Maximum Suppression with Interpolation No Interpolation


Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 42
2. Point, Line, and Edge Detection

➢ The Canny Edge Detector:


▪ Double thresholding

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 43


2. Point, Line, and Edge Detection

➢ The Canny Edge Detector:


▪ Connectivity analysis

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 44


2. Point, Line, and Edge Detection

➢ The Canny edge detection algorithm consists of the following steps:


▪ Smooth the input image with a Gaussian filter.
▪ Compute the gradient magnitude and angle images.
▪ Apply nonmaxima suppression to the gradient magnitude image.
▪ Use double thresholding and connectivity analysis to detect and link edges.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 45


2. Point, Line, and Edge Detection

(a) Original image of size


834x1114 pixels, with intensity
values scaled to the range [0,
1]. (b) Thresholded gradient
of the smoothed image. (c)
Image obtained using the
Marr-Hildreth algorithm. (d)
Image obtained using the
Canny algorithm. Note the
significant improvement of the
Canny image compared to
the other two.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 46


2. Point, Line, and Edge Detection

❖ Basic Edge Detection


➢ Line detection with Hough transform

(a) xy-plane. (b) Parameter space.


Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 47
2. Point, Line, and Edge Detection

➢ Line detection with Hough transform

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 48


2. Point, Line, and Edge Detection

➢ EXAMPLE: Some basic properties of the Hough transform.

(a) Image of size 101x101 pixels,


containing five white points (four in (b) Corresponding parameter space.
the corners and one in the center).
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 49
2. Point, Line, and Edge Detection

➢ EXAMPLE: Line detection Hough transform.

(a) A 502x564 aerial image of an


airport. (b) Edge map obtained
using Canny’s algorithm. (c) Hough
parameter space (the boxes
highlight the points associated with
long vertical lines). (d) Lines in the
image plane corresponding to the
points highlighted by the boxes. (e)
Lines superimposed on the original
image.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 50


Chapter 6. Image Segmentation

1. Fundamentals
2. Point, Line, and Edge Detection
3. Thresholding
4. Image Segmentation Using Deep Learning

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 51


3. Thresholding

➢ The Basics of Intensity Thresholding

Single thresholding

Multiple thresholding

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 52


3. Thresholding

➢ The Basics of Intensity Thresholding

Intensity histograms that can be partitioned (a) by a single threshold, and (b) by dual thresholds.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 53


3. Thresholding

➢ The Role of Noise in Image Thresholding

(a) Noiseless 8-bit image.


(b) Image with additive
Gaussian noise of mean 0
and standard deviation of
10 intensity levels. (c)
Image with additive
Gaussian noise of mean 0
and standard deviation of
50 intensity levels. (d)
through (f) Corresponding
histograms.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 54


3. Thresholding

➢ The Role of Illumination and Reflectance in Image Thresholding

(a) Noisy image. (b)


Intensity ramp in the range
[0.2, 0.6]. (c) Product of (a)
and (b). (d) through (f)
Corresponding histograms.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 55


3. Thresholding

❖ Basic Global Thresholding


➢ Iterative algorithm
▪ Select an initial estimate for the global threshold, T.

▪ Segment the image using T in Eq. (1). This will produce two groups of pixels: G1, consisting of
pixels with intensity values > T and G2, consisting of pixels with values  T.

▪ Compute the average (mean) intensity values m1 and m2 for the pixels in G1 and G2
respectively.

▪ Compute a new threshold value midway between m1 and m2:

▪ Repeat Steps 2 through 4 until the difference between values of T in successive iterations is
smaller than a predefined value, T

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 56


3. Thresholding

➢ EXAMPLE: Global thresholding

(a) Noisy fingerprint. (b) Histogram. (c) Segmented result using a global
threshold (thin image border added for clarity).
Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 57
3. Thresholding

➢ Optimum Global Thresholding Using Otsu’s Method

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 58


3. Thresholding

➢ Optimum Global Thresholding Using Otsu’s Method

(a) Original image. (b) Histogram (high


peaks were clipped to highlight details in
the lower values). (c) Segmentation result
using the basic global algorithm. (d)
Result using Otsu’s method.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 59


3. Thresholding

➢ Using Image Smoothing to Improve Global Thresholding

(a) Noisy image and (b) its


histogram. (c) Result obtained
using Otsu’s method. (d) Noisy
image smoothed using a 5x5
averaging kernel and (e) its
histogram. (f) Result of
thresholding using Otsu’s
method.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 60


3. Thresholding

➢ Using Image Smoothing to Improve Global Thresholding

(a) Noisy image and (b) its


histogram. (c) Result obtained
using Otsu’s method. (d) Noisy
image smoothed using a 5x5
averaging kernel and (e) its
histogram. (f) Result of
thresholding using Otsu’s
method. Thresholding failed in
both cases to extract the
object of interest.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 61


3. Thresholding

➢ Using Edges to Improve Global Thresholding


(a) Noisy image and (b) its
histogram. (c) Mask image
formed as the gradient
magnitude image
thresholded at the 99.7
percentile. (d) Image
formed as the product of (a)
and (c). (e) Histogram of
the nonzero pixels in the
image in (d). (f) Result of
segmenting image (a) with
the Otsu threshold based
on the histogram in (e). The
threshold was 134, which is
approximately midway
between the peaks in this
histogram.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 62


3. Thresholding

➢ EXAMPLE: Using edge information based on the Laplacian to improve global


thresholding.

(a) Image of yeast cells. (b) Histogram of (a).


(c) Segmentation of (a) with Otsu’s method
using the histogram in (b). (d) Mask image
formed by thresholding the absolute Laplacian
image. (e) Histogram of the nonzero pixels in
the product of (a) and (d). (f) Original image
thresholded using Otsu’s method based on the
histogram in (e).

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 63


3. Thresholding

➢ EXAMPLE: Multiple global thresholding

(a) Image of an iceberg. (b) Histogram. (c) Image segmented into three regions
using dual Otsu thresholds.

Rafael C. Gonzalez, Richard E. Woods, “Digital image processing,” Pearson (2018). 64


Chapter 6. Image Segmentation

1. Fundamentals
2. Point, Line, and Edge Detection
3. Thresholding
4. Image Segmentation Using Deep Learning

https://viso.ai/deep-learning/image-segmentation-using-deep-learning/. Retrieved 20 Oct 2021. 65


4. Image Segmentation Using Deep Learning

❖ Types of Image Segmentation tasks


➢ Semantic segmentation: classification of pixels in an image into semantic
classes
➢ Instance segmentation: classify pixels into categories on the basis of “instances”
rather than classes
➢ Panoptic segmentation: the combination of semantic segmentation and instance
segmentation where each instance of an object in the image is segregated and
the object’s identity is predicted

66
A Gentle Introduction to Image Segmentation for Machine Learning (v7labs.com)
4. Image Segmentation Using Deep Learning

❖ Types of Image Segmentation tasks

67
A Gentle Introduction to Image Segmentation for Machine Learning (v7labs.com)
4. Image Segmentation Using Deep Learning

❖ Deep Learning-based methods


➢ Semantic segmentation models provide segment maps as outputs corresponding
to the inputs they are fed.

68
A Gentle Introduction to Image Segmentation for Machine Learning (v7labs.com)
4. Image Segmentation Using Deep Learning

❖ Deep Learning-based methods


➢ Like most of the other applications, using a CNN for semantic segmentation is
the obvious choice.
➢ When using a CNN for semantic segmentation, the output is also an image
rather than a fixed length vector.

A Beginner's guide to Deep Learning based Semantic Segmentation using Keras | Divam Gupta 69
4. Image Segmentation Using Deep Learning

❖ Convolutional neural networks for segmentation


➢ The architecture of the model contains several convolutional layers, non-linear
activations, batch normalization, and pooling layers
➢ The initial layers learn the low-level concepts such as edges and colors
➢ The later level layers learn the higher level concepts such as different objects

A Beginner's guide to Deep Learning based Semantic Segmentation using Keras | Divam Gupta 70
4. Image Segmentation Using Deep Learning

❖ Convolutional neural networks for segmentation

Spatial tensor is downsampled and converted to a vector


A Beginner's guide to Deep Learning based Semantic Segmentation using Keras | Divam Gupta 71
4. Image Segmentation Using Deep Learning

❖ Convolutional neural networks for segmentation

Encoder-Decoder architecture
A Beginner's guide to Deep Learning based Semantic Segmentation using Keras | Divam Gupta 72
4. Image Segmentation Using Deep Learning

❖ Skip connections

Encoder-Decoder with skip connections


A Beginner's guide to Deep Learning based Semantic Segmentation using Keras | Divam Gupta 73
4. Image Segmentation Using Deep Learning

❖ Transfer learning

Transfer learning for Segmentation

A Beginner's guide to Deep Learning based Semantic Segmentation using Keras | Divam Gupta 74
4. Image Segmentation Using Deep Learning

❖ Loss function
➢ Each pixel of the output of the network is compared with the corresponding pixel
in the ground truth segmentation image. We apply standard cross-entropy loss
on each pixel.
In binary classification, where the number of classes M equals
2, cross-entropy can be calculated as:

If M>2 (i.e. multiclass classification), we calculate a separate


loss for each class label per observation and sum the result.

A Beginner's guide to Deep Learning based Semantic Segmentation using Keras | Divam Gupta 75
4. Image Segmentation Using Deep Learning

❖ Implementation
➢ Dataset: The first step in training our segmentation model is to prepare the
dataset.
➢ Data augmentation:

Example of image augmentation for segmentation


A Beginner's guide to Deep Learning based Semantic Segmentation using Keras | Divam Gupta 76
4. Image Segmentation Using Deep Learning

❖ Implementation
➢ Building the model: define our segmentation model with skip connections
➢ Choosing the model:
▪ Choosing the base model: select an appropriate base network → ResNet, VGG-
16, MobileNet, Custom CNN, …
▪ Select the segmentation architecture: FCN, SegNet, UNet, PSPNet, …

A Beginner's guide to Deep Learning based Semantic Segmentation using Keras | Divam Gupta 77
4. Image Segmentation Using Deep Learning

❖ Implementation

Architecture of FCN32
A Beginner's guide to Deep Learning based Semantic Segmentation using Keras | Divam Gupta 78
4. Image Segmentation Using Deep Learning

❖ Implementation

Architecture of SegNet
A Beginner's guide to Deep Learning based Semantic Segmentation using Keras | Divam Gupta 79
4. Image Segmentation Using Deep Learning

❖ Implementation

Architecture of UNet
A Beginner's guide to Deep Learning based Semantic Segmentation using Keras | Divam Gupta 80
4. Image Segmentation Using Deep Learning

❖ Implementation

Architecture of PSPNet

A Beginner's guide to Deep Learning based Semantic Segmentation using Keras | Divam Gupta 81
4. Image Segmentation Using Deep Learning

❖ Implementation
➢ Choosing the input size: If there are a large number of objects in the image, the
input size shall be larger. The standard input size is somewhere from 200x200
to 600x600.
➢ Training: output are the model weights
➢ Testing: get predictions from a saved model

A Beginner's guide to Deep Learning based Semantic Segmentation using Keras | Divam Gupta 82
4. Image Segmentation Using Deep Learning

❖ Implementation

Image Segmentation results of


DeepLabV3 on sample images.
Photo Credit:
https://arxiv.org/pdf/2001.05566.
pdf

83

You might also like