When learning image segmentation UNet serves as one of the basic models for the segmentation. UNet is one of the most used models for image segmentation. You can see people are making a lot of changes in the Original UNet architecture like using**_ Resnet_** etc. but let’s implement the **Original UNet Architecture. **in 7 Steps

Architecture of the Unet.

The architecture of the Unet can be divided into two part**_ Left_** (Contracting path) &_ Right_ (Expansion path).

The Left part_ is just a simple convolution network. In the left part Two 3x3 Convolution layers followed by a Relu activation function are stacked together (Sequentially) and a 2x2 maxpool layer is applied after that(red arrow in image) First vertical bar in the left side in the image is not a layer but represents the input.(input image tile)_

The Right part_ is where interesting things happen. Right part also uses Two 3x3 Convolution layers stacked together (Sequentially) like left side but no Relu activation function is used and there is no maxpool layer used instead a 2x2 Transpose convolution layer is used (green arrow in image ). During the expansion path, we will take the image (copy ) from the left side and combine it with the image on the right (grey arrow in the image). Remember a sequential 3x3 convolution layers are also used in the right side so the input for that will be combination of the image from right and its previous layer (half white and blue box in the right side of the image is the combination)._

The output layer on the right side an extra convolution layer is applied (output segmentation map ).


So let’s just code the Unet architecture.

Full code :_ Github_

#unet #ai #computer-vision #pytorch #image-segmentation

Implementing UNet in Pytorch
23.50 GEEK