Introducing image segmentation
Image segmentation is the process of assigning a class label (such as person, bicycle, or animal) to each pixel of an image. You can think of it as classification but on a pixel level – instead of classifying the entire image under one label, we’ll classify each pixel separately. The output of an image segmentation operation is known as a segmentation mask. It is a tensor with the same dimensions as the original input image, but instead of color, each pixel is represented by the class of object, to which it belongs. There are two types of segmentation:
- Semantic segmentation: This assigns a class to each pixel but doesn’t differentiate between object instances. For example, the middle image in the following figure shows a semantic segmentation mask, where the pixels of each separate vehicle have the same value. Semantic segmentation can tell us that a pixel is part of a vehicle but cannot make a distinction between two vehicles...