← Back to projects

Collaborative Project

PCB Understanding with Computer Vision

Component detection, marking interpretation, optical character recognition (OCR), symbol detection, and reference-designator association for structured board understanding.

Computer Vision · PCB Inspection · OCR · Object Detection

00 / Overview

AOI and AutoBOM from imagery

Automated Optical Inspection (AOI) refers to the use of imaging systems and computer vision workflows to inspect printed circuit boards (PCBs), electronic assemblies, and microelectronic components. In manufacturing and hardware-assurance contexts, AOI can support quality control, defect detection, reverse engineering, counterfeit-risk analysis, component verification, and documentation recovery.

A more ambitious extension of AOI is an automated bill of materials (AutoBOM) workflow. Instead of only detecting whether a board has visible defects, an AutoBOM-style system attempts to extract structured information from a PCB image: what components are present, where they are located, how they are oriented, what markings appear on them, and how those physical components relate to reference designators, board text, layout files, or engineering documentation.

Traditional electronics workflows already hold much of this information in engineering files. Pick-and-place files may contain X-Y coordinates, rotation, board side, and reference designators for surface-mount devices. Engineering bills of materials (BOMs) link reference designators to manufacturer part numbers, component classes, and descriptors; silkscreen Gerber files can contain vector graphics for board markings, outlines, logos, and printed labels. Assembly drawings add inspection notes and manufacturing context, while structured PCB design/archive formats such as ODB++ and IPC-2581 can package component databases, surface layers, BOM information, placement data, and netlist-related information into structured design archives.

The computer vision challenge is to approximate part of this understanding from imagery alone, especially when the original design files are unavailable, incomplete, inconsistent, or need to be cross-checked against a physical board.

01 / Input

Raw Board Input

The starting point is a raw PCB image. In a controlled inspection environment, imaging should ideally be standardized before any model is trained or deployed. Camera height, lighting, lens distortion, perspective, color response, and physical scale can all introduce inconsistencies that affect downstream detection and recognition.

Fiducial markers or calibration targets can help standardize the imaging setup. ArUco markers, ChArUco boards, AprilTags, AprilGrids, rulers, or known-size reference objects can be used to estimate image scale, camera geometry, or effective pixels per inch. A color reference target, such as an X-Rite ColorChecker, can also support color normalization when color consistency matters.

For this demonstration, the example board is a publicly available Raspberry Pi 4 Model B image. It is not a perfect inspection image: the lighting, perspective, and resolution are not controlled like they would be in a production AOI station. However, it is useful as a representative example of the kinds of visual information present on a populated PCB.

High-resolution photograph of a Raspberry Pi 4 board before pipeline annotations are applied.
The public Raspberry Pi example is used here as a representative demonstration board for component, marking, text, symbol, and association tasks.

02 / Component analysis

Component Detection and Classification

The first major step is identifying the physical components on the board. Surface-mount devices and larger board components are often among the most visually distinct structures in a PCB image. A detection model can be trained to localize components such as integrated circuits, connectors, capacitors, resistors, inductors, crystals, and other recognizable packages.

Depending on the task, the system may output axis-aligned bounding boxes, oriented bounding boxes, or segmentation masks. Axis-aligned boxes are simple and efficient, but they can be imprecise when components are rotated or densely packed. Oriented bounding boxes better capture component pose, while segmentation masks provide finer object boundaries when shape, outline, or separation from the background matters.

After detection, components can be classified into useful categories through a dedicated classifier, a multi-stage detection/classification pipeline, or a model that predicts both localization and class labels. Cropped component images may also be preprocessed with contrast enhancement, illumination correction, edge emphasis, background suppression, noise reduction, geometric normalization, or color-space transformations.

The result of this stage is an approximate component inventory: a structured list of detected objects, their locations, their classes, and possibly their orientations.

Figure 1 of 3

Raspberry Pi 4 board photograph with blue outlines and translucent overlays marking detected component regions.

Component Detection

Component Detection — component regions identified across the board.

  • Component
Dark charcoal canvas showing only detected Raspberry Pi board component regions in their original positions.

Isolated Components

Isolated Components — detected component regions preserved while board context is suppressed.

Contact sheet of Raspberry Pi component crops grouped by visual and component type.

Component Classification

Component Classification — cropped component instances grouped by visual/component type.

03 / Component marking analysis

Component-Level Marking Pipeline — Broadcom CPU

Many components contain important markings that are separate from the component’s package identity. These markings may include vendor logos, model numbers, lot codes, date codes, plant codes, polarity symbols, pin-one indicators, compliance marks, and other manufacturing or provenance information.

For a large integrated circuit such as a Broadcom CPU, the component-level pipeline can be treated as a sequence of subtasks: detect and crop the component, normalize the crop for orientation, scale, and contrast, separate non-text markings, recognize text, and parse the recognized strings into meaningful fields.

Symbol and logo detection can be useful before OCR because logos, icons, and decorative marks can otherwise confuse text detection or recognition models. In some workflows, detected symbols can be masked or inpainted before running OCR so that the text-recognition stage receives a cleaner visual field.

In this simplified demonstration, a crude neutral fill may be used to remove detected symbols from the crop. A more mature implementation could use image inpainting or reconstruction techniques to produce a cleaner background. The purpose is not to generate a realistic replacement image for its own sake, but to reduce visual interference before the next recognition step.

Once text is detected and recognized, a parsing stage can interpret the result. A rule-based dictionary, manufacturer-specific patterns, known part-number formats, or a language-model-assisted parser could help separate manufacturer names, part numbers, date codes, lot identifiers, and other component-level metadata.

  1. Detect and crop the component.
  2. Normalize the crop for orientation, scale, and contrast.
  3. Detect logos, symbols, or non-text markings.
  4. Detect alphanumeric text regions.
  5. Recognize the text with OCR or a text-recognition model.
  6. Parse the recognized strings into meaningful fields.

Figure 1 of 5

Enhanced crop of a Broadcom CPU package before marking analysis.

Raw Component Crop

Raw Component Crop — enhanced Broadcom CPU crop used for component-level marking analysis.

Broadcom CPU crop with vendor logo, pin indicators, QR-like regions, and non-text markings localized.

Symbol and Marking Detection

Symbol and Marking Detection — vendor logo, pin indicators, QR-like regions, and non-text markings localized first.

Broadcom CPU crop with non-text markings removed to simplify text detection.

Marking Suppression

Marking Suppression — non-text markings removed or inpainted to simplify subsequent text detection.

Broadcom CPU crop with readable text regions detected after marking suppression.

Text Detection

Text Detection — regular text regions detected after marking suppression.

Broadcom package text decomposed into labeled semantic marking fields.

Substring Interpretation

Substring Interpretation — detected text decomposed into semantic fields such as family, package, revision, plant, date, lot, and sub-lot codes.

* Artificially enhanced image. The Broadcom CPU crop is the detected CPU extracted from the component-detection stage above.

04 / Component marking analysis

Component-Level Marking Pipeline — Micron RAM

The same component-level process can be applied to memory packages and other marked integrated circuits. A Micron RAM chip, for example, may contain a manufacturer logo, alphanumeric package markings, production codes, and layout-specific text. The image-processing challenge is similar to the CPU example, but the visual details may differ: markings can be lower contrast, smaller, more stylized, partially degraded, or affected by lighting glare.

The pipeline again decomposes the task into smaller parts: isolate the detected component, normalize its crop, detect visible symbols and logos, suppress non-text markings where helpful, detect and recognize text, then parse the output into structured component metadata.

This staged design is useful because a single end-to-end model may struggle to solve every subproblem at once. Component localization, logo recognition, text detection, OCR, and semantic parsing each have different failure modes. Separating them makes the system easier to debug, evaluate, and improve.

  1. Isolate the detected component.
  2. Normalize the crop.
  3. Detect visible symbols and logos.
  4. Suppress non-text markings where helpful.
  5. Detect text regions.
  6. Recognize the text.
  7. Parse the output into structured component metadata.

Figure 1 of 5

Enhanced crop of a Micron RAM package before marking analysis.

Raw Component Crop

Raw Component Crop — enhanced Micron RAM crop used for package marking analysis.

Micron RAM crop with logo, barcode, and non-text traceability regions identified.

Symbol and Traceability Detection

Symbol and Traceability Detection — logo, barcode, and non-text marking regions identified.

Micron RAM crop with non-text and traceability regions suppressed to isolate readable text.

Marking Suppression

Marking Suppression — non-text or traceability regions suppressed to isolate remaining readable text.

Micron RAM crop with remaining alphanumeric text regions localized.

Text Detection

Text Detection — remaining alphanumeric text regions localized.

Micron package markings decomposed into part number, date code, plant, revision, and traceability fields.

Substring Interpretation

Substring Interpretation — marking text decomposed into part number, date code, plant/foundry code, revision code, and traceability fields.

* Artificially enhanced image. The Micron RAM crop is the detected memory component extracted from the component-detection stage above.

05 / Board understanding

Board-Level Text, Symbols, and Reference Designator Association

After component-level information has been extracted, the remaining board surface can be analyzed for silkscreen text, reference designators, polarity markers, connector labels, certification symbols, logos, and other board-level markings.

One practical approach is to use the detected component locations as context. Components can be masked from the image to reduce clutter, leaving the substrate, silkscreen, traces, pads, and printed board markings more visible. The board-level pipeline can then perform symbol detection, scene-text detection, OCR, and semantic parsing on the remaining visible markings.

Reference designators are especially important because they connect the physical PCB layout to engineering documentation. Markings such as R12, C4, U3, L1, J5, or D2 typically refer to specific classes of components and are used in schematics, BOMs, placement files, assembly drawings, and inspection workflows.

The association problem is to connect each detected reference designator to the correct physical component. A label may be printed near several components, partially occluded, rotated, or separated from the component it describes. A practical system can combine detection confidence with geometry, text orientation, and local layout context. The output is a structured mapping between physical components and board markings: for example, a detected capacitor package could be linked to a nearby “C47” marking, or a detected integrated circuit to a nearby “U1” designator.

  • component class predictions
  • component position and orientation
  • distance and layout heuristics
  • board-side information and local neighborhood structure
  • text orientation and known reference-designator prefixes
  • confidence scores from OCR and detection models

Figure 1 of 5

Raspberry Pi board with blue component overlays and purple overlays highlighting component markings.

Component Marking Overview

Component Marking Overview — component boxes shown with component-level markings emphasized.

  • Component
  • Component marking
Raspberry Pi board with detected component regions hidden to expose board-level silkscreen context.

Component Suppression

Component Suppression — component regions suppressed to expose board-level silkscreen context.

Raspberry Pi board with dark component masks and orange overlays identifying board-level graphic symbols.

Board Symbol Detection

Board Symbol Detection — board-level symbols, logos, and non-text markings detected after component suppression.

  • Board symbol
  • Suppressed component context
Raspberry Pi board with dark component masks and cyan overlays identifying board-level text.

Board Text Detection

Board Text Detection — board-level text and reference-designator candidates localized after component suppression.

  • Board text
  • Suppressed component context
Raspberry Pi board with component, board-text, symbol, and association overlays linking annotations to components.

Reference Designator Association

Reference Designator Association — candidate reference designators and board markings linked back to associated component detections.

  • Component
  • Component marking
  • Board text
  • Board symbol
  • Association

06 / Outcome

Unified PCB Understanding

The final goal is to aggregate the outputs of each stage into a unified representation of the board. A simplified PCB understanding system may produce:

  • detected components, component classes, locations, and orientations
  • component-level logos, markings, and recognized alphanumeric text
  • parsed manufacturer or part-number candidates
  • board-level symbols, labels, and reference designators
  • component-to-designator associations and confidence scores
  • unresolved or ambiguous cases requiring human review

This kind of structured output can support multiple downstream workflows. In quality assurance, it can help compare a physical board against expected documentation. In hardware assurance, it can support counterfeit-risk analysis, provenance review, or anomaly investigation. In reverse engineering, it can help reconstruct a partial component inventory when design files are unavailable. In manufacturing, it can assist inspection, traceability, and documentation validation.

Additional subtasks can extend the system further, including trace and via segmentation, solder-joint inspection, defect detection, package-dimension estimation, polarity verification, serial-number extraction, date-code analysis, and cross-referencing against external component databases.

The broader lesson is that AOI and AutoBOM are not single-model problems. They are multi-stage computer vision and data-integration workflows. Detection, classification, OCR, symbol recognition, reference-designator association, calibration, preprocessing, and documentation matching all contribute to the final system. In practice, the hard part is often not choosing a model architecture, but decomposing the problem into reliable stages, building useful datasets, handling imperfect imagery, and designing outputs that can be inspected, corrected, and used by engineers.

Raspberry Pi board with blue component overlays, purple component markings, cyan board text, orange board symbols, and magenta association lines.

The final view combines component detection, component markings, board text, board symbols, and reference-designator association into a single structured PCB-understanding workflow.

  • Component
  • Component marking
  • Board text
  • Board symbol
  • Association

© 2026 Paul Ramirez-Lopez