I-SECRET: Importance-guided fundus image enhancement via semi-supervised contrastive constraining

Overview

I-SECRET

This is the implementation of the MICCAI 2021 Paper "I-SECRET: Importance-guided fundus image enhancement via semi-supervised contrastive constraining".

Data preparation

  1. Firstly, download EyeQ dataset from EyeQ.
  2. Split the dataset into train/val/test according to the EyePACS challenge.
  3. Run
python tools/degrade_eyeq.py --degrade_dir ${DATA_PATH}$ --output_dir $OUTPUT_PATH$ --mask_dir ${MASK_PATH}$ --gt_dir ${GT_PATH}$.

Note that this scipt should be applied for usable dataset for cropping pre-processing.

  1. Make the architecture of the EyeQ directory as:
.
├── 
├── train
│   └── crop_good
│   └── degrade_good
│   └── crop_usable
├── val
│   └── crop_good
│   └── degrade_good
│   └── crop_usable
├── test
│   └── crop_good
│   └── degrade_good
│   └── crop_usable

Here, the crop_good is the ${GT_PATH}$ in the step 3, and degrade_good is the ${OUTPUT_PATH}$ in the step 3.

Package install

Run

pip install -r requirements.txt

Run pipeline

Run the baseline model

python main.py --model i-secret --lambda_rec 1 --lambda_gan 1 --data_root_dir ${DATA_DIR}$ --gpu ${GPU_INDEXS}$ -- batch size {BATCH_SIZE}$  --name baseline --experiment_root_dir ${LOG_DIR}$

Run the model with IS-loss

python main.py --model i-secret --lambda_is 1 --lambda_gan 1 --data_root_dir ${DATA_DIR}$ --gpu ${GPU_INDEXS}$ -- batch size {BATCH_SIZE}$  --name is_loss --experiment_root_dir ${LOG_DIR}$

Run the I-SECRET model

python main.py --model i-secret --lambda_is 1 --lambda_icc 1 --lambda_gan 1 --data_root_dir ${DATA_DIR}$ --gpu ${GPU_INDEXS}$ -- batch size {BATCH_SIZE}$  --name i-secret --experiment_root_dir ${LOG_DIR}$

Visualization

Go to the ${LOG_DIR}$ / ${EXPERIMENT_NAME}$ / checkpoint, run

tensorboard --logdir ./ --port ${PORT}$

then go to localhost:${PORT}$ for detailed logging and visualization.

Test and evalutation

Run

python main.py --test --resume 0 --test_dir ${INPUT_PATH}$ --output_dir ${OUTPUT_PATH}$ --name ${EXPERIMENT_NAME}$ --gpu ${GPU_INDEXS}$ -- batch size {BATCH_SIZE}$ 

Please note that the metric outputted by test script is under the PyTorch pre-process (resize etc.). It is not precise. Therefore, we need to run the evaluation scipt for further evaluation.

python tools/evaluate.py --test_dir ${OUTPUT_PATH}$ --gt_dir ${GT_PATH}$

Vessel segmentation

We apply the iter-Net framework. We simply replace the test set with the degraded images/enhanced images. For more details, please follow IterNet.

Future Plan

  • Cleaning codes
  • More SOTA backbones (ResNest ...)
  • WGAN loss
  • Internal evaluations for down-sampling tasks

Acknowledgment

Thanks for CutGAN for the implementation of patch NCE loss, EyeQ_Enhancement for degradation codes, Slowfast for the distributed training codes

You might also like...
SUPERVISED-CONTRASTIVE-LEARNING-FOR-PRE-TRAINED-LANGUAGE-MODEL-FINE-TUNING - The Facebook paper about fine tuning RoBERTa with contrastive loss Official code of
Official code of "R2RNet: Low-light Image Enhancement via Real-low to Real-normal Network."

R2RNet Official code of "R2RNet: Low-light Image Enhancement via Real-low to Real-normal Network." Jiang Hai, Zhu Xuan, Ren Yang, Yutong Hao, Fengzhu

Official implementation for
Official implementation for "Low-light Image Enhancement via Breaking Down the Darkness"

Low-light Image Enhancement via Breaking Down the Darkness by Qiming Hu, Xiaojie Guo. 1. Dependencies Python3 PyTorch=1.0 OpenCV-Python, TensorboardX

S2-BNN: Bridging the Gap Between Self-Supervised Real and 1-bit Neural Networks via Guided Distribution Calibration (CVPR 2021)
S2-BNN: Bridging the Gap Between Self-Supervised Real and 1-bit Neural Networks via Guided Distribution Calibration (CVPR 2021)

S2-BNN (Self-supervised Binary Neural Networks Using Distillation Loss) This is the official pytorch implementation of our paper: "S2-BNN: Bridging th

UniMoCo: Unsupervised, Semi-Supervised and Full-Supervised Visual Representation Learning
UniMoCo: Unsupervised, Semi-Supervised and Full-Supervised Visual Representation Learning

UniMoCo: Unsupervised, Semi-Supervised and Full-Supervised Visual Representation Learning This is the official PyTorch implementation for UniMoCo pape

Project looking into use of autoencoder for semi-supervised learning and comparing data requirements compared to supervised learning.

Project looking into use of autoencoder for semi-supervised learning and comparing data requirements compared to supervised learning.

Hybrid CenterNet - Hybrid-supervised object detection / Weakly semi-supervised object detection
Hybrid CenterNet - Hybrid-supervised object detection / Weakly semi-supervised object detection

Hybrid-Supervised Object Detection System Object detection system trained by hybrid-supervision/weakly semi-supervision (HSOD/WSSOD): This project is

Face2webtoon - Despite its importance, there are few previous works applying I2I translation to webtoon.
Face2webtoon - Despite its importance, there are few previous works applying I2I translation to webtoon.

Despite its importance, there are few previous works applying I2I translation to webtoon. I collected dataset from naver webtoon 연애혁명 and tried to transfer human faces to webtoon domain.

Rethinking the Importance of Implementation Tricks in Multi-Agent Reinforcement Learning
Rethinking the Importance of Implementation Tricks in Multi-Agent Reinforcement Learning

RIIT Our open-source code for RIIT: Rethinking the Importance of Implementation Tricks in Multi-AgentReinforcement Learning. We implement and standard

Comments
  • Dataset- Did you use all the eyeQ data?

    Dataset- Did you use all the eyeQ data?

    Hello, first thank you so much for sharing your code! :) It helped me a lot!

    I have one question, Did you use all the data in EyeQ dataset? As you may know, some images don't have whole circle of the fundus like the image below. image

    I have trying to use the same data as you did (but with different model), but because of the imperfect circle of some fundus images, high quality images are not generated well:( And I think it is because the model tries make the circle perfect like the below images. image

    Do you have some idea to overcome this problem? You seem to overcome this issue (if you have used the imperfect circle fundus images) since your FIQAs are high!

    Thanks a lot in advance:>

    opened by Nimbus1997 14
  • lq, hq data split

    lq, hq data split

    Hello I came again😁

    I was looking at your paper and came up with one question about how you split the lq and hq data. As mentioned in your paper and your github, you split your hq and lq data by score of eyeQ/MCFNet. - LQ for "usable" and HQ for "good"-. But in the table in the paper, Original FIQA is not zero which means some pictures are marked as "good". How could this possible? Did you used "EyeQ/data/Label_EyeQ_train.csv" quality level? I did and found out that some datas mark as "usable" to be "good" or "reject" when I tested with MCF net.

    image

    opened by Nimbus1997 6
Owner
null
From Fidelity to Perceptual Quality: A Semi-Supervised Approach for Low-Light Image Enhancement (CVPR'2020)

Under-exposure introduces a series of visual degradation, i.e. decreased visibility, intensive noise, and biased color, etc. To address these problems, we propose a novel semi-supervised learning approach for low-light image enhancement.

Yang Wenhan 117 Jan 3, 2023
[CVPR 2022] Back To Reality: Weak-supervised 3D Object Detection with Shape-guided Label Enhancement

Back To Reality: Weak-supervised 3D Object Detection with Shape-guided Label Enhancement Announcement ?? We have not tested the code yet. We will fini

Xiuwei Xu 7 Oct 30, 2022
This project aims to segment 4 common retinal lesions from Fundus Images.

This project aims to segment 4 common retinal lesions from Fundus Images.

Husam Nujaim 1 Oct 10, 2021
M2MRF: Many-to-Many Reassembly of Features for Tiny Lesion Segmentation in Fundus Images

M2MRF: Many-to-Many Reassembly of Features for Tiny Lesion Segmentation in Fundus Images This repo is the official implementation of paper "M2MRF: Man

null 12 Dec 14, 2022
ISBI 2022: Cross-level Contrastive Learning and Consistency Constraint for Semi-supervised Medical Image.

Cross-level Contrastive Learning and Consistency Constraint for Semi-supervised Medical Image Introduction This repository contains the PyTorch implem

null 25 Nov 9, 2022
Data-Uncertainty Guided Multi-Phase Learning for Semi-supervised Object Detection

An official implementation of paper Data-Uncertainty Guided Multi-Phase Learning for Semi-supervised Object Detection

null 11 Nov 23, 2022
Code for reproducing our analysis in the paper titled: Image Cropping on Twitter: Fairness Metrics, their Limitations, and the Importance of Representation, Design, and Agency

Image Crop Analysis This is a repo for the code used for reproducing our Image Crop Analysis paper as shared on our blog post. If you plan to use this

Twitter Research 239 Jan 2, 2023
Code for CoMatch: Semi-supervised Learning with Contrastive Graph Regularization

CoMatch: Semi-supervised Learning with Contrastive Graph Regularization (Salesforce Research) This is a PyTorch implementation of the CoMatch paper [B

Salesforce 107 Dec 14, 2022
This is the repository for the AAAI 21 paper [Contrastive and Generative Graph Convolutional Networks for Graph-based Semi-Supervised Learning].

CG3 This is the repository for the AAAI 21 paper [Contrastive and Generative Graph Convolutional Networks for Graph-based Semi-Supervised Learning]. R

null 12 Oct 28, 2022
This is the repository for the NeurIPS-21 paper [Contrastive Graph Poisson Networks: Semi-Supervised Learning with Extremely Limited Labels].

CGPN This is the repository for the NeurIPS-21 paper [Contrastive Graph Poisson Networks: Semi-Supervised Learning with Extremely Limited Labels]. Req

null 10 Sep 12, 2022