Coder Social home page Coder Social logo

devnetly / breast-cancer-classification Goto Github PK

View Code? Open in Web Editor NEW
4.0 0.0 0.0 523.48 MB

This repository contains some comprehensive approaches for the purpose of classifying breast cancer tissue using whole slide images (WSIs).

Python 0.61% Jupyter Notebook 99.39%
attention-models bracs breast-cancer-prediction hematoxylin-eosin-staining histological-images multi-instance-learning whole-slide-images gigapixel-images

breast-cancer-classification's Introduction

AI System for Breast Cancer Diagnosis

Overview

This project, conducted in 2024, is a collaboration between our team and the Anti-Cancer Center of Sidi Bel Abbes (CAC). The objective of this project was to develop an AI system capable of diagnosing breast cancer through the classification of gigapixel hematoxylin and eosin (H&E) histopathological images (whole slide images). We used the BRCAS dataset for this purpose. The process mainly consists of two stages:

  • Feature Extraction: This involves processing the high-resolution whole slide images to generate a more compact representation that can be processed by deep learning models.

  • Models Training: This step involves training the actual models to classify the WSIs, using the compressed WSIs generated from the previous step as input.

The final model was deployed in a desktop application where a WSI can be selected, then the feature extraction step is applied before passing the result to the model for inference and outputting the probabilities of each class, for more details please refere to : Report.

process overiew

Maintainers

This project was mantained by:

Steup

To set up the project, please follow these steps:

git [email protected]:Devnetly/Breast-Cancer-Detection.git
cd Breast-Cancer-Detection
conda create -n breast-cancer-detection
conda activate breast-cancer-detection
pip install -r requirements.txt
git clone [email protected]:yiqings/RandStainNA.git
git clone [email protected]:mahmoodlab/CLAM.git

Feature Extractors fine tuning

    cd src/training/feature_extractors
    python main.py [-h] [--batch-size BATCH_SIZE] [--epochs EPOCHS] \
        [--learning-rate LEARNING_RATE] \
        [--model-type {resnet18,resnet34 resnet50,vit}] \
        --weights-folder WEIGHTS_FOLDER --histories-folder HISTORIES_FOLDER \
        [--preprocessing {nothing,stain-normalization,augmentation,stain-augmentation}] \
        [--sampler {random,balanced}] [--dropout DROPOUT] \
        [--decay-rate DECAY_RATE] [--optimizer {adam,sgd,rmsprop}] \
        [--last-epoch LAST_EPOCH] [--weight-decay WEIGHT_DECAY] \
        [--depth DEPTH] [--num-workers NUM_WORKERS] \
        [--prefetch-factor PREFETCH_FACTOR] \
        [--class-weights CLASS_WEIGHTS] [--momentum MOMENTUM]

Feature Extraction

Apply feature extraction on the dataset using a pre-trained model :

Grid Based Feature Extraction

    cd src/feature_extraction
    python grid.py [-h] --in-path IN_PATH --out-path OUT_PATH \
        [--train TRAIN] [--test TEST] [--val VAL] \
        [--patch-size PATCH_SIZE] [--model MODEL] \
        --model-weights MODEL_WEIGHTS --metadata-path METADATA_PATH \
        [--n N] [--batch-size BATCH_SIZE] \
        [--num-workers NUM_WORKERS] [--prefetch-factor PREFETCH_FACTOR]

Feature Extraction With Patch Selection

    cd src/feature_extraction
    python vector.py [-h] --coords-path COORDS_PATH --in-path IN_PATH  \
        --out-path OUT_PATH [--train TRAIN] [--test TEST] [--val VAL] \
        [--patch-size PATCH_SIZE] [--model MODEL] \
        --model-weights MODEL_WEIGHTS --metadata-path METADATA_PATH \
        [--n N] [--batch-size BATCH_SIZE] [--num-workers NUM_WORKERS] \ [--prefetch-factor PREFETCH_FACTOR]

Training

To train WSI Classifiers on the compressed dataset :

    cd src/training/wsi_classifiers
    python3 main.py [-h] [--model {ABNN,ACMIL,HIPT}] \
        --tensors TENSORS --weights-folder WEIGHTS_FOLDER \
        --histories-folder HISTORIES_FOLDER [--epochs EPOCHS] \
        [--num-workers NUM_WORKERS] [--prefetch-factor PREFETCH_FACTOR] \
        [--last-epoch LAST_EPOCH] [--save-weights-every SAVE_WEIGHTS_EVERY] 
        [--dropout DROPOUT] [--learning-rate LEARNING_RATE] \
        [--weight-decay WEIGHT_DECAY] [--sampler {random,balanced}] \
        [--min-lr MIN_LR] [--decay-alpha DECAY_ALPHA] \
        [--filters-in FILTERS_IN] [--filters-out FILTERS_OUT] \
        [--use-lr-decay USE_LR_DECAY] \
        [--features {resnet18,resnet34,resnet50,vit,hipt_4k}] \
        [--mask-rate MASK_RATE] [--branches-count BRANCHES_COUNT] \
        [--k K] [--d D] [--data-augmentation DATA_AUGMENTATION]

Run the desktop application

To run the desktop app associated with the project :

    cd deployement
    python app.py

breast-cancer-classification's People

Contributors

abdelnour13 avatar abderrahmenex86 avatar adelcse avatar phues avatar

Stargazers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.