A PCB schematic diagram high-precision text recognition method and system based on multi-agent and knowledge base
By employing a multi-agent and knowledge-based approach, this method solves the character error problem caused by the lack of domain understanding in traditional OCR for PCB schematic text recognition, achieving high-precision and high-efficiency text recognition and ensuring the correctness of circuit connection relationships and the reliability of the design.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NINGBO BIANGXIN TECH CO LTD
- Filing Date
- 2026-02-26
- Publication Date
- 2026-05-29
AI Technical Summary
Existing optical character recognition (OCR) technology for PCB schematic text recognition suffers from a lack of understanding of electronic design standards, leading to minor character and semantic errors that affect circuit connections and design efficiency.
We employ a multi-agent and knowledge base-based approach, utilizing a domain-fine-tuned YOLO object detector for text region detection. We combine a structured PCB domain knowledge base and a retrieval-enhanced generation (RAG) mechanism for intelligent routing and depth correction, ensuring that the recognition results comply with PCB design specifications.
It achieves high-precision and semantically correct text recognition, significantly reduces character error rate and computational resource consumption, improves design reuse efficiency, and avoids the risks of design iteration and product failure.
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This invention belongs to the field of electronic design automation (EDA) technology, and provides a method and system for high-precision text recognition of PCB schematic diagrams based on multiple agents and knowledge base. Background Technology
[0002] Printed circuit board (PCB) schematics are the fundamental blueprints for the design and manufacture of electronic products. However, the industry possesses a large number of historical design assets, and these valuable intellectual property rights exist only in non-machine-readable formats such as images. This forces engineers to perform labor-intensive, time-consuming, and error-prone manual redrawing when these designs need to be reused or referenced, severely limiting design efficiency.
[0003] To automate schematic reconstruction, academia and industry have attempted to apply existing Optical Character Recognition (OCR) technologies. However, these traditional OCR solutions, designed for natural scenes or standard documents, exhibit significant limitations when applied to PCB schematics. The root cause lies in their failure to understand the specialized "language" and unique visual environment of electronic design. The specific shortcomings of existing technologies are as follows:
[0004] The extremely complex visual environment: PCB schematics have extremely high symbol density, tiny fonts, and text information is tightly interwoven with and even overlaps with graphic elements such as wires and component symbols. Traditional OCR text detectors struggle to accurately locate all text areas in this chaotic background, resulting in a large number of missed detections.
[0005] Strict and sensitive design guidelines: Text in PCB design follows a strict naming convention. For example, net labels are usually uppercase (e.g., GND, VCC), component reference identifiers have specific prefixes and serial numbers (e.g., R, C2), and differential pair signals have fixed suffixes (e.g., _P / _N). In this domain, minor identification errors are not harmless typos, but semantic errors that can completely change circuit connections or component attributes. A typical OCR engine might identify "GND" as "gNd," which, although visually similar, is completely invalid in the field of electronic engineering.
[0006] High-risk character confusion: Characters that look similar but have completely different meanings frequently appear in schematics, such as the number "0" and the letter "O", or the number "1" and the letter "I". This kind of confusion may lead to the misinterpretation of component parameter values or fatal errors in network connections. These errors can propagate to subsequent PCB layout, assembly and testing stages, ultimately leading to costly design iterations or even product failure in application.
[0007] The fundamental failure of existing technologies lies in their "semantic blindness." They treat text in schematic diagrams as random combinations of ordinary characters, failing to understand the strict syntax and engineering logic behind them. Therefore, these technologies not only lead to inefficient design reuse but also introduce significant economic and technical risks due to their unreliable output. This invention fundamentally addresses the shortcomings of existing technologies by introducing a knowledge-based driven correction mechanism, endowing the recognition system with "domain awareness." Figure 1 As shown, traditional OCR processes rely solely on visual detection and recognition modules, failing to understand domain rules and thus frequently resulting in semantic errors. The knowledge-based driven framework proposed in this invention adds rule constraints and semantic correction steps, effectively addressing the shortcomings of traditional methods. Summary of the Invention
[0008] The purpose of this invention is to solve the problem that traditional optical character recognition (OCR) systems, due to a lack of understanding of electronic design specifications, cause minor character errors (such as confusion between uppercase and lowercase letters, and misrecognition of numbers and letters) during PCB schematic text recognition, leading to misjudgment of circuit connection relationships and failure of engineering semantics.
[0009] To achieve the above objectives, the present invention employs the following technical means:
[0010] This invention provides a high-precision text recognition method for PCB schematic diagrams based on multi-agent systems and a knowledge base, comprising the following steps:
[0011] Step 1: Use the YOLO object detector with neighborhood fine-tuning to perform text region detection on the input PCB schematic image and output candidate text blocks containing location bounding boxes;
[0012] Step 2: Execute the rotation-aware text recognition algorithm on the candidate text block to generate an initial recognition result set. Each result includes text content, confidence score, and contextual metadata.
[0013] Step 3: Perform intelligent routing on the initial identification result set based on the structured PCB domain knowledge base:
[0014] When the confidence level of the recognition result is higher than the preset threshold and its text matches the predefined list of known correct terms in the knowledge base, it is directly output as valid text.
[0015] Otherwise, the result is routed to the correction module for further processing;
[0016] Step 4: The correction module retrieves relevant rules and examples from the PCB domain knowledge base through the retrieval enhancement generation RAG mechanism, constructs constraint prompt words, and inputs them into a large language model to generate corrected text;
[0017] Step 5: The fusion agent compares the confidence score of the original recognition result with the confidence score of the corrected text, and outputs the final text after performing rule consistency verification based on the knowledge base;
[0018] Step 6: The design rule checking module performs deterministic verification on the final text, forcing compliance with PCB naming specifications and correcting format errors.
[0019] In the above scheme, in step 1:
[0020] A target detection model based on the YOLOv11 architecture is used to detect text regions in the input PCB schematic image.
[0021] The YOLOv11 object detection model was fine-tuned on a specially constructed PCB schematic dataset containing thousands of schematic images, in which text regions were precisely annotated manually; the detection output includes candidate text blocks with location bounding boxes.
[0022] In the above scheme, the specially constructed PCB schematic dataset is obtained through the following steps:
[0023] Collect PCB schematic images from public resources and actual engineering projects, ensuring coverage of different types of components and signal naming patterns;
[0024] The text regions in each image are precisely labeled manually, including component names, pin identifiers, and mesh labels, and the exact bounding box position is provided for each text region.
[0025] All images and labeled data are organized into a format that meets the requirements for model training, and then the model is trained and evaluated.
[0026] In the above scheme, in step 2:
[0027] Step 2.1: Crop the original image blocks corresponding to the candidate text blocks. Perform optical character recognition to obtain initial recognition results. ,in This represents the identified text string. This represents the corresponding confidence score;
[0028] Step 2.2: Crop the original image into blocks. Rotate 90 degrees clockwise to obtain the rotated image block. ;
[0029] Step 2.3: For the rotated image block Perform optical character recognition (OCR) to obtain rotation recognition results. ,in This represents the identified text string. This represents the corresponding confidence score;
[0030] Step 2.4: Calculate the cropped blocks of the original image. Aspect Ratio ,in Indicates the height of the cut block. Indicates the width of the cut block;
[0031] Step 2.5: Determine the final recognition result based on the following judgment conditions. :
[0032] if but , , The preset threshold;
[0033] otherwise ;
[0034] in, This indicates the final text content. This represents the final confidence score;
[0035] Step 2.6: Output the final text content. Final confidence score and the initial identification results of context metadata, Recorded as .
[0036] In the above scheme, step 3 includes the following routing strategy: when the confidence score of the identification result... Higher than the preset threshold And the text content of the recognition result It exists in the list of known correct terms retrieved from the Retrieval Enhancement Generation (RAG) knowledge base. If the result is correct, it is directly output as valid text; otherwise, the recognition result is routed to the correction module for in-depth processing.
[0037] In the above scheme, the correction module in step 4 performs the following operations by retrieving and enhancing the RAG generation mechanism:
[0038] Step 4.1. Retrieval: For a text to be corrected input by the router agent... From the PCB domain knowledge base Retrieved text matching the text to be corrected The most relevant include rules and examples. Knowledge Entries ;
[0039] Step 4.2. Prompt for building: Convert the original OCR output With the retrieved knowledge entries Combine these elements to create a structured guide. ;
[0040] Step 4.3. Generate: Generate this prompt Input into a large language model (LLM) to generate corrected text. Correcting text Its corresponding confidence score This is recorded as the correction result. .
[0041] In the above scheme, the fusion agent described in step 5 analyzes the original recognition results. With revised text Perform the following operations:
[0042] Compare the confidence scores of the original recognition results Confidence score of the revised text If the confidence level of the corrected text is high, i.e., ĉ > c, the model is more confident in the corrected result and will continue to perform subsequent rule consistency checks.
[0043] If the confidence level of the corrected text is low, i.e., ĉ < c, then the correction process ends directly and the original recognition result is retained;
[0044] Consistency verification: Based on the RAG knowledge base generated by retrieval enhancement, the corrected text is verified. Perform rule consistency checks to verify whether it conforms to PCB design specifications;
[0045] If the rule consistency check passes, the final output text will be: Otherwise, output the original recognition result. .
[0046] In the above scheme, the design rule checking module performs deterministic verification on the final text to enforce compliance with PCB naming specifications; wherein, the deterministic verification includes:
[0047] Force all network tags to uppercase;
[0048] Verify the continuity of component reference identifiers;
[0049] Ensure that the differential signal has the correct suffix;
[0050] Minor formatting errors are automatically corrected, while serious anomalies or unrecognizable symbols are marked and prompted for manual review.
[0051] Because the present invention employs the above-mentioned technical means, it has the following beneficial effects:
[0052] 1. This invention solves the core technical problem of misjudging circuit connection relationships caused by minor character errors due to a lack of domain semantic understanding in the traditional OCR process of PCB schematic text recognition. This is achieved through the intelligent routing strategy based on a structured PCB domain knowledge base in step 3 (direct output when the confidence of the recognition result is higher than a preset threshold and conforms to the known correct terminology list) and the combination of retrieval enhancement generation (RAG) mechanism and rule consistency verification in steps 4-5.
[0053] The specific analysis is as follows:
[0054] Traditional OCR suffers from "semantic blindness," failing to distinguish between PCB design specifications (e.g., network labels must be all uppercase, differential signals must have a fixed suffix). For example, recognizing "GND" as "gNd" may be visually similar, but the engineering semantics are completely wrong. This invention addresses this by using a knowledge base routing mechanism built in step 3 to categorize recognition results into two types: results with high confidence and conforming to the predefined terminology list (e.g., "GND") are directly output, avoiding unnecessary correction; while results with low confidence or violating specifications (e.g., "gNd") are precisely routed to the RAG correction module in step 4. This module retrieves relevant rules and examples from the PCB knowledge base (e.g., the explicit constraint that "network labels must be all uppercase"), constructs structured prompts to guide a large language model in generating corrected text, and performs rule consistency checks (e.g., verifying whether the corrected result conforms to naming conventions) through a fusion agent in step 5. This closed-loop process ensures that the output text is not only character-correct but also strictly adheres to PCB design semantic logic—for example, automatically correcting "gNd" to "GND," completely eliminating the risk of circuit connection failures due to capitalization errors. Therefore, this invention fundamentally solves the problem of the lack of domain semantics in traditional methods, making the recognition results engineering-usable and avoiding technical risks of downstream design iteration or product failure.
[0055] 2. This invention solves the key efficiency bottleneck problem of excessive computational resource consumption and difficulty in large-scale deployment in the pursuit of high accuracy by combining the selective release mechanism of high-confidence valid text by the router agent in step 3, the deep correction process driven by RAG in steps 4-5, and the deterministic verification of the design rule checking module in step 6.
[0056] The specific analysis is as follows:
[0057] Existing solutions, which call large language models (LLMs) for correction of all recognition results, would lead to a surge in computational overhead, failing to meet the real-time requirements of industrial applications. This invention achieves "precise routing" through the router agent in step 3: resource-intensive processes (steps 4-5) are triggered only when the confidence level of the recognition result is below a threshold or the text does not conform to the knowledge base terminology list, while high-confidence valid results are directly output to step 6, avoiding redundant processing of over 90% of reliable results. Simultaneously, the RAG mechanism in step 4 significantly reduces the risk of LLM "illusion" (such as mistakenly correcting erroneous text to irrelevant content) by retrieving structured rules and example constraints from the knowledge base to constrain the LLM generation process, ensuring efficient and accurate correction. The design rule checking module in step 6 performs forced format correction (such as uppercase network tags and differential signal suffix completion) and anomaly marking before output, completing the final verification without additional computational resources. This three-tiered architecture of "lightweight offloading-deep correction-deterministic termination" significantly optimizes system throughput efficiency while ensuring recognition accuracy: the router agent, acting as the decision-making center, dynamically allocates the computational load, allowing LLM to be used only in critical error scenarios; the rule checking module is designed to replace manual review with deterministic logic, ensuring that the output results can be directly integrated into the EDA toolchain. Therefore, this invention achieves a balance between high accuracy and high efficiency, providing a feasible technical path for large-scale PCB historical asset digitization. Attached Figure Description
[0058] Figure 1 : A simplified flowchart of the invention;
[0059] Figure 2 A schematic diagram comparing the traditional OCR workflow with the knowledge base-driven OCR framework of this invention. This invention uses a knowledge base as its core to achieve high-precision semantic recognition, while traditional OCR relies solely on visual features, making it difficult to guarantee semantic accuracy.
[0060] Figure 3 This invention presents the overall system architecture and workflow diagram. The knowledge base is at the core, and the scheduling module is invoked around it. The diagram illustrates the end-to-end data flow from input to output: a PCB schematic image serves as input, first undergoing preliminary processing by the YOLO detection module and the PaddleOCR recognition module. The output is then routed by the router agent, and according to preset logic, the data is either directly directed to the design rule checking module or sent to the error correction module (composed of the RAG knowledge base, the agent, and the fusion agent) for deep refinement, generating high-fidelity text output.
[0061] Figure 4This diagram illustrates a comparison of the error correction effects of the present invention. The knowledge base plays a crucial role in correcting rule-based errors. This diagram visually demonstrates the effectiveness of the invention through a specific example. The diagram compares the recognition results of a principle image segment before and after correction, clearly showing how a domain-specific term (e.g., "DAP") is corrected from an initial incorrect recognition state to a correct result by the multi-agent correction system. This diagram powerfully demonstrates the domain-specific intelligence of the present invention and its value in practical applications. Detailed Implementation
[0062] The embodiments of the present invention will be described in detail below. Although the present invention will be described and illustrated in conjunction with some specific embodiments, it should be noted that the present invention is not limited to these embodiments. On the contrary, any modifications or equivalent substitutions made to the present invention should be covered within the scope of the claims of the present invention.
[0063] Furthermore, to better illustrate the present invention, numerous specific details are set forth in the following detailed embodiments. Those skilled in the art will understand that the present invention can be practiced without these specific details.
[0064] This invention belongs to the field of Electronic Design Automation (EDA) technology, specifically relating to a technique for automatically analyzing and reconstructing printed circuit board (PCB) schematics from image formats. This invention also relates to the fields of Artificial Intelligence (AI) and Computer Vision, particularly in applications of Optical Character Recognition (OCR). More specifically, this invention discloses a method and system for application domain knowledge bases, Retrieval Enhancement Generation (RAG), and lightweight scheduling modules to address the challenges of text recognition within specific domains. The core objective of this invention is to build a reliable data bridge between legacy schematic data in image formats and modern intelligent design and manufacturing systems, thereby providing key technical support for downstream applications such as circuit reverse engineering, design knowledge graph construction, and automated design verification.
[0065] The innovation of this invention is not merely an improvement on a single technology, but rather the definition of a completely new technological paradigm at the intersection of three independent technological fields: EDA, OCR, and advanced AI systems. This deep cross-domain integration forms a collaborative, closed-loop intelligent system that solves a challenge that no single-domain technology can address independently: achieving high-fidelity and semantically accurate text information extraction in the highly constrained and noisy environment of PCB schematics.
[0066] This invention provides a high-precision, semantically-aware automated text recognition system, named PCBTagent, capable of recognizing text from PCB schematic images. Figure 2As shown, the overall architecture of this invention consists of a detection and recognition module, a knowledge base correction module, and a design rule checking module. Unlike traditional OCR, this invention places the knowledge base at its core, ensuring that all results conform to domain specifications. The technical solution specifically includes:
[0067] 1. Initial Recognition Stage: This stage employs a robust Paddle-Yolo-OCR model to perform preliminary text detection and recognition on the input schematic image. This model innovatively integrates the YOLO object detector and the PaddleOCR recognition engine. The YOLO detector has been specifically fine-tuned on a large amount of PCB schematic data, enabling it to more accurately locate text regions in complex backgrounds compared to general detectors. Subsequently, the high-performance PaddleOCR engine is responsible for recognizing the text content within these regions. The goal of this stage is to achieve fast recognition with high recall, even if this introduces some initial errors.
[0068] 2. Knowledge-Based Correction Phase: This phase is the core of the invention, relying on a structured PCB knowledge base as the core criterion to analyze, verify, and correct the initial recognition results. The system acknowledges that a single OCR model cannot achieve perfection, and also recognizes that brute-force correction of all results (e.g., feeding all results into a large language model) is computationally infeasible. Therefore, this invention designs a clearly defined intelligent workflow:
[0069] Router Agent: As the decision-making center of the system, only "suspicious" results with low confidence or that may violate domain rules are sent to the next stage for in-depth processing, while correct results with high confidence are directly allowed to proceed.
[0070] The Correction Agent is a powerful but computationally expensive "expert module" that utilizes a large Language Model (LLM) and is guided by a Retrieval Enhanced Generation (RAG) knowledge base. This knowledge base encodes a large number of professional naming rules and design conventions in the PCB field, ensuring that the LLM's correction work is based on evidence and conforms to engineering practice.
[0071] Fusion Agent: Responsible for intelligently weighing and merging the original recognition results with the suggestions of the correction agent to output the most reliable final text.
[0072] The Design Rule Checking (DRC) module performs a final deterministic verification before output, ensuring that all text conforms to industry standards and design specifications.
[0073] This invention constructs a domain-specific knowledge base, uniformly encoding PCB naming rules, common obfuscation patterns, and other information into searchable structured information. During the correction phase, the recognition results do not rely on blind judgments from a single model, but are consistently supported by semantic evidence provided by the knowledge base. This design enables the system to invoke domain knowledge at the most critical points, achieving high-confidence automatic correction. It is precisely the introduction of the knowledge base that elegantly resolves the inherent contradiction between high accuracy and high efficiency, becoming the core highlight of this invention for industrial applications.
[0074] To facilitate a better understanding of the technical concept of this invention by those skilled in the art, further detailed description is provided below:
[0075] 1. System Overview
[0076] Reference Figure 2 The complete processing flow of the system proposed in this invention is as follows: First, the system receives an input PCB schematic image. This image is sent to the initial recognition module to generate a set of preliminary text annotation information, including text content, location bounding boxes, and confidence scores. Subsequently, this preliminary annotation information is passed to an intelligent correction system based on a domain knowledge base. This system selectively refines and verifies the annotations, correcting errors and ensuring compliance with domain specifications. Finally, the system outputs a set of high-precision text tags in YOLO format, which can be directly used in downstream applications.
[0077] 2. Initial Recognition Module (Paddle-Yolo-OCR)
[0078] This module is responsible for quickly and robustly performing preliminary text detection and recognition.
[0079] 2.1. YOLO-based text detection
[0080] This embodiment employs a target detection model based on the YOLOv11 architecture. This model was fine-tuned on a specially constructed PCB schematic dataset. This dataset contains thousands of schematic images, with text regions precisely annotated manually. Through this domain-specific training, the detector learns the unique layout patterns and text features of PCB schematics, thereby achieving a localization accuracy far exceeding that of general-purpose text detectors in complex environments with dense components and wires.
[0081] 2.2. Text Recognition Based on PaddleOCR
[0082] The image region corresponding to each text bounding box output during the detection phase is cropped and input into the PaddleOCR recognition module. This embodiment uses the recognition function of PP-OCRv5, which can efficiently convert image slices into text strings. For each bounding box, the output of this module is a tuple containing three elements: ,in It is the recognized text string. It is a confidence score (a floating-point number between 0 and 1) that represents the reliability of this identification. It is context metadata that contains information such as location.
[0083] 2.3. Rotation-Aware Text Recognition Algorithm
[0084] To address the common text rotation issue in schematic diagrams, this module integrates a rotation-aware recognition algorithm, the logic of which is as follows:
[0085] 1. Cropping blocks from the original image output by the YOLO detector. Perform an OCR recognition to obtain the initial result. ,in For text, , where is the confidence level.
[0086] 2. Rotate the original crop block I 90 degrees clockwise to obtain a new image block. .
[0087] 3. For the rotated image patch A second OCR recognition was performed to obtain the rotation result. .
[0088] 4. Execute decision logic. The judgment condition is: if and only if the confidence level after rotation... Greater than the original confidence level Furthermore, the rotated recognition result is only adopted if the aspect ratio (height / width) of the original bounding box is greater than a preset threshold (e.g., 1.1). Use this as the final output. Otherwise, retain the original recognition result. .
[0089] The pseudocode for the above algorithm steps is shown in the table below:
[0090]
[0091] The dual-conditional decision-making process in this algorithm is a key design feature. It utilizes the aspect ratio to help determine the original orientation of the text, avoiding erroneous rotation of the near-square bounding box, thereby significantly improving the robustness of vertical text recognition.
[0092] 3. Multi-agent correction system
[0093] This system is the core of the invention, responsible for intelligently refining the initial identification results.
[0094] 3.1. Router Intelligent Agent
[0095] This intelligent agent serves as the system's decision-making center, its core function being to strike a balance between accuracy and efficiency. It employs a hybrid routing strategy to process each initial identification result:
[0096] High-confidence bypass: If the confidence level c of an identification result is higher than a preset threshold τ (e.g., 0.95), and its text t exists in a list of "known correct terms" retrieved from the RAG knowledge base. If the result is satisfactory, it is considered highly reliable and can be passed directly without correction.
[0097] Low confidence correction: If the confidence level of a result is low... Below the threshold or its text If a result contains characters from the "common obfuscation character set" C_confuse (e.g., {'0', 'O'}, {'1', 'I'}), then the result is considered "suspicious" and routed to the correction agent for deep processing.
[0098] Rule-based routing: The agent can also be configured with additional pattern matching rules to identify anomalous text in a specific format and route it to the appropriate processing module.
[0099] 3.2. Correcting the intelligent agent
[0100] This agent is responsible for performing high-fidelity, context-aware error correction. Its operation relies on a domain-specific RAG knowledge base.
[0101] RAG Knowledge Base: This knowledge base It is not a simple dictionary, but a structured knowledge repository, the contents of which are shown in the following example:
[0102] Naming rules: explicit rules described in natural language, such as "power networks should use all uppercase letters".
[0103] Positive examples (good): A list of valid names that conform to the specification, such as "GND".
[0104] Negative examples (bad): A list of common incorrect syntaxes, such as ["gNd", "+5v", "reset!"].
[0105] Calibration process:
[0106] 1. Retrieval: For a text to be corrected input by a router agent... The system first starts from the knowledge base Search results for related The k most relevant knowledge items .
[0107] 2. Prompt to build: The system will output the original OCR. With retrieved knowledge (Including rules and examples) combine to construct a structured guideline. .
[0108] 3. Generation: The prompt is input into a large language model (LLM). Under the "constraints" and "guidance" of RAG knowledge, the LLM generates a corrected text string. This method effectively utilizes the reasoning power of LLM while avoiding the "illusion" that may arise when there is no domain knowledge, thus ensuring the professionalism and accuracy of the correction.
[0109] 3.3. Integrated Intelligent Agents
[0110] The function of this agent is to intelligently integrate the original OCR results. The correction results generated by the correction agent { , Its decision-making logic comprehensively considers multiple factors: first, it compares the confidence scores of the two, and second, it uses the RAG knowledge base to adjust the result. Perform a rule consistency check. If the LLM's correction result has high confidence but violates a specific design rule, the agent can choose to abandon the correction and revert to the original result. This mechanism adds a "safety lock" to the system, effectively preventing the introduction of new errors during the correction process.
[0111] The core of fusion is not simply choosing one result, but comparing and verifying the two, and deciding whether to accept the correction based on rules and confidence levels. This mechanism essentially uses intelligent decision-making to fuse the original text and the corrected result to achieve higher accuracy and rule consistency.
[0112] 3.4. Design Rule Check (DRC) Module
[0113] This is the final quality control checkpoint before data output, responsible for performing a definitive final check on the text to ensure it fully complies with the schematic design standards.
[0114] Example of application rules: Force all network labels to be uppercase; verify that the component reference identifiers are consecutive (e.g., R1, R2, R3); ensure that special signals (e.g., differential pairs) have the correct suffix (must end with _P / _N).
[0115] Actions performed: For minor violations (such as capitalization errors), the module can automatically correct them. For serious formatting errors or unrecognized symbols, the module will mark them and indicate that manual review is required.
[0116] After processing by the DRC module, the system outputs clean, standardized, and highly reliable data that can be seamlessly integrated into a professional EDA toolchain.
[0117] The method and system proposed in this invention have achieved significant technical progress and beneficial effects compared with existing technologies and robust baseline models, specifically in the following aspects:
[0118] Unprecedented Recognition Accuracy and Reliability: The multi-agent correction system of this invention significantly reduces the recognition error rate, achieving a qualitative leap from academic research to industrial applications. Compared to the baseline model using only Paddle-Yolo-OCR, the complete framework of this invention nearly halve the character error rate (CER) and word error rate (WER), with specific performance improvements shown in Table 1.
[0119] Table 1: Performance comparison between the baseline OCR pipeline and our proposed PCBTagent
[0120] method Character Error Rate (CER %) Word Error Rate (WER %) Character accuracy (ACC %) Baseline model (Paddle-Yolo-OCR) 6.33 19.04 93.67 This invention (PCBTagent) 3.03 9.99 96.97
[0121] As shown in the table, this invention reduces the character error rate by 3.30 percentage points and the word error rate by 9.05 percentage points, with a final character accuracy rate of 96.97%, providing a solid data foundation for the reliability of downstream EDA applications.
[0122] Domain Intelligence and Semantic Correctness: Through its correction agent and final DRC module, the system ensures that output strictly adheres to PCB naming conventions, proactively corrects common errors, and enforces industry standards. For example, when dealing with specific naming conventions, the system can correct initial identification deviations and output correct text that matches the design intent. This semantic-level correctness guarantees a high degree of integrity in the output data, enabling it to be directly adopted by critical downstream EDA applications.
[0123] Optimized computational efficiency: While pursuing high accuracy, this invention optimizes computational costs through ingenious architectural design. The router agent selectively triggers the resource-intensive LLM correction module, processing only predictions with low confidence or that violate the rules, significantly saving computational resources and making this technical solution feasible for large-scale deployment.
[0124] Automation and Cost Advantages: By providing a reliable automated solution, this invention directly addresses the industry pain points mentioned in the background section. It can significantly reduce or even eliminate the reliance on manually redrawing schematics, thereby saving substantial time and labor costs and significantly accelerating the design and iteration cycle of electronic products.
[0125] Advantages and application prospects of knowledge base
[0126] Unlike existing solutions that rely solely on visual detection and single-model reasoning, this invention establishes a domain knowledge base as the core support for PCB schematic text recognition for the first time. The knowledge base is not merely an auxiliary tool, but a fundamental innovation point for achieving a balance between high accuracy and high efficiency in the system. All recognition, scheduling, correction, and verification processes revolve around the knowledge base, thus forming a complete system with domain-aware capabilities. The following is an explanation and advantage analysis of the knowledge base:
[0127] The core role of the knowledge base: The PCB-specific knowledge base proposed in this invention is not a simple terminology dictionary, but a structured and scalable semantic storage system. It uniformly encodes naming rules, symbol confusion patterns, electrical connection constraints, and differential signal specifications, providing a clear semantic basis for the identification and correction process. This knowledge base occupies a central position in the system and is the fundamental guarantee for ensuring the semantic correctness of the identification results. For example... Figure 3 As shown, the knowledge base can correct domain errors that traditional OCR cannot handle. For example, the initial 'DAP' was correctly corrected to 'DAP_' under the constraints of the knowledge base rules, fully demonstrating the key value of the knowledge base at the semantic level.
[0128] During the correction process, the system first bases the correction on the input text. From the knowledge base Search for the most relevant set of entries Then, based on these rules, a hint is constructed. And input it into a large language model for inference:
[0129]
[0130] This formula clearly shows that the correction of the recognition results does not come from the "free generation" of the model, but is always controlled by the rules of the knowledge base.
[0131] Completeness and Extensibility: Unlike existing OCR systems that rely solely on visual information, this knowledge base preserves and expands upon multi-dimensional information in EDA design, including geometric features, electrical attributes, and topological logic. It can be dynamically updated according to industry standards, manufacturer specifications, and user-defined rules, supporting long-term applicability across versions and platforms.
[0132] Industry Application Prospects: The construction of this knowledge base enables schematic recognition results to be directly integrated with EDA toolchains and downstream applications. It not only supports circuit reverse engineering, design knowledge graph construction, and automated verification, but also extends to data interoperability among EDA tools from multiple vendors, driving electronic design automation from "recognition" to "understanding," and accelerating the intelligent transformation and upgrading of EDA.
[0133] Example 1
[0134] This invention provides a high-precision text recognition method for PCB schematic diagrams based on multi-agent systems and a knowledge base, comprising the following steps:
[0135] Step 1: Use the YOLO object detector with neighborhood fine-tuning to perform text region detection on the input PCB schematic image and output candidate text blocks containing location bounding boxes;
[0136] Step 2: Execute the rotation-aware text recognition algorithm on the candidate text block to generate an initial recognition result set. Each result includes text content, confidence score, and contextual metadata.
[0137] Step 3: Perform intelligent routing on the initial identification result set based on the structured PCB domain knowledge base:
[0138] When the confidence level of the recognition result is higher than the preset threshold and its text matches the predefined list of known correct terms in the knowledge base, it is directly output as valid text.
[0139] Otherwise, the result is routed to the correction module for further processing;
[0140] Step 4: The correction module retrieves relevant rules and examples from the PCB domain knowledge base through the retrieval enhancement generation RAG mechanism, constructs constraint prompt words, and inputs them into a large language model to generate corrected text;
[0141] Step 5: The fusion agent compares the confidence score of the original recognition result with the confidence score of the corrected text, and outputs the final text after performing rule consistency verification based on the knowledge base;
[0142] Step 6: The design rule checking module performs deterministic verification on the final text, forcing compliance with PCB naming specifications and correcting format errors.
[0143] In the above scheme, in step 1:
[0144] A target detection model based on the YOLOv11 architecture is used to detect text regions in the input PCB schematic image.
[0145] The YOLOv11 object detection model was fine-tuned on a specially constructed PCB schematic dataset containing thousands of schematic images, in which text regions were precisely annotated manually; the detection output includes candidate text blocks with location bounding boxes.
[0146] In the above scheme, the specially constructed PCB schematic dataset is obtained through the following steps:
[0147] Collect PCB schematic images from public resources and actual engineering projects, ensuring coverage of different types of components and signal naming patterns;
[0148] The text regions in each image are precisely labeled manually, including component names, pin identifiers, and mesh labels, and the exact bounding box position is provided for each text region.
[0149] All images and labeled data are organized into a format that meets the requirements for model training, and then the model is trained and evaluated.
[0150] In the above scheme, in step 2:
[0151] Step 2.1: Crop the original image blocks corresponding to the candidate text blocks. Perform optical character recognition to obtain initial recognition results. ,in This represents the identified text string. This represents the corresponding confidence score;
[0152] Step 2.2: Crop the original image into blocks. Rotate 90 degrees clockwise to obtain the rotated image block. ;
[0153] Step 2.3: For the rotated image block Perform optical character recognition (OCR) to obtain rotation recognition results. ,in This represents the identified text string. This represents the corresponding confidence score;
[0154] Step 2.4: Calculate the cropped blocks of the original image. Aspect Ratio ,in Indicates the height of the cut block. Indicates the width of the cut block;
[0155] Step 2.5: Determine the final recognition result based on the following judgment conditions. :
[0156] if but , , The preset threshold;
[0157] otherwise ;
[0158] in, This indicates the final text content. This represents the final confidence score;
[0159] Step 2.6: Output the final text content. Final confidence score and the initial identification results of context metadata, Recorded as .
[0160] In the above scheme, step 3 includes the following routing strategy: when the confidence score of the identification result... Higher than the preset threshold And the text content of the recognition result It exists in the list of known correct terms retrieved from the Retrieval Enhancement Generation (RAG) knowledge base. If the result is correct, it is directly output as valid text; otherwise, the recognition result is routed to the correction module for in-depth processing.
[0161] In the above scheme, the correction module in step 4 performs the following operations by retrieving and enhancing the RAG generation mechanism:
[0162] Step 4.1. Retrieval: For a text to be corrected input by the router agent... From the PCB domain knowledge base Retrieved text matching the text to be corrected The most relevant include rules and examples. Knowledge Entries ;
[0163] Step 4.2. Prompt for building: Convert the original OCR output With the retrieved knowledge entries Combine these elements to create a structured guide. ;
[0164] Step 4.3. Generate: Generate this prompt Input into a large language model (LLM) to generate corrected text. Correcting text Its corresponding confidence score This is recorded as the correction result. .
[0165] In the above scheme, the fusion agent described in step 5 analyzes the original recognition results. With revised text Perform the following operations:
[0166] Compare the confidence scores of the original recognition results Confidence score of the revised text If the confidence level of the corrected text is high, i.e., ĉ > c, the model is more confident in the corrected result and will continue to perform subsequent rule consistency checks.
[0167] If the confidence level of the corrected text is low, i.e., ĉ < c, then the correction process ends directly and the original recognition result is retained;
[0168] Consistency verification: Based on the RAG knowledge base generated by retrieval enhancement, the corrected text is verified. Perform rule consistency checks to verify whether it conforms to PCB design specifications;
[0169] If the rule consistency check passes, the final output text will be: Otherwise, output the original recognition result. .
[0170] In the above scheme, the design rule checking module performs deterministic verification on the final text to enforce compliance with PCB naming specifications; wherein, the deterministic verification includes:
[0171] Force all network tags to uppercase;
[0172] Verify the continuity of component reference identifiers;
[0173] Ensure that the differential signal has the correct suffix;
[0174] Minor formatting errors are automatically corrected, while serious anomalies or unrecognizable symbols are marked and prompted for manual review.
Claims
1. A high-precision text recognition method for PCB schematic diagrams based on multi-agent and knowledge base, characterized in that, Includes the following steps: Step 1: Use the YOLO object detector with neighborhood fine-tuning to perform text region detection on the input PCB schematic image and output candidate text blocks containing location bounding boxes; Step 2: Execute the rotation-aware text recognition algorithm on the candidate text block to generate an initial recognition result set. Each result includes text content, confidence score, and contextual metadata. Step 3: Perform intelligent routing on the initial identification result set based on the structured PCB domain knowledge base: When the confidence level of the recognition result is higher than the preset threshold and its text matches the predefined list of known correct terms in the knowledge base, it is directly output as valid text. Otherwise, the result is routed to the correction module for further processing; Step 4: The correction module retrieves relevant rules and examples from the PCB domain knowledge base through the retrieval enhancement generation RAG mechanism, constructs constraint prompt words, and inputs them into a large language model to generate corrected text; Step 5: Combine the confidence score of the agent on the original recognition result with the confidence score of the corrected text, and output the final text after performing rule consistency verification based on the knowledge base; Step 6: The design rule checking module performs deterministic verification on the final text, forcing compliance with PCB naming specifications and correcting format errors.
2. The method according to claim 1, characterized in that, In step 1: A target detection model based on the YOLOv11 architecture is used to detect text regions in the input PCB schematic image. The YOLOv11 object detection model was fine-tuned on a specially constructed PCB schematic dataset containing thousands of schematic images, in which text regions were precisely annotated manually; the detection output includes candidate text blocks with location bounding boxes.
3. The method according to claim 2, characterized in that, A specially constructed PCB schematic dataset is obtained through the following steps: Collect PCB schematic images from public resources and actual engineering projects, ensuring coverage of different types of components and signal naming patterns; The text regions in each image are precisely labeled manually, including component names, pin identifiers, and mesh labels, and the exact bounding box position is provided for each text region. All images and labeled data are organized into a format that meets the requirements for model training, and then the model is trained and evaluated.
4. The method according to claim 1, characterized in that, In step 2: Step 2.1: Crop the original image blocks corresponding to the candidate text blocks. Perform optical character recognition to obtain initial recognition results. ,in This represents the identified text string. This represents the corresponding confidence score; Step 2.2: Crop the original image into blocks. Rotate 90 degrees clockwise to obtain the rotated image block. ; Step 2.3: For the rotated image block Perform optical character recognition (OCR) to obtain rotation recognition results. ,in This represents the identified text string. This represents the corresponding confidence score; Step 2.4: Calculate the cropped blocks of the original image. Aspect Ratio ,in Indicates the height of the cut block. Indicates the width of the cut block; Step 2.5: Determine the final recognition result based on the following judgment conditions. : if but , , The preset threshold; otherwise ; in, This indicates the final text content. This represents the final confidence score; Step 2.6: Output the final text content. Final confidence score and the initial identification results of context metadata, Recorded as .
5. The method according to claim 2, characterized in that, Step 3 includes the following routing strategy: when the confidence score of the identification result... Higher than the preset threshold And the text content of the recognition result It exists in the list of known correct terms retrieved from the Retrieval Enhancement Generation (RAG) knowledge base. If the result is correct, it is directly output as valid text; otherwise, the recognition result is routed to the correction module for in-depth processing.
6. The method according to claim 4, characterized in that, The correction module described in step 4 performs the following operations by retrieving and enhancing the RAG generation mechanism: Step 4.
1. Retrieval: For a text to be corrected input by the router agent... From the PCB domain knowledge base Retrieved text matching the text to be corrected The most relevant include rules and examples. Knowledge Entries ; Step 4.
2. Prompt for building: Convert the original OCR output With the retrieved knowledge entries Combine these elements to create a structured guide. ; Step 4.
3. Generate: Generate this prompt Input into a large language model (LLM) to generate corrected text. Correcting text Its corresponding confidence score This is recorded as the correction result. .
7. The method according to claim 6, characterized in that, The fusion agent described in step 5 analyzes the original recognition results. With revised text Perform the following operations: Compare the confidence scores of the original recognition results Confidence score of the revised text If the confidence level of the corrected text is high, i.e., ĉ > c, the model is more confident in the corrected result and will continue to perform subsequent rule consistency checks. If the confidence level of the corrected text is low, i.e., ĉ < c, then the correction process ends directly and the original recognition result is retained; Consistency verification: Based on the RAG knowledge base generated by retrieval enhancement, the corrected text is verified. Perform rule consistency checks to verify whether it conforms to PCB design specifications; If the rule consistency check passes, the final output text will be: Otherwise, output the original recognition result. .
8. The method according to claim 6, characterized in that, The design rule checking module performs deterministic verification on the final text to enforce compliance with PCB naming conventions; wherein, the deterministic verification includes: Force all network tags to uppercase; Verify the continuity of component reference identifiers; Ensure that the differential signal has the correct suffix; Minor formatting errors are automatically corrected, while serious anomalies or unrecognizable symbols are marked and prompted for manual review.