Is it possible to classify resistors using ResNet50?


I want to train ResNet50 model using resistor images like below: enter image description here

I tried it by collecting data from google images and there were quite few. So accuracy was very low (around %10) but I wonder If it is due lack of images or is it really possible to classify these images? Because as it is seen the object to be classified is very small and its value as color coded. I thought maybe this is not a good idea. Searched it on google but could not find anybody tried to do it before. I have also tried data augmentation and changing to other models but still its accuracy was quite low.

P.S: I have also tried changin epoch numbers, optimizers and all other parameters. So I want to make sure If it is due low data or is it just very hard task to complete for a computer vision model.

And Is it rational to crop the image by using a mask before classifying it to make sure all color codes are bigger and easily valuable by model?


Posted 2020-07-03T14:41:33.120

Reputation: 157



Yes it should be possible. You may have a bug in your code, or the wrong hyperparameters. Training ResNet-50 will take a long time. Try training on other sets of images and see what accuracy you get to check if your approach is correct. Or, try loading a pretrained model, and training from that.

Simon Alford

Posted 2020-07-03T14:41:33.120

Reputation: 146

Thank you a lot for your answer. I was really worried about If it is due lack of images but now I will put effort on it. – Nabla – 2020-07-03T20:32:05.970

How many images do you have? – Simon Alford – 2020-07-03T23:32:32.977

I do not remember the exact numbers but as I remember It was around 3 per class and I have augmented it to around 100 per class by data augmentation. I know that this data is quite low to train a model. That is why I asked for If it is due low data (Because I thought maybe those color coded lines are just too small to be categorized because they are all in same shape -resistors-) If so I will start to collect data myself to train it because there are very few data online for resistors – Nabla – 2020-07-04T07:50:08.923

3You don't need ResNet-50 to learn resistors. They always look the same, a small convolutional network will suffice. You probably don't even need deep learning you could use do some kind of color thresholding and see how the colors are ordered or something like that – Brale – 2020-07-04T09:30:42.003

Oh OK thank you a lot. Then I will try it. – Nabla – 2020-07-04T17:35:45.270