| --- |
| license: mit |
| tags: |
| - object-detection |
| - pcb |
| - yolo |
| - rf-detr |
| - computer-vision |
| - aoi |
| - pytorch |
| datasets: |
| - custom |
| --- |
| |
| # PCBInspect-AI - Model Weights |
|
|
| Model weights for **PCBInspect-AI**, a deep learning platform for automated PCB (Printed Circuit Board) feature detection in Automated Optical Inspection (AOI) pipelines. |
|
|
| Source code and full documentation: [JC-prog/pcb-inspect-ai](https://github.com/JC-prog/pcb-inspect-ai) |
|
|
| --- |
|
|
| ## Models |
|
|
| ### 1. YOLOv12-Medium (Fine-Tuned) - Recommended |
|
|
| **File:** `YoloV12-Medium-160-FineTuned.pt` |
|
|
| Two-stage fine-tuned YOLOv12m for PCB feature detection. Trained over 160 epochs (100 pretraining + 60 fine-tuning). |
|
|
| | Metric | Score | |
| |---|---| |
| | mAP@0.5 | 0.839 | |
| | mAP@0.5:0.95 | 0.741 | |
| | Precision | 0.974 | |
| | Recall | 0.779 | |
| | Epochs | 160 (100 + 60) | |
|
|
| **Recommended for deployment** — highest recall minimises missed defects, critical for AOI. |
|
|
| ### 2. RF-DETR Medium (100 Epochs) |
|
|
| **File:** `RFDETR-Medium-100-Epoch.pth` |
|
|
| Roboflow RF-DETR with DINOv2 backbone trained for 100 epochs. Achieves the highest precision but lower recall than YOLOv12. |
|
|
| | Metric | Score | |
| |---|---| |
| | mAP@0.5 | 0.773 | |
| | mAP@0.5:0.95 | 0.655 | |
| | Precision | 0.991 | |
| | Recall | 0.700 | |
| | Epochs | 100 | |
|
|
| --- |
|
|
| ## Classes |
|
|
| | ID | Class | |
| |---|---| |
| | 0 | Background | |
| | 1 | MountingHole | |
| | 2 | ComponentBody | |
| | 3 | SolderJoint | |
| | 4 | Lead | |
|
|
| --- |
|
|
| ## Usage |
|
|
| ### Setup |
|
|
| ```bash |
| git clone https://github.com/JC-prog/pcb-inspect-ai.git |
| cd pcb-inspect-ai/demo |
| pip install -r requirements.txt |
| ``` |
|
|
| ### Download weights |
|
|
| ```bash |
| huggingface-cli download JcProg/PCBInspect-AI --local-dir demo/checkpoint/ |
| ``` |
|
|
| ### Launch app |
|
|
| ```bash |
| python app.py |
| ``` |
|
|
| Open [http://localhost:7860](http://localhost:7860), select a model in the **Model** tab, and run inference in the **Inference** tab. |
|
|
| --- |
|
|
| ## Training |
|
|
| ### YOLOv12 Two-Stage Regime |
|
|
| - **Stage 1 (100 epochs):** 640x640 resolution, heavy augmentation for fast convergence |
| - **Stage 2 (60 epochs):** 896x896 resolution, lighter augmentation for fine-tuning |
|
|
| ### RF-DETR |
|
|
| - **100 epochs** with DINOv2 backbone |
| - Bounding box annotations in COCO format |
|
|
| --- |
|
|
| ## Citation |
|
|
| If you use these weights, please reference the associated project: |
|
|
| ``` |
| PCBInspect-AI - Automated Generation of PCB Inspection Recipes Using Deep Learning-Based Feature Detection |
| National University of Singapore (NUS) |
| https://github.com/JC-prog/pcb-inspect-ai |
| ``` |
|
|