{"id":764,"date":"2018-02-11T19:12:00","date_gmt":"2018-02-11T19:12:00","guid":{"rendered":"http:\/\/www.codeastar.com\/?p=764"},"modified":"2018-02-12T18:24:14","modified_gmt":"2018-02-12T18:24:14","slug":"convolutional-neural-network-python","status":"publish","type":"post","link":"https:\/\/www.codeastar.com\/convolutional-neural-network-python\/","title":{"rendered":"Python Image Recognizer with Convolutional Neural Network"},"content":{"rendered":"

On our data science journey, we have solved classification<\/a> and regression<\/a> problems. What’s next? There is one popular machine learning territory we have not set feet on yet — the image recognition. But now the wait is over, in this post we are going to teach our machine to recognize images by using Convolutional Neural Network (CNN).<\/p>\n

<\/p>\n

Before we go further to our topic on Convolutional Neural Network, let’s talk about another related term we will see often: Deep Learning.<\/p>\n

Deep Learning is a subfield of machine learning which its model consists of multiple layers. The concept of a deep learning model is to use outputs from the previous layer as inputs for the successive layer. The model starts learning from the first layer and use its outputs to learn through the next layer. Eventually, the model goes “deep” by learning layer after layer in order to produce the final outcome.<\/p>\n

Convolutional Neural Network is a type of Deep Learning\u00a0architecture. We will use the abbreviation CNN in the post. Please don’t mix up this CNN to a news channel with the same abbreviation. :]]<\/p>\n

What is a Convolutional Neural Network?<\/h3>\n

We will describe a CNN in short here. For in depth CNN explanation, please visit “A\u00a0Beginner’s Guide<\/a>\u00a0To Understanding Convolutional Neural Networks”. This is the best CNN guide I have ever found on the Internet and it is good for readers with no data science background.<\/p>\n

Since a CNN is a type of Deep Learning model, it is also constructed with layers. A CNN starts with a convolutional layer as input layer and ends with a classification layer as output layer. There are multiple hidden layers in between the input and output layers, such as\u00a0convolutional layers, pooling layers and fully connected layers. So a typical CNN model should look like:<\/p>\n

Conv (Input) -> Pool -> Conv -> Pool -> FC -> FC (Output)\r\n\r\nConv: convolutional layer\r\nPool: pooling layer\r\nFC: fully connected layer<\/pre>\n

\"\"
\n(image source:\u00a0
http:\/\/yann.lecun.com\/exdb\/publis\/pdf\/lecun-98.pdf<\/a>)<\/p>\n

Feel dizzy for seeing different layers? Don’t worry, we can have short explanations on each layer here. For in-depth details, please refer to the CNN guide I mentioned previously.<\/p>\n