Use Case: Ocular Disease Recognition

We decided to build an ML model in PerceptiLabs that applies image recognition techniques on fundus images to detect possible cataracts in patients. Using a model like this could help doctors, optometrists, and researchers to more easily classify and detect such conditions.

Use Case: Ocular Disease Recognition
We decided to build an ML model in PerceptiLabs that applies image recognition techniques on fundus images to detect possible cataracts in patients.

Ocular diseases are extensively-studied in the healthcare world as they affect millions of people. With this in mind, we decided to build an ML model in PerceptiLabs that applies image recognition techniques on fundus images to detect possible cataracts in patients. Using a model like this could help doctors, optometrists, and researchers to more easily classify and detect such conditions.

Dataset

To train our model, we grabbed the Ocular Disease Recognition dataset on Kaggle that is comprised of fundus images representing seven ocular-related conditions as well as normal images (i.e., those depicting no-ocular-related conditions).

Figure 1: Examples of images from the dataset.

For our use case, we narrowed down the dataset to 293 images representing normal images and 293 representing cataracts. Each image is a .jpg file and has been preprocessed to 512x512 pixels.

We created a .csv file (dataset.csv) to map the classification labels for cataracts (C) and normal (N) to their respective image files for use in loading the data using PerceptiLabs' Data Wizard.

Below is a partial example of how the .csv file looks:

labels

files

N

preprocessed_images/0_right.jpg

C

preprocessed_images/24_right.jpg

Example of the .csv file to load data into PerceptiLabs that maps the labels to their associated image files.

Model Summary

Our model was built with just three Components:

Component 1: MobileNetV2 

include_top=false, pretrained=imagenet

Component 2: Dense 

Activation=ReLU, Neurons=128

Component 3: Dense

Activation=Softmax, Neurons=2

Figure 2: Topology of the model in PerceptiLabs.

Training and Results

Figure 3: PerceptiLabs' Statistics View during training.
Figure 3: PerceptiLabs' Statistics View during training.

With a training time of just over 77 seconds, we were able to achieve a training accuracy of 100% and a validation accuracy of 97.44%. In the following screenshot from PerceptiLabs, you can see how the training and validation accuracy quickly ramped up during the first epoch, after which both remained fairly stable:

Figure 4: Accuracy Plot.
Figure 4: Accuracy Plot.

Vertical Applications

A model like this could be used to help screen for a variety of conditions detectable through fundus images and to notify doctors as to which cases may require a closer look.

Such a project could also be used by medical students or practitioners looking to build next-generation ML-based medical technology. The model itself could also be used as the basis for transfer learning to create additional models for detecting a variety of conditions using fundus images or other types of medical scans/imagery.

Summary

This use case is a simple example of how ML can be used to identify ailments using image recognition. If you want to build a deep learning model similar to this, run PerceptiLabs and grab a copy of our pre-processed dataset from GitHub.