In this blog post, we will be building a feed forward neural network and convolutional neural network from scratch on “Fruit 360” dataset using PyTorch
A feed-forward neural network is an artificial neural network wherein connections between the nodes do not form a cycle. As such, it is different from its descendant: recurrent neural networks. The feed-forward neural network was the first and simplest type of artificial neural network devised.
FFN are of two types —
Single layer FFN consists of single layer of output nodes, inputs are fed directly to the output via a series of weights. Sum of product of weights and inputs is calculated at each node and if it is greater than threshold, the neuron fires and takes the activation value.
Multi-layer FFN consists of hidden layers between input and output layers. Hidden nodes do not directly send outputs to the external environment. FFN overcomes the limitation of single layer FFN i.e. they can handle non-linearly separable learning tasks.
The name “convolutional neural network” indicates that the network employs a mathematical operation called convolution. Convolution is a specialized kind of linear operation. Convolutional networks are simply neural networks that use convolution in place of general matrix multiplication in at least one of their layers.
Some terms that are related to CNN and are important to understand the working of a CNN are —
Basic steps involved in building a neural network are —
Fruit 360 is a dataset of images containing fruits and vegetables. The dataset contains 90483 images of 1131 different fruits and vegetables.
Total number of images: 90483.
Training set size: 67692 images (one fruit or vegetable per image).
Test set size: 22688 images (one fruit or vegetable per image).
Multi-fruits set size: 103 images (more than one fruit (or fruit class) per image)
Number of classes: 131 (fruits and vegetables).
Image size: 100x100 pixels.
Filename format: image_index_100.jpg (e.g. 32_100.jpg) or r_image_index_100.jpg (e.g. r_32_100.jpg) or r2_image_index_100.jpg or r3_image_index_100.jpg. “r” stands for rotated fruit. “r2” means that the fruit was rotated around the 3rd axis. “100” comes from image size (100x100 pixels).
Different varieties of the same fruit (apple for instance) are stored as belonging to different classes.
#neural-networks #pytorch #convolutional-network #kaggle #deep-learning