Module 2_ICP 4: Image Classification with CNN - acikgozmehmet/PythonDeepLearning GitHub Wiki

Module 2_ICP 4: Image Classification with CNN

Objectives:

We are going to discuss Image classification with CNN.

In deep learning, a convolutional neural network (CNN, or ConvNet) is a class of deep neural networks, most commonly applied to analyzing visual imagery. They are also known as shift invariant or space invariant artificial neural networks (SIANN), based on their shared-weights architecture and translation invariance characteristics. They have applications in image and video recognition, recommender systems,[4] image classification, medical image analysis, natural language processing, and financial time series.

CNNs are regularized versions of multilayer perceptrons. Multilayer perceptrons usually mean fully connected networks, that is, each neuron in one layer is connected to all neurons in the next layer. The "fully-connectedness" of these networks makes them prone to overfitting data. Typical ways of regularization include adding some form of magnitude measurement of weights to the loss function. CNNs take a different approach towards regularization: they take advantage of the hierarchical pattern in data and assemble more complex patterns using smaller and simpler patterns. Therefore, on the scale of connectedness and complexity, CNNs are on the lower extreme.

Convolutional networks were inspired by biological processes in that the connectivity pattern between neurons resembles the organization of the animal visual cortex. Individual cortical neurons respond to stimuli only in a restricted region of the visual field known as the receptive field. The receptive fields of different neurons partially overlap such that they cover the entire visual field.

CNNs use relatively little pre-processing compared to other image classification algorithms. This means that the network learns the filters that in traditional algorithms were hand-engineered. This independence from prior knowledge and human effort in feature design is a major advantage.

Overview

  • Quick Review of Previous Topics and NNs
  • Convolutional Neural Networks (CNN)
  • Hyperparameters of CNN
  • Image classification with CNN

In Class Programming

1. Follow the instruction below and then report how the performance changed.(apply all at once)

Click here to get the source code

Did the performance change?

The performance in computing takes more time than a simpler model. However, the accuracy of the model has increased to 62.40 %.

2. Predict the first 4 image of the test data. Then, print the actual label for those 4 images (label means the probability associated with them) to check if the model predicted correctly or not

3. Visualize Loss and Accuracy using the history object

Bonus Question:

Program the question 2 using the saved model (.h5 model)

References