Official code for BenchReAD: A systematic benchmark for retinal anomaly detection (MICCAI 2025)
OS: Ubuntu 20.04 LTS.
Language: Python 3.10.8
Create a virtual environment and install the dependencies through the following command:
pip install numpy
pip install pandas
pip install tqdm
pip install scikit-image
pip install opencv-python
The traning and validation sets of the fundus benchmark are build on the EDDFS [1] and BRSET [2] datasets. The following steps are used to establish the training and validation sets.
-
Put the EDDFS data in the
./data/EDDFS/OriginalImages
folder and the annotations in the./data/EDDFS
folder. -
Preprocessing the EDDFS data using the EDDFS_preprocessing.ipynb and EDDFS_split.ipynb notebooks.
-
Put the BRSET data in the
./data/brazilian-ophthalmological/
folder. -
Preprocessing the BRSET data using the BRSET_preprocessing.ipynb and BRSET_split.ipynb notebooks.
The testing sets of the fundus benchmark are build on the RIADD [3] and JSIEC [4] datasets. The following steps are used to establish the testing sets.
-
Put the RIADD data in the
./data/RIADD/
folder. -
Preprocessing the RIADD data using the RIADD_preprocessing.ipynb and RIADD_split.ipynb notebooks.
-
Put the JSIEC data in the
./data/JSIEC/
folder. -
Preprocessing the JSIEC data using the JSIEC.ipynb notebook.
The training and validation sets of the OCT benchmark are build on the OCT 2017 [5] dataset. The following steps are used to establish the training and validation sets.
-
Download the OCT 2017 dataset from the link.
-
Put the OCT 2017 data in the
./data/OCT_2017/
folder. -
Preprocessing the OCT 2017 data using the OCT_2017_preprocessing.ipynb and OCT_2017_split.ipynb notebooks.
-
The process above also generate the OCT 2017 dataset for testing.
In addition to the OCT 2017 testing set, the testing sets of the OCT benchmark also include the OCTDL [6] and OCTID [7] datasets. The following steps are used to establish the testing sets.
-
Put the OCTDL and OCTID data in the
./data/OCTDL/
and./data/OCTID/
folders, respectively. -
Preprocessing the OCTDL data using the OCTDL.ipynb notebook.
-
Preprocessing the OCTID data using the OCTID_step1.ipynb and OCTID_step2.ipynb notebooks.
See NFM-DRA for more details.
Thank the authors of DRA, PatchCore for their code, which are used in this project.
[1] Xia, X., Li, Y., Xiao, G., Zhan, K., Yan, J., Cai, C., Fang, Y., Huang, G.: Benchmarking deep models on retinal fundus disease diagnosis and a large-scale dataset. Signal Processing: Image Communication 127, 117151 (2024).
[2] Nakayama, L.F., Restrepo, D., Matos, J., Ribeiro, L.Z., Malerbi, F.K., Celi, L.A., et al.: Brset: A brazilian multilabel ophthalmological dataset of retina fundus photos. PLOS Digital Health 3(7), e0000454 (2024).
[3] Pachade, S., Porwal, P., Thulkar, D., Kokare, M., Deshmukh, G., Sahasrabuddhe, V., Giancardo, L., Quellec, G., Mériaudeau, F.: Retinal fundus multi-disease image dataset (rfmid): a dataset for multi-disease detection research. Data 6(2), 14 (2021)
[4] Cen, L.P., Ji, J., Lin, J.W., Ju, S.T., Lin, H.J., Li, T.P., Wang, Y., Yang, J.F., Liu, Y.F., Tan, S., et al.: Automatic detection of 39 fundus diseases and conditions in retinal photographs using deep neural networks. Nature communications 12(1), 4828 (2021)
[5] Kermany, D.S., Goldbaum, M., Cai, W., Valentim, C.C., Liang, H., Baxter, S.L., McKeown, A., Yang, G., Wu, X., Yan, F., et al.: Identifying medical diagnoses and treatable diseases by image-based deep learning. cell 172(5), 1122–1131 (2018)
[6] Kulyabin, M., Zhdanov, A., Nikiforova, A., Stepichev, A., Kuznetsova, A., Ronkin, M., Borisov, V., Bogachev, A., Korotkich, S., Constable, P.A., et al.: Octdl: Optical coherence tomography dataset for image-based deep learning methods. Scientific Data 11(1), 365 (2024)
[7] Gholami, P., Roy, P., Parthasarathy, M.K., Lakshminarayanan, V.: Octid: Optical coherence tomography image database. Computers & Electrical Engineering 81, 106532 (2020)