Image Classification & Machine learning

Convolution operation of image and kernel function

In this post, you will learn about how could image classification problems be solved using machine learning techniques. The following are some of the topics which will be covered:

  • How does the computer learn about an image?
  • How could machine learning be used to classify the images?

How does the computer learn about an image?

Unlike the human beings, the image has to be converted into numbers for computer to learn about the image. So, the question is how can an image be converted into numbers?

The most fundamental element or the smallest building block of an image is a pixel. An image can be represented as a set of pixels. A pixel can be represented in form of bits to represent different colors. If the color need to be just black and white, a pixel can be represented using just 1 bit which can take value of 0 or 1. A value of 0 for 1 bit will represent black and the value of 1 can represent white. In case, the pixel need to represent four colors, a pixel can be represented using 2 bits (00 to 11). In case, the pixel needs to be represented as 8 colors, the pixel can be represented as 3 bits (000 to 111). In case, the pixel needs to be represented as 16 colors (0000 to 1111), the pixel can be represented using 4 bits.

In case, there is a need to store the image having all shades of colors, each pixel needs to have 8 bits or more. This is called a high-resolution image. A low-resolution image can be stored using pixels represented using a lower number of bits such as 4 bits or so. Image quality is represented as a function of image resolution.

Higher the pixels size in terms of bits, the image size will become larger. You may have noticed that the camera capturing a very high-resolution image results in photos or images of larger size.

For the computer to learn about images, all one needs is to convert the image into a vector consisting of pixels information and feed the vector into a computer or any machine learning algorithm.

How could machine learning be used to classify the images?

Once the image is converted into a vector of numbers representing pixels, the vector can be fed into machine learning classification algorithms for training the model. There are different machine learning algorithms which can be used to train image classification models. The most popular one is convoluted neural network (CNN).

Here is a tutorial on how one can use Tensorflow to train a CNN model for image classification. Also, check this Google page for understanding concepts of convolution neural networks.

Ajitesh Kumar

Ajitesh Kumar

I have been recently working in the area of Data analytics including Data Science and Machine Learning / Deep Learning. I am also passionate about different technologies including programming languages such as Java/JEE, Javascript, Python, R, Julia, etc, and technologies such as Blockchain, mobile computing, cloud-native technologies, application security, cloud computing platforms, big data, etc. I would love to connect with you on Linkedin. Check out my latest book titled as First Principles Thinking: Building winning products using first principles thinking.
Posted in Machine Learning. Tagged with .