Lakshay Dulani
Lakshay Dulani

Reputation: 1775

How to classify two very similar images using Deep Learning?

I have a scenario where I have to classify two images taken from a still CCTV camera which would be very similar except the central region where I have to detect if a technician is working on the machine or not.

Without technician:

enter image description here

With technician:

enter image description here

I want the classifier to concentrate on the central region.

I can find architectures where I can classify "cat vs dog" or "rock-papers-scissors" kind of images like this one (Rock Papers Scissors on Colab). Since many areas in the image are going to be same, how can I specify the area the model should concentrate on.

Upvotes: 0

Views: 512

Answers (2)

Zabir Al Nazi Nabil
Zabir Al Nazi Nabil

Reputation: 11218

If you want to focus on the technician and not on the whole image context, just use an object detector.

human detected on image

Object detection models:

https://github.com/pjreddie/darknet

https://github.com/AlexeyAB/darknet

https://github.com/ultralytics/yolov5 (pytorch)

https://github.com/wizyoung/YOLOv3_TensorFlow

https://github.com/OlafenwaMoses/ImageAI (library)

Upvotes: 2

James_SO
James_SO

Reputation: 1387

You can use a tool like labelImg (https://github.com/tzutalin/labelImg) to build a training set of images - you could do a set in which you differentiate "area occupied" and "area unoccupied". This may be vulnerable to changes in the area, though.

An alternative is to train on a person (meaning, in labelImg you put the boundary box around the person), and you interpret your classifier's output such that, probability of the person has to be above a threshold to indicate presence.

If you need a tutorial on how to do this end-to-end I recommend this one: https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/training.html

Upvotes: 1

Related Questions