Method and system for real-time detection of industrial-grade PCB defects based on hybrid architecture and edge enhancement
By employing a hybrid architecture and edge-enhanced PCB defect detection method, the issues of real-time performance, stability, and multi-board type compatibility in industrial settings have been resolved. This enables efficient traceability of detection results and system integration, thereby improving detection efficiency and quality management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ANHUI NORMAL UNIV
- Filing Date
- 2026-04-27
- Publication Date
- 2026-07-21
AI Technical Summary
Existing PCB defect detection technologies suffer from insufficient real-time performance, poor stability, difficulty in adapting to multiple board types, difficulty in traceability of results, and challenges in integrating upstream and downstream systems in industrial settings, resulting in low detection efficiency and high maintenance costs.
An industrial-grade real-time PCB defect detection method based on hybrid architecture and edge enhancement is adopted. It combines image preprocessing, multi-scale edge information enhancement and feature fusion to build a closed-loop processing link, including task management, model inference, result output and data persistence, and supports batch detection, real-time monitoring and self-learning.
It improves production line testing efficiency and quality management, reduces manual screening and maintenance costs, and achieves stable and efficient testing and structured storage of results under complex working conditions.
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial vision and deep learning target detection technology, specifically to a method and system for real-time detection of industrial-grade PCB defects based on hybrid architecture and edge enhancement. Background Technology
[0002] Printed Circuit Boards (PCBs) and their assemblies (PCBAs) are critical components in the manufacturing process of electronic products, and their surface defects directly affect product yield and reliability. During actual manufacturing and assembly, PCB / PCBA surfaces may develop various types of defects, including scratches, board damage, foreign objects, dirt, false copper leaks, burrs, and rough hole walls, due to process fluctuations, equipment precision, material differences, and environmental factors. Because of the diverse defect morphologies, significant dimensional differences, and complex background textures, especially under high-resolution imaging and multi-board-type mixed-line production conditions, defect detection systems not only need high precision but must also meet engineering requirements such as real-time performance, stability, and data traceability.
[0003] With the development of machine learning and deep learning technologies, an increasing number of PCB defect detection solutions adopt a data-driven approach, using trained models to locate and classify defects, achieving better detection accuracy than traditional methods on medium-sized datasets. However, existing solutions still have the following problems in terms of industrial field deployment and long-term stable operation: 1) Significant Engineering Deployment and Real-Time Constraints: Industrial inspection typically requires processing high-resolution images, continuous material intake, and multi-station concurrent tasks. The system needs to achieve stable inference and continuous throughput under limited computing power (such as industrial control computers or edge devices). Existing methods often only provide algorithm models or offline inspection scripts, lacking engineering designs for inference acceleration, resource scheduling, concurrency control, and anomaly recovery, making it difficult to stably meet real-time requirements after deployment. 2) High adaptation and maintenance costs for multiple board types and operating conditions: In scenarios involving mixed-line production, frequent board type switching, or changes in process parameters, data distribution is prone to drift, and model performance may fluctuate. Existing solutions generally lack supporting mechanisms for sample management, manual review, retraining data accumulation, and version iteration, resulting in the need for repeated manual sample selection and retraining, leading to high maintenance costs and long cycles. 3) Lack of traceability and closed-loop quality management: Industrial sites not only require "detection," but also unified management of batches, defect details, review conclusions, and exported reports to support quality traceability, process analysis, and auditing. Existing solutions often save test results as image annotations or temporary files, lacking a structured database and statistical reporting system, making it difficult to support production management and continuous improvement; 4) Insufficient long-term robustness to complex environmental interference: When factors such as changes in illumination, background texture interference, noise, and differences in imaging angle exist, the detection system is prone to false detection and missed detection. Moreover, existing solutions usually lack online monitoring, parameter adaptation, or operational status diagnosis mechanisms, which affects the stability and availability of the system. 5) Insufficient integration capabilities with upstream and downstream systems: Actual production lines often need to interface with MES / quality management systems / traceability systems to output structured results usable in production. Existing methods are mostly research and verification-oriented, lacking engineering elements such as unified output formats, batch management, interface protocols, and access control auditing, resulting in high integration costs and difficulties in implementation.
[0004] In summary, although existing technologies have made some progress in detection accuracy, they still generally suffer from engineering deficiencies in industrial settings, such as real-time throughput, stability and robustness, board type adaptation, result traceability, report management, and closed-loop iteration. Therefore, there is an urgent need for a PCB defect detection method and system designed for industrial environments, capable of stable and efficient detection under complex conditions, and possessing closed-loop capabilities including batch detection, real-time triggering, structured result storage, report output, and self-learning for manual review, in order to improve detection efficiency and quality management. Summary of the Invention
[0005] The purpose of this invention is to provide a method and system for real-time detection of industrial-grade PCB defects based on hybrid architecture and edge enhancement. This method and system for real-time detection of industrial-grade PCB defects based on hybrid architecture and edge enhancement can significantly improve the throughput and operational stability of production lines while meeting the requirements for detection accuracy, and reduce the cost of manual screening and maintenance.
[0006] To achieve the above objectives, embodiments of the present invention provide a method for real-time detection of industrial-grade PCB defects based on hybrid architecture and edge enhancement. The method includes: Image acquisition and preprocessing: Acquire the PCB image to be inspected; preprocess the acquired PCB image, including size scaling, normalization, color space conversion, noise suppression, image enhancement and format conversion; Backbone feature extraction based on CSP structure: The input features of the preprocessed image are split into two paths in the channel dimension. One path enters the main branch to perform convolution transformation and several layers of feature extraction modules to obtain higher-level semantic features, while the other path serves as a shortcut branch to directly transmit information. The output of the main branch and the output of the shortcut branch are fused to obtain the output feature map of the current stage. Multi-scale edge information enhancement: Adaptive average pooling, convolution transformation, extraction and enhancement of defect boundaries, and upsampling alignment are sequentially performed on the output feature map through a preset number of parallel scale branches; the features sampled and aligned by the preset number of parallel scale branches are fused to obtain an enhanced feature map. Feature fusion and detection head prediction: The enhanced feature map is input into the neck feature fusion network or directly into the detection head. The neck feature fusion network integrates semantic information and spatial detail information at different levels of the enhanced feature map. The detection head classifies and regresses the fused features, outputting the class probability, bounding box position parameters and confidence score of each candidate target, and obtaining the PCB defect detection result.
[0007] Preferably, the step of sequentially performing adaptive average pooling, convolutional transformation, extraction and enhancement of defect boundaries, and upsampling alignment on the output feature map through a preset number of parallel scale branches includes: Adaptive average pooling is applied to the features of the input feature map to form contexts at different scales; Feature transformation is performed using convolutional layers; The edge enhancer first obtains the edge response by subtracting the average pooling result from the feature, and then outputs the edge enhancement feature by connecting it with the residual through a 1×1 convolution. Upsample the output to make the resolution of each branch output consistent with the target fusion resolution.
[0008] Preferably, the edge enhancer first obtains the edge response by subtracting the average pooling result from the feature, and then outputs the edge enhancement feature through a 1×1 convolution and residual connection, including: The input feature map is F e ∈R C×H×W The edge enhancer first performs smoothing subtraction to obtain the edge / high-frequency components: ; in, For adaptive average pooling; Then perform a 1×1 transformation on the edge components, and add the residuals of the transformations to the original features to obtain the enhanced features: .
[0009] Preferably, the image enhancement includes random flipping, random rotation, brightness and contrast perturbation, and random cropping.
[0010] Preferably, after feature fusion and detection head prediction, the method further includes: Results and Applications: The PCB defect detection results output by the detection head are filtered by confidence threshold, non-maximum suppression (NMS), or end-to-end matching to obtain the final defect target set.
[0011] In addition, the present invention also provides a system for real-time detection of industrial-grade PCB defects based on hybrid architecture and edge enhancement, the system comprising: The image acquisition and preprocessing structure is used to: acquire the PCB image to be inspected; and preprocess the acquired PCB image, including size scaling, normalization, color space conversion, noise suppression, image enhancement, and format conversion. The task management structure is used to: receive detection trigger instructions and generate detection tasks. The detection trigger instructions include at least batch detection trigger instructions and real-time monitoring trigger instructions. In batch detection mode, the batch number folder is traversed, files are verified and batched, and then sent to the model inference structure. In real-time monitoring mode, file creation events and / or file modification events in the monitoring directory are listened to and detection tasks are automatically generated when the events are triggered. The model inference structure is used to: load the defect detection model and perform inference on the image data to be detected, and output defect candidate results, wherein the defect candidate results include at least the defect category, location coordinates and confidence level; wherein the defect detection model adopts a hybrid architecture of CNN and Transformer, and introduces multi-scale information enhancement and edge detail enhancement mechanisms to improve the detection capability of small defects and reduce false detections and false negatives. The output generation structure is used to: write the structured detection results into a production-ready result file, and generate annotation files and / or defect image export files for training and / or manual review, so that downstream production systems can call them and support sample accumulation; The data persistence structure is used to write batch information, test results and their associated information into the database to achieve traceability; the associated information includes at least image identifiers, defect details, review records, output status and / or model version information. The human-computer interaction structure is used to: configure testing parameters, display testing progress and statistical information, and provide report export and manual review entry points to support testing process management, result display, quality statistics and review and correction; The output and application structure is used to: perform confidence threshold filtering, non-maximum suppression (NMS) or end-to-end matching filtering on the PCB defect detection results output by the detection head to obtain the final defect target set.
[0012] Preferably, the task management structure is used to: after receiving a batch detection trigger instruction, traverse the batch number folder and verify the files, filter out files that do not meet the preset format, and send the verified images to the model inference structure in a preset batch size group, so as to improve the batch detection throughput efficiency.
[0013] Preferably, the task management structure includes a folder monitoring unit, which is used to listen for file creation events and / or file modification events in a preset monitoring directory, and automatically generate a detection task when the event is triggered, sending the newly added or updated images to the model inference structure to achieve online real-time detection.
[0014] Preferably, the model inference structure is configured to support CPU inference mode and GPU inference mode, and the inference mode is selected according to device availability and / or preset strategy to improve system deployment adaptability.
[0015] Preferably, the task management structure includes a concurrency control unit, which is used to set a maximum number of concurrent tasks for detection tasks and adopt queue scheduling to reduce resource contention and improve system stability.
[0016] Preferably, the model inference structure includes a model preloading unit and / or a result caching unit, used to preload model parameters before the detection task begins and reuse intermediate resources during continuous detection, so as to reduce startup latency and improve continuous detection efficiency.
[0017] Preferably, the output generation structure is used to generate at least two types of output, including: structured result files for production systems; and labeled files and / or defect image export files for manual review or training, so as to reduce the cost of interfacing with upstream and downstream systems and support sample accumulation.
[0018] Preferably, the data persistence structure includes a batch record table, a defect detail table, and a manual review table. The defect detail table is associated with the batch record table, and the manual review table is associated with the defect detail table, so as to achieve traceability and auditability of the test results.
[0019] Preferably, the human-computer interaction structure and / or output generation structure includes a report generation unit, which is used to statistically summarize the test results in the database according to date range, batch number, product type and / or defect category, and export test report files to support quality management and process analysis.
[0020] Preferably, the human-computer interaction structure provides a manual review interface for confirming, rejecting, or correcting the test results, and writes the review conclusion into the data persistence structure to reduce the production costs caused by false detections and missed detections.
[0021] Preferably, the industrial-grade PCB defect real-time detection system further includes a training data collection structure, which is used to automatically collect true positive samples, false positive samples and / or false negative samples based on the conclusions of manual review, and generate a retraining dataset to achieve continuous iterative improvement of the model.
[0022] Through the above technical solution, this invention not only applies the defect detection model to PCB defect identification, but also constructs a closed-loop processing chain for industrial sites, encompassing "image acquisition and preprocessing—task scheduling—model inference—result processing—result output—data persistence—reporting and manual review—retraining data collection." Specifically, the task management structure enables batch detection and real-time monitoring triggering; the model inference structure combines a hybrid architecture and edge enhancement mechanisms to improve the detection capability of small defects; the result processing structure, output generation structure, and data persistence structure jointly achieve structured output of detection results, database traceability, and downstream system integration; and the human-computer interaction structure further supports report statistics, manual review, and continuous iteration, thereby improving production line detection efficiency, operational stability, traceability, and system maintenance convenience. Other features and advantages of this invention will be described in detail in the subsequent detailed implementation section. Attached Figure Description
[0023] The accompanying drawings are provided to further illustrate embodiments of the present invention and form part of the specification. They are used together with the following detailed description to explain the embodiments of the present invention, but do not constitute a limitation thereof. In the drawings: Figure 1 This is a distribution map of the private PCB dataset; Figure 2 This is a schematic diagram of the model framework of the present invention; Figure 3 This is a schematic diagram of the backbone feature extraction unit based on the CSP structure; Figure 4 This is a schematic diagram of a multi-scale edge information enhancement structure; Figure 5 A schematic diagram of the Edge Enhancer and its calculation process; Figure 6 Workflow diagram; Figure 7 System main interface; Figure 8 Main interface for exporting reports; Figure 9 Database structure diagram; Figure 10 Monitoring workflow diagram; Figure 11 Schematic diagram of edge enhancement effect; Figure 12 Overall architecture diagram and core design pattern of PCB defect detection system. Detailed Implementation
[0024] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit the scope of the present invention.
[0025] I. System Overall Structure and Functional Modules In addition to providing defect detection models and methods, this invention also provides an industrial-grade PCB defect detection system for batch detection, real-time monitoring triggering, result storage, report export, manual review, and self-learning data collection in production / offline quality inspection scenarios. The system comprises a presentation layer, a service layer, a domain layer, and an infrastructure layer. The presentation layer provides the human-computer interaction interface; the service layer is responsible for the business orchestration of detection services, monitoring services, report services, image export services, manual review services, and self-learning services; the domain layer includes core logic such as a detection worker, model runner, result processor, and output generator; and the infrastructure layer provides supporting capabilities such as database, configuration management, log system, and file monitoring.
[0026] The core functions of the system include: (1) Batch inspection: Automatically scan and detect defects in PCB images within a specified folder; (2) Real-time monitoring: Monitor folder changes and automatically trigger the detection process; (3) Output of results: Generate YOLO annotation files and binary result files required for production; (4) Manual review: Supports manual review and correction of test results; (5) Report Export: Generate Excel inspection reports and point reports; (6) Image export / self-learning data collection: Based on the pre-set reliability threshold, image quality rules and manual review conclusions corresponding to the defect category, the detection samples are stratified and screened, and a retraining dataset for subsequent model training and iteration is exported.
[0027] II. Defect Detection Model Structure The defect detection model of this invention can be implemented using an end-to-end target detection model. The following is only a preferred implementation; specific implementations are not limited to this structure. RT-DETR (Real-Time Target Detection Transformer) is a high-efficiency end-to-end target detection model based on a hybrid encoder-decoder architecture, specifically designed for real-time detection. The following is the image processing flow in this model: Input image features: First, the image undergoes feature extraction via the backbone network, yielding feature maps for the final three stages (S3, S4, and S5). These feature maps are then fed into the model's encoder. Notably, the Transformer's intra-scale interaction is applied only to S5, instead of combining multi-scale features for full Transformer encoding as is common in many DETR variants.
[0028] High-efficiency hybrid encoder: The core of RT-DETR is its high-efficiency hybrid encoder, which transforms multi-scale features into a sequence of image features through two main modules: Attention-based Same-Scale Feature Interaction (AIFI): This module enhances the model's ability to process features at the same scale, focusing on processing high-level semantic features.
[0029] Cross-scale feature fusion (CCFF) based on convolutional neural networks: This module effectively fuses features at different scales, avoiding unnecessary computational overhead, thereby improving both accuracy and speed.
[0030] Query selection: After the encoder processes image features, the model uses a minimum uncertainty query selection strategy to select a certain number of high-confidence features from the encoder as initial object queries to be passed to the decoder. This query selection method ensures that only high-quality queries are passed to the decoder by optimizing classification and localization features.
[0031] Transformer Decoder: The decoder, based on a transformer architecture, receives these selected queries and processes each query progressively through multiple levels. Each iteration optimizes these object queries (i.e., predicted bounding boxes and object categories), progressively improving accuracy and the quality of object localization. The decoder also includes an auxiliary prediction head for generating the categories and bounding boxes of detected objects.
[0032] Final Object Prediction: After the decoder progressively optimizes the query, the model generates the final object prediction, including the category (classification) and bounding box coordinates, as the detection result output. This end-to-end architecture makes RT-DETR highly efficient in real-time applications. The hybrid encoder enables effective processing of multi-scale features of the image, and the minimum uncertainty query selection ensures that only high-quality features are used for object detection. These optimizations allow RT-DETR to achieve a good balance between speed and accuracy, making it suitable for real-time object detection tasks. Furthermore, RT-DETR supports model expansion, allowing adaptation to different real-time detection needs by adjusting the depth and width of the encoder and decoder layers without retraining the model.
[0033] The overall process is as follows: The multi-scale edge information enhancement structure includes: an input end, multiple parallel scale branches, a feature alignment unit, and a fusion output unit.
[0034] Input: Receives feature maps F from the neck network or backbone network. e .
[0035] Parallel scaling branch: For each branch K: Adaptive average pooling is applied to the input features to form contexts at different scales; the idea of expanding the receptive field by using average pooling can reduce computational complexity and enhance multi-scale representation. Feature transformation is performed using convolutional layers; Edge information is extracted and enhanced through an edge enhancer: the edge enhancer first obtains the edge response by subtracting the average pooling result from the feature, and then outputs the edge enhancement feature through a 1×1 convolution and residual connection. Specifically, the input feature map is F. e ∈R C×H×W The edge enhancer first performs a "smooth subtraction" to obtain the edge / high-frequency components: AAP is an adaptive average pooling method. Then perform a 1×1 transformation on the edge components, and add the residuals of the transformations to the original features to obtain the enhanced features: Upsample the output to make the resolution of each branch output consistent with the target fusion resolution.
[0036] Feature alignment and fusion output unit: It concatenates the features of each scale branch and fuses them through convolution to output enhanced features.
[0037] Compared with existing technologies, this invention realizes a closed-loop process from "batch / real-time detection - result output - database traceability - report statistics - manual review - self-learning data accumulation", which can effectively improve detection stability and generalization ability in complex industrial environments and multi-plate scenarios. It improves the detection rate of small target defects by enhancing multi-scale and edge information, and reduces the cost of manual screening and repetitive operations by engineering scheduling and resource adaptation, thereby improving production line detection efficiency and quality management level.
[0038] The defect detection model introduces multi-scale information enhancement and edge detail enhancement mechanisms. "Multi-scale" includes: firstly, a wide range of scale (boundary width / height or area) distribution of defect targets at the data level, with small and large defects coexisting, such as... Figure 1 First, a defect distribution map of the dataset; second, at the feature level, features are extracted and fused in parallel at different spatial resolutions / receptive field levels (e.g., features from different levels of the backbone network or the same feature is pooled at different scales and then aligned and fused) to simultaneously preserve small defect details and global context information, thereby improving the ability to detect small target defects and reducing false positives and false negatives.
[0039] The "industrial grade" is reflected in the following: the system supports automated scheduling for both batch and real-time detection modes, and has CPU / GPU adaptive inference, concurrent queue control, and model preloading and reuse mechanisms, enabling it to stably process massive amounts of high-resolution images under continuous operation conditions; at the same time, it forms a closed loop through structured result output, persistent database traceability, automatic report generation, manual review, and self-learning data accumulation, meeting the production line's engineering requirements for real-time performance, stability, traceability, and maintainability.
[0040] Example 1: Model Framework Figure 2 This is a model framework diagram of the present invention. The PCB defect detection method provided by the present invention includes: an image acquisition and preprocessing step, a backbone feature extraction step based on a CSP structure, a multi-scale edge information enhancement step, a feature fusion and detection head prediction step, and a result output step.
[0041] The image acquisition and preprocessing process specifically involves acquiring the PCB image to be detected, which is sourced from production line camera captures, offline image libraries, or public datasets. The acquired PCB image undergoes preprocessing, including but not limited to: size scaling, normalization, color space conversion, noise suppression, image enhancement, and format conversion. Image enhancement may include random flipping, random rotation, brightness / contrast perturbation, and random cropping to improve the model's robustness to complex textures and lighting variations. The preprocessed image is then used as the input image for the detection model.
[0042] The backbone feature extraction network adopts a CSP (Cross-Stage Partial Network) structure, such as... Figure 3 The input features are split into two paths along the channel dimension. One path enters the main branch to perform convolutional transformations and several layers of feature extraction modules to obtain higher-level semantic features, while the other path serves as a shortcut branch for direct information transmission. Subsequently, the outputs of the main branch and the shortcut branch are fused (e.g., concatenated or summed) to obtain the output feature map for the current stage. This approach reduces redundant computation and improves gradient flow, thereby increasing the feature extraction efficiency of the backbone network.
[0043] The specific content of the multi-scale edge information enhancement is as follows: Figure 4 The diagram shown is a schematic of the multi-scale edge information enhancement structure in an embodiment of the present invention. The target feature map from the backbone network or neck network is input into the multi-scale edge information enhancement structure, which includes multiple parallel scale branches and a fusion output unit.
[0044] In this embodiment, the number of parallel scale branches is preferably four, and each scale branch includes: an adaptive average pooling unit, a convolution transformation unit, an edge enhancer, and an upsampling alignment unit.
[0045] Adaptive average pooling unit: Performs adaptive average pooling on the input feature map to obtain context features at different scales, thereby aggregating background and defect information within different receptive fields; different branches correspond to different pooling output scales or different pooling kernel sizes to construct multi-scale representations.
[0046] Convolutional Transformation Unit: Performs convolutional transformation on the pooled features to complete channel adjustment and enhance local detail representation; the convolutional layer can be a 1×1 convolution, a 3×3 convolution or a combination thereof, and may also contain normalization and activation functions.
[0047] Edge enhancer: such as Figure 5 The diagram shows a schematic of an edge enhancer. The edge enhancer is used to extract and enhance defect boundary information. Its processing includes: performing average pooling on the branch input features to obtain smoothed features; then differencing the original features with the smoothed features to obtain edge response features; subsequently, performing a 1×1 convolution mapping on the edge response features and residual fusion with the original features to output enhanced edge features. This difference and residual enhancement method can highlight defect boundaries, texture abrupt changes, and fine structural information, improving the ability to express minute defects and defects with blurred boundaries.
[0048] Upsampling alignment unit: Upsamples the edge enhancement features output by each scale branch to make its spatial resolution consistent with the predetermined fusion resolution, which facilitates subsequent cross-scale fusion.
[0049] The fusion output unit is used to fuse the features upsampled and aligned at each scale branch. The fusion method includes, but is not limited to, feature concatenation and convolutional fusion. In this embodiment, channel-dimensional concatenation followed by convolutional layer fusion is preferred to output a feature map with multi-scale edge enhancement.
[0050] The feature fusion and detection head prediction process involves inputting the obtained enhanced feature map into the neck feature fusion network or directly into the detection head. The neck network can employ a top-down or bottom-up fusion structure to integrate semantic and spatial detail information from different levels. The detection head performs classification and regression prediction on the fused features, outputting the class probability, bounding box position parameters, and confidence score for each candidate target, thus obtaining the PCB defect detection result.
[0051] The specific content of the output and application involves post-processing the detection head output. Post-processing includes, but is not limited to, confidence threshold filtering, non-maximum suppression (NMS), or end-to-end matching filtering to obtain the final defect target set. The final output includes: defect category, defect location, defect confidence level, and defect quantity statistics. The detection results can be used for real-time rejection on the production line, defective product alarms, defect traceability analysis, or the generation of quality inspection reports.
[0052] When using the PCB defect detection method provided by this invention, the system can execute the above steps on an edge computing device or server to achieve real-time defect detection of PCB images. By introducing a high-efficiency backbone network based on CSP architecture and a multi-scale edge information enhancement structure, the model computation overhead can be reduced while ensuring detection accuracy, and the detection capability for small-sized, low-contrast, and unclear-boundary defects can be improved, thereby meeting the real-time and stability requirements of industrial sites.
[0053] Example 2: Systematization and workflow of PCB defect detection based on the aforementioned model (I) System Composition like Figure 6 As shown in the system workflow diagram, the PCB defect detection system includes: 1) Detection module: such as Figure 7 The system's main interface is shown. It's used to scan the image to be detected, invoke the model for inference, and generate detection results. The detection module is coordinated by the detection worker, sequentially executing steps such as scanning, verification, inference, result processing, output generation, and data storage.
[0054] 2) Model running module: Used to load the weights of the trained RT-DETR detection model and perform single / batch image inference, supporting GPU / CPU device selection and threshold configuration.
[0055] 3. Results Processing Module: This module performs coordinate transformation, confidence filtering, defect type mapping, and statistical summarization on the model output to obtain structured detection results.
[0056] 4. Output generation module: This module is used to generate various target output formats from the structured defect detection results output by the results processing module. The output generation module includes a label file generation submodule and a binary result encapsulation submodule. The label file generation submodule generates YOLO format label files for sample accumulation and subsequent model training. The binary result encapsulation submodule maps and serializes defect detection result objects according to a preset field order and writes them into a binary result file for direct reading and use by production systems, traceability systems, or downstream business systems.
[0057] Preferably, the binary result encapsulation submodule first constructs a structured result object containing batch information, image identifier, defect category, defect location, confidence level and / or result status, and then generates a target binary file through file creation, archiving and writing and resource closing processes, and writes the file path and output status to the data persistence module.
[0058] 5. Real-time monitoring module: Used to monitor file creation / modification events in a specified folder, automatically triggering detection tasks to achieve real-time detection without manual clicking.
[0059] 6. Reporting module: such as Figure 8 The report export interface is used to query the database by batch or time range, generate inspection summary reports, detailed reports, defect type reports and point reports, and export them as Excel files.
[0060] 7. Manual Review Module: This module generates a list of tasks to be reviewed based on the inspection results. It loads the original PCB image and corresponding defect candidate boxes into the review interface, displaying image identifiers, defect categories, location coordinates, confidence levels, and batch information to the reviewers. Reviewers can perform operations such as confirmation, rejection, category modification, box coordinate adjustment, defect addition, and remarks for each candidate defect. The system writes the review conclusions into the manual review table and updates the review status in the defect details table to form the basis for review statistics and subsequent training samples.
[0061] 8. Self-learning data collection module: This tool is used to perform stratified screening of detection / review results based on pre-set reliability thresholds corresponding to defect categories, image quality verification results, and manual review conclusions, and to export a retraining dataset to support model iteration and continuous improvement.
[0062] The stratified screening of samples includes at least the following: (1) Detection samples with confidence scores higher than the first threshold of the corresponding category and passing the image quality check are selected as candidate positive samples; (2) Add the test samples with confidence levels within the preset range to the queue to be reviewed, and decide whether to export them after manual review; (3) Detection samples below the second threshold are marked as low confidence samples and are not directly exported as positive samples; (4) Collect false positive samples that were manually verified and confirmed as false positive samples, and collect false negative samples that were manually filled in or labeled. (5) Filter or remove duplicate images, blurry images, images with abnormal exposure, bounding box samples, and samples with class conflicts to reduce the probability of problematic data entering the retraining dataset.
[0063] 9. Database module: such as Figure 9The database structure diagram supports persistent testing results, real-time monitoring and deduplication, closed-loop manual review, report statistics, and retraining data accumulation. This database is not merely for storing testing results; rather, it establishes a multi-table data architecture around the industrial testing process, including batch record tables, defect detail tables, folder cache tables, and manual review tables.
[0064] The batch record table records the batch number, product type, detection start time, end time, model version, task status, and result file path; the defect details table records the image identifier, defect category, defect location coordinates, confidence level, batch, and export status; the folder cache table records the path, modification time, hash value, or status flag of processed files to support incremental detection, duplicate filtering, and anomaly recovery in monitoring scenarios; and the manual review table records the review conclusion, corrected defect category / frame coordinates, reviewer, review time, and remarks.
[0065] The folder cache table is used to record the file identifier, modification time, and processing status of processed images in real-time monitoring mode. When the monitoring module detects a directory change event, it first determines whether the corresponding image is a newly added file or a validly updated file based on the cache table. Detection tasks are only generated for images that have not been processed or have undergone valid changes, thereby reducing repeated inference and repeated data entry and improving the detection throughput efficiency in continuous operation scenarios.
[0066] The batch record table uses batch_id as the primary key, the defect details table uses defect_id as the primary key and is associated with the batch record table through batch_id, and the manual review table uses review_id as the primary key and is associated with the defect details table through defect_id, thus forming a full-link traceability relationship of "batch - defect - review - retraining sample".
[0067] (II) Inspection Workflow After the user selects the batch number folder on the interface, the system starts the detection. The system creates a background detection thread and calls the detection service. The detection service starts the detection worker and completes the folder scanning, model loading, batch inference, result processing, output file generation and database writing in sequence. Finally, it returns the results and updates the interface display.
[0068] (III) Binary Result Generation Process After the result processing module completes defect screening, coordinate organization, and category mapping, the output generation module receives the structured detection results. The binary result encapsulation submodule constructs a result object according to preset field organization rules and creates a target file. Subsequently, the result object is serialized into a byte stream and written to the target file through an archive writing mechanism to form a binary result file. After the file is written, the writing resource is closed, and the path, batch, generation time, and output status of the binary result file are written to the database for subsequent traceability and downstream system calls.
[0069] (iv) Monitoring Workflow like Figure 10 The monitoring workflow diagram illustrates this process. After the system starts monitoring, the file monitoring module continuously listens for directory changes. When a new image file creation / modification event is detected, the detection service is triggered to automatically start the detection process, achieving real-time detection and automatic data entry.
[0070] (v) Report / Status Tracking Workflow After the user selects the report type and time range, the reporting module uses a thread to call the reporting service to query the database for detection records and defect records, perform statistical aggregation, and generate an Excel report file.
[0071] (vi) Manual review workflow After completing the detection and writing to the database, the system adds the samples to be reviewed to the review queue according to preset rules. These rules include, but are not limited to, the confidence level being within a preset range, belonging to a high-risk defect category, having category conflicts, or being selected for review by a user-specified batch. After the reviewer selects the batch or image to be reviewed in the interface, the system reads the corresponding image path, defect details, and review status from the database, loads the original image, and overlays the detection frame, defect category, and confidence level information onto the image. The reviewer can perform actions such as confirmation, rejection, category modification, frame coordinate adjustment, defect addition, and remarks. The system writes the review results to the manual review table and simultaneously updates the category, location coordinates, review status, and update time in the defect details table.
[0072] For samples that have been verified, the system can generate corrected annotation files or defect image export files; for rejected samples, they can be marked as false positives; for manually added missed targets, they can be written into the retraining dataset as false negative supplementary samples.
[0073] (vii) Self-learning data collection process After the detection results are written to the database, the self-learning data collection module performs preliminary stratification of the samples based on the preset reliability thresholds corresponding to the defect categories.
[0074] For samples with a confidence level higher than the first threshold and that pass the image quality verification, the system marks them as candidate positive samples; for samples with a confidence level between the first and second thresholds, the system adds them to the review queue, where reviewers can confirm, reject, modify the category, or adjust the bounding box coordinates in the manual review interface; for samples below the second threshold, the system does not directly export them as positive samples.
[0075] True positive samples, false positive samples, and false negative samples added manually are written into the training data collection results table. Subsequently, the system generates corrected annotation files and / or defect image export files based on the verified category, coordinates, and image path, and organizes the catalog by batch, defect category, model version, or verification status to form a traceable retraining dataset.
[0076] Preferably, the system further performs duplicate sample filtering, blur / exposure anomaly sample filtering, anomaly box filtering, and category consistency checks before exporting, in order to reduce problematic data from entering the retraining dataset and improve the stability of subsequent model iterations.
[0077] Example 3 This invention provides a system for real-time detection of industrial-grade PCB defects based on a hybrid architecture and edge enhancement. The system includes: an image acquisition and preprocessing structure for: acquiring an image of the PCB to be detected; preprocessing the acquired PCB image, wherein the preprocessing includes size scaling, normalization, color space conversion, noise suppression, image enhancement, and format conversion; a backbone feature extraction structure based on a CSP structure for: splitting the input features of the preprocessed image into two paths in the channel dimension, one path entering the main branch to perform convolution transformation and several layers of feature extraction modules to obtain higher-level semantic features, and the other path serving as a shortcut branch for direct information transmission; fusing the output of the main branch and the output of the shortcut branch to obtain the output feature map of the current stage; and a multi-scale edge information enhancement structure for: using a preset number of... The output feature map is sequentially processed by an adaptive average pooling unit, a convolutional transformation unit, an edge enhancer, and an upsampling alignment unit through a number of parallel scale branches. The features sampled and aligned by a predetermined number of parallel scale branches are fused to obtain an enhanced feature map. The feature fusion and detection head prediction structure is used to: input the enhanced feature map into the neck feature fusion network or directly into the detection head; the neck feature fusion network integrates semantic and spatial detail information from different levels of the enhanced feature map; and the detection head performs classification and regression prediction on the fused features, outputting the class probability, bounding box position parameters, and confidence score of each candidate target to obtain the PCB defect detection result. The result output and application structure is used to: perform confidence threshold filtering, non-maximum suppression (NMS), or end-to-end matching filtering on the PCB defect detection result output by the detection head to obtain the final defect target set.
[0078] Preferably, the multi-scale edge information enhancement structure is used for: Adaptive average pooling is applied to the features of the input feature map to form contexts at different scales; Feature transformation is performed using convolutional layers; The edge enhancer first obtains the edge response by subtracting the average pooling result from the feature, and then outputs the edge enhancement feature by connecting it with the residual through a 1×1 convolution. Upsample the output to make the resolution of each branch output consistent with the target fusion resolution.
[0079] Preferably, the multi-scale edge information enhancement structure is used for: The input feature map is F e ∈R C×H×W The edge enhancer first performs smoothing subtraction to obtain the edge / high-frequency components: ; in, For adaptive average pooling; Then perform a 1×1 transformation on the edge components, and add the residuals of the transformations to the original features to obtain the enhanced features: .
[0080] Preferably, the result output and application structure includes: a result processing module and an output generation module; The result processing module is used to perform coordinate transformation, confidence filtering, defect type mapping and statistical summarization on the PCB defect detection results output by the detection head to obtain structured detection results; The output generation module includes a label file generation submodule for generating YOLO format label files and a binary result encapsulation submodule. The binary result encapsulation submodule is used to serialize and encode the structured detection result object output by the result processing module according to a preset field order, and generate a binary result file for external systems to read.
[0081] Preferably, the image enhancement includes random flipping, random rotation, brightness and contrast perturbation, and random cropping.
[0082] Preferably, after feature fusion and detection head prediction, the method further includes: Results and Applications: The PCB defect detection results output by the detection head are filtered by confidence threshold, non-maximum suppression (NMS), or end-to-end matching to obtain the final defect target set.
[0083] Example 4 This invention also provides a system for real-time detection of industrial-grade PCB defects based on a hybrid architecture and edge enhancement. The system includes: The image acquisition and preprocessing structure is used to: acquire the PCB image to be inspected; and preprocess the acquired PCB image, including size scaling, normalization, color space conversion, noise suppression, image enhancement, and format conversion. The task management structure is used to: receive detection trigger instructions and generate detection tasks. The detection trigger instructions include at least batch detection trigger instructions and real-time monitoring trigger instructions. In batch detection mode, the batch number folder is traversed, files are verified and batched, and then sent to the model inference structure. In real-time monitoring mode, file creation events and / or file modification events in the monitoring directory are listened to and detection tasks are automatically generated when the events are triggered. The model inference structure is used to: load the defect detection model and perform inference on the image data to be detected, and output defect candidate results, wherein the defect candidate results include at least the defect category, location coordinates and confidence level; wherein the defect detection model adopts a hybrid architecture of CNN and Transformer, and introduces multi-scale information enhancement and edge detail enhancement mechanisms to improve the detection capability of small defects and reduce false detections and false negatives. The output generation structure is used to: write the structured detection results into a production-ready result file, and generate annotation files and / or defect image export files for training and / or manual review, so that downstream production systems can call them and support sample accumulation; The data persistence structure is used to write batch information, test results and their associated information into the database to achieve traceability; the associated information includes at least image identifiers, defect details, review records, output status and / or model version information. The human-computer interaction structure is used to: configure testing parameters, display testing progress and statistical information, and provide report export and manual review entry points to support testing process management, result display, quality statistics and review and correction; The output and application structure is used to: perform confidence threshold filtering, non-maximum suppression (NMS) or end-to-end matching filtering on the PCB defect detection results output by the detection head to obtain the final defect target set.
[0084] Preferably, the task management structure is used to: after receiving a batch detection trigger instruction, traverse the batch number folder and verify the files, filter out files that do not meet the preset format, and send the verified images to the model inference structure in a preset batch size group, so as to improve the batch detection throughput efficiency.
[0085] Preferably, the task management structure includes a folder monitoring unit, which is used to listen for file creation events and / or file modification events in a preset monitoring directory, and automatically generate a detection task when the event is triggered, sending the newly added or updated images to the model inference structure to achieve online real-time detection.
[0086] Preferably, the model inference structure is configured to support CPU inference mode and GPU inference mode, and the inference mode is selected according to device availability and / or preset strategy to improve system deployment adaptability.
[0087] Preferably, the task management structure includes a concurrency control unit, which is used to set a maximum number of concurrent tasks for detection tasks and adopt queue scheduling to reduce resource contention and improve system stability.
[0088] Preferably, the model inference structure includes a model preloading unit and / or a result caching unit, used to preload model parameters before the detection task begins and reuse intermediate resources during continuous detection, so as to reduce startup latency and improve continuous detection efficiency.
[0089] Preferably, the output generation structure is used to generate at least two types of output, including: structured result files for production systems; and labeled files and / or defect image export files for manual review or training, so as to reduce the cost of interfacing with upstream and downstream systems and support sample accumulation.
[0090] Preferably, the data persistence structure includes a batch record table, a defect detail table, and a manual review table. The defect detail table is associated with the batch record table, and the manual review table is associated with the defect detail table, so as to achieve traceability and auditability of the test results.
[0091] Preferably, the human-computer interaction structure and / or output generation structure includes a report generation unit, which is used to statistically summarize the test results in the database according to date range, batch number, product type and / or defect category, and export test report files to support quality management and process analysis.
[0092] Preferably, the human-computer interaction structure provides a manual review interface for confirming, rejecting, or correcting the test results, and writes the review conclusion into the data persistence structure to reduce the production costs caused by false detections and missed detections.
[0093] Preferably, the industrial-grade PCB defect real-time detection system further includes a training data collection structure, which is used to automatically collect true positive samples, false positive samples and / or false negative samples based on the conclusions of manual review, and generate a retraining dataset to achieve continuous iterative improvement of the model.
[0094] Preferably, the model inference structure includes: Adaptive average pooling is applied to the features of the input feature map to form contexts at different scales; Feature transformation is performed using convolutional layers; The edge enhancer first obtains the edge response by subtracting the average pooling result from the feature, and then outputs the edge enhancement feature by connecting it with the residual through a 1×1 convolution. Upsample the output to make the resolution of each branch output consistent with the target fusion resolution.
[0095] Preferably, the edge enhancer of the model inference structure first obtains the edge response by subtracting the average pooling result from the features, and then outputs edge enhancement features through 1×1 convolution and residual connection, including: The input feature map is F e ∈R C×H×WThe edge enhancer first performs smoothing subtraction to obtain the edge / high-frequency components: ; in, For adaptive average pooling; Then perform a 1×1 transformation on the edge components, and add the residuals of the transformations to the original features to obtain the enhanced features: .
[0096] Preferably, after feature fusion and detection head prediction, the method further includes: Output and application structure: used to perform confidence threshold filtering, non-maximum suppression (NMS) or end-to-end matching filtering on the PCB defect detection results output by the detection head, so as to obtain the final defect target set.
[0097] Compared with the prior art, the present invention has at least the following beneficial effects: I. Beneficial Effects of the Algorithm Model Robustness and consistency brought by global modeling of Transformer: Transformer models global context and long-distance dependencies through self-attention mechanism, which can suppress local false responses caused by complex texture backgrounds, enabling the model to maintain more stable and consistent predictions in scenes with changes in lighting, noise interference and blurred boundaries, thereby improving robustness and reducing false detections.
[0098] The complementary advantages of CNN+Transformer fusion: CNN provides efficient local texture and edge detail representation, while Transformer provides global context and cross-scale relationship modeling. The fusion of the two can simultaneously improve the accuracy of small defect localization, background interference suppression, and cross-condition generalization stability under low overhead. Multi-scale enhancement: Parallel scale branching extracts defect information under different receptive fields, which can improve the detection rate of small defects and defects with scale changes; Edge detail enhancement: The edge enhancer highlights the boundary response by using the difference between the original feature and its average pooling feature, and combines 1×1 convolution with residual connections to enhance the expression of defect boundaries and fine structures; the enhancement effect is as follows. Figure 11 Schematic diagram of edge enhancement effect.
[0099] High efficiency and deployability: The CSP architecture reduces computational redundancy and improves gradient flow by splitting features into two paths, which is conducive to obtaining effective representations with lower computational overhead. Industrial real-time performance: While ensuring detection accuracy, it reduces the number of parameters and computational load, making it easier to achieve real-time detection and online quality inspection at the edge of the production line; Table 1 Comparison Experiment Results of Private PCB Dataset Table 2 Comparison results of publicly available datasets PKU-PCB II. Beneficial Effects at the System Level Compared to solutions that only provide algorithm models, this invention embeds the detection model into an industrial-grade PCB defect detection system, such as... Figure 12 The overall architecture diagram and core design pattern diagram of the PCB defect detection system realize a closed loop from "detection - storage - review - reporting - self-learning": 1. Supports batch detection and automated workflow: The system can scan, verify, perform batch inference, process results and generate output for specified folders, and write detection records to the database, reducing the time cost of manual inspection and sorting.
[0100] 2. Supports real-time monitoring triggering: The folder monitoring module listens for new / modified image events and automatically triggers detection tasks, enabling real-time detection and rapid feedback on the production line, thereby improving the overall detection throughput efficiency.
[0101] 3. Supports traceability of test results: Batch information, defect information and review modification information are recorded through batch library, defect library and review library, supporting traceability and statistical analysis by time / batch / defect type.
[0102] 4. Supports automatic report generation: The system can automatically generate inspection summary reports, detailed reports, defect type reports and point reports by batch or time range and export them to Excel, improving the efficiency of quality management.
[0103] 5. Supports manual review and continuous improvement: The system employs a training sample selection mechanism based on confidence thresholds, image quality rules, and manual review conclusions. This mechanism stratifies the detection results and identifies true positive, false positive, and false negative samples, reducing the risk of model drift caused by problematic data directly entering the training set. This improves the stability and effectiveness of subsequent model iterations.
[0104] Table 3. Statistical table of typical production line configuration and typical plate type conditions.
[0105] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0106] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for real-time defect detection in industrial-grade PCBs based on hybrid architecture and edge enhancement, characterized in that, The method for real-time detection of industrial-grade PCB defects based on hybrid architecture and edge enhancement includes: Image acquisition and preprocessing: Acquire the PCB image to be inspected; preprocess the acquired PCB image, including size scaling, normalization, color space conversion, noise suppression, image enhancement and format conversion; Backbone feature extraction based on CSP structure: The input features of the preprocessed image are split into two paths in the channel dimension. One path enters the main branch to perform convolution transformation and several layers of feature extraction modules to obtain higher-level semantic features, while the other path serves as a shortcut branch to directly transmit information. The output of the main branch and the output of the shortcut branch are fused to obtain the output feature map of the current stage. Multi-scale edge information enhancement: Adaptive average pooling, convolution transformation, extraction and enhancement of defect boundaries, and upsampling alignment are sequentially performed on the output feature map through a preset number of parallel scale branches; the features sampled and aligned by the preset number of parallel scale branches are fused to obtain an enhanced feature map. Feature fusion and detection head prediction: The enhanced feature map is input into the neck feature fusion network or directly into the detection head. The neck feature fusion network integrates semantic information and spatial detail information at different levels of the enhanced feature map. The detection head classifies and regresses the fused features, outputting the class probability, bounding box position parameters and confidence score of each candidate target, and obtaining the PCB defect detection result.
2. The method for real-time detection of industrial-grade PCB defects based on hybrid architecture and edge enhancement according to claim 1, characterized in that, The step of sequentially performing adaptive average pooling, convolutional transformation, extraction and enhancement of defect boundaries, and upsampling alignment on the output feature map through a preset number of parallel scale branches includes: Adaptive average pooling is applied to the features of the input feature map to form contexts at different scales; Feature transformation is performed using convolutional layers; The edge enhancer first obtains the edge response by subtracting the average pooling result from the feature, and then outputs the edge enhancement feature by connecting it with the residual through a 1×1 convolution. Upsample the output to make the resolution of each branch output consistent with the target fusion resolution.
3. The method for real-time detection of industrial-grade PCB defects based on hybrid architecture and edge enhancement according to claim 1, characterized in that, The edge enhancer first obtains the edge response by subtracting the average pooling result from the features, and then outputs edge enhancement features through 1×1 convolution and residual connection, including: The input feature map is F e ∈R C×H×W The edge enhancer first performs smoothing subtraction to obtain the edge / high-frequency components: ; in, For adaptive average pooling; Then perform a 1×1 transformation on the edge components, and add the residuals of the transformations to the original features to obtain the enhanced features: 。 4. The method for real-time detection of industrial-grade PCB defects based on hybrid architecture and edge enhancement according to claim 1, characterized in that, The image enhancement includes random flipping, random rotation, brightness and contrast perturbation, and random cropping.
5. The method for real-time detection of industrial-grade PCB defects based on hybrid architecture and edge enhancement according to claim 1, characterized in that, Following feature fusion and detector head prediction, the following is also included: Results and Applications: The PCB defect detection results output by the detection head are filtered by confidence threshold, non-maximum suppression (NMS), or end-to-end matching to obtain the final defect target set.
6. A system for real-time detection of industrial-grade PCB defects based on hybrid architecture and edge enhancement, characterized in that, The system for real-time detection of industrial-grade PCB defects based on hybrid architecture and edge enhancement includes: The image acquisition and preprocessing structure is used to: acquire the PCB image to be inspected; and preprocess the acquired PCB image, including size scaling, normalization, color space conversion, noise suppression, image enhancement, and format conversion. The task management structure is used to: receive detection trigger instructions and generate detection tasks. The detection trigger instructions include at least batch detection trigger instructions and real-time monitoring trigger instructions. In batch detection mode, the batch number folder is traversed, files are verified and batched, and then sent to the model inference structure. In real-time monitoring mode, file creation events and / or file modification events in the monitoring directory are listened to and detection tasks are automatically generated when the events are triggered. The model inference structure is used to: load the defect detection model and perform inference on the image data to be detected, and output defect candidate results, wherein the defect candidate results include at least the defect category, location coordinates and confidence level; wherein the defect detection model adopts a hybrid architecture of CNN and Transformer, and introduces multi-scale information enhancement and edge detail enhancement mechanisms to improve the detection capability of small defects and reduce false detections and false negatives. The output generation structure is used to: write the structured detection results into a production-ready result file, and generate annotation files and / or defect image export files for training and / or manual review, so that downstream production systems can call them and support sample accumulation; The data persistence structure is used to write batch information, test results and their associated information into the database to achieve traceability; the associated information includes at least image identification, defect details, review records, output status and / or model version information. The human-computer interaction structure is used to: configure testing parameters, display testing progress and statistical information, and provide report export and manual review entry points to support testing process management, result display, quality statistics and review and correction; The output and application structure is used to: perform confidence threshold filtering, non-maximum suppression (NMS) or end-to-end matching filtering on the PCB defect detection results output by the detection head to obtain the final defect target set.
7. The industrial-grade PCB defect real-time detection system based on hybrid architecture and edge enhancement according to claim 6, characterized in that, The task management structure is used to: after receiving a batch detection trigger instruction, traverse the batch number folder and verify the files, filter out files that do not meet the preset format, and send the images that pass the verification to the model inference structure in a preset batch size group, so as to improve the batch detection throughput efficiency.
8. The industrial-grade PCB defect real-time detection system based on hybrid architecture and edge enhancement according to claim 6, characterized in that, The task management structure includes a folder monitoring unit, which is used to listen for file creation events and / or file modification events in a preset monitoring directory, and automatically generate a detection task when the event is triggered, sending the newly added or updated images to the model inference structure to achieve online real-time detection.
9. The industrial-grade PCB defect real-time detection system based on hybrid architecture and edge enhancement according to claim 6, characterized in that, The model inference structure is configured to support both CPU and GPU inference modes, and the inference mode is selected based on device availability and / or a preset strategy to improve system deployment adaptability.
10. The industrial-grade PCB defect real-time detection system based on hybrid architecture and edge enhancement according to claim 6, characterized in that, The task management structure includes a concurrency control unit, which is used to set the maximum concurrency of detection tasks and adopt queue scheduling to reduce resource contention and improve system stability.