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.
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
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
Dataset | classes | Train samples | Validation samples | Test samples | Reference |
---|---|---|---|---|---|
BCSS | 22 | 30760 | 5429 | 4021 | link |
Carvana (future works) | - | - | - | - | link |
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.
Training result
- Train Loss
- Train Accuracy
- Train Mean IoU
Validation result
- Validation Loss
- Validation Accuracy
- Validation Mean IoU
- Enhancing Unet performane by changing architecture: add more blocks, integrate Resnet, etc.
- Training on multiple datasets
- Implement
train.py
andinference.py
- Containerize project by Docker
- Email: Buitanphuong712@gmail.com