https://github.com/cviu-csu/hrdecoder
HRDecoder: High-Resolution Decoder Network for Fundus Image Lesion Segmentation
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.0%) to scientific vocabulary
Repository
HRDecoder: High-Resolution Decoder Network for Fundus Image Lesion Segmentation
Basic Info
- Host: GitHub
- Owner: CVIU-CSU
- Language: Python
- Default Branch: main
- Size: 228 KB
Statistics
- Stars: 13
- Watchers: 2
- Forks: 1
- Open Issues: 5
- Releases: 0
Metadata Files
README.md
HRDecoder: High-Resolution Decoder Network for Fundus Image Lesion Segmentation
Environment
Our code is based on MMsegmentation.
In this work, we used: - python=3.8.5 - pytorch=2.0.1 - mmsegmentation=0.16.0 - mmcv=1.7.1
The environment can be installed with: ``` conda create -n hrdecoder python=3.8.5 conda activate hrdecoder
pip install -r requirements.txt chmod u+x tools/* ```
Datasets
We carried out experiments on two public datasets, i.e. IDRiD and DDR. For IDRiD, please download the segmentation part from here. For DDR dataset, please download the segmentation part from here.
Please first change the original structure of datasets and organize like this: ``` IDRiD(segmentation part) |——images | |——train | | |——IDRiD01.jpg | | |——... | | |——IDRiD54.jpg | |——test |——labels | |——train | | |——EX | | | |——IDRiD01EX.tif | | | |——... | | | |——IDRiD54EX.tif | | |——HE | | |——SE | | |——MA | |——test | | |——EX | | |——HE | | |——SE | | |——MA
DDR(segmentation part) |——images | |——test | | |——007-1789-100.jpg | | |——... | | |——20170627170651362.jpg | |——val | |——train |——labels | |——test | | |——EX | | | |——007-1789-100.tif | | | |——... | | | |——20170627170651362.tif | | |——HE | | |——MA | | |——SE | |——val | | |——EX | | |——HE | | |——MA | | |——SE | |——train | | |——EX | | |——HE | | |——MA | | |——SE ```
Please note that the original GT with .tif format can not be directly used for training, so you can use the following command to convert the labels to .png format:
python tools/convert_dataset/idrid.py
python tools/convert_dataset/ddr.py
Then the structure of dataset will be converted to:
```
IDRiD(segmentation part)
|——images
| |——train
| | |——IDRiD01.jpg
| | |——...
| | |——IDRiD54.jpg
| |——test
|——labels
| |——train
| | |——IDRiD01.png
| | |——...
| | |——IDRiD54.png
| |——test
DDR(segmentation part) |——images | |——test | | |——007-1789-100.jpg | | |——... | | |——20170627170651362.jpg | |——val | |——train |——labels | |——test | | |——007-1789-100.png | | |——... | | |——20170627170651362.png | |——val | |——train ```
Finally the structure of the project should be like this:
HRDecoder
|——configs
|——mmseg
|——tools
|——data
| |——IDRiD(segmentation part)
| | |——images
| | | |——train
| | | |——test
| | |——labels
| | | |——train
| | | |——test
| |——DDR(segmentation part)
| | |——images
| | | |——train
| | | |——val
| | | |——test
| | |——labels
| | | |——train
| | | |——val
| | | |——test
Training and Testing
To train or test a model using MMsegmentation framework, you can use commands like this: ```
train
CUDAVISIBLEDEVICES=0,1,2,3 PORT=18940 tools/disttrain.sh configs/lesion/hrdecoderfcnhr48idrid2880x1920-slide.py 4 or CUDAVISIBLEDEVICES=0,1,2,3 PORT=18940 tools/disttrain.sh configs/lesion/efficient-hrdecoderfcnhr48idrid2880x1920-slide.py 4
test
CUDAVISIBLEDEVICES=4,5,6,7 PORT=17940 tools/disttest.sh configs/lesion/hrdecoderfcnhr48idrid2880x1920-slide.py workdirs/hrdecoderfcnhr48idrid2880x1920-slide/latest.pth 4 --eval mIoU or CUDAVISIBLEDEVICES=4,5,6,7 PORT=17940 tools/disttest.sh configs/lesion/efficient-hrdecoderfcnhr48idrid2880x1920-slide.py workdirs/efficient-hrdecoderfcnhr48idrid2880x1920-slide/latest.pth 4 --eval mIoU ```
The trained model will be stored to work_dirs/.
In this project, we supply two version of implemention: HRDecoder and Efficient-HRDecoder.
HRDecoder is the version utilized for presenting the results in our paper. While Efficient-HRDecoder is an improved version of HRDecoder to further reduce computational overhead and memory usage. We simply compress the dimension of the extracted features using a 1x1 convolutional layer right after the backbone. This helps save a lot of memory. The compression operation can be replaced with various multi-scale feature fusion methods, such as FPN, CATNet, APPNet, CARAFE++ and so on. We do not focus on this part but on the later HR representation learning module and HR fusion module, so we simply use upsampling and concat in HRDecoder, or use a 1x1 conv in Efficient-HRDecoder.
Models and Evaluation
We evaluate our method out IDRiD and DDR test set.
| Dataset | mIoU | mAUPR | download | | ------- | :----: | :----: | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | | IDRiD | 52.20 | 71.34 | config; model | | DDR | 32.24 | 49.24 | config; model |
For calculating FLOPs and FPs, you can use the following commands: ```
calculate FLOPs
CUDAVISIBLEDEVICES=0 python tools/getflops.py configs/lesion/hrdecoderfcnhr48ddr_2048.py
Calculate FPs
CUDAVISIBLEDEVICES=0 python tools/getfps.py configs/lesion/hrdecoderfcnhr48ddr_2048.py ``` Typically, we calculate FPs on DDR dataset.
Acknowledgements
Last, we thank these authors for sharing their ideas and source code: - MMsegmentation - HRNet - HRDA - CARAFE++ - CATNet - SenFormer - M2MRF
This manuscript was supported in part by the National Key Research and Development Program of China under Grant 2021YFF1201202, the Natural Science Foundation of Hunan Province under Grant 2024JJ5444 and 2023JJ30699, the Key Research and Development Program of Hunan Province under Grant 2023SK2029, the Changsha Municipal Natural Science Foundation under Grant kq2402227, and the Research Council of Finland (formerly Academy of Finland for Academy Research Fellow project) under Grant 355095. The authors wish to acknowledge High Performance Computing Center of Central South University for computational resources.
Owner
- Name: CVIU-CSU
- Login: CVIU-CSU
- Kind: organization
- Repositories: 4
- Profile: https://github.com/CVIU-CSU
GitHub Events
Total
- Issues event: 13
- Watch event: 17
- Delete event: 1
- Issue comment event: 25
- Push event: 16
- Pull request event: 2
- Fork event: 2
- Create event: 2
Last Year
- Issues event: 13
- Watch event: 17
- Delete event: 1
- Issue comment event: 25
- Push event: 16
- Pull request event: 2
- Fork event: 2
- Create event: 2
Dependencies
- Jinja2 ==3.1.3
- Markdown ==3.6
- MarkupSafe ==2.1.5
- PyYAML ==6.0.1
- Pygments ==2.17.2
- addict ==2.4.0
- aliyun-python-sdk-core ==2.15.0
- aliyun-python-sdk-kms ==2.16.2
- certifi ==2024.2.2
- cffi ==1.16.0
- charset-normalizer ==3.3.2
- click ==8.1.7
- cmake ==3.28.3
- colorama ==0.4.6
- contourpy ==1.1.1
- crcmod ==1.7
- cryptography ==42.0.5
- cycler ==0.12.1
- filelock ==3.13.1
- fonttools ==4.49.0
- idna ==3.6
- importlib_metadata ==7.0.2
- importlib_resources ==6.3.0
- jmespath ==0.10.0
- joblib ==1.3.2
- kiwisolver ==1.4.5
- lit ==18.1.1
- markdown-it-py ==3.0.0
- matplotlib ==3.7.5
- mdurl ==0.1.2
- mmcv ==1.7.1
- mmengine ==0.10.3
- model-index ==0.1.11
- mpmath ==1.3.0
- networkx ==3.1
- numpy ==1.24.4
- nvidia-cublas-cu11 ==11.10.3.66
- nvidia-cuda-cupti-cu11 ==11.7.101
- nvidia-cuda-nvrtc-cu11 ==11.7.99
- nvidia-cuda-runtime-cu11 ==11.7.99
- nvidia-cudnn-cu11 ==8.5.0.96
- nvidia-cufft-cu11 ==10.9.0.58
- nvidia-curand-cu11 ==10.2.10.91
- nvidia-cusolver-cu11 ==11.4.0.1
- nvidia-cusparse-cu11 ==11.7.4.91
- nvidia-nccl-cu11 ==2.14.3
- nvidia-nvtx-cu11 ==11.7.91
- opencv-python-headless ==4.9.0.80
- opendatalab ==0.0.10
- openmim ==0.3.9
- openxlab ==0.0.36
- ordered-set ==4.1.0
- oss2 ==2.17.0
- packaging ==24.0
- pandas ==2.0.3
- pillow ==10.2.0
- platformdirs ==4.2.0
- prettytable ==3.10.0
- pycparser ==2.21
- pycryptodome ==3.20.0
- pyparsing ==3.1.2
- python-dateutil ==2.9.0.post0
- pytz ==2023.4
- requests ==2.28.2
- rich ==13.4.2
- scikit-learn ==1.3.2
- scipy ==1.10.1
- six ==1.16.0
- sympy ==1.12
- tabulate ==0.9.0
- termcolor ==2.4.0
- threadpoolctl ==3.3.0
- tomli ==2.0.1
- torch ==2.0.1
- torchaudio ==2.0.2
- torchvision ==0.15.2
- tqdm ==4.65.2
- triton ==2.0.0
- typing_extensions ==4.10.0
- tzdata ==2024.1
- urllib3 ==1.26.18
- wcwidth ==0.2.13
- yapf ==0.40.1
- zipp ==3.18.1