Anomaly Detection with Auto-Encoders: How we used it for Cervical Cancer detection

Photo by rawpixel on Unsplash

Background:

TL;DR

Problem Statement:

What is an Auto-encoder anyways?

An Auto-encoder is a type of artificial neural network used to learn efficient data codings in an unsupervised manner. The aim of an Auto-encoder is to learn a representation (encoding) for a set of data, typically for dimensionality reduction.

Credit: Curiously, What to do when data is missing? — Part II

How it works

from torch.nn import Module, Linear, MSELoss
from torch.optim import Adam
# Define our constants
input_neurons = 8
hidden_neurons = 4
# create our network
class AutoEncoder(torch.nn.Module):
def __init__(self):
super(AutoEncoder, self).__init__()
self.fc1 = Linear(input_neurons, hidden_neurons)
self.fc2 = Linear(hidden_neurons, hidden_neurons)
self.fc3 = Linear(hidden_neurons, input_neurons)

def forward(self, x):
x = self.fc1(x)
x = self.fc2(x)
x = self.fc3(x)
return x
#initiate model and define loss function & optimizer algorithm
model = AutoEncoder()
critereon = MSELoss()
optimizer = Adam(model.parameters())

Making Predictions

Working at the intersection of technology and impact. Love for anything technology, passionate about anything Africa.