Solder-pad contamination on PCBs — red glue overflow, component squeeze-out, dispenser splatter — leaves under 0.5 mm² of glue residue on the solder pad. It's a hidden killer. ICT passes it, the board ships looking fine, then weeks into the field a joint cracks open under vibration or thermal cycling.
This defect should be caught at AOI. But traditional rule-based AOI struggles here, and it's not because the detection algorithm isn't advanced enough — it's because the setup step is wildly expensive. Let's break it down.
1. The Real Pain Isn't the Algorithm — It's ROI Setup
The traditional AOI SOP for catching pad contamination: manually draw an ROI (region of interest) on every solder pad, then set the RGB threshold, area ratio, and binarization parameters inside that region.
The problem is scale. A medium-complexity PCBA has hundreds to thousands of pads. Drawing boxes one by one, tuning parameters, running trial passes — bringing up a single new board burns 8–16 engineer-hours. New panel, board revision, new product? Repeat the entire process.
What actually happens on the floor: most mid-size EMS plants resort to "set ROI on critical pads only, let the rest go" — escape risk gets baked straight into the system.
If the "set ROI" step could be automated, the underlying color-extraction algorithm (RGB threshold + area ratio) is actually a stable, reliable tool for red-glue detection.
2. Why Not Just Use Pure End-to-End AI?
So why not skip rules entirely — board in, all defects out?
Technically possible, but two real problems for the factory floor:
① Engineers lose control — model judgment is a black box. Want to tighten judgment slightly, or weight a high-risk zone? No handle to turn.
② Results aren't explainable — when audit asks "why was this board flagged NG?", "the AI said so" doesn't hold up.
Pure AI shines in "scenarios humans can't write rules for" — pad contamination isn't that case. The judgment logic is clear (non-metallic blob inside a pad region = NG); what needs solving is the upstream problem of "where is the pad region?"
3. Use AI Where It Hurts Most, Leave Detection to Classical
DaoAI's PCBA AOI now supports a pad-contamination module. The workflow splits into two stages:
Stage ①: AI auto-draws detection boxes
The model looks at the entire PCB once, automatically identifies the position of every solder pad, and draws all ROIs for you.
- New board onboarding: 8–16 hours → 5–10 minutes
- No coordinate memorization, no per-panel reset
- Engineers review and fine-tune the AI-drawn boxes — not start from zero
- No defect samples needed: this AI learns "what a pad looks like" (from PCB layout), not "what red glue looks like" — sidestepping the biggest data bottleneck of pure end-to-end AI
"Pad shapes vary too much for rules to cover" is exactly the kind of scenario where AI has a real advantage.
Stage ②: Color extraction does the detection
Inside each ROI, classical RGB threshold extraction + binarization + area ratio:
- Engineer picks the red-glue color range on the RGB triangle
- Sets the area ratio threshold (e.g., red-glue pixels > 10% of ROI = NG)
- Adjusts brightness binarization to match line lighting
For the engineer: readable, tunable, explainable. Reuses existing AOI operating experience — zero learning curve. For audit and SPC reports, every NG has a clear numerical basis.
4. Three Approaches Compared — Pad Contamination Scenario
| Dimension | Pure Rule-Based AOI (Manual ROI) | Pure End-to-End AI | Hybrid (AI ROI + Classical Detection) |
|---|---|---|---|
| New board onboarding | 8–16 hr ROI setup | Days to weeks (training data) | 5–10 min |
| Color extraction algorithm | RGB threshold ✓ | Black box | RGB threshold ✓ |
| Engineer control | Full (but per-pad setup) | Lost | Threshold / area retained |
| Explainable result | ✓ | ✗ | ✓ |
| Panel / board change | Full redo | Retrain | AI re-draws boxes |
| Glue batch variation | Adjust threshold | Retrain | Adjust threshold |
"Auto-drawing the box" is where traditional AOI truly hits the wall (rules can't keep up, setup cost explodes) — using AI to break this bottleneck recovers the most engineer hours.
For pad contamination, pure rule-based setup is too expensive. AI's job is "where is the pad", not "what does red glue look like" — leave the latter to mature color-extraction algorithms, where engineers keep tuning parameters the way they already know how.
If Your Line Is Stuck on ROI Setup
Bring us a real board. We'll run the AI box-drawing on it together, estimate how many engineer-hours you'd recover, and decide whether to take it further.
Contact Us Learn About DaoAI P Series AOI