Title:
Multi-class Resistor Classification and Color Recognition
https://github.com/kazar4/ohmnist
Who:
Kazen Gallman
kgallman
Josh Abramson
jabrams8
Introduction:
The problem we are trying to solve is a non-binary classification problem focused on classifying resistors from images by their color and resistance. When dealing with resistors, there are often dozens or more resistors of varying resistances. While they are color-coded, trying to identify them on a very complicated chart of colors can be very annoying, so we wanted to see if we could train a model that could recognize the different classes of resistors.
Related Work:
While planning out this project, we came up with the idea on our own. However, we have also found that other researchers have attempted to implement a similar project. In one paper, they applied multiple preprocessing methods in combination with clustering and advanced color classification to attempt this problem. However, they were attempting to classify resistors by video, so it is slightly different from our project. Ultimately, their project was a success, surpassing previous models that attempted to do the same thing and maintaining a high success rate. https://ieeexplore.ieee.org/document/8710533
Data:
For this project we plan on collecting the data ourselves. This limits the kind of models that we can do as some models will take too much data than we can reasonably collect. We expect to get about 1000 photos of resistors. We will purchase a small kit of about 70 different kinds and take close up pictures of them through our phone. We plan to use opencv to clean up a lot of the inconsistencies in the data collection process.
Methodology:
Our design can be split up into two portions. One is the preprocessing and the other is our training model. Both of these designs can be adjusted to change ours models result but our first ideas are below:
Preprocessing:
First the opencv program would create a bounding box around the resistor using contours. Then it would save a small amount of the background color before filtering it out. Then it would get the band's colors and save those. At the end there will be multiple matrices of colors, one for each band and the background color (which will help adjust for lighting).
Training:
We’re not 100% sure on our training architecture yet, but we have multiple ideas in mind. One such idea would be a model similar to our MNIST model that we used in class (but made to allow multiple colors). We will also likely attempt a convolutional model and compare the two. Either way, we will try out several model architectures in this process. Ultimately, we will likely attempt to focus on a section of the image containing the resistor and then quantify the meaning of the color bands.
Metrics:
The metrics would depend on the architecture we choose. For example if we have the model look at each color band separately, then it could simply be the number of colors predicted successfully. While if we classified the entire resistor it would be whether or not it gave back the correct resistor value as a whole.
Our base goals will be to get a model that goes through the entire pipeline successfully, whether or not it is accurate. Then as a target we want to be able to increase that model's success rate (whatever metric we decide for that architecture). Even if the model is not very accurate we hope to atleast get it better than the original base goal, and then we can compare the different architectures. As a stretch goal we may want to expand our dataset. For example we will mainly be using resistors that have a blue backing (everything except the bands are blue), but getting it to work for wood versions could be useful (This also brings up the question of other resistor types like how different resistors have a different number of bands on them sometimes). In terms of our model, possibly trying a convolution neural network could be a stretch goal but that may increase the amount of data we have to collect by a lot.
Ethics:
Why is Deep Learning a good approach to this problem? Deep learning is a good approach to this problem as this problem involves images that can have a lot of small changes that can not easily be accounted for. For example blue might look like black to the model if the lighting is different, or the resistor might be in a different position than it was before. All of these differences make deep learning a good approach as by creating many weights and layers it may be able to better match the way our brain itself chooses colors.
Who are the major “stakeholders” in this problem, and what are the consequences of mistakes made by your algorithm? In general if this model were to be implemented in industry or for recreational purposes it could pose problems if too much trust is built in it. For example if some project requires a resistor with a lot of resistance and the model misidentifies a small ohm resistor to be that value, then it could lead to an electrical fire or a circuit not getting the correct voltage. And so for such an algorithm its use needs to be fact checked in where an incorrectly indeed resistor can be dangerous.
Division of labor:
We are going to be working together in-person a lot of the time, so we haven’t defined individual portions of the project to complete. However, we do know that to start, Kazen will be working on applying OpenCV to our problem and I will be working on the basic model architecture. Ultimately, though, these roles may shift around and merge as we run into problems along the way.
Check in 2 Reflection:
Linked Below: https://docs.google.com/document/d/1yzIEyWKk5NutwsEQ3QIhTYpLfgKRXdjEdFhLrPqCp0g/edit?usp=sharing
Final Submission Materials:
Final Writeup: https://docs.google.com/document/d/1ZTsnLcPvsOlfkIVzwQ8fR-rZZv44BxqZKrCC9NXJoPc/edit?usp=sharing
2 minute video: https://youtu.be/w70H_xg_7jk
Poster: https://drive.google.com/file/d/1BJZwz0nQtsLaXIi4MHvx56do0aMO3-G-/view?usp=sharing
Log in or sign up for Devpost to join the conversation.