Skip to content

maedemir/CIFAR-10-image-classification-using-fully-connected-NN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

CIFAR-10-image-classification-using-fully-connected-NN

This is an image classification project using pure python and fully connected nural networks from scratch!

Problem description

In this problem, we want to classify the images of the CIFAR-10 dataset. This dataset is a smaller version of the CIFAR-100 dataset, limited to images from 10 different categories. to reduce the computational complexity, we only use the images of the first 4 classes of this dataset. The dimensions of the images in this dataset are equal to 32 (length) by 32 (width) by 3 (RGB color channels).

image

Neural network architecture and details

For this neural network, we consider two hidden layers, each of which has 16 neurons. So the structure of our neural network will be as follows:

image

The pseudo-code of our neural network learning process according to the Descent Gradient Stochastic method is as follows:

image

Feedforward

to calculate the output from the input in neural networks, the following operation is done in each layer: image

As a result, in the implementation of the neural network, for the weights between both layers, we consider a k by n matrix that k is the number of neurons in the next layer and n is the number of neurons in the current layer. image

Backpropagation

As you know, neural network learning process is in fact minimizing the cost function. This is done with the help of Descent Gradient method, where by obtaining the partial derivatives of the cost function for all the parameters (that is, the same gradient), we make the desired changes on the parameters. Obtaining these derivatives is done with the help of backpropagation.

image

image

Vectorization

So far, we only worked with the first 200 data of the dataset because the execution time of the current training process takes a lot of time and it's not optimal for network learning. To solve this problem, we apply vectorization. This means that instead of using for loops, the desired operation is done in the form Matrix operations (matrix and vector multiplication and addition, internal multiplication, transposition and applying functions on each element)

Persian description

you can see the persian project description below:

CI_project1.pdf

About

This is an image classification project using pure python and

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published