The Glaucoma-Detection-using-Transfer-Learning A.K.A GlaucoDetect is a full stack project with Machine Learning at its core. This project aims to help people get a report about the condition of their eyes and the possibility of having glaucoma eye disease. The ML model is trained using the concepts of transfer learning techniques (where we use the pre-trained models to extract the features to help us train the model without worrying about overfitting comparatively smaller datasets). The core tech stack used to build this project is Python, JavaScript and its libraries and framework. The frontend is built using the React library and the backend is built using the Flask framework.
There are two parts of the project, one which contains the algorithm used to train the model and the other uses the exported model as a part of the backend in the web application to interact with end users. But here some common parts which you can get started with...
- Make sure you have git, python, any conda environment (i.e., miniconda or anaconda) and node.js installed within your system.
- Now fork the repository and clone it to your local machine by using the following command.
git clone https://github.com/<your-username>/Glaucoma-Detection-using-Transfer-Learning.git
- Open the cloned directory and set up the conda environments using the
enviroment.yml
(more details down below) and download the requirednode_modules
using node (more details down below).
All the ML model-related files including the dataset and exported model are present within the model
directory of the project. To set up Jupyter Notebook, you either have to use Google Colab or your local system.
- If you want to use it through Google Colab, you can just download the Jupyter Notebook present within the
model
directory named glaucoma-detection-using-transfer-learning.ipynb and open it through Google Colab your account.
Note
Please note if you're using Google Colab, please don't use GPU or TPU runtime as train the model from scratch take a lots of time and compute power which might exhaust your daily limit thus leading to termination of your runtime and all the progress that your model made.
- If you wish to proceed with your local system, you can just open it up using the Jupyter Notebook that comes along with the complete installation of the Anaconda environment.
- If you're using the Miniconda instead of the complete Anaconda environment, you can make use of the exported environment.yml configuration to set up the same environment that I used to train the model. You can use the following command to set up the environment within your system:
# setup the environment using conda within your system.
conda env create -f model/environment.yml
# activate your the environment to train the model.
conda activate glaucoma-detection
Tip
- If you're using VSCode to open and train the model within the jupyter notebook, make sure to select the interpret using
ctrl
+shift
+p
(or)cmd
+shif
+p
, then type "select python interpreter" and then select the python interpreter fromglaucoma-detection
miniconda environment. - Do the same while selecting the runtime environment for the jupyter notebook too.
The files related to the web application are located within the root of the project directory. For setting up this project you're going to need node.js and python (miniconda is recommended).
- You can start initializing the react application using the following command:
npm install
- As for the backend, you can set up the miniconda environment using the
environment.yml
file present within theserver
directory.
# setup the environment using conda within your system.
conda env create -f server/environment.yml
# activate your the environment to host the server.
conda activate glaucoma-detection-server
- If you're not using miniconda environment, then you still install dependencies using the
pip
package manager (which is not recommended). It's recommended to have some kind of virtual environment like miniconda but you can still use other virtual environments likepipenv
orvirtualenv
. Here are the required dependencies for setting up virtual dependencies.
numpy=1.23.5
scikit-learn=1.3.0
scikit-image=0.22.0
tensorboard=2.12.1
flask=2.2.5
flask_cors=3.0.10
- After setting up the required environment, you can run up the servers for both the React app and Flask applications you can use the following commands:
# Run the server for react app
npm run dev
# In a new terminal, run the flask server
python server/server.py
I welcome anyone who finds my project interesting and willing to contribute to this project. Please make sure to set up the project with your system and try it out at least once, even before you start contributing to the project. If you face any kind of issue while setting up the project within your system, you can raise a ticket by creating a new discussion within the discussion section of the repo.
Important
- Please create a new issue in the issue section and get assigned even before you start contributing to the project. By this way you can let others know that you're out of a feature/bug which was already recorded, this helping us maintain the project better.
- This is the reason, why any PR made without a issue tag will be rejected and closed unless or until there a new issue has been created and linked with the respective issue.