Professional Documents
Culture Documents
Final Report - ML
Final Report - ML
REPORT ON
IMAGE SEGMENTATION
Image Segmentation
Image segmentation is a method in which a digital image is broken down
into various subgroups called Image Segments which helps in
reducing the complexity of the image to make further processing or
analysis of the image simpler.
Segmentation in simple terms is assigning labels to pixels. All picture
elements or pixels belonging to the same category have a common label
assigned to them.
Different Image Segmentation techniques are as follows:
1. Threshold based segmentation
2. Edge - based segmentation
3. Region - based segmentation
4. Clustering - based segmentation
5. Artificial Neural Network based segmentation
1
Group Number 29
The results of the model that we have developed are discussed below
which includes the snippets of the program, their meanings and outputs
by showing the segmented image and original image.
NOTE: Some of the deep learning and machine learning frameworks and
libraries used are:
2
Group Number 29
for i in range(detection_count):
box = boxes[0, 0, i]
class_id = box[1]
score = box[2]
if score < 0.5:
continue
3
Group Number 29
These are the images that are the results of the Mask R-CNN model.
● The first one is the result for object division, that is basically, the
model detects all the models in the given image by masking other
objects in the image.
● The second one is the image that is basically instance segmented
image, that is, the objects are mapped to different classes based on
their pixel values and the colours for the labels are given randomly.
4
Group Number 29
5
Group Number 29
From above, image (a) consists of only 3 colors, which are in turn
used as the colors for k clusters. Here, we lose the significance of ‘k’
value if k is greater than the number of colors, as the clusters
cannot be differentiated clearly.
Image (b) is the desired image after k-means clustering, to
understand the clusters, differentiate them and derive the
inferences.
for i in range(0,kmeans.labels_.size):
if kmeans.labels_[i] == 0:
img2[i] = np.array([0.0,0.0,255.0])
elif kmeans.labels_[i] == 1:
img2[i] = np.array([255.0,255.0,0.0])
elif kmeans.labels_[i] == 2:
img2[i] = np.array([0.0,0.0,0.0])
elif kmeans.labels_[i] == 3:
img2[i] = np.array([255.0,0.0,255.0])
6
Group Number 29
7
Group Number 29
Input:
Output:
8
Group Number 29
The model that is used was trained using a really sophisticated dataset
which can identify over 50 classes of objects.
We tried to train our model with our own dataset of images. The images
are annotated manually using makesense.ai website. The images that are
used for training include various screwdrivers. A COCO Json file is
generated which is later used to train the Mask-RCNN model to identify
the screwdrivers in the input image.
The following images depict the defined classes in the annotation of
images.
9
Group Number 29
A random image is taken and ran through the model that is trained. The
above image is the output of the given image.
10
Group Number 29
11
Group Number 29
Name Contribution
12