# chungkein4320/pcb-defect-detection-benchmark architecture

> Architecture diagram of the GitHub repository chungkein4320/pcb-defect-detection-benchmark, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chungkein4320/pcb-defect-detection-benchmark
- Repository: https://github.com/chungkein4320/pcb-defect-detection-benchmark

## Overview

This repository is a reproducible research benchmark for PCB defect detection, rather than a deployable detection service. Its principal workflow standardizes three PCB dataset sources into a six-class dataset, trains five detector variants, evaluates them on merged and source-specific test sets, and compares the recorded results. The README also documents a separate public-disclosure branch for a confidential-data Semi-DETR study. Notebook internals and most data-preparation/training wiring were not sampled, so those connections are shown as unverified where needed; the comparison notebook’s input and output relationships are documented.

Main entry points: [`data`](https://github.com/chungkein4320/pcb-defect-detection-benchmark/tree/master/data) (Clean six-class data), [`notebooks`](https://github.com/chungkein4320/pcb-defect-detection-benchmark/tree/master/notebooks) (Merged and source tests), [`notebooks/01_prepare_final_datapcb_clean_6cls_sourcewise.ipynb`](https://github.com/chungkein4320/pcb-defect-detection-benchmark/blob/master/notebooks/01_prepare_final_datapcb_clean_6cls_sourcewise.ipynb) (Dataset preparation), [`notebooks/07_compare_sourcewise_benchmark_results.ipynb`](https://github.com/chungkein4320/pcb-defect-detection-benchmark/blob/master/notebooks/07_compare_sourcewise_benchmark_results.ipynb) (Benchmark comparison)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Dataset preparation"]
  node_pcb_sources[("PCB source datasets")]
  node_prepare["Dataset preparation"]
  node_clean_data[("Clean six-class data")]
  node_audit["Dataset integrity audit"]
end

subgraph group_benchmark["Detector benchmark"]
  node_yolo["YOLOv11s baseline"]
  node_rtdetr["RT-DETR-L"]
  node_faster_rcnn["Faster R-CNN"]
  node_yolo_variant["Small-object YOLO"]
  node_pcbnet["PCBNet RT-DETR"]
  node_source_eval["Merged and source tests"]
end

subgraph group_analysis["Results analysis"]
  node_source_tables[("Source-wise result tables")]
  node_compare["Benchmark comparison"]
  node_figures["Comparison figures"]
  node_integrity_report["Integrity report"]
  node_repro_validate["Provenance validation"]
  node_manifest["Experiment manifest"]
end

subgraph group_research["Semi-DETR study"]
  node_semidetr["Semi-DETR experiments"]
  node_semidetr_summary["Public study summary"]
end

node_researcher(("Benchmark researcher"))

node_researcher -.->|"prepares data"| node_prepare
node_pcb_sources -->|"standardizes"| node_prepare
node_prepare -.->|"produces"| node_clean_data
node_clean_data -.->|"audits"| node_audit
node_clean_data -.->|"trains and tests"| node_yolo
node_clean_data -.->|"trains and tests"| node_rtdetr
node_clean_data -.->|"trains and tests"| node_faster_rcnn
node_clean_data -.->|"trains and tests"| node_yolo_variant
node_clean_data -.->|"trains and tests"| node_pcbnet
node_yolo -.->|"evaluates on"| node_source_eval
node_rtdetr -.->|"evaluates on"| node_source_eval
node_faster_rcnn -.->|"evaluates on"| node_source_eval
node_yolo_variant -.->|"evaluates on"| node_source_eval
node_pcbnet -.->|"evaluates on"| node_source_eval
node_source_eval -.->|"records results"| node_source_tables
node_source_tables -->|"reads tables"| node_compare
node_compare -->|"generates figures"| node_figures
node_researcher -.->|"compares models"| node_compare
node_manifest -->|"validates provenance"| node_repro_validate
node_researcher -.->|"runs study"| node_semidetr
node_semidetr -.->|"summarizes study"| node_semidetr_summary

click node_prepare "https://github.com/chungkein4320/pcb-defect-detection-benchmark/blob/master/notebooks/01_prepare_final_datapcb_clean_6cls_sourcewise.ipynb"
click node_clean_data "https://github.com/chungkein4320/pcb-defect-detection-benchmark/tree/master/data"
click node_audit "https://github.com/chungkein4320/pcb-defect-detection-benchmark/blob/master/scripts/audit_dataset_integrity.py"
click node_yolo "https://github.com/chungkein4320/pcb-defect-detection-benchmark/blob/master/notebooks/02_train_yolov11s_datapcb_clean_6cls_sourcewise.ipynb"
click node_rtdetr "https://github.com/chungkein4320/pcb-defect-detection-benchmark/blob/master/notebooks/03_train_rtdetr_l_datapcb_clean_6cls_sourcewise.ipynb"
click node_faster_rcnn "https://github.com/chungkein4320/pcb-defect-detection-benchmark/blob/master/notebooks/04_train_faster_rcnn_datapcb_clean_6cls_sourcewise.ipynb"
click node_yolo_variant "https://github.com/chungkein4320/pcb-defect-detection-benchmark/blob/master/notebooks/05_train_yolov11s_cbamlite_bifpnlite_p2_datapcb_clean_6cls_sourcewise.ipynb"
click node_pcbnet "https://github.com/chungkein4320/pcb-defect-detection-benchmark/blob/master/notebooks/06_train_pcbnet_rtdetr_hybridopt_datapcb_clean_6cls_sourcewise.ipynb"
click node_source_eval "https://github.com/chungkein4320/pcb-defect-detection-benchmark/tree/master/notebooks"
click node_source_tables "https://github.com/chungkein4320/pcb-defect-detection-benchmark/tree/master/reports/tables"
click node_compare "https://github.com/chungkein4320/pcb-defect-detection-benchmark/blob/master/notebooks/07_compare_sourcewise_benchmark_results.ipynb"
click node_figures "https://github.com/chungkein4320/pcb-defect-detection-benchmark/tree/master/reports/figures"
click node_integrity_report "https://github.com/chungkein4320/pcb-defect-detection-benchmark/blob/master/reports/dataset_integrity_summary.json"
click node_repro_validate "https://github.com/chungkein4320/pcb-defect-detection-benchmark/blob/master/scripts/validate_reproducibility.py"
click node_manifest "https://github.com/chungkein4320/pcb-defect-detection-benchmark/blob/master/configs/experiments/public_benchmark.json"
click node_semidetr "https://github.com/chungkein4320/pcb-defect-detection-benchmark/tree/master/notebooks/semidetr"
click node_semidetr_summary "https://github.com/chungkein4320/pcb-defect-detection-benchmark/blob/master/notebooks/semidetr/07_semidetr_summary_public_sanitized.ipynb"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_pcb_sources,node_prepare,node_clean_data,node_audit toneBlue
class node_yolo,node_rtdetr,node_faster_rcnn,node_yolo_variant,node_pcbnet,node_source_eval toneAmber
class node_source_tables,node_compare,node_figures,node_integrity_report,node_repro_validate,node_manifest toneMint
class node_semidetr,node_semidetr_summary toneRose
class node_researcher toneIndigo
```

## Components

### Dataset preparation

- **PCB source datasets**
- [Dataset preparation](https://github.com/chungkein4320/pcb-defect-detection-benchmark/blob/master/notebooks/01_prepare_final_datapcb_clean_6cls_sourcewise.ipynb): `notebooks/01_prepare_final_datapcb_clean_6cls_sourcewise.ipynb`
- [Clean six-class data](https://github.com/chungkein4320/pcb-defect-detection-benchmark/tree/master/data): `data`
- [Dataset integrity audit](https://github.com/chungkein4320/pcb-defect-detection-benchmark/blob/master/scripts/audit_dataset_integrity.py): `scripts/audit_dataset_integrity.py`

### Detector benchmark

- [YOLOv11s baseline](https://github.com/chungkein4320/pcb-defect-detection-benchmark/blob/master/notebooks/02_train_yolov11s_datapcb_clean_6cls_sourcewise.ipynb): `notebooks/02_train_yolov11s_datapcb_clean_6cls_sourcewise.ipynb`
- [RT-DETR-L](https://github.com/chungkein4320/pcb-defect-detection-benchmark/blob/master/notebooks/03_train_rtdetr_l_datapcb_clean_6cls_sourcewise.ipynb): `notebooks/03_train_rtdetr_l_datapcb_clean_6cls_sourcewise.ipynb`
- [Faster R-CNN](https://github.com/chungkein4320/pcb-defect-detection-benchmark/blob/master/notebooks/04_train_faster_rcnn_datapcb_clean_6cls_sourcewise.ipynb): `notebooks/04_train_faster_rcnn_datapcb_clean_6cls_sourcewise.ipynb`
- [Small-object YOLO](https://github.com/chungkein4320/pcb-defect-detection-benchmark/blob/master/notebooks/05_train_yolov11s_cbamlite_bifpnlite_p2_datapcb_clean_6cls_sourcewise.ipynb): `notebooks/05_train_yolov11s_cbamlite_bifpnlite_p2_datapcb_clean_6cls_sourcewise.ipynb`
- [PCBNet RT-DETR](https://github.com/chungkein4320/pcb-defect-detection-benchmark/blob/master/notebooks/06_train_pcbnet_rtdetr_hybridopt_datapcb_clean_6cls_sourcewise.ipynb): `notebooks/06_train_pcbnet_rtdetr_hybridopt_datapcb_clean_6cls_sourcewise.ipynb`
- [Merged and source tests](https://github.com/chungkein4320/pcb-defect-detection-benchmark/tree/master/notebooks): `notebooks`

### Results analysis

- [Source-wise result tables](https://github.com/chungkein4320/pcb-defect-detection-benchmark/tree/master/reports/tables): `reports/tables`
- [Benchmark comparison](https://github.com/chungkein4320/pcb-defect-detection-benchmark/blob/master/notebooks/07_compare_sourcewise_benchmark_results.ipynb): `notebooks/07_compare_sourcewise_benchmark_results.ipynb`
- [Comparison figures](https://github.com/chungkein4320/pcb-defect-detection-benchmark/tree/master/reports/figures): `reports/figures`
- [Integrity report](https://github.com/chungkein4320/pcb-defect-detection-benchmark/blob/master/reports/dataset_integrity_summary.json): `reports/dataset_integrity_summary.json`
- [Provenance validation](https://github.com/chungkein4320/pcb-defect-detection-benchmark/blob/master/scripts/validate_reproducibility.py): `scripts/validate_reproducibility.py`
- [Experiment manifest](https://github.com/chungkein4320/pcb-defect-detection-benchmark/blob/master/configs/experiments/public_benchmark.json): `configs/experiments/public_benchmark.json`

### Semi-DETR study

- [Semi-DETR experiments](https://github.com/chungkein4320/pcb-defect-detection-benchmark/tree/master/notebooks/semidetr): `notebooks/semidetr`
- [Public study summary](https://github.com/chungkein4320/pcb-defect-detection-benchmark/blob/master/notebooks/semidetr/07_semidetr_summary_public_sanitized.ipynb): `notebooks/semidetr/07_semidetr_summary_public_sanitized.ipynb`

### Other components

- **Benchmark researcher**

## Connections

- Benchmark researcher → Dataset preparation: prepares data
- PCB source datasets → Dataset preparation: standardizes (evidence: `README.md`)
- Dataset preparation → Clean six-class data: produces
- Clean six-class data → Dataset integrity audit: audits
- Clean six-class data → YOLOv11s baseline: trains and tests
- Clean six-class data → RT-DETR-L: trains and tests
- Clean six-class data → Faster R-CNN: trains and tests
- Clean six-class data → Small-object YOLO: trains and tests
- Clean six-class data → PCBNet RT-DETR: trains and tests
- YOLOv11s baseline → Merged and source tests: evaluates on
- RT-DETR-L → Merged and source tests: evaluates on
- Faster R-CNN → Merged and source tests: evaluates on
- Small-object YOLO → Merged and source tests: evaluates on
- PCBNet RT-DETR → Merged and source tests: evaluates on
- Merged and source tests → Source-wise result tables: records results
- Source-wise result tables → Benchmark comparison: reads tables (evidence: `README.md`)
- Benchmark comparison → Comparison figures: generates figures (evidence: `README.md`)
- Benchmark researcher → Benchmark comparison: compares models
- Experiment manifest → Provenance validation: validates provenance (evidence: `scripts/validate_reproducibility.py`)
- Benchmark researcher → Semi-DETR experiments: runs study
- Semi-DETR experiments → Public study summary: summarizes study
