Skip to content

SimonZeng7108/Fetal_Segmentation_Pytorch

Repository files navigation

Fetal_Segmentation_Pytorch

This repo showcases two deep learning methods(SegNet and UNet) with Pytorch to segment fetal images. The work is heavily based on the book PyTorch Computer Vision Cookbook-Michael Avendi.

Repository overview

data/training/: Stores all the unsplited training data
data/test_set: Stores all data for prediction use
model/weights.pt: Stores the best weight model generated after training
main.py: The main script imports dataset, trainer, loss functions to run the model
dataset.py: Customise a dataset to process the trainig images
model.py: Construct the SegNet and UNet model
train.py: The trainer to run epochs
loss_functions.py: Define the dice loss + BCElogits loss function
predict.py: Script to predict unlabeld images

Requirements

  • torch == 1.8.0
  • torchvision
  • torchsummary
  • numpy
  • scipy
  • skimage
  • matplotlib
  • PIL

SegNet

SegNet Model Results



UNet

This UNet implementation is rather a vanilla model, there is no BatchNorm, DropOut utilised. If one follow the original paper strictly, there will be a conflict betweent input and output sizes(572 to 388). To avoid label and prediction mismatch in this implementatino, a resize function has been applied after every up-convolution in expansive path and at final output layer.
Unet Model Results



About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages