UNet for Kvasir-SEG Polyp Segmentation
Architecture
Standard U-Net architecture (Ronneberger et al., 2015) for binary medical image segmentation.
- Encoder: 4 downsampling stages (3→64→128→256→512) with double convolution blocks and max pooling
- Bottleneck: 512→1024 channels at the lowest spatial resolution
- Decoder: 4 upsampling stages using transposed convolutions with skip connections from the encoder
- Output: 1×1 convolution producing a single-channel binary segmentation mask
Input: (B, 3, 256, 256) RGB images → Output: (B, 1, 256, 256) segmentation logits
Loss Function
Combined BCE + Dice Loss to address class imbalance:
- BCE (Binary Cross-Entropy): Handles pixel-level binary classification
- Dice Loss: Directly optimizes the overlap between predicted and ground-truth masks, counteracting the dominance of background pixels in medical images
Dataset
Trained on
Kvasir-SEG — gastrointestinal polyp segmentation dataset.
References
Ronneberger, O., Fischer, P., & Brox, T. (2015). U-Net: Convolutional Networks for Biomedical Image Segmentation. MICCAI 2015.