A method and system for detecting rotating targets on industrial circuit boards based on lightweight YOLOv5

By using an improved YOLOv5n-OBB model, combined with GhostConv, C3Ghost, and C3K2 modules, the accuracy and efficiency issues of dense small targets in industrial circuit board inspection were solved, and efficient deployment on edge computing devices was achieved.

CN122265254APending Publication Date: 2026-06-23DONGGUAN MOVISION AUTOMATION TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
DONGGUAN MOVISION AUTOMATION TECH CO LTD
Filing Date
2026-04-14
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Existing industrial circuit board inspection models suffer from low detection accuracy and high computational complexity when dealing with dense, small-sized rotating targets. It is difficult to achieve a balance between lightweight design and high precision, and it is also difficult to deploy efficiently on edge computing devices with limited computing power.

Method used

An improved YOLOv5n-OBB model is adopted. By introducing the GhostConv module into the backbone network and neck network to replace the standard convolutional layer, and replacing the original C3 module with the C3Ghost module and C3K2 module, and combining rotation nonmaximum suppression (RNMS) for post-processing, the number of model parameters and computational cost are reduced, while outputting the rotation box parameters.

Benefits of technology

It improves the detection accuracy of dense, small-sized rotating targets, reduces the number of model parameters and computational load, making it suitable for edge computing devices with limited computing power, and meeting the high-speed, high-precision, and low-power consumption requirements of industrial sites.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122265254A_ABST
    Figure CN122265254A_ABST
Patent Text Reader

Abstract

The application discloses a kind of industrial circuit board rotating target detection method and system based on light YOLOv5, the method includes: the high-definition image of the circuit board to be detected is obtained;Image is input to improved YOLOv5n-OBB model and inferences, the class information of each electronic component and the corresponding rotating frame parameter are output.The improved model is constructed by executing the following improvements in YOLOv5n-OBB benchmark model: in backbone network and neck network, GhostConv module is used to replace standard convolution layer, to reduce parameter quantity and calculation amount and retain spatial details;In backbone network, C3Ghost module constituted by a plurality of Ghost bottleneck layers in series is used to replace original C3 module, to realize the light weight extraction of deep features;In deep layer of backbone network and head network, C3K2 module is used to replace original C3 module, by stacking two small convolution kernels to replace large convolution kernel, while maintaining the receptive field, reduce the calculation complexity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent vision inspection technology in electronic manufacturing automation, and in particular to a method and system for detecting rotating targets on industrial circuit boards based on lightweight YOLOv5. Background Technology

[0002] As the electronics manufacturing industry moves towards intelligence and precision, automated optical inspection has become a crucial step in ensuring the quality of industrial circuit boards (such as printed circuit boards, PCBs). Deep learning-based target detection algorithms, especially the YOLO (You Only Look Once) series of models, have been widely applied to online inspection tasks of electronic components on circuit boards due to their superior performance in both speed and accuracy.

[0003] However, when targeting the specific application scenario of industrial circuit boards, existing general-purpose testing models still face the following technical bottlenecks:

[0004] First, electronic components on circuit boards (such as resistors, capacitors, and chips) are generally small in size, densely packed, and have different orientations. When locating these components, the horizontal bounding boxes used by traditional target detection algorithms introduce a lot of background noise, which leads to inaccurate calculation of the intersection-over-union (IoU) ratio between the predicted box and the real box, resulting in a significant decrease in detection accuracy.

[0005] To overcome the above problems, existing technologies have developed detection models that support rotating bounding boxes, such as YOLOv5n-OBB. Although these models can output bounding boxes with angular information, which better fit the actual shape of the components and improve positioning accuracy to some extent, the backbone network of YOLOv5n-OBB still follows the design paradigm of general object detection and has not been specifically optimized for dense small target scenes. Its feature extraction capability is still insufficient when facing densely arranged small components, which can easily lead to missed detections and false detections.

[0006] On the other hand, industrial sites have high requirements for the deployment environment of detection algorithms. To meet the real-time detection needs of production lines, algorithms usually need to be deployed on edge computing devices or embedded platforms with limited computing power (such as the NVIDIA Jetson series). Existing high-precision rotating target detection models often have a large number of parameters and high computational complexity, making it difficult to achieve a balance between lightweight and high precision. Even the lightweight versions of the YOLO series (such as YOLOv5n) still have considerable room for optimization in balancing accuracy and efficiency when dealing with rotating, densely packed small targets.

[0007] Therefore, how to design a lightweight detection model that can accurately detect dense, small-sized rotating targets while having low parameter and computational requirements, and enable it to be efficiently deployed on industrial edge computing devices to meet the high-speed, high-precision, and low-power detection needs of production lines, is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0008] The purpose of this section is to outline some aspects of embodiments of the present invention and to briefly describe some preferred embodiments. Simplifications or omissions may be made in this section, as well as in the abstract and title of this application, to avoid obscuring the purpose of these documents; however, such simplifications or omissions should not be construed as limiting the scope of the invention.

[0009] Therefore, to solve the above-mentioned technical problems, the present invention provides the following technical solution: a method for detecting rotating targets on industrial circuit boards based on lightweight YOLOv5, comprising the following steps:

[0010] S1: Acquire a high-resolution image of the industrial circuit board to be inspected;

[0011] S2: Input the high-definition image obtained in step S1 into the improved YOLOv5n-OBB model for inference, and output the category information of each electronic component and the corresponding rotation frame parameters.

[0012] The improved YOLOv5n-OBB model is constructed by performing the following improvements on the YOLOv5n-OBB baseline model:

[0013] In the backbone network and neck network, the GhostConv module is used to replace the standard convolutional layer in the YOLOv5n-OBB baseline model. The GhostConv module is used to generate basic feature maps first through a small number of convolutions, and then generate phantom feature maps from the basic feature maps through a series of linear transformations, so as to reduce the number of model parameters and computational cost, and preserve spatial detail information.

[0014] In the backbone network, the original C3 module in the YOLOv5n-OBB baseline model is replaced by the C3Ghost module. The C3Ghost module is composed of multiple Ghost bottleneck layers connected in series, which is used to achieve lightweight extraction of deep features while maintaining the cross-stage connection structure.

[0015] In the deep layers of the backbone network and the head network, the original C3 module in the YOLOv5n-OBB baseline model is replaced by the C3K2 module. The C3K2 module replaces the traditional large convolutional kernel by stacking two small convolutional kernels, which reduces computational complexity while maintaining the receptive field.

[0016] As a preferred embodiment of the industrial circuit board rotation target detection method based on lightweight YOLOv5 described in this invention, the GhostConv module is applied to the shallow layer of the backbone network, including the P2 / 4 and / or P3 / 8 feature stages.

[0017] As a preferred embodiment of the industrial circuit board rotation target detection method based on lightweight YOLOv5 described in this invention, the C3Ghost module is applied to the shallow and intermediate layers of the backbone network, including the P2 / 4 and / or P3 / 8 feature stages.

[0018] As a preferred embodiment of the industrial circuit board rotating target detection method based on lightweight YOLOv5 described in this invention, each Ghost bottleneck layer contains two GhostConv modules.

[0019] As a preferred embodiment of the industrial circuit board rotation target detection method based on lightweight YOLOv5 described in this invention, the C3K2 module is applied to the feature fusion path of the deep and head networks of the backbone network, including the P4 / 16 and / or P5 / 32 feature stages.

[0020] As a preferred embodiment of the industrial circuit board rotating target detection method based on lightweight YOLOv5 described in this invention, the prediction results are post-processed using rotational nonmaximum suppression (RNMS) after the inference of the improved YOLOv5n-OBB model to eliminate redundant detection boxes.

[0021] An industrial circuit board rotating target detection system based on lightweight YOLOv5, used to implement the industrial circuit board rotating target detection method based on lightweight YOLOv5 described above, the system comprising:

[0022] Image acquisition unit, used to acquire high-definition images of industrial circuit boards;

[0023] An edge computing unit, which is equipped with an improved YOLOv5n-OBB model, is used to perform real-time inference on the acquired images and output detection results.

[0024] The control unit is used to coordinate the start and stop of the conveyor belt according to the circuit board position signal and to trigger the image acquisition unit to work;

[0025] The human-computer interaction interface is connected to the edge computing unit and is used to visualize and display the detection results and alarm information. The detection results include the category information of electronic components, the defect type and its corresponding rotating frame.

[0026] As a preferred embodiment of the industrial circuit board rotation target detection method based on lightweight YOLOv5 described in this invention, the image acquisition unit is a high-resolution industrial camera configured to perform vertical orthophoto imaging on the horizontally transported circuit board.

[0027] As a preferred embodiment of the industrial circuit board rotation target detection method based on lightweight YOLOv5 described in this invention, the edge computing unit is an industrial computer or an embedded AI computing device.

[0028] As a preferred embodiment of the industrial circuit board rotation target detection system based on lightweight YOLOv5 described in this invention, the embedded AI computing device includes an NVIDIA Jetson series or an edge inference platform with equivalent computing power.

[0029] The beneficial effects of this invention are:

[0030] 1. This invention uses a rotating frame output, which makes the detection frame fit the actual contour of the component more closely, thus solving the problem that the traditional horizontal bounding box introduces a lot of background noise and causes a decrease in positioning accuracy.

[0031] 2. This invention introduces the C3Ghost and C3K2 modules into the backbone network, which enhances the network's ability to represent the features of small-sized components and perceive the contours of rotating targets, thus solving the problems of existing rotating box models not being optimized for dense small targets and being prone to missed detections and false detections.

[0032] 3. This invention replaces some standard convolutional layers with GhostConv modules in the backbone and neck networks, which greatly reduces the number of model parameters and computational load, and solves the problem that high-precision rotating target detection models are difficult to deploy on edge computing devices with limited computing power.

[0033] 4. This invention integrates GhostConv, C3Ghost, and C3K2 modules into an improved YOLOv5n-OBB model architecture. Through layered configuration, it achieves a balance between lightweight and high performance, solving the problem that lightweight versions of the YOLO series struggle to balance accuracy and efficiency when dealing with rotating and dense small targets. Attached Figure Description

[0034] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained from these drawings without creative effort.

[0035] Figure 1This is a flowchart of the method of the present invention.

[0036] Figure 2 This is the system architecture of the present invention.

[0037] Figure 3 This is a diagram of the improved YOLOv5n-OBB model architecture of the present invention. Detailed Implementation

[0038] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0039] Example 1

[0040] Reference Figures 1-3 The first embodiment of the present invention provides a method for detecting rotating targets on industrial circuit boards based on lightweight YOLOv5. This method is used to perform real-time and accurate category identification and rotation positioning of electronic components (such as resistors, capacitors, chips, etc.) on printed circuit boards (PCBs) on production lines.

[0041] Reference Figure 1 (Workflow diagram) The method of the present invention includes the following steps:

[0042] Step S1: Acquire a high-resolution image of the industrial circuit board to be inspected;

[0043] Specifically, when the circuit board is conveyed to the detection area by the conveyor belt, the photoelectric sensor detects the board position signal, and the control unit (such as PLC) triggers the image acquisition unit to work; the image acquisition unit uses a high-resolution industrial camera to perform vertical orthophoto imaging on the horizontally conveyed circuit board and obtain a high-definition BGR image containing the entire surface of the circuit board.

[0044] It is important to note that the high-resolution industrial camera is mounted in a fixed position to ensure a consistent imaging angle, providing high-quality image data for subsequent accurate inspection.

[0045] Step S2: Input the high-resolution image obtained in step S1 into the improved YOLOv5n-OBB model for inference, and output the category information and corresponding rotation box parameters for each electronic component. The specific steps are as follows:

[0046] In the edge computing unit (embedded AI device), a pre-trained improved YOLOv5n-OBB model is pre-deployed; before the image is input into the model, preprocessing operations are first performed:

[0047] Image reading and format conversion: Read in raw BGR format images;

[0048] Size adjustment: Resize the image to the model input size (480×480 in this example). For the blank areas generated after adjustment, use a gray value of 114 pixels to fill them in order to maintain the image ratio while meeting the model input requirements.

[0049] Channel and Dimension Conversion: Convert image data from H×W×C format to C×H×W format to adapt to the data organization method of the model inference framework;

[0050] Batch processing dimension expansion: Add a batch processing dimension to the first dimension to convert a single image into a batch data format with a shape of 1×C×H×W;

[0051] After preprocessing, the image data is fed into the improved YOLOv5n-OBB model for forward inference. The model outputs the category (e.g., resistor, capacitor) of each detected component and the rotation box parameters representing its position and orientation on the feature maps at three scales: P3, P4, and P5. These parameters include the center coordinates (x, y), the width w of the rotation box, the height h of the rotation box, and the rotation angle. Confidence (conf) and class (class); where rotation angle This is a key parameter for distinguishing the rotation direction of components. Traditional horizontal box models (such as YOLOv5n) cannot directly output this parameter, resulting in a decrease in the detection accuracy of dense small targets.

[0052] After inference is completed, Rotational Nonmaximum Suppression (RNMS) is used to filter out redundant detection boxes, resulting in the final simplified detection results.

[0053] Step S2 involves a lightweight improvement to the YOLOv5n-OBB baseline model, significantly reducing the number of model parameters and computational load while maintaining or even improving detection accuracy, making it more suitable for deployment on edge devices with limited computing power; the improved network structure is as follows. Figure 3 As shown, the specific improvements are as follows:

[0054] a. Replace the standard convolutional layer with the GhostConv module;

[0055] In the backbone and neck networks, GhostConv modules are used to replace some of the standard convolutional layers.

[0056] The GhostConv module works as follows: it generates a subset of intrinsic feature maps through a small number of standard convolutions, then applies a series of computationally less computationally expensive linear transformations (such as depthwise separable convolutions) to these intrinsic feature maps to generate multiple "ghost" feature maps; finally, it concatenates the intrinsic feature maps and the ghost feature maps along the channel dimension as the output of this layer.

[0057] The above design adopts a "feature redundancy generation" mechanism, which uses redundant information in the feature map to replace a large number of redundant convolution calculations with inexpensive operations, thereby significantly reducing the number of model parameters and computational cost, while effectively preserving spatial detail information.

[0058] It should be noted that in this embodiment, the GhostConv module is preferentially applied to the shallow feature stages of the backbone network, such as P2 / 4 (1 / 4 resolution feature map) and P3 / 8 (1 / 8 resolution feature map), so that it can retain the fine texture and edge information of small-sized components while reducing dimensionality.

[0059] b. Replace the original C3 module with the C3Ghost module;

[0060] In the backbone network, the original C3 module is replaced with the C3Ghost module; the specific steps are as follows:

[0061] The C3Ghost module retains the cross-stage connection structure of the original C3 module, but it is composed of multiple Ghost Bottleneck layers connected in series. Each Ghost Bottleneck layer contains two GhostConv modules, which are used to achieve lightweight extraction of deep features, making it particularly suitable for processing small, densely packed circuit board components.

[0062] It should be noted that in this embodiment, the C3Ghost module is applied to the shallow and intermediate layers of the backbone network, such as the P2 / 4 and P3 / 8 feature stages, to efficiently extract features at these key levels.

[0063] c. Replace the original C3 module with the C3K2 module;

[0064] In the deep layers of the backbone network (such as the P4 / 16 and P5 / 32 feature stages) and the feature fusion path of the head network, the C3K2 module is used to replace the original C3 module;

[0065] The C3K2 module uses two stacked small convolutional kernels (e.g., two 3×3 convolutions) instead of traditional large convolutional kernels (e.g., 5×5 or 7×7 convolutions).

[0066] This design, while maintaining the same receptive field, significantly reduces computational complexity (FLOPs) on the one hand, and enhances nonlinear expressive power by increasing network depth on the other hand, which helps to capture the complete outline and rotation angle features of components.

[0067] It should be noted that in this embodiment, the C3K2 module is introduced into the deep network to maintain the receptive field while maintaining computational efficiency.

[0068] d. Other reserved modules;

[0069] This model retains the SPPF module from the YOLOv5n-OBB baseline model to enhance multi-scale context awareness; the GhostConv module is used multiple times for channel compression in the upsampling path relay of the neck network; and the C3Ghost module and C3K2 module are used in combination in the feature fusion stage.

[0070] It should be noted that the "head network" mentioned in the above improvement operation refers to the detection head (Detect layer) in the YOLOv5n-OBB model.

[0071] After the improvement, the model finally outputs the prediction results of the rotated box on the feature maps at three scales, P3, P4 and P5, corresponding to feature maps at input resolutions of 1 / 32, 1 / 16 and 1 / 8 respectively, so as to realize multi-scale detection of components of different sizes.

[0072] Finally, the detection head (Detect layer) outputs the prediction results of the rotated bounding box at three scales: P3, P4, and P5.

[0073] Based on the above method, this embodiment also provides an industrial circuit board rotating target detection system based on lightweight YOLOv5, such as... Figure 2 As shown, the system includes:

[0074] The image acquisition unit uses a high-resolution industrial camera to acquire high-definition images of circuit boards that are horizontally conveyed by a conveyor belt.

[0075] The edge computing unit is an industrial computer or embedded AI computing device (such as the NVIDIA Jetson series). This edge computing unit is equipped with the aforementioned improved YOLOv5n-OBB model, which is used to perform image preprocessing, model inference, and post-processing on the acquired high-definition images in real time, and output the detection results.

[0076] The control unit, which uses a programmable logic controller (PLC), coordinates the start and stop of the conveyor belt based on the circuit board position signal and precisely triggers the image acquisition unit to work.

[0077] The human-machine interface is connected to the edge computing unit to visualize the detection results and alarm information, making it convenient for operators to monitor the status of the circuit board production line in real time. The detection results include the category information of electronic components, the defect type and its corresponding rotating frame.

[0078] Example 2

[0079] This is a second embodiment of the present invention, which differs from the first embodiment in that: to verify the effectiveness of the present invention, the following comparative experiment was constructed in this embodiment:

[0080] 1. The baseline model and the improved YOLOv5n-OBB model of this invention;

[0081] Baseline Model: The YOLOv5n-OBB baseline model is used as a reference. The input image size is 480×480, and the output includes the rotated bounding box parameters. ), confidence level (conf) and class (class).

[0082] The improved YOLOv5n-OBB model of this invention makes the following improvements based on the YOLOv5n-OBB baseline model:

[0083] In the backbone and neck networks, GhostConv modules are used to replace some standard convolutions.

[0084] The C3Ghost module is introduced to replace the original C3 module, and Ghost convolutional compression channels are used internally.

[0085] The C3K2 module is introduced into the deep layers of the backbone network and the head network.

[0086] Retain the SPPF module;

[0087] The GhostConv module is used for channel compression in the upsampling path;

[0088] The feature fusion stage uses a combination of the C3Ghost and C3K2 modules; finally, the Detect layer outputs the rotation box prediction results at three scales: P3, P4, and P5.

[0089] 2. Dataset and training configuration;

[0090] Dataset: A PCB industrial inspection dataset was created, containing 20,000 images, labeled with 4 common electronic components (nc=4), and the labeling format adopts the DOTA format of rotated boxes.

[0091] Training parameters: input size 480×480, batch size 32, optimizer SGD, initial learning rate 0.001, training for 200 rounds.

[0092] Hardware platform: NVIDIA RTX 4090 (24GB VRAM).

[0093] Example 3

[0094] This is the third embodiment of the present invention, which differs from the first embodiment in that: in order to objectively evaluate the performance of the model of the present invention, it is compared with the YOLOv5n-OBB benchmark model on the same test set; this experiment uses evaluation metrics commonly used in the field of object detection.

[0095] Among them, the intersection-union ratio ( This is used to measure the overlap between the predicted bounding box and the ground truth bounding box; it is defined as the predicted bounding box. With real frame The ratio of the area of ​​intersection to the area of ​​union, i.e. ;

[0096] It should be noted that, A threshold of 0.5 is a common evaluation standard in the field of object detection (such as the COCO dataset specification). This threshold can achieve a good balance between detection accuracy and recall, and is particularly suitable for detection evaluation in scenarios with dense circuit board components.

[0097] This embodiment conducts the following performance comparison experiment between the model of the present invention (denoted as YOLOv5n-C3K2-Ghost) and the YOLOv5n-OBB benchmark model in Embodiment 2;

[0098] A comprehensive comparison of the two models was conducted on the same test set, based on... This embodiment calculates the following core indicators:

[0099] mAP@50: The average precision when the threshold is 0.5 is calculated using the following formula: Where c represents the total number of categories, For class c in Average accuracy;

[0100] mAP@50:95: The average accuracy of the threshold ranges from 0.5 to 0.95 (step size 0.05). This metric has stricter requirements for positioning accuracy and is usually used to comprehensively evaluate the detection performance of the model.

[0101] Parameters: The total number of trainable parameters in the model;

[0102] Computational cost (GFLOPs): The number of floating-point operations required for a model to process one image;

[0103] Inference speed (Speed): The average inference time (ms) for a single image.

[0104] The experimental results are shown in the table below:

[0105]

[0106] The experimental results show that:

[0107] (1) While maintaining the same mAP@50, the improved YOLOv5n-OBB model of this invention achieved a 1.9% improvement in mAP@50:95 (from 0.788 to 0.803):

[0108] As can be seen from the above data, the improved YOLOv5n-OBB model of this invention, by introducing the C3Ghost module and the C3K2 module, can more effectively fuse deep features and enhance the contextual information of rotating targets, thereby improving the detection capability of small rotating targets. Therefore, compared with the original model, the improved YOLOv5n-OBB model of this invention is more accurate in locating and classifying dense small rotating targets.

[0109] Specifically, in the circuit board inspection scenario of this application, electronic components are usually small in size and densely spaced. The original model is limited by its receptive field and feature extraction capabilities. However, the improved YOLOv5n-OBB model of this invention introduces the C3Ghost module, which retains important spatial detail information by compressing channels through Ghost convolution. Especially in scenarios with dense small targets like circuit boards, it can reduce information loss and thus improve accuracy. The C3K2 module replaces the traditional large convolution kernel by stacking two small convolution kernels, which greatly reduces computational complexity while maintaining the receptive field and enhances the network's ability to express details, further improving accuracy.

[0110] (2) The number of parameters decreased by approximately 30.78% (from approximately 2 million to approximately 1.39 million):

[0111] As can be seen from the above data, the improved YOLOv5n-OBB model of this invention, through the introduction of the GhostConv module, uses low-computational-cost linear operations to generate phantom feature maps, replacing part of the standard convolution, thereby significantly reducing the number of model parameters. This not only improves the inference speed but also enables the model to run more efficiently on devices with low computing power, meeting the real-time detection needs of industrial sites. In addition, the improved YOLOv5n-OBB model of this invention further optimizes the feature extraction process through the design of the C3Ghost and C3K2 modules, reducing redundant computations. This lightweight design strikes a balance between maintaining high accuracy.

[0112] (3) The computational cost was reduced by approximately 30.61% (from 4.9 GFLOPs to 3.4 GFLOPs):

[0113] The data above shows that the improved YOLOv5n-OBB model of this invention maintains the receptive field while significantly reducing the computational load by replacing the larger convolutional kernel with the C3K2 module. Combined with the introduction of the GhostConv module, the entire model reduces the consumption of computing resources without sacrificing accuracy, further improving inference speed and responsiveness, making the model more efficient and suitable for resource-constrained industrial environments.

[0114] (4) Inference speed improved by approximately 7.14% (from 5.6ms to 5.2ms):

[0115] As can be seen from the above data, the improved YOLOv5n-OBB model of this invention, by introducing the GhostConv module and the C3K2 module, not only reduces computational redundancy and significantly reduces the number of parameters and computational load, but also reduces memory usage and speeds up information transmission. Therefore, it can better meet the demand for rapid response in industrial automation inspection.

[0116] In summary, the improved YOLOv5n-OBB model of this invention significantly improves the model's advantages in terms of accuracy, computational cost, number of parameters, and inference speed by introducing GhostConv (shallow layer), C3Ghost (shallow / middle layer), and C3K2 (deep / head) modules in a layered manner. Through the combination of lightweight design and rotation feature enhancement technology, it effectively solves the shortcomings of traditional models in the task of detecting small targets in dense circuit boards, and provides a more efficient and accurate solution suitable for industrial edge deployment.

[0117] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the invention by those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the invention should be included within the scope of protection of the invention.

Claims

1. A method for detecting rotating targets on industrial circuit boards based on lightweight YOLOv5, characterized in that: Includes the following steps: S1: Acquire a high-resolution image of the industrial circuit board to be inspected; S2: Input the high-definition image obtained in step S1 into the improved YOLOv5n-OBB model for inference, and output the category information of each electronic component and the corresponding rotation frame parameters. The improved YOLOv5n-OBB model is constructed by performing the following improvements on the YOLOv5n-OBB baseline model: In the backbone network and neck network, the GhostConv module is used to replace the standard convolutional layer in the YOLOv5n-OBB baseline model. The GhostConv module is used to generate basic feature maps first through a small number of convolutions, and then generate phantom feature maps from the basic feature maps through a series of linear transformations, so as to reduce the number of model parameters and computational cost, and preserve spatial detail information. In the backbone network, the original C3 module in the YOLOv5n-OBB baseline model is replaced by the C3Ghost module. The C3Ghost module is composed of multiple Ghost bottleneck layers connected in series, which is used to achieve lightweight extraction of deep features while maintaining the cross-stage connection structure. In the deep layers of the backbone network and the head network, the original C3 module in the YOLOv5n-OBB baseline model is replaced by the C3K2 module. The C3K2 module replaces the traditional large convolutional kernel by stacking two small convolutional kernels, which reduces computational complexity while maintaining the receptive field.

2. The method for detecting rotating targets on industrial circuit boards based on lightweight YOLOv5 according to claim 1, characterized in that: The GhostConv module is applied to the shallow layers of the backbone network, including the P2 / 4 and / or P3 / 8 feature stages.

3. The method for detecting rotating targets on industrial circuit boards based on lightweight YOLOv5 according to claim 2, characterized in that: The C3Ghost module is applied to the shallow and intermediate layers of the backbone network, including the P2 / 4 and / or P3 / 8 feature stages.

4. The method for detecting rotating targets on industrial circuit boards based on lightweight YOLOv5 according to claim 3, characterized in that: Each Ghost bottleneck layer contains two GhostConv modules.

5. The method for detecting rotating targets on industrial circuit boards based on lightweight YOLOv5 according to claim 4, characterized in that: The C3K2 module is applied to the feature fusion paths of the deep and head networks of the backbone network, including the P4 / 16 and / or P5 / 32 feature stages.

6. The method for detecting rotating targets on industrial circuit boards based on lightweight YOLOv5 according to claim 5, characterized in that: After inference using the improved YOLOv5n-OBB model, the prediction results are post-processed using Rotated Nonmaximum Suppression (RNMS) to eliminate redundant detection boxes.

7. A rotating target detection system for industrial circuit boards based on lightweight YOLOv5, used to implement the rotating target detection method for industrial circuit boards based on lightweight YOLOv5 as described in any one of claims 1-6, characterized in that: The system includes: Image acquisition unit, used to acquire high-definition images of industrial circuit boards; An edge computing unit, which is equipped with an improved YOLOv5n-OBB model, is used to perform real-time inference on the acquired images and output detection results. The control unit is used to coordinate the start and stop of the conveyor belt according to the circuit board position signal and to trigger the image acquisition unit to work; The human-computer interaction interface is connected to the edge computing unit and is used to visualize and display the detection results and alarm information. The detection results include the category information of electronic components, the defect type and its corresponding rotating frame.

8. The industrial circuit board rotating target detection system based on lightweight YOLOv5 according to claim 7, characterized in that: The image acquisition unit is a high-resolution industrial camera configured to perform vertical orthophoto imaging on a horizontally transported circuit board.

9. The industrial circuit board rotating target detection system based on lightweight YOLOv5 according to claim 8, characterized in that: The edge computing unit is an industrial computer or an embedded AI computing device.

10. The industrial circuit board rotating target detection system based on lightweight YOLOv5 according to claim 9, characterized in that: The embedded AI computing device includes NVIDIA Jetson series or equivalent edge inference platforms.