Image Classification
I am trying to classify two kinds of images as follows:
(1)
(2)
classes can be called unscrewable/screwable. The screwable ones(1) are the ones with a slot on them, in addition to the hole, whereas the unscrewable ones only contain a hole.
There are two ways of solving this problem.
- Train a network.
- Use edge information.
I tried to use sobel derivates and Canny but one can't implement something that works for all, I mean, anything that is threshold-dependent is not so reliable, I try to avoid using such methods, therefore. What works for these two images, does not work for more and etc. Perhaps sobel derivates weren't the best choice for this type, I don't know. Hence, my question.
I was curious if anyone here try to achieve something similar. The difference between these two classes are really little, and I wonder if it makes sense to use purely traditional image processing techniques found in OpenCV or to deploy a neural network. I suspect haar classifier wouldn't be able to tackle this either.
What do you think?
I see the second image has many circle, maybe use hough circle detection?
There are neural nets in OpenCV also, and you can wrap quite alot of networks from other frameworks already. I would solve this with an easy classification setup. On the other hand, making a HOG and then feeding them to an SVM might already be working quite well.
@gino0717 I thought of that too, but not all of them have circles, sometimes it is just a hole without a slot. So hough circles don't work, It's my fault that I uploaded only that one, sorry.
@StevenPuttemans See my updated post, the images are really similar to each other, with only a slot being the difference. Which network in your opinion could really get the difference? Given around 50 images, let's say, of each class.
My first attempt would be a darknet48 network, pre-trained on imagenet, and passed those 50 samples to fine-tune the classifier. You could swap out the darknet48 structure easily by any network, just don't take a too deep one. These classification networks seem to capture quite smalle inner class differences fairly easy.
Thank you for your valuable input. I'll try it out and share the results.
@Raki. Python or cpp?
Python3. Sorry, I am adding that to the question too.
@StevenPuttemans
What is a darknet48 network? Is it a yolov3 config stripped down to 48 layers and the weight were created using the partial command?
Or does it corresponds to the yolov3-tiny cfg?
I only found this one "darknet19_448.cfg" which is very very small indeed - smaller than tiny cfg
@holger, I think he means that one yes, that was the only I could find only as well