{"id":20099485,"url":"https://github.com/alzubair98/glaucoma-classification-model","last_synced_at":"2026-05-08T20:33:53.563Z","repository":{"id":247796772,"uuid":"826875673","full_name":"Alzubair98/Glaucoma-classification-model","owner":"Alzubair98","description":"Glaucoma - classification -mode with CDR","archived":false,"fork":false,"pushed_at":"2024-09-09T19:15:40.000Z","size":49247,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-04T22:51:36.270Z","etag":null,"topics":["deeplearning","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Alzubair98.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-07-10T14:54:41.000Z","updated_at":"2024-09-09T19:15:46.000Z","dependencies_parsed_at":"2024-09-09T19:48:46.930Z","dependency_job_id":null,"html_url":"https://github.com/Alzubair98/Glaucoma-classification-model","commit_stats":null,"previous_names":["alzubair98/glaucoma-classification-model"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Alzubair98/Glaucoma-classification-model","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alzubair98%2FGlaucoma-classification-model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alzubair98%2FGlaucoma-classification-model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alzubair98%2FGlaucoma-classification-model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alzubair98%2FGlaucoma-classification-model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Alzubair98","download_url":"https://codeload.github.com/Alzubair98/Glaucoma-classification-model/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alzubair98%2FGlaucoma-classification-model/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32795995,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deeplearning","tensorflow"],"created_at":"2024-11-13T17:10:47.320Z","updated_at":"2026-05-08T20:33:53.547Z","avatar_url":"https://github.com/Alzubair98.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Glaucoma-classification-model\n\nGlaucoma classification model is the model project for our proposed paper that will be published soon. Now this repo will have the weights only, after the paper is published the code for the model, how to train, and more will be added.\n\n**NOTE: DO NOT FORGET TO UNZIP THE FOLDERS**\n\n## Folder structure\n\nThe repository is structured as follows:\n\n1. Dataset folder: This folder contains the datasets used to train, test, and validate the models. Datasets are ACRIMA, DRISHTI-GS, and RIM-ONE.\n\n2. files folder: This folder contains the weights of the models. **NOTE** Because of weight size, the file is available in Google Docs using this [link](https://drive.google.com/drive/folders/1EjKJgV9oEtuPHs7siJ7ogsBPn-_YG8kc?usp=sharing)\n\n3. predictions folder: In this folder the models performance was test on the test images from the datasets folder each model for its own dataset. the predictions are saved as masks for cup and disc.\n\n4. cdr folder: Its the folder that contains the test images from different datasets (ACRIMA, DRISHTI-GS, RIM-ONE) to test the CDR accuracy of all the models **note** the models were not trained on these images.\n\n5. classification_model: This folder contains the weights for the classification model that is used to classify images as (optic-cup, no optic-cup). **NOTE** Because of weight size the file is available in Google Docs using this [link](https://drive.google.com/drive/folders/1EjKJgV9oEtuPHs7siJ7ogsBPn-_YG8kc?usp=sharing)\n\n6. classified_images: This folder has 3 folders inside it, each one for each dataset. In each folder, there are two folders named (cdr and segmentation). The cdr folder contains the output of the classification model applied to each dataset. The segmentation folder contains the output of the segmentation model applied to the cdr folder images **NOTE** that cdr here is not the same folder in the first step.\n\n7. models.ipynb: This is the code used to test all the models. You can clone it and run it on your end.\n\n## Getting Started\n\n### Prerequisites\n\nIn order to clone and use this repo, you need to have the following:\n\n- Python (version \u003e= 3.7)\n- Tensorflow (version \u003e= 2.10.0)\n- Numpy\n- OpenCv\n- Matplotlib.pyplot\n- glob\n- tqdm\n- shutil\n\n**NOTE:** the models' file used in jupyter notebook its preferred to use anaconda but it's okay to use only jupyter notebook\n\n## Installation\n\nTo Install and run the test on your end you need to clone the repo using this snippet :\n\n### Clone this repository\n\n```shell\ngit clone https://github.com/Alzubair98/Glaucoma-classification-model.git\n```\n\n### Run Anaconda\n\n```shell\njupyter notebook\n```\n\nand navigate to Glaucoma-classification-model folder, open models.ipynb\n\n## Explination of the Code In Models.ipynb\n\nMost Important functions will be explained here.\n\n\u003cdiv align='center'\u003e\n\u003cimg alt='seg-task function image' src='./images/seg_task.png'/\u003e\n\u003c/div\u003e\n\nThe segmentation task is function is used to load a model, load dataset, and predict the masks of the dataset images using the model then save the results (masks) in a save_path. The parameters of this function are:\n\n1- model_path : path to the model.\n\n2- dataset_path : path to the dataset.\n\n3- save_path : path to where you want to save the images.\n\n\u003cdiv align='center'\u003e\n\u003cimg alt='model performance function image' src='./images/model_perfromace_check.png'/\u003e\n\u003c/div\u003e\n\nThe second function is Model_performance_check its used to check measure the model performance using various matrices such as (DICE, PIXEL ACCURACY, RECALL , JACCARD INDEX, COHEN KAPPA, and MORE). The parameters of this function are:\n\n1- pred_mask_dir : the path to the predicted masks.\n2- true_mask_dir : the path to the ture masks/labels.\n3- cup_or_disc : in case you measure the accuracy of a disc masks you need to write disc otherwise you need to write cup.\n\n\u003cdiv align='center'\u003e\n\u003cimg alt='Classification function image' src='./images/classification function.png'/\u003e\n\u003c/div\u003e\n\nThe Third function is used to classifiy images as optic-cup and no optic-cup (no Glaucoma) this function will autumatically load the weights from the classfication model path and apply the classification on the images and save the output on another file. the parameters of this function are:\n\n1- images_path : images you want to apply the model on.\n\n2- output_path : the path were you want to save the classified images in.\n\n**NOTR:** the output will be saved in two folders first one called optic-cup for images classified as there is an optic cup, and no-glaucoma for images classified as no optic-cup. as mentioned in the paper the optic-cup images will be processed to the segmentation task to apply the CDR on it and find if its normal or glaucoma affected.\n\n\u003cdiv align='center'\u003e\n\u003cimg alt='CDR function image' src='./images/CDR.png'/\u003e\n\u003c/div\u003e\n\nThe fourth function is Cup-to-Disc Ration (CDR), which measures whether the image is a normal or glaucoma-affected eye. the CDR measurement is the total pixels of optic cup divided by total pixels of optic disc:\n\n$$\n \\text{CDR} = \\frac{\\text{Total number of pixels of the optic cup}}{\\text{Total number of pixels of the optic disc}}\n$$\n\nthe parameters of the function are:\n\n1- optic-cup-dir : path to the predicted optic cup masks.\n\n2- optic-disc-dir : path to the predicted optic disc masks.\n\nThe function will output:\n\nImages names - Result of CDR - Reuslt (glaucoma or normal).\n\n\u003cdiv align='center'\u003e\n\u003cimg alt='CDR function image' src='./images/cdr-accuracy.png'/\u003e\n\u003c/div\u003e\n\nThe final function is used to check the overall accuracy of CDR , because we have applyed the CDR on more than one image we need to measure the overall accuracy and its measured using this equation:\n\n$$\n \\text{CDR-Accuracy} = \\frac{\\text{correct prediction}}{\\text{total number of images}} * 100\\%\n$$\n\nthe parameters of this function are:\n\n1- total_images : total number of images.\n\n2- correct_predictions : number of correct predictions.\n\n3- dataset_name : the name of the dataset you are checking the accuracy on.\n\n## Important\n\nRest of the code is applying the functions above on the propsed model and find the accuracies of them\n\n## Models Performance\n\nThe proposed model performance is shown in the Table below:\n\n**DISC**\n\n| DataSet    | Dice    | Jaccard Index | Recall  | Precision | Pixel Accuracy | Cohen's Kappa | MCC     |\n| ---------- | ------- | ------------- | ------- | --------- | -------------- | ------------- | ------- |\n| Dristhi-Gs | 0.97292 | 0.94755       | 0.96919 | 0.97744   | 0.97379        | 0.94654       | 0.94724 |\n| ACRIMA     | 0.95450 | 0.91378       | 0.95393 | 0.95761   | 0.97917        | 0.94074       | 0.94178 |\n| RIM-ONE    | 0.96716 | 0.93687       | 0.95852 | 0.97720   | 0.97410        | 0.94563       | 0.94653 |\n\n**CUP**\n\n| DataSet    | Dice    | Jaccard Index | Recall  | Precision | Pixel Accuracy | Cohen's Kappa | MCC     |\n| ---------- | ------- | ------------- | ------- | --------- | -------------- | ------------- | ------- |\n| Dristhi-Gs | 0.94174 | 0.89081       | 0.93683 | 0.95046   | 0.97094        | 0.92160       | 0.92329 |\n| ACRIMA     | 0.90040 | 0.82127       | 0.90038 | 0.91134   | 0.98140        | 0.89008       | 0.89335 |\n| RIM-ONE    | 0.90076 | 0.82247       | 0.92093 | 0.89251   | 0.98066        | 0.88979       | 0.89330 |\n\n**CDR classification Accuracy**\n\n| DataSet    | CDR Accuracy |\n| ---------- | ------------ |\n| Dristhi-Gs | 94.4444 %    |\n| ACRIMA     | 96.4286 %    |\n| RIM-ONE    | 93.2836 %    |\n\n\n\n## If you use this code please cite this work \n\nAlzubair Alqaraghuli. (2024). Alzubair98/Glaucoma-classification-model: First Release of the model (Test-model). Zenodo. https://doi.org/10.5281/zenodo.12737514\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falzubair98%2Fglaucoma-classification-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falzubair98%2Fglaucoma-classification-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falzubair98%2Fglaucoma-classification-model/lists"}