Inspiration

Printed Circuit Boards (PCBs) are essential components of almost every electronic device. Even a small defect, such as a missing component, a damaged track, or an unwanted solder connection, can affect the performance and reliability of an electronic product. Traditional PCB inspection methods can require expensive equipment, specialized infrastructure, or manual effort.

We were inspired to explore how artificial intelligence and edge computing could make PCB quality inspection faster, more accessible, and cost-effective. Our goal was to develop a lightweight defect detection system that can operate on resource-constrained devices without depending entirely on cloud computing.

What it does

PCBDefectLite is an AI-based PCB image classification system that identifies whether a printed circuit board image is Normal or Defective.

The system uses transfer learning with MobileNetV2 to learn visual patterns from PCB images and classify new images. Users can upload a PCB image through a simple web interface and receive a prediction with a confidence score.

Key features include:

  • AI-based classification: Classifies PCB images as normal or defective.
  • Transfer learning: Reuses pretrained MobileNetV2 features to reduce training requirements.
  • Image preprocessing: Resizes and prepares images for consistent model input.
  • User-friendly interface: Makes predictions accessible through a web application.
  • Edge deployment: Supports conversion to TensorFlow Lite for lightweight inference on compatible edge devices.
  • Performance evaluation: Measures classification metrics, model size, and inference latency.

The system is designed as a practical prototype for assisting PCB quality inspection. Its predictions require validation before use in real manufacturing environments.

How we built it

We designed PCBDefectLite using a modular machine learning pipeline.

1. Dataset preparation

PCB images are collected from a suitable dataset, checked for invalid files, organized by class, and divided into training, validation, and testing sets.

2. Image preprocessing

Images are resized to 224 × 224 pixels and processed using the normalization expected by MobileNetV2. Suitable augmentation is applied to training images to improve generalization.

3. Transfer learning

We use MobileNetV2 pretrained on ImageNet as the feature extraction backbone. A lightweight classification head is added to distinguish normal and defective PCB images. The model is trained and optionally fine-tuned using PCB-specific data.

4. Model evaluation

The model is evaluated using accuracy, precision, recall, F1-score, and a confusion matrix. Model size and inference latency are also measured to assess its suitability for edge deployment.

5. Application development

A Flask backend connects the trained model to a web interface built with HTML, CSS, and JavaScript. Users can upload images and view the classification result.

6. Edge optimization

The trained model can be converted to TensorFlow Lite, with optional quantization, to explore reduced model size and faster inference on compatible hardware.

Technology stack: Python, TensorFlow/Keras, MobileNetV2, OpenCV, NumPy, scikit-learn, Flask, HTML, CSS, JavaScript, and TensorFlow Lite.

Challenges we ran into

One of our main challenges was designing a model that balances classification performance with lightweight deployment requirements. Large models may provide strong performance but can be unsuitable for devices with limited computing resources.

Other challenges included:

  • Preparing a reliable dataset with consistent labels.
  • Avoiding data leakage between training and testing.
  • Handling differences in lighting, PCB orientation, image quality, and defect appearance.
  • Reducing overfitting when the available dataset is limited.
  • Maintaining prediction consistency after TensorFlow Lite conversion.
  • Measuring inference performance without confusing laptop results with actual edge-device performance.
  • Distinguishing image classification from precise defect localization.

These challenges highlighted the importance of reliable data preparation, careful evaluation, and testing beyond simply achieving high training accuracy.

Accomplishments that we're proud of

We developed a clear approach to combining transfer learning, computer vision, and edge AI for an important electronics manufacturing problem.

Our key project accomplishments include:

  • Designing a modular PCB defect classification pipeline.
  • Selecting MobileNetV2 as a lightweight transfer learning architecture.
  • Planning an end-to-end workflow from image upload to prediction.
  • Integrating model inference with a user-friendly web application.
  • Exploring TensorFlow Lite as a path toward edge-device deployment.
  • Defining evaluation criteria that consider both predictive performance and computational efficiency.

Our biggest achievement is the development of a practical foundation for accessible PCB inspection that can be extended toward real-time and resource-efficient quality control.

What we learned

Through this project, we learned how transfer learning can adapt a pretrained deep learning model to a specialized image classification task. We also gained experience in image preprocessing, model training, evaluation metrics, Flask integration, and edge AI deployment concepts.

We learned that accuracy alone is not enough to judge an AI inspection system. Recall is particularly important because missing a defective PCB can have serious consequences. Model size, inference latency, dataset quality, and generalization to unseen boards also matter.

Additionally, we learned that lightweight deployment requires more than choosing a small architecture: the complete preprocessing

Built With

  • ai
  • automation
  • classification
  • computervision
  • css
  • deeplearning
  • edgeai
  • electronics
  • embeddedsystems
  • flask
  • html
  • industrialai
  • iot
  • javascript
  • ml
  • mobilenetv2
  • opencv
  • optimization
  • python
  • qualitycontrol
  • quantization
  • tensorflow
  • tensorflowlite
  • transferlearning
Share this project:

Updates

Submission history