Skip to content

astromanu007/PCB_Anomaly_Detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

21 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—     โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ•—   โ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—     
โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—    โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘     
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘     โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•       โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•”โ–ˆโ–ˆโ–ˆโ–ˆโ•”โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘     
โ–ˆโ–ˆโ•”โ•โ•โ•โ• โ–ˆโ–ˆโ•‘     โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—       โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•  โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘     
โ–ˆโ–ˆโ•‘     โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•       โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ•šโ•โ• โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
โ•šโ•โ•      โ•šโ•โ•โ•โ•โ•โ•โ•šโ•โ•โ•โ•โ•โ•        โ•šโ•โ•   โ•šโ•โ•  โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ•  โ•šโ•โ•โ•šโ•โ•     โ•šโ•โ•โ•šโ•โ•  โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ•

๐ŸŒก๏ธ PCB Thermal Anomaly Detection System ๐Ÿ”

Real-time AI-powered thermal analysis for printed circuit boards โ€” detect hotspots before they become failures.

Python OpenCV Pygame License: MIT Status Platform


๐Ÿ”ฅ Identify overheated PCB components in real-time using thermal imaging, visual markers, and live graphs โ€” before damage occurs.


๐Ÿ“ธ Gallery

๐Ÿ–ฅ๏ธ Main Interface

Main Interface

๐ŸŒ… Welcome Screen

Welcome Screen

๐ŸŽฅ Real-Time Thermal Video Mode

Real-Time Video Mode

๐Ÿ“Š Live Thermal Tracking Results

Thermal Tracking Results

๐Ÿ“ˆ Detection Accuracy & Intensity Graphs

Graphs


โšก Why This Project?

PCB failures cost manufacturers millions annually. Overheated components are often invisible to the naked eye โ€” until it's too late.

This system bridges that gap by providing:

  • Instant visual feedback on thermal anomalies
  • Automatic documentation of every detected hotspot
  • Live performance metrics for continuous monitoring
  • A slick, interactive UI โ€” no terminal expertise needed

๐ŸŒˆ Feature Highlights

๐Ÿ”ด Detection & Analysis

  • Real-time hotspot detection with colored markers
  • Customizable temperature thresholds
  • Frame-by-frame thermal intensity tracking
  • Automatic anomaly classification

๐Ÿ“Š Visualization & Reporting

  • Live accuracy graphs with matplotlib
  • Thermal intensity trend charts
  • Timestamped anomaly snapshots
  • Results overlay on thermal feed

๐ŸŽฎ User Interface

  • Modern Pygame-powered UI
  • Smooth animations & transitions
  • Interactive threshold slider
  • One-click image upload for offline testing

๐Ÿ’พ Storage & Export

  • Auto-save anomaly captures with timestamp
  • Dedicated anomaly_captures/ folder
  • Compatible with FLIR & Seek Thermal cameras
  • Sample images included for demo/testing

๐Ÿ›’ Hardware Requirements

Component Specification Purpose
๐Ÿ–ฅ๏ธ Computer Windows / Linux / macOS Host system
๐Ÿ Python Version 3.6 or higher Runtime
๐Ÿ“ท Thermal Camera FLIR or Seek Thermal (USB) Thermal imaging input
๐Ÿ”Œ USB Port USB 2.0 / 3.0 Camera connection
๐Ÿ’พ Storage ~500MB free space Anomaly capture storage

๐Ÿš€ Getting Started

Step 1 โ€” Clone the Repository

git clone https://github.com/astromanu007/PCB_Anomaly_Detection.git
cd PCB_Anomaly_Detection

Step 2 โ€” Install Dependencies

# Option A: Install individually
pip install numpy opencv-python pygame matplotlib

# Option B: Install from requirements file
pip install -r requirements.txt

Step 3 โ€” Connect Your Thermal Camera

๐Ÿ”Œ Plug in your FLIR or Seek Thermal USB camera
โœ… Verify it's detected by your OS

Step 4 โ€” Launch the Application

python main.py

๐Ÿ’ก No hardware? No problem! Use the Upload feature to test with sample images from the sample_images/ folder.


๐Ÿ“ Project Structure

PCB_Anomaly_Detection/
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ assets/                      # Static assets
โ”‚   โ”œโ”€โ”€ ๐Ÿ–ผ๏ธ  thermal_icon.png         # App icon
โ”‚   โ””โ”€โ”€ ๐Ÿง‘  creator_photo.jpg        # Creator photo (About section)
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ sample_images/               # Demo PCB images for offline testing
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ anomaly_captures/            # ๐Ÿ”ด Auto-saved hotspot images (timestamped)
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ images/                      # README screenshot assets
โ”‚   โ”œโ”€โ”€ MAIN.jpg
โ”‚   โ”œโ”€โ”€ INTRO.png
โ”‚   โ”œโ”€โ”€ VIDEO_MODE.png
โ”‚   โ”œโ”€โ”€ LIVE_TRACKING_RESULTS.png
โ”‚   โ””โ”€โ”€ GRAPHS.jpg
โ”‚
โ”œโ”€โ”€ ๐Ÿ“„ main.py                      # โญ Core application โ€” start here
โ””โ”€โ”€ ๐Ÿ“„ README.md                    # Documentation

๐ŸŽฎ UI Controls Reference

Control Symbol Action
Start / Stop ๐ŸŸข / ๐Ÿ”ด Toggle real-time thermal camera monitoring
Threshold Slider ๐ŸŽš๏ธ Fine-tune the temperature sensitivity cutoff
Record ๐Ÿ”ด Enable auto-capture of anomaly frames
Upload ๐Ÿ“ค Load a PCB image manually for offline analysis
Results ๐Ÿ“Š View processed frame with hotspot markers
Graphs ๐Ÿ“ˆ Open live accuracy & intensity visualization

๐Ÿ”„ How It Works

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                     APPLICATION FLOW                            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

  ๐Ÿ“ท Thermal Camera Feed
         โ”‚
         โ–ผ
  ๐Ÿ–ผ๏ธ  Frame Capture (OpenCV)
         โ”‚
         โ–ผ
  ๐ŸŒก๏ธ  Temperature Mapping
         โ”‚
         โ–ผ
  โš–๏ธ  Threshold Comparison โ”€โ”€โ”€โ”€ Below threshold โ†’ โœ… Normal
         โ”‚
         โ”‚ Above threshold
         โ–ผ
  ๐Ÿ”ด Anomaly Detected!
         โ”‚
    โ”Œโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”
    โ”‚         โ”‚
    โ–ผ         โ–ผ
  ๐Ÿ“ธ Auto    ๐Ÿ–ฅ๏ธ Visual
  Capture   Overlay
  + Save    on UI
    โ”‚         โ”‚
    โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜
         โ–ผ
  ๐Ÿ“Š Update Graphs
  (Accuracy + Intensity)

๐Ÿ“Š What the Graphs Show

Graph Metric Use Case
๐Ÿ“ˆ Accuracy Graph Detection confidence over time Monitor system reliability
๐ŸŒก๏ธ Intensity Graph Thermal intensity per frame Spot heat spikes & trends

Both graphs update live during monitoring sessions, giving you a complete picture of PCB thermal behavior.


๐Ÿงช Testing Without a Thermal Camera

You can fully evaluate this system using the included sample images:

  1. Launch python main.py
  2. Click ๐Ÿ“ค Upload in the UI
  3. Browse to sample_images/ folder
  4. Select any PCB image
  5. View detection results and graph outputs

๐Ÿ› ๏ธ Tech Stack

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Layer        โ”‚  Technology                              โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Language     โ”‚  Python 3.6+                            โ”‚
โ”‚  Vision       โ”‚  OpenCV โ€” frame capture & processing    โ”‚
โ”‚  UI           โ”‚  Pygame โ€” interface & animations        โ”‚
โ”‚  Graphs       โ”‚  Matplotlib โ€” live chart rendering      โ”‚
โ”‚  Numerics     โ”‚  NumPy โ€” thermal data computation       โ”‚
โ”‚  Hardware     โ”‚  FLIR / Seek Thermal USB camera         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿค Contributing

Contributions, bug reports, and feature ideas are always welcome!

  1. Fork the repository
  2. Create your branch: git checkout -b feature/YourFeature
  3. Commit your changes: git commit -m 'Add YourFeature'
  4. Push to the branch: git push origin feature/YourFeature
  5. Open a Pull Request ๐ŸŽ‰

๐Ÿ“ž Contact

Platform Link
๐Ÿ“ง Email manishdhatrak1121@gmail.com
๐Ÿ’ผ LinkedIn Manish Dhatrak
๐Ÿ™ GitHub @astromanu007

๐Ÿ“œ License

This project is licensed under the MIT License โ€” free to use, modify, and distribute.

See the LICENSE file for full details.


๐ŸŒก๏ธ Hot components detected. Cool solutions delivered. ๐ŸŒก๏ธ

Built with โค๏ธ by Manish Dhatrak

โญ Star this repo if it helped you! โญ

GitHub stars GitHub forks

About

This repository contains the implementation of an advanced machine learning system for detecting anomalies in PCB components. The system uses infrared imaging to identify and mark overheated or faulty components, ensuring efficient and accurate fault detection.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages