Skip to main content

Why use CNN instead of normal Feed forward Network?

    While we can use a simple Feed Forward Network, we use Convolutional Neural Network... What is the need for such a network?

    I took a picture of me with my mobile camera which has 12 MP resolution ( Poco F1). I imported it as numpy array. Number of pixel in that image was 2756160. I have nearly 3 million pixel! If i use a Feed Forward Network it means i have 3 million features! I will require more number of data. A 10 million photos will satisfy my need. Also this would require a large memory and long time for training!

   We can reduce the dimension? PCA? PCA of 3 million X 10 million will still be a great problem. Moreover we cannot get 10 million photos. We have to train better with small amount of data.

   How else can we reduce the dimension? Feature extraction is a good option, we can have multiple filters for a image and use the results of filter as the feature. This significantly reduces our data. 128 filters (of size 3x3) applied to my image will reduce it into a  128 images of size 3x3. This is what a Convolutional Neural Network is! The  problem gets reduced in dimension and difficulty...
The size of the image was found to be 2756160.

Comments

Popular posts from this blog

CodeSignal - Almost Strictly Increasing Sequence

I came across an interesting question in Code Signal.   "Given a sequence of integers as an array, determine whether it is possible to obtain a strictly increasing sequence by removing no more than one element from the array."                                                                                                         It is strictly increasing if every element in the array is greater than its successor.     For a strictly increasing sequence we can check for each element whether it is greater than the next. In that case we can come to a conclusion that this sequence is not strictl...

Deep Learning (Goodfellow et al) - Chapter 2 review

     This chapter is the first chapter of the part - 1. This part prepares you for Deep learning and in this chapter Linear Algebra is covered. The author advice you to skip the chapter if you are already familiar with the concepts. Also it is not that you can become Gilbert Strang after reading this chapter! The chapter is so concise that what may be relevant to our future acquaintance with the book are only present here. Only at the end of the chapter some concepts author speaks on the application part. The focus is on mathematical concepts involving Linear Algebra.       Though Science and Engineering use Linear Algebra efficiently, Computer scientist have lesser experience with it. This is the motivation of the chapter and if you have experience it then author provides you with a reference (The Matrix Cookbook - Petersen and Pedersen, 2006) and waves you good bye to meet in the next chapter.      Definitions ...

Some Terminologies - Module, Package, Framework, API,..

    Following Article is a list of some terminologies and explanations in software development with a focus on Data Science. Module:       What can we do to reuse a function or a class that we have already written? Suppose we write a function to find Euclidean norm and the least square error while writing code for linear regression. We may need the same while writing code for K-nearest neighbors.      For the purpose of reusing the codes we can write such sharable functions in a single file. Lets save it as a 'lin_alg.py' and import it while we are writing code for linear regression and KNN.  import lin_alg lin_alg.least_sq_er(y,y_pred)  Package:       We can have a module to reuse code. But how much will it contain? There may be 100-200 functions or more used. We have two problems here, first is the space required to store every function. If we want to just calculate the euclidean ...