Skip to content

Lightweight neural network for binary classification of cancer metastasis in bone scan images using PyTorch. Code repository for the study entitled "A Lightweight Convolutional Neural Network for Detection of Osseous Metastasis using Feature Fusion and Attention Strategies". Presented at CVIPPR 2024.

Notifications You must be signed in to change notification settings

IrishMorales/lightweight-cnn-for-bone-metastasis

Repository files navigation

Lightweight Neural Network for Bone Metastasis Detection

Lightweight neural network for binary classification of cancer metastasis in bone scan images using PyTorch. Code repository for the study entitled "A Lightweight Convolutional Neural Network for Detection of Osseous Metastasis using Feature Fusion and Attention Strategies". Presented at CVIPPR 2024.

MobileLookNet

MobileLookNet is a novel lightweight CNN for osseous metastasis detection in bone scintigrams on resource-constrained devices. The top-performing MobileLookNet variant exhibits superior accuracy, precision, sensitivity, and F1 score to ResNet while achieving a 95.54% reduction in parameters. This is achieved through employing depthwise separable convolutions in parallel, utilizing inverted residuals, and integrating low-level and high-level features, allowing the model to capture diverse levels of abstraction and extract more individually expressive features. MobileLookNet also outperforms traditional bone scintigraphy methods and state-of-the-art networks in metastasis detection while requiring significantly fewer floating-point operations (FLOPs) and parameters.

MobileLookNet is applied to cancer detection through bone metastasis in the hopes of assisting understaffed and underfunded healthcare facilties, which often lack the computing power needed to run existing state-of-the-art models.

Resultst


Models

This repository contains the following:


Setup

  1. Create your virtual environment using environment.yml.
  2. Unzip and place your dataset as specified in the Dataset section below.

Dataset

For privacy reasons, the dataset used in this study is limited to research collaborators. To use the notebooks here with your own dataset, unzip and place your dataset/s in your folder as follows:

root
├── .gitignore  
├── README.md  
├── dataset-sample
├── dataset
├── base-cnn.ipynb
└── ...

Your dataset should be a folder containing .tif images, where each .tif image corresponds to one bone scan. Each image filename should follow the format XXXX-Y-Z:

  • XXXX corresponds to the image index*
  • Y corresponds to either 0 or 1, with 0 indicating no metastasis and 1 indicating with metastasis
  • Z corresponds to either A or P, with A indicating anterior bone scan and P indicating posterior bone scan* *These parts are ignored in the code, but are helpful for holding additional information about specific images.

Alternatively, if you would like to request access to the dataset used in this study, please contact alive.sose@ateneo.edu.


Steps for Training

When training a model for the first time, do the following:

  1. Change data_dir = r"dataset-sample-flat" to the name of your dataset. It is recommended to have two datasets, one being your actual dataset and another being a smaller sample that you can use to first test if the notebook is set up correctly on your machine.
  2. Run the notebook on your sample dataset and see if it runs to the very end.
  3. If it runs to the very end, change data_dir = r"dataset-sample-flat" to the filename of your actual dataset (ex. data_dir = r"dataset-augmented-flat")
  4. Change hyperparameters, number of folds for crossfold validation (k_folds = 3), and number of epochs (epochs = 2) as you see fit.
  5. Run the model on your full dataset.

Note: If using CUDA and you have already run the notebook once then try to run again, it may error on the cell with summary(model, (C, H, W)). To fix this, simply restart the kernel and run all cells to reset the tensor state from the previous run.

About

Lightweight neural network for binary classification of cancer metastasis in bone scan images using PyTorch. Code repository for the study entitled "A Lightweight Convolutional Neural Network for Detection of Osseous Metastasis using Feature Fusion and Attention Strategies". Presented at CVIPPR 2024.

Topics

Resources

Stars

Watchers

Forks