Skip to content

vessel segmentation, artery and vein, optic disc, vascular feature analysis

License

Notifications You must be signed in to change notification settings

liutiming/AutoMorph

ย 
ย 

Repository files navigation

AutoMorph 2022 ๐Ÿ‘€

--Code for AutoMorph: Automated Retinal Vascular Morphology Quantification via a Deep Learning Pipeline.

badge-logo badge-logo

Project website: https://rmaphoh.github.io/projects/automorph.html

Talks on NIHR Moorfields BRC: https://www.moorfieldsbrc.nihr.ac.uk/news/automorph-tool-to-analyse-retinal-photographs

Please contact [email protected] or [email protected] if you have questions.

Before starting, we summarise the features for three running ways:

  • Google Colab (no commands/code, free gpu for 12 hours)
  • Configure environment on local/virtual machine (data privacy, code development)
  • Docker image (data privacy, no need to configure environment)

Index

ย 

Pixel resolution

The units for vessel average width, disc/cup height and width, and calibre metrics are defined as microns. For it, we need to organise a resolution_information.csv which includes the pixel resolution information, which can be queried in FDA and Dicom files. Alternatively, some people use approximate value for every images, e.g., 0.008 for Topcon 3D-OCT.

If you don't use these features or care their units, you can just run following command after putting all images in the folder of ./images

python generate_resolution.py

Quickstart with Colab

Use the Google Colab and a free Tesla T4 gpu

Colab link click

Install instruction for local/virtual machine

Requirements

  1. Linux is preferred. For windows, install MinGW-w64 for using commands below to set enviroment.
  2. Anaconda or miniconda installed.
  3. python=3.6, cudatoolkit=11.0, torch=1.7, etc. (installation steps below)
  4. GPU is essential.

Package installation

Step 1: create virtual environment:

conda update conda
conda create -n automorph python=3.6 -y
conda activate automorph

Step 2: install pytorch 1.7 and cudatoolkit 11.0

conda install pytorch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0 cudatoolkit=11.0 -c pytorch -y

Step 3: install other packages:

pip install --ignore-installed certifi
pip install -r requirement.txt
pip install efficientnet_pytorch

Running

Activate virtual environment and clone the code.

conda activate automorph
git clone https://github.com/rmaphoh/AutoMorph.git

Put the images in folder 'images' and

sh run.sh

Please not that resolution_information.csv includes the resolution for image, i.e., size for each pixel. Please prepare it for the customised data in the same format.

ย 

Docker usage

Zero experience in Docker? No worries.

First, clone the github to <path/of/AutoMorph, e.g., /home/AutoMorph> and put the images in AutoMorph/images

git clone https://github.com/rmaphoh/AutoMorph.git

Then, pull our docker image and run the tool.

docker pull yukundocker/image_automorph
docker run  -v <path/of/AutoMorph>:/root/AutoMorph -ti --runtime=nvidia -e NVIDIA_DRIVER_CAPABILITIES=compute,utility -e NVIDIA_VISIBLE_DEVICES=all yukundocker/image_automorph
source /root/set_up.sh

Common questions

Memory/ram error

We use Tesla T4 (16Gb) and 32vCPUs (120Gb). When you meet memory/ram issue in running, try to decrease batch size:

  • ./M1_Retinal_Image_quality_EyePACS/test_outside.sh -b=64 to smaller, e.g., 32 or 16.
  • ./M2_Artery_vein/test_outside.sh --batch-size=8 to smaller
  • ./M2_lwnet_disc_cup/test_outside.sh --batchsize=8 to smaller

Invalid results

In csv files, invalid values (e.g., optic disc segmentation failure) are indicated with -1.

Components

  1. Vessel segmentation BF-Net

  2. Image pre-processing EyeQ

  3. Optic disc segmentation lwnet

  4. Feature measurement retipy

Citation

@article{zhou2022automorph,
  title={AutoMorph: Automated Retinal Vascular Morphology Quantification Via a Deep Learning Pipeline},
  author={Zhou, Yukun and Wagner, Siegfried K and Chia, Mark A and Zhao, An and Xu, Moucheng and Struyven, Robbert and Alexander, Daniel C and Keane, Pearse A and others},
  journal={Translational vision science \& technology},
  volume={11},
  number={7},
  pages={12--12},
  year={2022},
  publisher={The Association for Research in Vision and Ophthalmology}
}

About

vessel segmentation, artery and vein, optic disc, vascular feature analysis

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.3%
  • Shell 1.2%
  • Dockerfile 0.5%