Deep learning is part of a broader family of machine learning methods based on Artificial Neural Networks (ANN). Deep learning today is ubiquitous, it is used in different application, from image classification to speech recognition. In this blog post I’m going to show you how to build a simple neural network to detect different eye diseases from Retinal optical coherence tomography (OCT) images using pytorch.

This is the 5 assignment for the course Zero to GANs on freeCodeCam.com

The dataset

OCT is an imaging technique used to capture high-resolution cross sections of the retinas of living patients. Approximately 30 million OCT scans are performed each year, and the analysis and interpretation of these images takes up a significant amount of time.

The dataset is taken from kaggle, it’s organized into 3 folders (train, test, val) and contains subfolders for each image category: choroidal neovascularization (CNV), diabetic macular edema (DME), multiple drusen present in early AMD (DRUSEN), and normal retina with preserved foveal contour and absence of any retinal fluid/edema (NORMAL).

Load and preprocess the images

First we’re going to load all the libraries and specify the function that we will use to load our data and our model on the GPU.

Then we’re going to parse all the image in the train folder in order to create two vectors containing the mean and the standard deviation of each channel of the training images. We’re gonna use those stats to normalize the images.

Now we load the data using pytorch. Each image is center-croppped to a size of 490x490 pixels (in order to have uniform size between each image), is converted to a tensor and then normalized.

#zero-to-gan #image-classification #deep-learning #pytorch #deep learning

Detect Eye Disease With Pytorch
2.95 GEEK