This repository provides PyTorch implementation of our MICCAI2024 paper 'A Bayesian Approach to Weakly-supervised Laparoscopic Image Segmentation'.
Download the CholecSeg8k and AutoLaparo datasets.
Extract dataset files to form folder structures like
Bayesian_WSS
├── ...
├── CholecSeg8k
│ ├── ...
│ ├── dataset
│ │ ├── CholecSeg8k
│ │ │ ├── video01
│ │ │ ├── video09
│ │ │ ├── ...
│ │ ├── target_list.txt
│ │ ├── val_samples_fold_1.txt
│ │ ├── val_samples_fold_2.txt
│ │ ├── val_samples_fold_3.txt
│ │ ├── val_samples_fold_4.txt
│ │ ├── val_samples_fold_5.txt
├── AutoLaparo
│ ├── ...
│ ├── dataset
│ │ ├── AutoLaparo_Task3
│ │ │ ├── imgs
│ │ │ ├── masks
│ │ ├── target_list.txt
Install necessary packages
pip install -r requirements.txt
Build extension module to apply DenseCRF loss
cd CholecSeg8k/utils/crfloss/wrapper/bilateralfilter
swig -python -c++ bilateralfilter.i
python setup.py install
cd AutoLaparo/utils/crfloss/wrapper/bilateralfilter
swig -python -c++ bilateralfilter.i
python setup.py install
For the CholecSeg8k dataset:
cd CholecSeg8k
python weak_label_simulation.py
For the AutoLaparo dataset:
cd AutoLaparo
python weak_label_simulation.py
With the CholecSeg8k dataset:
cd CholecSeg8k
# Default parameter values are already set.
python train.py
python inference.py
With the AutoLaparo dataset:
cd AutoLaparo
# Default parameter values are already set.
python train.py
python inference.py
We would like to express our gratitude to the following codebases:
Contact: Zhou Zheng (zzheng@mori.m.is.nagoya-u.ac.jp)