Identifying circuit components can be difficult in complex circuits. There can be a range of components from capacitors, resistors, potentiometers, inductors, microchips, and much more. In addition, there can be multiple, sometimes ranging to tens or hundreds of components. In legacy systems with poor documentation, it may be impossible or very time consuming to identify and count the components in a system. In this project, a deep learning computer vision neural network was created to identify different electrical circuit components from pictures. The first part of the project created three different neural networks with varying amounts of layers and nodes and they were compared on the base dataset of pictures of circuit components. Then, transfer learning was used on the models when they were used on a dataset consisting of full circuits and the model had to predict if certain components were present. This model will be useful in industry for reverse engineering by taking pictures of circuits and identifying the components present and their number. This will also aid in the production of documentation by counting parts for the team.
The first step of this project was gathering data. For the first training of the models, the “Electronic-Parts-Dataset” by praneelchand10 on Github was used. This dataset is comprised of 30 by 30-pixel grayscale images of capacitors, potentiometers, and IC voltage regulators. It can be found here: https://github.com/praneelchand10/Electronics-Parts-Dataset. From there, the three convolutional neural network (CNN) models were made. After the first set of models were trained, the second dataset was acquired. After searching the internet for a dataset, there was no suitable one found. Thus, one was made. This was done by creating basic circuits that included resistors, a microchip, potentiometers, and capacitors in differing amounts and locations. These pictures were then uploaded to the models and the model was trained in detection of capacitors, potentiometers, or lack thereof. Since this was a transfer learning case, the convolutional part of the model remained the same when training on the new dataset and the model retrained the fully connected part when training on the new dataset. This limited the trainable parameters on model 1 to 16,899 of the total 35,715, model 2 to 82,563 of the total 110,627, and model 3 to 312,579 of the total 359,139. During the transfer learning, model 1 resulted in an accuracy of 89.23%, model 2 had an accuracy of 96.41%, and model 3 had an accuracy of 94.48%.
The overall results of this project were success in both the original model and the transfer learning case. There are still several variables that could be improved in this project. First, the second dataset had low-quality pictures, especially when the images were rescaled to match the size of the first dataset. Secondly, the number of epochs when training were low, but the accuracy converged extremely fast. Changing the batch size and adding more pictures to the datasets could help. In the future, training these models on PCBs would be ideal. PCBs are more common in industry and being able to detect their components would be great. In addition, changing the scope of this project to detect errors in PCBs would be another great use of these CNN models. Overall, this project was a success and taught how to implement varying amounts of convolutional layers and fully connected layers to increase the success in the identification of electrical circuit components, both individually and as part of a bigger circuit.