--Code for AutoMorph: Automated Retinal Vascular Morphology Quantification via a Deep Learning Pipeline.
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)
ย
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
Use the Google Colab and a free Tesla T4 gpu
- Linux is preferred. For windows, install MinGW-w64 for using commands below to set enviroment.
- Anaconda or miniconda installed.
- python=3.6, cudatoolkit=11.0, torch=1.7, etc. (installation steps below)
- GPU is essential.
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
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.
ย
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
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
In csv files, invalid values (e.g., optic disc segmentation failure) are indicated with -1.
-
Vessel segmentation BF-Net
-
Image pre-processing EyeQ
-
Optic disc segmentation lwnet
-
Feature measurement retipy
@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}
}