Unit V (AI & ML)
Unit V (AI & ML)
Unit V (AI & ML)
Dendrites Inputs
Synapse Weights
Axon Output
The architecture of an artificial neural network:
Artificial Neural Network primarily consists of three
layers:
Input Layer:
As the name suggests, it accepts inputs in several different formats provided by the
programmer.
Hidden Layer:
The hidden layer presents in-between input and output layers. It performs all the calculations
to find hidden features and patterns.
Output Layer:
The input goes through a series of transformations using the hidden layer, which finally results
in output that is conveyed using this layer.
Advantages of Artificial Neural Network (ANN)
Hardware dependence:
Artificial neural networks need processors with parallel processing power, as per their structure. Therefore, the
realization of the equipment is dependent.
Binary:
In binary activation function, the output is either a one or a 0.
Here, to accomplish this, there is a threshold value set up. If the
net weighted input of neurons is more than 1, then the final
output of the activation function is returned as one or else the
output is returned as 0.
Sigmoidal Hyperbolic:
The Sigmoidal Hyperbola function is generally seen as an "S"
shaped curve. Here the tan hyperbolic function is used to
approximate output from the actual net input. The function is
defined as:
F(x) = (1/1 + exp(-????x))
2. Classification of Handwritten Digits Using CNN
To create and train a simple Convolutional Neural Network (CNN) for classifying handwritten
digits from a popular dataset.
Convolutional Neural Network
NN is a deep learning technique to classify the input automatically (well, after you provide the right data).
A CNN model consists of three primary layers: Convolutional Layer, Pooling layer(s), and fully connected layer.
(1) Convolutional Layer: This layer extracts high-level input features from input data and passes those
features to the next layer in the form of feature maps.
(2) Pooling Layer: It is used to reduce the dimensions of data by applying pooling on the feature map to
generate new feature maps with reduced dimensions. PL takes either maximum or average in the old
feature map within a given stride.
(3) Fully-Connected Layer: Finally, the task of classification is done by the FC layer. Probability scores
are calculated for each class label by a popular activation function called the softmax function.
Dataset
The dataset that is being used here is the MNIST digits classification dataset. Keras is a deep learning API
written in Python and MNIST is a dataset provided by this API. This dataset consists of 60,000 training
images and 10,000 testing images. It is a decent dataset for individuals who need to have a go at pattern
recognition as we will perform in just a minute!
When the Keras API is called, there are four values returned namely- x_train, y_train, x_test, and y_test.
Do not worry, I will walk you through this.
Loading the Dataset