Skip to content
ModelListedExternal
Download

Unet Kvasir Seg

Standard U-Net with: Encoder: 4 levels (64, 128, 256, 512 channels), each with two Conv3x3+BN+ReLU blocks followed by MaxPool2x2 Bottleneck: 1024 channels at 16x16 spatial resolution Decoder: 4 levels mirroring the...

KindOtherVersionRevision 5e1711a

Model source

Kind
Other
File size
118 MB
Version
vRevision 5e1711a
Updated
Sep 27, 2026
Downloads
0
Tasks
Image segmentation
Source
Hugging Face

Source description

U-Net for Gastrointestinal Polyp Segmentation

Architecture

Standard U-Net with:

  • Encoder: 4 levels (64, 128, 256, 512 channels), each with two Conv3x3+BN+ReLU blocks followed by MaxPool2x2
  • Bottleneck: 1024 channels at 16x16 spatial resolution
  • Decoder: 4 levels mirroring the encoder, using ConvTranspose2d for learned upsampling + skip connections via concatenation
  • Output: 1x1 Conv producing a single-channel binary mask

Input: 3x256x256 RGB image -> Output: 1x256x256 segmentation mask

Loss Function

BCE + Dice Loss -- Binary Cross-Entropy provides smooth per-pixel gradients, while Dice Loss directly optimizes mask overlap and handles class imbalance (polyps are typically small relative to background).

Training

  • 20 epochs, batch size 8, learning rate 1e-4 (Adam)
  • Trained on Kvasir-SEG dataset (gastrointestinal polyp segmentation)
  • Best checkpoint selected by validation loss

Parameters

~31M parameters

Sources

1 source
Hugging FacePrimaryVersion 5e1711ad5239d52a9cf07b84f64c59b00e40dd4d
huggingface.co/rmachado23/unet-kvasir-seg/tree/5e1711ad5239d52a9cf07b84f64c59b00e40dd4d

Verified Sep 27

Model artifacts

1 artifact

model.safetensors

safetensors · 118 MB · SHA-256 a6c5997d592f…39da · Hugging Face

Download

Source excerpts

2 excerpts

--- tags: - image-segmentation - medical-imaging - unet - pytorch datasets: - Angelou0516/kvasir-seg --- # U-Net for Gastrointestinal Polyp Segmentation ## Architecture Standard U-Net with: - **Encoder**: 4 levels (64, 128, 256, 512 channels), each with two Conv3x3+BN+ReLU blocks followed by MaxPool2x2 - **Bottleneck**: 1024 channels at 16x16 spatial resolution - **Decoder**: 4 levels mirroring the encoder, using ConvTranspose2d for learned upsampling + skip connections via concatenation - **Output**: 1x1 Conv producing a single-channel binary mask Input: 3x256x256 RGB image -> Output: 1x256x256 segmentation mask ## Loss Function **BCE + Dice Loss** -- Binary Cross-Entropy provides smooth per-pixel gradients, while Dice Loss directly optimizes mask overlap and handles class imbalance (polyps are typically small relative to background). ## Training - 20 epochs, batch size 8, learning rate 1e-4 (Adam) - Trained on Kvasir-SEG dataset (gastrointestinal polyp segmentation) - Best checkpoint selected by validation loss ## Parameters ~31M parameters

Source context: 0 downloads · 0 likes · Pipeline image-segmentation · Repo rmachado23/unet-kvasir-seg