Cooking your first U-Net for Image Segmentation
8 min readJul 7, 2023
Fellow AI cooks, today you are going to learn how to prepare one of the most important recipes in Computer Vision: the U-Net.
You can find the full code on my Github, or on Google Colab
Even better, we are going to apply the U-Net to the MRI segmentation dataset from Kaggle, accessible here:
Ingredients of the Recipe:
- Exploration of the Dataset
- Creation of the Datasets and Dataloader classes
- Creation of the architecture
- Examining the losses (DICE and Binary Cross Entropy)
- Results
- Post-cooking tips to Spice things up!
Exploration of the Dataset
We are given a set of (255 x 255) 2D images of MRI scans, as well as their corresponding masks, where we have to classify each pixel as either 0 (sane), or 1 (tumour).
Here are some examples: