Industrial part detection method and device based on g-yolo neural network and storage medium

The industrial parts inspection method using G-YOLO neural networks solves the problems of strict position requirements of traditional robots and high overhead of deep learning networks, enabling rapid and real-time inspection of various parts, and is suitable for industrial environments.

CN115239643BActive Publication Date: 2026-06-05WUHAN INST OF TECH +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
WUHAN INST OF TECH
Filing Date
2022-07-04
Publication Date
2026-06-05

Smart Images

  • Figure CN115239643B_ABST
    Figure CN115239643B_ABST
Patent Text Reader

Abstract

The application provides an industrial part detection method and device based on a G-YOLO neural network and a storage medium, an industrial part is photographed by a shooting device, and an initial data set of the industrial part is made, a sample training set and a sample test set are constructed, an initial G-YOLO industrial part detection model is constructed based on the G-YOLO neural network, and model training and performance testing are respectively performed on the initial G-YOLO industrial part detection model through the preprocessed sample training set and sample test set, so that a G-YOLO industrial part detection model is obtained; the G-YOLO industrial part detection model has strong generalization ability and can meet the detection of various industrial parts, solves the problem that the existing method has a slow detection speed for industrial parts in a complex environment, greatly improves the detection speed, and meets the real-time detection demand of parts in an industrial environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial parts inspection technology, specifically to an industrial parts inspection method, device, and storage medium based on a G-YOLO neural network. Background Technology

[0002] With the increasing automation of industry, intelligent industrial robots are gradually replacing manual labor in sorting tasks across various industrial scenarios, improving work efficiency and effectively saving production costs. Traditional sorting technologies mostly employ teach-in or offline-programmed sorting robots. These robots systematically grasp objects on a worktable according to pre-defined trajectories. Because of this, these robots have strict requirements on the placement of objects, and when the sorting target or environment changes, the program needs to be rewritten manually. However, in actual sorting tasks, the objects to be sorted are often materials or parts of various categories, sizes, and randomly arranged. This makes traditional sorting technologies unsuitable for such complex tasks.

[0003] To improve the automation level of sorting robots and achieve intelligent sorting, the robots need to utilize machine vision technology to automatically identify and locate mixed materials to be sorted. Traditional machine vision technology mainly relies on manually created features for image recognition and analysis. Designing such manual features is costly and difficult, the feature extraction effect is limited, and the detection performance is easily affected by ambient lighting. This results in poor robustness and portability of such algorithms, making them unsuitable for industrial parts inspection problems in industrial settings.

[0004] In recent years, with significant breakthroughs in feature extraction using deep learning technology, deep learning-based object detection techniques can automatically extract more comprehensive image features. Furthermore, this method has achieved success in various fields, further demonstrating its robustness and portability. However, to achieve high detection accuracy, deep learning-based object detection networks typically employ deep network structures, leading to a substantial increase in both space and time overhead. Summary of the Invention

[0005] The technical problem to be solved by the present invention is to address the shortcomings of the prior art by providing an industrial parts inspection method, device and storage medium based on G-YOLO neural network.

[0006] The technical solution of this invention to solve the above-mentioned technical problems is as follows: An industrial parts inspection method based on G-YOLO neural network, comprising the following steps:

[0007] Industrial parts are photographed using imaging equipment, and an initial dataset of industrial parts is created, which includes multiple sample images of industrial parts.

[0008] Target bounding boxes were annotated for multiple industrial part sample images using an image annotation tool.

[0009] Data augmentation processing is performed on multiple labeled industrial part sample images. The labeled industrial part sample images and the data-augmented industrial part sample images are divided according to a preset ratio to obtain a sample training set and a sample test set.

[0010] An initial G-YOLO industrial parts inspection model was constructed based on the G-YOLO neural network;

[0011] The initial G-YOLO industrial parts detection model is trained using the sample training set, and the performance of the trained initial G-YOLO industrial parts detection model is tested using the sample test set to obtain the G-YOLO industrial parts detection model.

[0012] The imaging device is used to capture images of the industrial parts to be inspected, thereby obtaining images of the industrial parts to be inspected.

[0013] The image of the industrial part to be detected is sent to the G-YOLO industrial part detection model, and the detection result of the image of the industrial part to be detected is output by the G-YOLO industrial part detection model.

[0014] The beneficial effects of this invention are as follows: An initial G-YOLO industrial parts detection model is constructed based on the G-YOLO neural network. The initial G-YOLO industrial parts detection model is then trained and its performance is tested using preprocessed sample training and sample test sets, respectively, to obtain the G-YOLO industrial parts detection model. The G-YOLO industrial parts detection model has strong generalization ability and can meet the detection requirements of various industrial parts. It solves the problem of slow detection speed of existing methods for industrial parts in complex environments, greatly improves the detection speed, and meets the real-time detection requirements of parts in industrial environments.

[0015] Based on the above technical solution, the present invention can be further improved as follows.

[0016] Furthermore, the step of photographing industrial parts using a camera and creating an initial dataset of industrial parts specifically involves:

[0017] The industrial parts placed on the operating table are photographed using a camera to obtain video samples of the industrial parts;

[0018] Based on image processing algorithms, multiple single-frame industrial part sample images are obtained from the video samples of the industrial parts. According to the set requirements, the multiple industrial part sample images are filtered and the filtered industrial part sample images are combined into an initial industrial part dataset.

[0019] Furthermore, the step of annotating multiple industrial part sample images using an image annotation tool specifically involves:

[0020] The Labelimg image annotation tool was used to perform target bounding box annotation on multiple industrial part sample images. The target bounding box annotation process included the four positional information of the target bounding box (x, y, w, and h) and the category information corresponding to each target bounding box. The category information included gear category information, bearing category information, and nut category information.

[0021] The beneficial effect of adopting the above-mentioned further technical solution is that the initial G-YOLO industrial part detection model can be accurately trained using the labeled industrial part sample images, thereby improving the detection accuracy of the G-YOLO industrial part detection model.

[0022] Furthermore, the data augmentation processing performed on the labeled sample images of multiple industrial parts specifically includes:

[0023] Three data augmentation processes—horizontal mirroring, vertical mirroring, and diagonal mirroring—were applied to the labeled images of multiple industrial parts.

[0024] The beneficial effect of adopting the above-mentioned further technical solution is that it can obtain a sample training set and a sample test set that are conducive to model training and performance testing of the initial G-YOLO industrial parts inspection model.

[0025] Furthermore, the step of sending the image of the industrial part to be detected to the G-YOLO industrial part detection model, and outputting the detection result of the image of the industrial part to be detected by the G-YOLO industrial part detection model, specifically involves:

[0026] The G-YOLO industrial parts inspection model is deployed on an external PC;

[0027] The image of the industrial part to be detected is transmitted as a data stream to the G-YOLO industrial part detection model on an external PC. The G-YOLO industrial part detection model detects the image of the industrial part to be detected and outputs the detection results. The detection results include the position information of the prediction box, the industrial part category information in the prediction box, and the confidence level of the prediction box.

[0028] Furthermore, the construction of the initial G-YOLO industrial part inspection model based on the G-YOLO neural network specifically involves:

[0029] A GhostNet network layer was constructed to replace the CSPDarkNet53 backbone feature extraction network in the G-YOLO neural network;

[0030] The down-up feature fusion path in the G-YOLO neural network is removed, and the output branch of feature fusion is pruned, retaining the feature layer used to detect large-scale targets and the feature layer used to detect medium-scale targets as the output of the G-YOLO neural network;

[0031] The target bounding boxes are clustered using the K-Means clustering algorithm to obtain the anchor size suitable for the G-YOLO neural network, thereby completing the optimization of the G-YOLO neural network.

[0032] The optimized G-YOLO neural network was constructed using the Tensonflow-gpu deep learning framework to obtain the G-YOLO industrial parts inspection model.

[0033] The beneficial effects of adopting the above-mentioned further technical solutions are: it can improve the feature fusion speed, further reduce network parameters, increase the amount of computation, and at the same time, use the K-Means clustering algorithm to optimize the anchor size of the model, thereby improving the training effect of the network model.

[0034] Another technical solution of the present invention to solve the above-mentioned technical problems is as follows: An industrial parts inspection device based on G-YOLO neural network, characterized in that it includes:

[0035] The imaging module is used to photograph industrial parts using an imaging device and create an initial dataset of industrial parts, which includes multiple sample images of industrial parts.

[0036] The annotation module is used to annotate the target bounding boxes of multiple industrial part sample images using an image annotation tool.

[0037] The image preprocessing module is used to perform data augmentation processing on multiple labeled industrial part sample images respectively. The labeled industrial part sample images and the data-augmented industrial part sample images are divided according to a preset ratio to obtain a sample training set and a sample test set.

[0038] The model building module is used to build an initial G-YOLO industrial part inspection model based on the G-YOLO neural network.

[0039] The training module is used to train the initial G-YOLO industrial parts detection model using the sample training set, and to perform performance testing on the trained initial G-YOLO industrial parts detection model using the sample test set, so as to obtain the G-YOLO industrial parts detection model.

[0040] The imaging module is also used to capture images of the industrial parts to be inspected using the imaging device, thereby obtaining images of the industrial parts to be inspected.

[0041] The detection module is used to send the image of the industrial part to be detected to the G-YOLO industrial part detection model, and output the detection result of the image of the industrial part to be detected through the G-YOLO industrial part detection model.

[0042] Another technical solution of the present invention to solve the above-mentioned technical problems is as follows: an industrial parts inspection device based on G-YOLO neural network, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the industrial parts inspection method based on G-YOLO neural network as described above.

[0043] Another technical solution of the present invention to solve the above-mentioned technical problems is as follows: a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the industrial part inspection method based on the G-YOLO neural network as described above. Attached Figure Description

[0044] Figure 1 This is a schematic flowchart of the industrial parts inspection method provided in an embodiment of the present invention;

[0045] Figure 2 This is a functional block diagram of the industrial parts testing device provided in an embodiment of the present invention. Detailed Implementation

[0046] The principles and features of the present invention are described below with reference to the accompanying drawings. The examples given are only for explaining the present invention and are not intended to limit the scope of the present invention.

[0047] Example 1:

[0048] like Figure 1 As shown, an industrial part inspection method based on G-YOLO neural network includes the following steps:

[0049] Industrial parts are photographed using imaging equipment, and an initial dataset of industrial parts is created, which includes multiple sample images of industrial parts.

[0050] Target bounding boxes were annotated for multiple industrial part sample images using an image annotation tool.

[0051] Data augmentation processing is performed on multiple labeled industrial part sample images. The labeled industrial part sample images and the data-augmented industrial part sample images are divided according to a preset ratio to obtain a sample training set and a sample test set.

[0052] An initial G-YOLO industrial parts inspection model was constructed based on the G-YOLO neural network;

[0053] The initial G-YOLO industrial parts detection model is trained using the sample training set, and the performance of the trained initial G-YOLO industrial parts detection model is tested using the sample test set to obtain the G-YOLO industrial parts detection model.

[0054] The imaging device is used to capture images of the industrial parts to be inspected, thereby obtaining images of the industrial parts to be inspected.

[0055] The image of the industrial part to be detected is sent to the G-YOLO industrial part detection model, and the detection result of the image of the industrial part to be detected is output by the G-YOLO industrial part detection model.

[0056] In the above embodiments, an initial G-YOLO industrial parts detection model is constructed based on the G-YOLO neural network. The initial G-YOLO industrial parts detection model is then trained and its performance is tested using preprocessed sample training and sample test sets, respectively, to obtain the G-YOLO industrial parts detection model. The G-YOLO industrial parts detection model has strong generalization ability and can meet the detection requirements of various industrial parts. It solves the problem of slow detection speed of existing methods for industrial parts in complex environments, greatly improves the detection speed, and meets the real-time detection requirements of parts in industrial environments.

[0057] Preferably, the step of photographing industrial parts using a camera and creating an initial dataset of industrial parts specifically involves:

[0058] The industrial parts placed on the operating table are photographed using a camera to obtain video samples of the industrial parts;

[0059] Based on image processing algorithms, multiple single-frame industrial part sample images are obtained from the video samples of the industrial parts. According to the set requirements, the multiple industrial part sample images are filtered and the filtered industrial part sample images are combined into an initial industrial part dataset.

[0060] Specifically, the requirements are set to filter industrial part sample images under different lighting conditions, angles, and positions.

[0061] Preferably, the step of annotating the multiple industrial part sample images using an image annotation tool specifically involves:

[0062] The Labelimg image annotation tool was used to annotate the bounding boxes of multiple industrial part sample images. The annotation process included the x, y, w, and h coordinates of the bounding box and the category information corresponding to each bounding box. The category information included gear, bearing, and nut categories. Here, (x, y) represents the coordinates of the center point of the bounding box, w is the width of the bounding box, and h is the height of the bounding box. The four coordinates x, y, w, and h constitute the position information of the bounding box. c represents the category information of the industrial part marked by the bounding box.

[0063] In the above embodiments, the initial G-YOLO industrial part detection model can be accurately trained using the labeled industrial part sample images, thereby improving the detection accuracy of the G-YOLO industrial part detection model.

[0064] Preferably, the step of performing data augmentation processing on the labeled multiple industrial part sample images specifically includes:

[0065] Three data augmentation processes—horizontal mirroring, vertical mirroring, and diagonal mirroring—were applied to the labeled images of multiple industrial parts.

[0066] Specifically, the labeled industrial part sample images and the data-enhanced industrial part sample images can be divided into a sample training set, a sample test set, and a sample validation set in a ratio of 7:2:1.

[0067] Considering that a small sample size can lead to overfitting during model training, thus reducing the model's generalization ability, and that collecting and labeling a large dataset would consume significant human and time resources, data augmentation was performed on the obtained data-enhanced industrial parts sample images to expand the dataset from the original 1000 samples to 4000. This resulted in the final sample dataset.

[0068] The training set is used to train the model, the test set is used to verify the model's detection performance, and the validation set is generally used during training. After several epochs, the validation set is run once to check the training effect.

[0069] In the above embodiments, it is possible to obtain a sample training set and a sample test set that are beneficial for model training and performance testing of the initial G-YOLO industrial parts inspection model.

[0070] Preferably, the step of sending the image of the industrial part to be detected to the G-YOLO industrial part detection model, and outputting the detection result of the image of the industrial part to be detected by the G-YOLO industrial part detection model, specifically involves:

[0071] The G-YOLO industrial parts inspection model is deployed on an external PC;

[0072] The image of the industrial part to be detected is transmitted as a data stream to the G-YOLO industrial part detection model on an external PC. The G-YOLO industrial part detection model detects the image of the industrial part to be detected and outputs the detection results. The detection results include the position information of the prediction box, the industrial part category information in the prediction box, and the confidence level of the prediction box.

[0073] Specifically, the location information of the predicted bounding box is (x, y, w, h). Where x is the x-coordinate of the center point of the predicted bounding box, y is the y-coordinate of the center point of the predicted bounding box, w is the width of the predicted bounding box, and h is the height of the predicted bounding box. The confidence score of the predicted bounding box is expressed by the following formula:

[0074]

[0075] Among them, P r (object) represents the probability of containing an object, with a value of 1 or 0. This represents the intersection-union ratio (IUGR) of the actual and predicted coordinates of the bounding box. A value of 1 indicates that the bounding box and the predicted box coincide. If the current prediction is not the best, it will be ignored if it exceeds the threshold.

[0076] Understandably, the existing deep learning-based object detection network YOLOv4 has a staggering 64,040,001 parameters and a model size of 244MB. Even on a 1080ti GPU, its detection speed is only around 10fps. Furthermore, vision systems are typically deployed in embedded devices with limited hardware resources, and the large size and high complexity of deep learning-based object detection models severely impact their usability in real-world industrial sorting. Therefore, achieving the required accuracy while reducing the number of parameters and computational cost, and improving detection efficiency to meet the real-time sorting demands of industrial scenarios, is an extremely challenging task.

[0077] Preferably, the construction of the initial G-YOLO industrial part inspection model based on the G-YOLO neural network specifically involves:

[0078] S1: Construct a GhostNet network layer to replace the CSPDarkNet53 backbone feature extraction network in the G-YOLO neural network. It should be understood that the core of the GhostNet network layer is the use of Ghost modules. Ghost modules decompose the ordinary convolution step into two stages: the first stage uses fewer convolution kernels to perform convolution calculations, generating a partial feature map F1; the second stage uses less computationally intensive linear operations to replace part of the convolution calculations, obtaining another partial feature map F2. Finally, the F1 and F2 feature maps are concatenated. Compared to ordinary convolutional neural networks, with equal input and output feature map sizes, using Ghost modules requires less computation and fewer parameters than using ordinary convolution blocks. The Ghost Bottleneck residual structure, designed based on the advantages of Ghost modules, consists of two stacked Ghost modules. The first Ghost module primarily increases the number of channels in the network, acting as an extension layer. The second Ghost module primarily reduces the number of channels in the network and matches the residual edges. Finally, the output of the Ghost module is connected to the input via residual edges. It's important to note that when the stride of the Ghost Bottleneck residual structure is set to 2, a depthwise convolution with a stride of 2 needs to be added between the two Ghost modules to connect them. GhostNet significantly reduces the parameter computation of the backbone feature extraction network while maintaining detection accuracy, thus accelerating the model's feature extraction speed.

[0079] S2: Remove the down-up feature fusion path in the G-YOLO neural network and prune the output branch of the feature fusion, retaining the feature layers used to detect large-scale targets and the feature layers used to detect medium-scale targets as the output of the G-YOLO neural network. It should be understood that the deeper the layers of the convolutional neural network, the richer the semantic information of the target extracted by the model. However, as the convolutional layers continue to deepen, on the one hand, it will significantly increase the network parameters and computational load, resulting in a slow inference speed; on the other hand, it will lead to the problem of feature vanishing. In actual industrial sorting environments, industrial cameras used to acquire images are generally fixed above the conveyor belt, and the positions of the camera and the industrial materials on the conveyor belt are relatively fixed. Therefore, the scale difference between the various targets in the image is not large. Therefore, in this application, G-YOLO only uses the last two feature layers of the backbone feature network to construct the feature fusion network. In addition, unlike YOLOv4, G-YOLO proposes the down-up feature fusion path of YOLOv4 to accelerate the feature fusion speed, using only one top-down feature fusion path for feature fusion. The final output consists of two feature layers with sizes of 13x13 and 26x26, used for subsequent classification and regression tasks. The number of channels in each feature layer is:

[0080] 3×(1+4+C),

[0081] Where 3 represents that each feature point in each feature layer has 3 prior boxes, 1 represents the confidence information of the predicted box, 4 represents the 4 location information (x, y, w, h) of the predicted box, and C represents the number of classes in the dataset. The grid prediction confidence is:

[0082]

[0083] Specifically, if the center of the target object falls within this grid, then Pr(object) = 1; otherwise, Pr(object) = 0. Pr(class) i |object) represents the confidence probability of the i-th type of object predicted by the grid. box(Pred) represents the predicted bounding box, and box(Truth) represents the ground truth bounding box.

[0084] S3: Cluster each of the target bounding boxes using the K-Means clustering algorithm to obtain anchor sizes suitable for the G-YOLO neural network, thereby optimizing the G-YOLO neural network. It should be understood that in object detection, a reasonable anchor box size can effectively improve the accuracy and speed of object detection. Therefore, the K-Means algorithm is used to re-cluster the sample bounding boxes in the mixed-material recognition dataset to obtain anchor sizes suitable for G-YOLO. The steps are as follows: Read the labeled training dataset, randomly select the width and height values ​​of one image as coordinate points and use them as initial cluster centers, and then use the K-means clustering method iteratively to calculate the specific anchor size values.

[0085] S4: The optimized G-YOLO neural network is constructed using the Tensonflow-gpu deep learning framework to obtain the G-YOLO industrial parts inspection model.

[0086] In the above embodiments, to address the problem of slow detection speed of industrial parts in complex environments using existing methods, the backbone feature extraction network CSPDarkNet53 of the YOLOv4 network (i.e., the G-YOLO neural network) is replaced with the lightweight network GhostNet to improve detection speed. The feature extraction network of the YOLOv4 network is pruned and optimized, eliminating the down-up feature fusion path in its feature fusion network. At the same time, the output branch of feature fusion is also pruned, retaining only the two feature layers used for detecting large-scale and medium-scale targets as the output of the G-YOLO neural network. This improves the feature fusion speed, further reduces network parameters, and increases computational cost. Meanwhile, the K-Means clustering algorithm is used to optimize the anchor size of the model, improving the training effect of the network model.

[0087] Preferably, the initial G-YOLO industrial parts detection model is trained using the sample training set, and the performance of the trained initial G-YOLO industrial parts detection model is tested using the sample test set to obtain the G-YOLO industrial parts detection model, specifically as follows:

[0088] The G-YOLO network is trained using the training set to obtain the final training weights.

[0089] Specifically, the model training parameters are as follows: batch size is set to 16; NMS is set to 0.5; learning rate is 0.001 to 0.0001; and epoch is 100. The trained G-YOLO network model is validated using a validation set, and the model training parameters are iteratively optimized based on the loss value obtained from the validation. When the loss value tends to stabilize, the final G-YOLO industrial parts inspection model is obtained.

[0090] It should be understood that in the field of deep learning object detection, the loss function is used to measure the quality of the model's predictions, that is, to represent the degree of difference between the predictions and the actual data. Since the quality of the model represents the effectiveness of the detection, the detection result obtained for object detection consists of three pieces of information: the location information of the predicted bounding box; the category information of the predicted target; and the confidence score. Therefore, the loss function used in the G-YOLO industrial parts detection network of this application consists of the above three sets of loss values, specifically:

[0091]

[0092]

[0093]

[0094] loss = lbox - lcls - lobj

[0095] Where SxS represents the number of grids in the input image, and B represents the predicted bounding box. This indicates that if there is a target in the predicted bounding box at position i or j, the value is 1; otherwise, it is 0. This indicates that if the predicted bounding box at positions i and j contains no target, its value is 1; otherwise, it is 0. λ coord Let λ be the error coefficient of the predicted bounding box. class λ is the error coefficient for category information. noobj c represents the confidence error coefficient when the target to be identified is not included. i and p represents the predicted confidence and the true confidence that the target exists in the i-th grid, respectively. i and These represent the predicted probability and the true probability of the target belonging to a certain category in the i-th grid, respectively.

[0096] Finally, after training, the trained network model is tested using the test set. The predicted results are compared with the ground truth boxes in the test set to test the model's performance.

[0097] Example 2:

[0098] like Figure 2As shown, an industrial parts inspection device based on a G-YOLO neural network includes:

[0099] The imaging module is used to photograph industrial parts using imaging equipment and to create an initial dataset of industrial parts, which includes multiple sample images of industrial parts.

[0100] The annotation module is used to annotate the target bounding boxes of multiple industrial part sample images using an image annotation tool.

[0101] The image preprocessing module is used to perform data augmentation processing on multiple labeled industrial part sample images respectively. The labeled industrial part sample images and the data-augmented industrial part sample images are divided according to a preset ratio to obtain a sample training set and a sample test set.

[0102] The model building module is used to build an initial G-YOLO industrial part inspection model based on the G-YOLO neural network.

[0103] The training module is used to train the initial G-YOLO industrial parts detection model using the sample training set, and to perform performance testing on the trained initial G-YOLO industrial parts detection model using the sample test set, so as to obtain the G-YOLO industrial parts detection model.

[0104] The imaging module is also used to capture images of the industrial parts to be inspected using the imaging device, thereby obtaining images of the industrial parts to be inspected.

[0105] The detection module is used to send the image of the industrial part to be detected to the G-YOLO industrial part detection model, and output the detection result of the image of the industrial part to be detected through the G-YOLO industrial part detection model.

[0106] Preferably, in the annotation module, multiple industrial part sample images are annotated using an image annotation tool, specifically as follows:

[0107] The Labelimg image annotation tool was used to perform target bounding box annotation on multiple industrial part sample images. The target bounding box annotation process included the four positional information of the target bounding box (x, y, w, and h) and the category information corresponding to each target bounding box. The category information included gear category information, bearing category information, and nut category information.

[0108] Example 3:

[0109] An industrial parts inspection device based on a G-YOLO neural network includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the industrial parts inspection method based on a G-YOLO neural network as described above.

[0110] Example 4:

[0111] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the industrial part inspection method based on a G-YOLO neural network as described above.

[0112] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0113] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. An industrial parts inspection method based on G-YOLO neural network, characterized in that, Includes the following steps: Industrial parts are photographed using imaging equipment, and an initial dataset of industrial parts is created, which includes multiple sample images of industrial parts. Target bounding boxes were annotated for multiple industrial part sample images using an image annotation tool. Data augmentation processing is performed on multiple labeled industrial part sample images. The labeled industrial part sample images and the data-augmented industrial part sample images are divided according to a preset ratio to obtain a sample training set and a sample test set. An initial G-YOLO industrial parts inspection model was constructed based on the G-YOLO neural network; The initial G-YOLO industrial parts detection model is trained using the sample training set, and the performance of the trained initial G-YOLO industrial parts detection model is tested using the sample test set to obtain the G-YOLO industrial parts detection model. The imaging device is used to capture images of the industrial parts to be inspected, thereby obtaining images of the industrial parts to be inspected. The image of the industrial part to be detected is sent to the G-YOLO industrial part detection model, and the detection result of the image of the industrial part to be detected is output by the G-YOLO industrial part detection model. The step of annotating multiple industrial part sample images using an image annotation tool specifically involves: The Labelimg image annotation tool was used to perform target bounding box annotation on multiple industrial part sample images. The target bounding box annotation process included the four positional information of the target bounding box (x, y, w, and h) and the category information corresponding to each target bounding box. The category information included gear category information, bearing category information, and nut category information. The initial G-YOLO industrial parts inspection model based on the G-YOLO neural network is constructed as follows: A GhostNet network layer was constructed to replace the CSPDarkNet53 backbone feature extraction network in the G-YOLO neural network; The down-up feature fusion path in the G-YOLO neural network is removed, and the output branch of feature fusion is pruned, retaining the feature layer used to detect large-scale targets and the feature layer used to detect medium-scale targets as the output of the G-YOLO neural network; The target bounding boxes are clustered using the K-Means clustering algorithm to obtain the anchor size suitable for the G-YOLO neural network, thereby completing the optimization of the G-YOLO neural network. The optimized G-YOLO neural network was constructed using the Tensonflow-gpu deep learning framework to obtain the G-YOLO industrial parts inspection model.

2. The industrial parts inspection method according to claim 1, characterized in that, The process of photographing industrial parts using a camera and creating an initial dataset of industrial parts specifically involves: The industrial parts placed on the operating table are photographed using a camera to obtain video samples of the industrial parts; Based on image processing algorithms, multiple single-frame industrial part sample images are obtained from the video samples of the industrial parts. According to the set requirements, the multiple industrial part sample images are filtered and the filtered industrial part sample images are combined into an initial industrial part dataset.

3. The industrial parts inspection method according to claim 1, characterized in that, The data augmentation processing for the labeled multiple industrial part sample images is specifically as follows: Three data augmentation processes—horizontal mirroring, vertical mirroring, and diagonal mirroring—were applied to the labeled images of multiple industrial parts.

4. The industrial parts inspection method according to any one of claims 1 to 3, characterized in that, The step of sending the image of the industrial part to be detected to the G-YOLO industrial part detection model, and then outputting the detection result of the image of the industrial part to be detected by the G-YOLO industrial part detection model, specifically involves: The G-YOLO industrial parts inspection model is deployed on an external PC; The image of the industrial part to be detected is transmitted as a data stream to the G-YOLO industrial part detection model on an external PC. The G-YOLO industrial part detection model detects the image of the industrial part to be detected and outputs the detection results. The detection results include the position information of the prediction box, the industrial part category information in the prediction box, and the confidence level of the prediction box.

5. An industrial parts inspection device based on a G-YOLO neural network, characterized in that, include: The imaging module is used to photograph industrial parts using imaging equipment and to create an initial dataset of industrial parts, which includes multiple sample images of industrial parts. The annotation module is used to annotate the target bounding boxes of multiple industrial part sample images using an image annotation tool. The image preprocessing module is used to perform data augmentation processing on multiple labeled industrial part sample images respectively. The labeled industrial part sample images and the data-augmented industrial part sample images are divided according to a preset ratio to obtain a sample training set and a sample test set. The model building module is used to build an initial G-YOLO industrial part inspection model based on the G-YOLO neural network. The training module is used to train the initial G-YOLO industrial parts detection model using the sample training set, and to perform performance testing on the trained initial G-YOLO industrial parts detection model using the sample test set, so as to obtain the G-YOLO industrial parts detection model. The imaging module is also used to capture images of the industrial parts to be inspected using the imaging device, thereby obtaining images of the industrial parts to be inspected. The detection module is used to send the image of the industrial part to be detected to the G-YOLO industrial part detection model, and output the detection result of the image of the industrial part to be detected through the G-YOLO industrial part detection model. The multiple industrial part sample images were annotated using an image annotation tool, specifically as follows: The Labelimg image annotation tool was used to perform target bounding box annotation on multiple industrial part sample images. The target bounding box annotation process included the four positional information of the target bounding box (x, y, w, and h) and the category information corresponding to each target bounding box. The category information included gear category information, bearing category information, and nut category information. The initial G-YOLO industrial parts inspection model based on the G-YOLO neural network is constructed as follows: A GhostNet network layer was constructed to replace the CSPDarkNet53 backbone feature extraction network in the G-YOLO neural network; The down-up feature fusion path in the G-YOLO neural network is removed, and the output branch of feature fusion is pruned, retaining the feature layer used to detect large-scale targets and the feature layer used to detect medium-scale targets as the output of the G-YOLO neural network; The target bounding boxes are clustered using the K-Means clustering algorithm to obtain the anchor size suitable for the G-YOLO neural network, thereby completing the optimization of the G-YOLO neural network. The optimized G-YOLO neural network was constructed using the Tensonflow-gpu deep learning framework to obtain the G-YOLO industrial parts inspection model.

6. An industrial parts inspection device based on a G-YOLO neural network, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the industrial part inspection method based on the G-YOLO neural network as described in any one of claims 1 to 4.

7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the industrial part inspection method based on the G-YOLO neural network as described in any one of claims 1 to 4.