Skip to content

PhuongBui712/Unet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unet

Table of content

Introduction

Welcome to the Unet Image Segmentation project! This repository implements the Unet model using Pytorch, designed for image segmentation tasks.

In this repository, you'll find:

  • Implementation of Unet: Detailed implementation of the Unet model in Pytorch.
  • Training Scripts: Scripts for training the model on your own dataset.
  • Evaluation and Inference: Tools for evaluating model performance and making predictions.
  • Example Notebooks: Jupyter notebooks demonstrating usage and showcasing results.

Whether you're new to image segmentation or looking to explore the capabilities of Unet, this project aims to provide a clear and practical implementation. Feel free to explore, use, and contribute to further enhance the capabilities of image segmentation in your applications.

Model Architecture

The architecture of Unet in this implementation closely follows the original Unet architecture proposed by Olaf Ronneberger, Philipp Fischer, and Thomas Brox in their seminal paper, "U-Net: Convolutional Networks for Biomedical Image Segmentation" (link).

The architecture can be illustrated as following image

Unet

Getting started

To get started, follow these following simple steps:

1. Clone this project

git clone https://github.com/uvipen/Hierarchical-attention-networks-pytorch.git

2. Setup Python environment

Create Python virtual environment

cd Unet # To ensure you are in project directory
python3.12 -m venv .venv 

Activate it

  • MacOS/Linux
source .venv/bin/activate
  • Windows
.venv\Scripts\activate

Install necessary packages

pip install -U pip # upgrade pip
pip install -r requirements.txt

Experiments

Datasets

Dataset classes Train samples Validation samples Test samples Reference
BCSS 22 30760 5429 4021 link
Carvana (future works) - - - - link

Training

1. Computing resources

2 GPU T4 on Kaggle.

2. How to train

Currently, my model has not performed as well as I expected, so I have still not implemented both train.py and inference.py files. You can use this notebook to train and evaluate your model.

Moreover, you can watch my Kaggle notebook. This notebook has a few difference comparing with BCSS_Unet which is suited to training model on Kaggle.

Result

Training result

  • Train Loss

train loss

  • Train Accuracy

train accuracy

  • Train Mean IoU

train mean IoU

Validation result

  • Validation Loss

val loss

  • Validation Accuracy

val accuracy

  • Validation Mean IoU

val mean IoU

Future works

  1. Enhancing Unet performane by changing architecture: add more blocks, integrate Resnet, etc.
  2. Training on multiple datasets
  3. Implement train.py and inference.py
  4. Containerize project by Docker

Contact

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published