Classifying retinal disease using CNN

Nithiyashree SNithiyashree S
3 min read

There a lot of pre defined architectures meant for image processing.

I have trained my model using VGG-16, LeNet architecture.

The diseases chosen appear very similar but requires completely different treatments.A wrong diagnose will deteriorate eye health. Built a classifier that accurately classifies dieases like CNV,DME,Drusen from healthy eyes.

You'll have to feed your OCT(Optical Coherence Tomography-to see the posterior of your eye like MRI is to head) scans .

The best performing model will be converted into .h5 format and used in the backend of the project . Django framework was used as API to merge the sign in, image feed UI with the model.

LeNet Architecture

For the LeNet convolutional neural network architecture for image categorization.Two sets of convolutional and average pooling layers make up the LeNet architecture, which is then followed by a flattening layer, two fully connected layers, and an output layer with softmax activation.The training photos are scaled to values between 0 and 1, and random transformations like shearing, zooming, and horizontal flipping are applied in the code using the Keras ImageDataGenerator class. Just resizing is done to the test photos. This categories cross-entropy loss function, the RMSprop optimizer, and accuracy are used to build the model.The best model's weights are saved using the model checkpoint callback once the training process has completed 100 epochs with a batch size of 32. The algorithm makes predictions on the test set after training, computes the classification report and confusion matrix, and outputs the findings. Moreover, it displays the accuracy and loss over epochs for the training history.

Visual Geometric Group-16

This VGG16 model was created with TensorFlow's Keras API. An ImageDataGenerator is used to create augmented pictures while the model is being trained on a dataset of photos divided into four classes.Several Conv2D layers with ReLU activation are followed by MaxPooling layers in the model design. The probabilities for each class are produced by completely linked dense layers with softmax activation. The categorical crossentropy loss function and the accuracy metric are used in the model's construction.The highest accuracy model weights on the validation set are saved during training using the ModelCheckpoint callback. Following training, two graphs displaying the training and validation accuracy/loss curves throughout the epochs are created.Overall, this code may be improved upon and modified for improved results when training a VGG16 model for picture categorization.

My dataset is acquired from Kaggle and is about 2000 images.

Equally 400 images from each class was used for training and the rest was used for testing the model.

ACCURACY COMPARISON

The accuracy attained by VGG-16 was 30 percent where in LeNet attained 97.8 percent. The loss incurred as the graph represents must be controlled in future.

0
Subscribe to my newsletter

Read articles from Nithiyashree S directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Nithiyashree S
Nithiyashree S