Aditya Nisal
Email : anisal@wpi.edu
Description
Aim: To perform Semantic Segmentation using the U-Net architecture in Deep Learning.
​
Steps Involved:
-
Creating a script test_utils.py which gives us a summary of the model through the summary function.
-
Importing the required packages like tensorflow, matplotlib, imageio, etc.
-
Loading and splitting the dataset: (a) RGB Images and (b) Mask Images.
-
Checking out the masked and unmasked images from the dataset to make sure they are in order and have the same index.
-
Splitting the dataset to masked and unmasked images while setting the shuffle parameter as False.
-
Preprocessing the data: Resizing the images to (96, 128) and setting the method parameter to the nearest.
-
Writing functions for conv block(Encoder) and upsampling box(decoder) while the former returns the skip connections and the latter concatenates them with each output.
-
Creating a function for building the model including both the functions created above.
-
Conv2D from tf.keras.layers was used with parameters: activation-relu, padding-same, kernel_initializer-he_normal.
-
Setting model Dimensions as: img_height = 96, img_width = 128, num_channels = 3 and getting the summary of the model.
-
Using the compile function with adam optimizer and CategoricalCrossentropy loss and accuracy as the metrics.
-
Training the model with epochs=5, validation subsplits=5, batch_size=32.
-
Created a mask function to return the predicted mask.
-
Plotting the accuracy.
-
Getting the predictions from the output using matplotlib functions.
Latest Accuracy of the model
Input Image
True Mask
Predicted Mask