Image classification with Tensorflow

Did you ever ask yourself when walking in nature what kind of Fungus you come upon? is it safe for kids to touch it? So I’ve got the idea to train a model to recognize the mushrooms/Fungus. The idea is to take a picture with your phone and ask the model what is it. Pretty awesome isn’t it?

So, here is the story of my journey playing with image classification.

Define the problem: Image detection/ Image classification

Before we start, let’s clarify some notions. Computer vision, one of the interesting branches of AI, is the art to teach a model to find information in an image and so to understand vision content. When classifying images is pretty simple for humans(cats, dogs, cars…), machines always struggled to be competitive. It is something, we humans, learn as kids. A common play game for parents/toddlers is repeating names of objects and persons. So it comes easily for everyday classes. Computer vision comes a long way and now with deep learning, it is as good as humans and even better in specific fields. For example, in medical radiology, AI could be trained to detect and classify a tumor, and often it has better results than humans.

The first step in computer vision is image detection.

Image detection is finding in a given image a specific object in an image and return its coordinates/bounding boxes.

Image classification is when you give an image of one object and your model returns a class with a probability and a confidence rate. So our model should first detect the objects and secondly classify them by the type of classes it has been trained on. For this, we commonly use CNN-Convolutional Neural Networks. What is a CNN?

An image is a matrix of pixels. To detect only the edges in the image you multiply with a filter matrix. This will bring the majority of the pixels to zero/black and it will show you only the edges. For more details check this page. So CNN is a succession of nodes, each node applies a filter on the image. This helps the model learn features, mathematically saying vectors, from the image. The deeper the network is -biggest number of layers and nodes- the more it cost you on memory.

Image recognition is when you give the model an image with multiple objects. The model, for each object in the image gives its bounding boxes(object detection) and predictions on classes with a confidence rate.

Our problem here is a multi-class categorization/ image classification

#convolution-neural-net #data-science #image-classification #tensorflow #artificial-intelligence

Computer vision: Let’s classify mushrooms
1.40 GEEK