Procedures ( Object Detection )

After planning the project, Team started with selecting a pretrained neural network for object detection. Since we select Faster R-CNN pre-trained network, the team needs to implement the code for the network to understand the circuit board. For the training session, it has two inputs, which are:

  • an image dataset that will be used as circuit elements representation allowing the network to recognize with different pictures
  • code containing the algorithm to train the neural network. The output will be the trained network after multiple epochs of learning that will be used to tackle the task with the real image from the user.

For the input, systm_frm_mdlng_code, the model requires a PCB image dataset with a proper resolution, which is set to 800*600. The team has prepared 80 images with 80% for training and 20% for validation. In order to allow the mode to perform feature extraction, the team used the LabelImg program to label each component on each image as shown in the following figure. We categorized 6 types of components: SMD Capacitor, SMD Resistor, Resistor, Inductor, Electrolytic Capacitor, and Diode. These labeled images will be used by a pretrained network to train.


As for the output, mdlng_trnd_nrl_ntwrk_other, the Faster R-CNN Neural Network will be added with the the number of classes mentioned above and be trained using Tensorflow framework along with Object Detection API. To enable Cuda Cores on the Discrete GPU for computing, we used the Nvidia Cuda software tool. For hardware configuration, the team stationed with Nvidia RTX 2080 Graphics Card, 16 DDR4 RAM, and Intel Core i7 9700K. After preparing the setup for training, the team used Anaconda Virtual Environment to begin training. The process took up to 4700 steps and the team also monitored the lost function reduction via Tensorboard.


it is noticeable that the lost function value is exponentially decreased from the initial state to 4700 steps. This process took almost 1 hour due to the resolution of the images and graphics power. Because we attempted to avoid overfitting, the team stopped at 4700 steps. Our ultimate goal for this detection task is to categorize each circuit element with at least 70% confidence. After the training process, the model provided us the inference graph to use for testing. The team used Jupyter Notebook to test with another dataset. In order to enable the model to visualize the images and create bounding boxes on each object, the team used the OpenCV Computer Vision Framework on the jupyter notebook. The results are shown here.

The result’s quality is dependent on the following factors. First, with the clear appearance of each object, the network is able to detect correctly with high percentage confidence and vice versa. Second, the team believed that the image dataset for training could have been better as the team used the images from the online site, but the quality of the images is inconsistent, despite the same resolution. Third, the team believed that 80 images are not sufficient to perfectly detect components, so more high quality images should be added. Overall, the majority of the results are as expected, and the team will continue to re-train for improvement.