# Neural Networks with Use Cases

--

# Simple Definition Of A Neural Network

Modeled in accordance with the human brain, a *Neural Network was built to mimic the functionality of a human brain*. The human brain is a neural network made up of multiple neurons, similarly, an Artificial Neural Network (ANN) is made up of multiple perceptrons (explained later).

The Neural Network is constructed from 3 type of layers:

- Input layer — initial data for the neural network.
- Hidden layers — intermediate layer between input and output layer and place where all the computation is done.
- Output layer — produce the result for given inputs.

There are 3 yellow circles on the image above. They represent the input layer and usually are noted as vector ** X. **There are 4 blue and 4 green circles that represent the hidden layers. These circles represent the “activation” nodes and usually are noted as

**or**

*W***. The red circle is the output layer or the predicted value (or values in case of multiple output classes/types).**

*θ*Each node is connected with each node from the next layer and each connection (black arrow) has particular weight. Weight can be seen as impact that node has on the node from the next layer.

# What Is Deep Learning?

Deep Learning is an advanced field of Machine Learning that uses the concepts of Neural Networks to solve highly-computational use cases that involve the analysis of multi-dimensional data. It automates the process of feature extraction, making sure that very minimal human intervention is needed.

# Deep Learning Use Case/ Applications

Did you know that PayPal processes over $235 billion in payments from four billion transactions by its more than 170 million customers? It uses this vast amount of data to identify possible fraudulent activities among other reasons.

With the help of Deep Learning algorithms, PayPal mined data from their customer’s purchasing history in addition to reviewing patterns of likely fraud stored in its databases to predict whether a particular transaction is fraudulent or not.

The company has been relying on Deep Learning & Machine Learning technology for around 10 years. Initially, the fraud monitoring team used simple, linear models. But over the years the company switched to a more advanced Machine Learning technology called, Deep Learning.

Fraud risk manager and Data Scientist at PayPal, Ke Wang, quoted:

*“What we enjoy from more modern, advanced machine learning is its ability to consume a lot more data, handle layers and layers of abstraction and be able to ‘see’ things that a simpler technology would not be able to see, even human beings might not be able to see.”*

A simple linear model is capable of consuming around 20 variables. However, with Deep Learning technology one can run thousands of data points. Therefore, by implementing Deep Learning technology, PayPal can finally analyze millions of transactions to identify any fraudulent activity.

# How Does A Neural Network Work?

To understand neural networks, we need to break it down and understand the most basic unit of a Neural Network, i.e. a Perceptron.

# What Is A Perceptron?

A Perceptron is a single layer neural network that is used to classify linear data. It has 4 important components:

- Inputs
- Weights and Bias
- Summation Function
- Activation or transformation Function

The basic logic behind a Perceptron is as follows:

*The inputs (x) received from the input layer are multiplied with their assigned weights w. The multiplied values are then added to form the Weighted Sum. The weighted sum of the inputs and their respective weights are then applied to a relevant Activation Function. The activation function maps the input to the respective output.*

# Types of Artificial Neural Networks

There are two important types of Artificial Neural Networks –

- FeedForward Neural Network
- FeedBack Neural Network

## FeedForward Artificial Neural Networks

In the feedforward ANNs, the flow of information takes place only in one direction. That is, the flow of information is from the input layer to the hidden layer and finally to the output. There are no feedback loops present in this neural network. These type of neural networks are mostly used in *supervised learning *for instances such as classification, image recognition etc. We use them in cases where the data is not sequential in nature.

## Feedback Artificial Neural Networks

In the feedback ANNs, the feedback loops are a part of it. Such type of neural networks are mainly for memory retention such as in the case of recurrent neural networks. These types of networks are most suited for areas where the data is sequential or time-dependent.

# Bayesian Networks

These type of neural networks have a probabilistic graphical model that makes use of Bayesian Inference for computing the probability. These type of Bayesian Networks are also known as Belief Networks. In these Bayesian Networks, there are edges that connect the nodes representing the probabilistic dependencies present among these type of random variables. The direction of effect is such that if one node is affecting the other then they fall in the same line of effect. Probability associated with each node quantifies the strength of the relationship. Based on the relationship, one is able to infer from the random variables in the graph with the help of various factors.

The only constraint that these networks have to follow is it cannot return to the node through the directed arcs. Therefore, Bayesian Networks are referred to as Directed Acyclic Graphs (DAGs).

# Neural Networks Explained With An Example

Consider a scenario where you are to build an Artificial Neural Network (ANN) that classifies images into two classes:

- Class A: Containing images of non-diseased leaves
- Class B: Containing images of diseased leaves

So how do you create a Neural network that classifies the leaves into diseased and non-diseased crops?

The process always begins with processing and transforming the input in such a way that it can be easily processed. In our case, each leaf image will be broken down into pixels depending on the dimension of the image.

For example, if the image is composed of 30 by 30 pixels, then the total number of pixels will be 900. These pixels are represented as matrices, which are then fed into the input layer of the Neural Network.

Just like how our brains have neurons that help in building and connecting thoughts, an ANN has perceptrons that accept inputs and process them by passing them on from the input layer to the hidden and finally the output layer.

As the input is passed from the input layer to the hidden layer, an initial random weight is assigned to each input. The inputs are then multiplied with their corresponding weights and their sum is sent as input to the next hidden layer.

Here, a numerical value called bias is assigned to each perceptron, which is associated with the weightage of each input. Further, each perceptron is passed through activation or a transformation function that determines whether a particular perceptron gets activated or not.

An activated perceptron is used to transmit data to the next layer. In this manner, the data is propagated (Forward propagation) through the neural network until the perceptrons reach the output layer.

At the output layer, a probability is derived which decides whether the data belongs to class A or class B.

# Artificial Neural Networks Applications

Following are the important Artificial Neural Networks applications –

## Handwritten Character Recognition

ANNs are used for handwritten character recognition. Neural Networks are trained to recognize the handwritten characters which can be in the form of letters or digits.

## Speech Recognition

ANNs play an important role in speech recognition. The earlier models of Speech Recognition were based on statistical models like Hidden Markov Models. With the advent of *deep learning*, various types of neural networks are the absolute choice for obtaining an accurate classification.

## Signature Classification

For recognizing signatures and categorizing them to the person’s class, we use artificial neural networks for building these systems for authentication. Furthermore, neural networks can also classify if the signature is fake or not.

## Facial Recognition

In order to recognize the faces based on the identity of the person, we make use of neural networks. They are most commonly used in areas where the users require security access. Convolutional Neural Networks are the most popular type of ANN used in this field.

# Summary

So, you saw the use of artificial neural networks through different applications. We studied how neural networks are able to predict accurately using the process of backpropagation. We also went through the Bayesian Networks and finally, we overviewed the various applications of ANNs.