Skip to content

TruhnLab/LiverOCT

Repository files navigation

Towards Rapid Differentiation of Liver Malignancies using Optical Coherence Tomography and Deep Learning

Python PyTorch

This repository provides the official PyTorch implementation for the paper "Towards Rapid Differentiation of Liver Malignancies using Optical Coherence Tomography and Deep Learning".

The code trains and evaluates deep learning models (ResNet50 and Xception) to classify Optical Coherence Tomography (OCT) images of liver tissue, differentiating between liver parenchyma and various malignancies like iCCA, CRLM, and HCC.

Dataset Availability

The datasets used in this study can be obtained from the corresponding author upon reasonable request.

Getting Started

Prerequisites

  • Python 3.10.4
  • We recommend uv for fast environment and package management.

Installation

  1. Create and activate a virtual environment:

    $ uv venv --python 3.10.4
    
    $ source .venv/bin/activate
    
  2. Install the required packages:

    $ uv pip install -r requirements.txt
    

Training

The run.sh script is the main entry point for training and evaluation. You can customize the run by modifying the script or by passing arguments directly.

Parameters:

Flag Description Possible Values Default (in run.sh)
-fold Test fold for 5-fold cross-validation. 0, 1, 2, 3, 4 0
-bs Batch size. integer 8
-lr Learning rate. float 5e-5
-ep Number of epochs. integer 1
-wb Log to Weights & Biases. - present
-wbStr Name for the W&B run. string "evaluation run"
-net Network architecture. resnet50, xception xception
-label Comma-separated list of classes. Leber_Parenchym, CCC, CRLM, HCC Leber_Parenchym,CCC,CRLM,HCC

Example:

Execute the script to start a training run with the default parameters defined in run.sh:

$ ./run.sh

Repository Structure

  • trainLoop.py: Main script for the training and evaluation loop.
  • netModel.py: Defines the ResNet50 and Xception model architectures.
  • CONFIG.py: Configuration file for paths, labels, and model parameters.
  • argParser.py: Handles command-line argument parsing.
  • LiverOCT2DZipDataset.py: PyTorch Dataset class for loading data from a ZIP file.
  • run.sh: Shell script to execute training runs with different parameters.
  • requirements.txt: A list of all python dependencies.

Citation

If you find this code useful for your research, please cite our paper:

[TODO ADD CITATION]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors