# Image Classification & Machine learning

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.