File size: 2,425 Bytes
0cfdfbf | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | ---
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
```
|