Skip to content

Indonesia AI final project with the topic of colorectal cancer segmentation

License

Notifications You must be signed in to change notification settings

DickyAdi/colRectalSegm

Repository files navigation

Forks Stargazers Issues MIT License LinkedIn


Colorectal Cancer Segmentation

Segmenting a colorectal cancer from histopathology images using UNet architecture
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Model Parameters Documentation
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments
  9. Reference

About The Project

Product Name Screen Shot

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

(back to top)

Built With

  • Lightning
  • PyTorch
  • Python Version

(back to top)

Getting Started

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.

Prerequisites

This project requires Python 3.7 or higher

  • You can download the latest Python version here.

Installation

  1. Clone the repo
    git clone https://github.com/DickyAdi/colRectalSegm.git
  2. move to the colRectalSegm directory
    cd colRectalSegm
  3. Install the requirements.txt
    pip install -r requirements.txt

(back to top)

Usage

There're 2 approaches to use this project:

  1. Using the model architecture only
  2. Using the jupyter notebook

Using model architecture only

Since the model is written in PyTorch nn.module, so the model can be used . In order to do that, do the follows.
  1. The model is located at
        .
    └── unetArch/
        ├── .
        ├── .
        ├── .
        ├── unetModel.py
        └── unetParts.py
  2. Import the model
    from unetArch import UNet
  3. Assign the model to a variable
    model = UNet(n_channels=3, n_classes=5)
  4. Proceed to use the model

Using the jupyter notebook

The provided jupyter notebook is only for a guidelines on how to use the model, make sure to modify the notebook to your specific case.
  1. Open the provided jupyter notebook with the name of
    colorectalSegm.ipynb

(back to top)

Model Parameters Documentations

unetArch.unetModel.UNet(n_channels, n_classes, residual=False, attention=False)

  • n_channelsint: This parameter initialize the color channels of your image in your dataset. 3 for RGB, and 1 for black and white.
  • n_classesint: 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.
  • residualbool: This parameter initialize whether to use residual connection in your model or not. Default value is False.
  • attentionbool: This parameter initialize wheter to use channel and spatial attention in your model or not. Default value is False.

(back to top)

Contributing

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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Dicky Adi N.F - Dicky Adi

Project Link: https://github.com/DickyAdi/colRectalSegm

(back to top)

Acknowledgments

(back to top)

Reference

(back to top)

About

Indonesia AI final project with the topic of colorectal cancer segmentation

Resources

License

Stars

Watchers

Forks

Packages

No packages published