Segmenting a colorectal cancer from histopathology images using UNet architecture
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
This project uses UNet, Residual UNet, and Attention UNet with dice score and combined dice loss as below:
Model | Dice score | Dice loss |
---|---|---|
UNet | 0.8454 | 0.1489 |
Residual UNet | 0.8267 | 0.1454 |
Attention UNet | 0.9412 | 0.1817 |
This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.
This project requires Python 3.7 or higher
- You can download the latest Python version here.
- Clone the repo
git clone https://github.com/DickyAdi/colRectalSegm.git
- move to the colRectalSegm directory
cd colRectalSegm
- Install the requirements.txt
pip install -r requirements.txt
There're 2 approaches to use this project:
Since the model is written in PyTorch nn.module, so the model can be used . In order to do that, do the follows.- The model is located at
. └── unetArch/ ├── . ├── . ├── . ├── unetModel.py └── unetParts.py
- Import the model
from unetArch import UNet
- Assign the model to a variable
model = UNet(n_channels=3, n_classes=5)
- Proceed to use the model
- Open the provided jupyter notebook with the name of
colorectalSegm.ipynb
unetArch.unetModel.UNet(n_channels, n_classes, residual=False, attention=False)
- n_channels
int
: This parameter initialize the color channels of your image in your dataset. 3 for RGB, and 1 for black and white. - n_classes
int
: This parameter initialize how many labels you have in your image in your dataset and makesure you add 1 to it because of the background. - residual
bool
: This parameter initialize whether to use residual connection in your model or not. Default value is False. - attention
bool
: This parameter initialize wheter to use channel and spatial attention in your model or not. Default value is False.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. As this is my first open source project, any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Dicky Adi N.F - Dicky Adi
Project Link: https://github.com/DickyAdi/colRectalSegm