Electronic Components Image Classifier
Photo by Alexandre Debiève on Unsplash

Electronic Components Image Classifier

This article is about an Android application that can classify electronic components in real-time with the source code publicly available.

Github Link: https://github.com/pouria-faraji/Electronic-Components-Classification

The six main components that the application can detect are as follows:

  1. Capacitor
  2. Diode
  3. Resistor
  4. Inductor
  5. Transformer
  6. IC

The application also shows the confidence of the detection, in other words, the probability of the detected components.

Android

The Android is developed in Kotlin. For working with the camera and analyzing the camera frames in real-time, CameraX library is used, which is part of the Jetpack libraries.

In order to use Tensorflow models in the Android environment, it has to be converted to Tensorflow Lite models, which have .tflite extensions.

Python

Python codes contain two parts:

  • Codes related to creating and training the image classification Tensorflow model based on MobileNet.
  • Codes related to crawling Digi-Key, the world's largest seller of electronic components, to create the image datasets

The model which is used for image classification is MobileNet v2. The model has 154 layers, and in the beginning, the model is not trained and only the last layer of the model among the classification layer is trained with 10 epochs. Then, for fine-tuning the model, the last 54 layers of the model are also trained with another 10 epochs.

Evaluation

For evaluation, the dataset is divided into a train set (70%) and a validation set (30%). The following are the results after training the model:

  • Loss for Train Set: 0.5579
  • Loss for Validation Set: 0.6060
  • Accuracy for Train Set: 81.49%
  • Accuracy for Validation Set: 78.58%

The loss used for evaluation is Cross-entropy.

Dataset

The dataset contains 4038 photos of electronic components in 6 different categories: Capacitor, Diode, Resistor, Transformer, Inductor, and IC. Two resources were used to create the dataset. The Digi-Key website, which is the biggest seller of electronic components in the world, was crawled in order to extract photos of the mentioned categories. Also, a public dataset of electronic components hosted in Kaggle was used.

Github Link: https://github.com/pouria-faraji/Electronic-Components-Classification

#machinelearning #deeplearning #python #tensorflow #android #kotlin #imageclassification #electroniccomponents

very nice project.....!

Like
Reply

To view or add a comment, sign in

More articles by Pouria Faraji

Others also viewed

Explore content categories