This repository houses an innovative multi-class medical image classification system designed to advance the diagnosis of various ocular diseases through the power of Convolutional Neural Networks (CNN) and transfer learning. Utilizing the ODIR-5K dataset, which comprises 5000 color fundus photographs representing a range of ocular conditions, our system aims to classify these into eight distinct categories: Normal (N), Diabetes (D), Glaucoma (G), Cataract (C), Age-related Macular Degeneration (A), Hypertension (H), Pathological Myopia (M), and Other diseases/abnormalities (O).
Addressing the common challenge of class imbalance in medical image datasets, our approach embraces multi-class classification enhanced with various explainability techniques. This methodology not only improves diagnostic accuracy but also increases transparency, enabling healthcare professionals to understand the rationale behind each diagnosis made by our computer-aided diagnostic system.
- ODIR-5K Dataset: A comprehensive collection of 5000 color fundus photographs, accessible on Kaggle here.
The following pre-trained models from Keras were used, selected for their proven efficiency in image classification tasks:
- VGG16
- VGG19 (same link as VGG16)
- Xception
- ResNet50
- InceptionV3
These models were chosen based on their performance metrics, including accuracy and precision, in classifying images into the relevant ocular disease categories.
Before starting, ensure you have:
- A Kaggle account for dataset access
- Google Colab for running notebooks
- Clone the repository:
git clone https://github.com/dduwa/ocular-disease-recognition-system.git
- Access the ODIR-5K dataset: Navigate to the provided Kaggle link and download the dataset.
- Prepare the kaggle.json file: Follow the instructions on Kaggle for generating and downloading your API key (kaggle.json). This file is crucial for accessing the dataset from within the notebooks. There is also a kaggle.json file already available for use aswell in the repository
- Open the notebooks on Google Colab: Import the cloned notebooks into Google Colab to utilise its computational resources and pre-installed libraries.
- Upload kaggle.json: Ensure the kaggle.json file is uploaded to the Colab environment using the section "Access Dataset via Kaggle API" to programmatically download the dataset.
- Run the notebooks: Follow the step-by-step instructions within each notebook to train and evaluate the models. The notebooks are self-contained and include comments to guide you through the process.
To enhance the transparency of the model predictions, there is implementation of XAI techniques for the top performing model which is VGG16. These techniques are designed to provide insights into the decision-making process of the neural network, thereby making the outcomes more interpretable for medical professionals. To run the XAI implementations please upload the images within the XAI Test Images folder to the Colab environment.
- K_Fold_Cross_Validation_Attempt folder: Implementation attempt of K-Fold Cross Validation for VGG16 and Resnet model to resolve overfitting caused by augmentation and sampling
- RandomSamplingModels folder: Has the implementation of using random sampling in attempts to increase model accuracy.
- JupyterNotebookInVSImplementations folder: Contains the implementation of the notebooks in Visual Studio Code, before switching to Google Colab after issues with running out of computational resources.