Towards Rapid Differentiation of Liver Malignancies using Optical Coherence Tomography and Deep Learning
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.
The datasets used in this study can be obtained from the corresponding author upon reasonable request.
- Python 3.10.4
- We recommend
uvfor fast environment and package management.
-
Create and activate a virtual environment:
$ uv venv --python 3.10.4$ source .venv/bin/activate -
Install the required packages:
$ uv pip install -r requirements.txt
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
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.
If you find this code useful for your research, please cite our paper:
[TODO ADD CITATION]