List Headline Image
Updated by mohitverma0491 on Sep 26, 2020
 REPORT
7 items   1 followers   5 votes   0 views

Build you own Artificial Neural Network from Scratch

Artificial Neural Networks are feed-forward neural networks. They have been quite famous recently for the amazing feats they have achieved. Follow this list to see how you can build your own Artificial Neural Network or ANN, as they are commonly known from Scratch.

1

Visualisation of Neural Network Structure

Visualisation of Neural Network Structure

Our Artificial Neural Network has a structure as shown in the figure above. As it can be clearly seen that the Image which is in the form of a matrix is first converted into a vector. The artificial neural network then contains dense layers of 250, 100 and 10 layers. To learn more about Artificial Neural Networks and how you can create your own artificial neural network from scratch, follow the link mentioned in the post.

2

Summary of the model

Summary of the model

The image shown above shows a summary of the artificial neural network model that we just built from scratch. The summary of the model shows the layers that are present in the model, such as flatten, dense, dense_1, and dense_2. Along with this, the total number of parameters are shown for each layer. At the end of the summary, we have a description of the total number of trainable and non-trainable parameters in the model.

3

Division of data

Division of data

It is important how the data is divided into the training set, the validation set, and the test set. The total dataset of 70000 samples is divided into the training set which contains 60000 samples, the validation set which contains 5000 samples and the test set which contains 5000 samples. The visualization above shows how the data is divided into these 3 sets.

4

Training the Model

Training the Model

Training of the model is carried out once we have developed the model and compiled it. The image above shows how a model is trained. The various metrics that are shown during the training such as training accuracy, validation accuracy, training loss, and validation loss.

Building an Artificial Neural Network from Scratch using Keras

We will be building our own Artificial Neural Network from Scratch using the Keras library which will internally use the Tensorflow library.

6

Evaluating the model

Evaluating the model

It is necessary to evaluate the model on data that it has not seen before hand. Hence, evaluate our model on the test set. Since the model has not this set before it will act like real-world data.

7

Concolusion

Lastly, I have compared how our Artificial Neural Network that we created from scratch compares to the Convolutional Neural Network we built from scratch before this. Hope you have a great time reading this blog post, and enjoy it as much as I did while writing it. Thank you.