A wheel hub weld visual inspection method and inspection system
By applying the deep learning algorithm based on YOLOV3 in the hub weld detection, the existing detection methods are solved, and intelligent detection of hub welds is realized, meeting the real-time online detection needs.
Patent Information
- Application Number
- CN202010870708.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-26
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2040-08-26
AI Technical Summary
The existing hub weld detection methods rely on manual visual inspection, are inefficient and rely on the level of the inspector, and there are missed or mis-checked conditions. The traditional machine vision detection methods are poor in versatility and lack robustness, making it difficult to meet the real-time online detection needs.
The visual detection method of hub welds based on YOLOV3 is adopted, and by building a detection system, the YOLOv3-GIoU improved algorithm of deep convolutional neural network algorithm is used for detection training, the prior box and loss function are optimized, and the detection accuracy and efficiency are improved.
It realizes intelligent detection of wheel hub weld defects, improves detection efficiency and accuracy, meets the real-time online inspection needs of wheel hub manufacturers, has high robustness and versatility, and can adapt to different production environments.
Smart Images

Figure CN111929314B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of industrial detection, and in particular relates to a wheel hub weld visual detection method and detection system. Background Art
[0002] At present, most of the weld defects of wheel hubs are surface defects. In actual production, surface defect detection is mostly done by manual visual inspection. However, this method has the problems of low detection efficiency, reliance on the level of the inspectors, and the inspectors are prone to fatigue. Therefore, there are cases of missed detection or false detection.
[0003] The object detection algorithm based on deep learning is fast and accurate, and has achieved many results in application. In particular, the YOLOv3 algorithm proposed in 2018 has extremely high detection speed and high accuracy for limited types of object detection. Therefore, many scholars have applied the YOLOv3 algorithm to the industrial field.
[0004] Through the above analysis, the problems and defects of the existing technology are as follows: the existing detection methods are mostly manual visual inspection, which has low detection efficiency, depends on the level of the inspection personnel, and has the problem of missed detection or false detection; the use of traditional machine vision inspection methods has the problem of relying on manually designed feature extraction algorithms, and this method has poor versatility and insufficient robustness, and it is difficult to meet the real-time online detection needs and high requirements for detection accuracy of wheel manufacturers.
[0005] The difficulty of solving the above problems and defects is: designing an overall inspection process plan, building a wheel hub transmission mechanism, a wheel hub weld automatic collection device and a defective wheel hub screening mechanism. It is necessary to select a suitable open source algorithm and improve it to meet the real-time and high-precision requirements of the production enterprise.
[0006] The significance of solving the above problems and defects is: realizing intelligent detection of wheel hub weld defects instead of manual visual inspection, improving production efficiency, and meeting the real-time online detection needs of wheel hub manufacturers. This method can quickly and efficiently identify wheel hub weld defects, and has high robustness and versatility. It can adapt to different production environments and can also increase the types of weld defects to be identified according to needs. Summary of the invention
[0007] In view of the problems existing in the prior art, the present invention provides a wheel hub weld visual inspection method.
[0008] The present invention is implemented as follows: a wheel hub weld visual inspection method, comprising:
[0009] Step 1: Build a wheel weld visual inspection system based on YOLOV3;
[0010] Step 2: Verify the built wheel hub weld visual inspection system;
[0011] Step three: Use the verified wheel hub weld visual inspection system to perform visual inspection on the wheel hub weld.
[0012] Further, in step 2, the hub weld visual inspection system verification method includes:
[0013] (1) Using camera equipment to collect images of wheel hub weld defects in the factory, preprocess the collected images, adjust the image size and classify the images;
[0014] (2) Use image annotation tools to classify and annotate various images and create a dataset of wheel hub weld defects;
[0015] (3) The improved YOLOv3-GIoU algorithm based on the deep convolutional neural network algorithm is used to train the wheel hub weld defect detection, and the recognition detection verification is carried out. The verification result data is analyzed, and the adjustment parameters are optimized through the verification result analysis to obtain the optimized wheel hub weld detection system based on the improved YOLOv3.
[0016] Furthermore, in step (2), the image classification and labeling includes: classifying weld defects into broken arc, weld nodule, weld deviation, poor arc starting and porosity, and classifying and labeling them as different categories.
[0017] Further, in step (2), the wheel hub weld defect dataset is divided into a training set, a validation set, and a test set in a ratio of 7:2:1;
[0018] The training set is used for model training;
[0019] The validation set is used to evaluate model performance;
[0020] The test set is used to simulate real detection experiments.
[0021] Further, in step (3), the YOLOv3-GIoU improved algorithm based on the deep convolutional neural network algorithm includes:
[0022] 1) Improve the YOLOv3 algorithm using loss function;
[0023] The original YOLOv3 algorithm loss function is as follows:
[0024]
[0025] Where obj means that the cell contains an object, noobj means that the cell does not contain an object; i means the i-th cell, j means the j-th box predicted by the cell; tx, ty, tw, th in the first two items respectively represent the center point coordinate offset value of the predicted box and the ratio of the predicted box width and height to the image, where the superscripts are the position coordinate information of the real box; I represents the indicative function of whether the j-th box of the i-th cell has an object; C is the confidence score of the predicted box; p is the conditional category probability value; the first two items are positioning loss functions, items 3 and 4 are confidence loss functions, and the last item is the classification loss function;
[0026] The category confidence score is calculated by multiplying the conditional category probability by the prediction box confidence score, as follows:
[0027]
[0028] GIoU is introduced as the positioning loss function. The GIoU calculation formula is as follows:
[0029]
[0030]
[0031] LGIoU = 1 - GIoU # (7)
[0032] In the formula, A and B represent the predicted box and the real box, and C represents the minimum bounding rectangle containing A and B. The first two terms in the YOLOv3 loss function are the calculation formulas for the positioning loss function, which uses the bi-norm value of the coordinate formula to represent the overlap between the A box and the B box. Here, the calculation formula of GIoU is used to replace the bi-norm value to achieve the purpose of optimizing the loss function and improving the algorithm performance.
[0033] 2) Optimize the prior box: Use K-means clustering to calculate the prior box size of the training set, modify the value of the anchor box in the parameter file based on the calculation result, and optimize the prior box;
[0034] 3) Calculate the parameters using the following formula:
[0035] W=W BN ·W conv #(8)
[0036] b=W BN b conv +b BN #(9)
[0037] Among them, W conv and b conv are the weight matrix and bias of the convolutional layer, W BN and bBN is the weight matrix and bias of the BN layer.
[0038] Further, in step three, the visual inspection of the hub weld using the verified intelligent inspection system includes:
[0039] First, the conveying device conveys the wheel hub to the predetermined position; when the wheel hub triggers the photoelectric sensor at the predetermined position, the area array CCD camera is used to collect image information of the weld;
[0040] Secondly, the collected image information is processed and whether the wheel hub weld is qualified is determined based on the processed image information; if qualified, the inspected wheel hub is transmitted to the next production process using a conveying device; if the wheel hub fails the inspection, the ejection device is started when the wheel hub passes the second photoelectric sensor, and the unqualified wheel hub is ejected onto the defective workpiece recovery raceway to recover the defective workpiece.
[0041] Another object of the present invention is to provide a wheel hub weld visual inspection system based on YOLOV3 for implementing the wheel hub weld visual inspection method based on YOLOV3, wherein the wheel hub weld visual inspection system based on YOLOV3 comprises:
[0042] Conveying module, image acquisition module, detection module, defective workpiece ejection module and recovery module;
[0043] A conveying module, used for conveying the wheel hub to a corresponding position by using a conveying device;
[0044] An image acquisition module is used to collect image information of the weld using an area array CCD camera when the wheel hub reaches a predetermined position and triggers the photoelectric sensor;
[0045] A detection module, used to process the collected image information and determine whether the hub weld is qualified based on the processed image information;
[0046] Defective workpiece ejection module, used to eject the unqualified wheel hub by using the ejection device when there are defects in the wheel hub weld;
[0047] The recycling module is used to recycle unqualified wheels.
[0048] Furthermore, the wheel hub weld visual inspection system further comprises a conveying device;
[0049] The wheel hub is transferred from the previous process to the inspection platform by the conveying device. When the wheel hub reaches the predetermined position and triggers the first photoelectric sensor, the image acquisition device starts to capture the wheel hub weld. The acquired image information is transmitted to the image workstation for processing and judging whether the wheel hub weld is qualified. If the result is that the weld is free of defects, the inspection is completed and the wheel hub is transmitted to the next process. If the inspection result is that the weld is defective, the defective workpiece ejection device is started when the wheel hub passes the second photoelectric sensor, and the unqualified wheel hub is ejected onto the defective workpiece recovery raceway to recover the defective workpiece.
[0050] The actions of the conveying device, the image acquisition device and the defective workpiece ejecting device are controlled by PLC.
[0051] The conveying device comprises a driving roller and a driven roller; a rubber conveyor belt is installed on the driving roller and the driven roller;
[0052] The bearing and the bearing cup are assembled and fixed on the bearing sleeve with screws, and the bearing sleeve is on the active roller and the driven roller; there are multiple bearing sleeves;
[0053] The aluminum profile components are respectively connected to the bearing sleeves at the same end of the active roller and the driven roller, and a tension block is added during the connection to adjust the distance between the active roller and the driven roller;
[0054] A sprocket is installed on the active roller shaft and the stepper motor output shaft and connected with a chain for power transmission from the stepper motor to the active roller.
[0055] The image acquisition device includes a CCD camera with more photosensitive lenses and a rotating detection frame; the CCD camera is installed on the rotating detection frame; the rotating detection frame includes a disc conveyor, a disc, a disc bracket, and a rotating motor;
[0056] The disc conveyor is installed on the disc; the disc is installed on the upper end of the disc bracket; the rotating motor is connected to the bottom of the disc through a shaft sleeve;
[0057] The defective workpiece ejection device is used to push the determined defective workpiece from the original conveying device to another conveying device perpendicular to it for recycling or reprocessing; a double-acting single-rod piston hydraulic cylinder is used as a power element, and an electromagnetic reversing valve is connected to the PLC for control, and the second photoelectric sensor is used to realize the screening of unqualified wheel hubs; the double-acting single-rod piston hydraulic cylinder is fixed on the sliding guide rod fixing plate; the sliding guide rod holes on both sides of the sliding guide rod fixing plate are penetrated by freely sliding sliding guide rods, including a left sliding guide rod and a right sliding guide rod; the top end of the double-acting single-rod piston hydraulic cylinder, the left sliding guide rod and the right sliding guide rod are all connected to the push plate.
[0058] Another object of the present invention is to provide a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the method.
[0059] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the method.
[0060] Combined with all the above technical solutions, the advantages and positive effects of the present invention are as follows: the present invention proposes a new method for intelligent detection of wheel hub weld defects, and uses the improved YOLOv3-GIoU algorithm based on the deep convolutional neural network algorithm to detect wheel hub weld defects. GIoU is introduced as a new loss function calculation method, and the K-means clustering method is used to optimize the prior frame parameters, which improves the accuracy of the detection model and reduces the training time. Through the test verification, the YOLOv3-GIoU better result model can be used for the wheel hub weld defect intelligent detection system. The test results show that the improved result model has an F1 value of 0.92 in the verification set detection, and the mAP value reaches 89.16%. The overall accuracy of the detection on the test set is 98.54%, which shows that the YOLOv3-GIoU algorithm model can accurately identify, classify and locate tractor wheel hub weld defects in practical applications, realize the intelligent detection of tractor weld defects, and replace manual visual inspection. The single-sheet detection time of the detection algorithm does not exceed 22 milliseconds, and the detection efficiency is high, which meets the production line rhythm requirements of wheel hub manufacturers and realizes real-time online detection of wheel hub weld defects.
[0061] The detection method of the present invention has a high detection accuracy rate on both the verification data set and the test data set. The detection effect diagram of each defect category is shown in the attached figure. Fig.12 .
[0062] The present invention uses a network model based on the YOLOv3 algorithm to identify, detect and classify the defects of the hub weld, thereby realizing intelligent detection of the hub weld defects. In view of the problem of the application of the detection system in actual production, a detection process from image acquisition to automatic detection and then to the ejection of defective workpieces is designed, and a solution for installing an intelligent detection system on the production line is realized. In view of the problem of the detection effect of the algorithm model, the generalized intersection-over-union (GIoU) is used to improve it and adjust the parameters in the YOLOv3 model algorithm, and good results are achieved in experimental detection.
[0063] The technical effects or experimental effects of the comparison include:
[0064] In the present invention, the YOLOv3-2 algorithm with optimized prior frame and the improved YOLOv3-GIoU algorithm are respectively trained on the training set, and then the model performance is verified by the validation set, and the training parameters are continuously adjusted to obtain the model with the best effect. The results of different training parameters and different algorithm models are comprehensively considered. Since the judgment criteria of positive samples have a greater impact on the algorithm results when the mean average precision (mAP) result is detected on the validation set, the mAP value is statistically calculated with different positive sample judgment criteria (different IoU thresholds), and the detection results are shown in Table 1. It can be seen that YOLOv3-GIoU performs better, and its mAP value is higher than the mAP value of YOLOv3-2 at thresholds of 0.3, 0.35, 0.6, 0.7 and average values, especially at 0.7 and 0.75, which are relatively improved by 3.26% and 3.7%. Based on the above data, it can be concluded that the improved YOLOv3-GIoU model has higher positioning detection accuracy and higher accuracy, and is a better algorithm model.
[0065] Table 1 Validation set mAP of different models at different IoU thresholds
[0066] BRIEF DESCRIPTION OF THE DRAWINGS
[0067] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0068] Figure 1 It is a flow chart of the wheel hub weld visual inspection method based on YOLOV3 provided in an embodiment of the present invention.
[0069] Figure 2 It is a schematic diagram of a wheel hub weld visual inspection method based on YOLOV3 provided in an embodiment of the present invention.
[0070] Figure 3 It is a schematic diagram of the structure of a wheel hub weld visual inspection system based on YOLOV3 provided in an embodiment of the present invention.
[0071] Figure 3 In: 1. Conveying device; 2. Image acquisition device; 3. Defective workpiece ejection device; 4. Wheel hub; 5. Inspection platform; 6. First photoelectric sensor; 7. Second photoelectric sensor.
[0072] Figure 4It is a schematic diagram of the structure of a rotary detection framework provided by an embodiment of the present invention.
[0073] Figure 4 Middle: 8. disc conveyor; 9. disc; 10. disc bracket; 11. rotating motor.
[0074] Figure 5 It is a schematic diagram of a defective workpiece ejection device provided in an embodiment of the present invention.
[0075] Figure 5 Middle: 12. Double-acting single-rod piston hydraulic cylinder; 13. Left sliding guide rod; 14. Right sliding guide rod; 15. Push plate.
[0076] Figure 6 This is an example diagram of a data set provided by an embodiment of the present invention.
[0077] Figure 8 It is a schematic diagram of predicted boxes and real boxes in different situations provided by an embodiment of the present invention.
[0078] Figure 7 It is a schematic diagram of two overlapping frames provided by an embodiment of the present invention.
[0079] Fig. 9 It is a curve diagram of the change of Loss value with the number of iterations provided by an embodiment of the present invention.
[0080] Fig.10 It is a schematic diagram of an average intersection-to-joint ratio iteration curve provided by an embodiment of the present invention.
[0081] Fig.11 Schematic diagram of the change of mAP value with the number of iterations provided by an embodiment of the present invention.
[0082] Fig.12 It is a diagram of the detection effect on the test set provided by an embodiment of the present invention.
[0083] Fig.13 This is a typical misdetection result diagram of a good image in the test set provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0084] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0085] In view of the problems existing in the prior art, the present invention provides a wheel hub weld visual inspection method and inspection system, which will be described in detail below in conjunction with the accompanying drawings.
[0086] like Figure 1As shown, the wheel hub weld visual inspection method based on YOLOV3 provided in an embodiment of the present invention comprises the following steps:
[0087] S101, build a wheel hub weld visual inspection system based on YOLOV3.
[0088] S102, verifying the constructed intelligent detection system.
[0089] S103, using a verified intelligent inspection system to perform visual inspection on the hub weld.
[0090] In step S101, the intelligent detection system verification method provided by the embodiment of the present invention includes:
[0091] (1) Using camera equipment to collect images of wheel hub weld defects in the factory, preprocess the collected images, adjust the image size and classify the images;
[0092] (2) Use image annotation tools to classify and annotate various images and create a dataset of wheel hub weld defects;
[0093] (3) The improved YOLOv3-GIoU algorithm based on the deep convolutional neural network algorithm is used to train the wheel hub weld defect detection, and the recognition detection verification is carried out. The verification result data is analyzed, and the adjustment parameters are optimized through the verification result analysis to obtain the optimized wheel hub weld detection system based on YOLOv3.
[0094] In step (2), the image classification and labeling provided by the embodiment of the present invention includes: classifying weld defects into broken arc, weld nodule, weld deviation, poor arc starting and porosity, and classifying and labeling them as different categories.
[0095] In step (2), the wheel hub weld defect data set provided by the embodiment of the present invention is divided into a training set, a validation set, and a test set in a ratio of 7:2:1;
[0096] The training set is used for model training;
[0097] The validation set is used to evaluate model performance;
[0098] The test set is used to simulate real detection experiments.
[0099] In step (3), the YOLOv3-GIoU improved algorithm based on the deep convolutional neural network algorithm provided by the embodiment of the present invention includes:
[0100] 1) Improve the YOLOv3 algorithm using loss function;
[0101] The loss function of the YOLOv3 improved algorithm is as follows:
[0102]
[0103] Where obj means that the cell contains an object, noobj means that the cell does not contain an object; i means the i-th cell, j means the j-th box predicted by the cell; tx, ty, tw, th in the first two items respectively represent the center point coordinate offset value of the predicted box and the ratio of the predicted box width and height to the image, where the superscripts are the position coordinate information of the real box; I represents the indicative function of whether the j-th box of the i-th cell has an object; C is the confidence score of the predicted box; p is the conditional category probability value; the first two items are positioning loss functions, items 3 and 4 are confidence loss functions, and the last item is the classification loss function;
[0104] The category confidence score is calculated by multiplying the conditional category probability by the prediction box confidence score, as follows:
[0105]
[0106] GIoU is introduced as the positioning loss function. The GIoU calculation formula is as follows:
[0107]
[0108]
[0109] LGIoU=1-GIoU#(7)
[0110] In the formula, A and B represent two rectangular boxes, and C represents the minimum circumscribed rectangle containing A and B. The first two terms in the YOLOv3 loss function are the calculation formulas for the positioning loss function, which uses the bi-norm value of the coordinate formula to represent the overlap between box A and box B. Here, the calculation formula of GIoU is used to replace the bi-norm value to achieve the purpose of optimizing the loss function and improving the algorithm performance.
[0111] 2) Optimize the prior box: Use K-means clustering to calculate the prior box size of the training set, modify the value of the anchor box in the parameter file based on the calculation result, and optimize the prior box;
[0112] 3) Calculate the parameters using the following formula:
[0113] W=W BN ·W conv #(8)
[0114] b=W BN b conv +b BN #(9)
[0115] Among them, W conv and bconv are the weight matrix and bias of the convolutional layer, W BN and b BN is the weight matrix and bias of the BN layer.
[0116] like Figure 2 As shown, in step S103, the visual inspection of the hub weld using the verified intelligent inspection system provided by the embodiment of the present invention includes:
[0117] First, the conveying device conveys the wheel hub to the predetermined position; when the wheel hub triggers the photoelectric sensor at the predetermined position, the area array CCD camera is used to collect image information of the weld;
[0118] Secondly, the collected image information is processed and whether the wheel hub weld is qualified is determined based on the processed image information; if qualified, the inspected wheel hub is transmitted to the next production process using a conveying device; if the wheel hub fails the inspection, the ejection device is started when the wheel hub passes the second photoelectric sensor, and the unqualified wheel hub is ejected onto the defective workpiece recovery raceway to recover the defective workpiece.
[0119] The wheel hub weld visual inspection system based on YOLOV3 provided in an embodiment of the present invention includes:
[0120] A conveying module, used for conveying the wheel hub to a corresponding position by using a conveying device;
[0121] An image acquisition module is used to collect image information of the weld using an area array CCD camera when the wheel hub reaches a predetermined position and triggers the photoelectric sensor;
[0122] A detection module, used to process the collected image information and determine whether the hub weld is qualified based on the processed image information;
[0123] Defective workpiece ejection module, used to eject the unqualified wheel hub by using the ejection device when there are defects in the wheel hub weld;
[0124] The recycling module is used to recycle unqualified wheels.
[0125] In the present invention, if Figure 3 As shown, the wheel hub weld visual inspection system based on YOLOV3 provided by the embodiment of the present invention aims to realize the workpiece transmission and screening functions based on the improved YOLOv3 wheel hub weld intelligent inspection method, and complete the wheel hub weld image acquisition work at the same time, solve the problem of fuzzy and inaccurate image acquisition, and make the modules and mechanical structures included in the intelligent inspection system cooperate with each other through PLC, effectively and accurately locate the wheel hub weld and screen qualified wheel hubs from unqualified wheel hubs after classifying and identifying weld defects.
[0126] The mechanical structure of the wheel hub weld visual inspection system based on YOLOV3 provided in the embodiment of the present invention mainly comprises a conveying device 1, an image acquisition device (CCD camera) 2 and a defective workpiece ejecting device 3. It also includes a PLC, which controls the conveying device 1, the image acquisition device (CCD camera) 2 and the defective workpiece ejecting device to work.
[0127] In order to ensure high-quality and high-efficiency production of the wheel hub automated production line, it is necessary to match the wheel hub weld intelligent detection system with the wheel hub automated production line, while meeting the production line beat requirements and weld defect detection accuracy requirements. The relevant parameters of the wheel hub production line are production line roller height 1.35 meters, production line roller speed 8.64 meters / minute, wheel hub welding robot single station beat 12.5s / piece, wheel hub weight 10kg, wheel hub minimum circumference radius 150mm, wheel hub maximum circumference radius 400mm.
[0128] The overall detection process of the present invention (such as Figure 2 ) is as follows: In the actual production process, the wheel hub 4 is transferred from the previous process to the inspection platform 5 by the conveying device 1. When the wheel hub 4 reaches the predetermined position and triggers the first photoelectric sensor 6, the image acquisition device 2 starts to take an image of the weld of the wheel hub 4. The acquired image information will be transmitted to the image workstation for processing and judging whether the weld of the wheel hub is qualified. If the result is that the weld is free of defects, the inspection is completed and the wheel hub 4 is transmitted to the next process; if the inspection result is that there is a defect in the weld, the defective workpiece ejection device 3 is started when the wheel hub passes the second photoelectric sensor 7, and the unqualified wheel hub is ejected onto the defective workpiece recovery raceway to recover the defective workpiece. Its structural schematic diagram is shown as follows Figure 3 shown.
[0129] The conveying device 1 of the present invention uses a conveyor belt for conveying, and the main structure of a single conveying device is as follows. First, the roller is selected to have a size of 76×150×20 (diameter×length×shaft head diameter), and a single conveying device has a total of 2, divided into an active roller and a driven roller. Secondly, the bearing (6204) and the bearing cup (6204) are combined and fixed on the bearing sleeve (4080) with screws, for a total of 4 groups. A rubber conveyor belt is installed on the master and slave rollers, and the conveyor belt size is 2118×150×3 (circumference×width×thickness). The 4 groups of assembled bearing sleeves are respectively mounted on the master and slave rollers, and then the national standard 4080 aluminum profiles are used to connect the bearing sleeves at the same end of the master and slave rollers, and elastic L blocks are added during the connection to adjust the distance between the master and slave rollers, thereby realizing the conveyor belt tension adjustment function. The national standard 4040 aluminum profile (150mm) is used to support the entire conveyor belt, and the 4040 aluminum profile and 4080 aluminum profile are connected by 4040 angle code, which are fixed by 13FM8 nuts and M8×16 bolts. Finally, sprockets are installed on the active roller shaft and the stepper motor output shaft respectively and connected with chains to realize the power transmission from the motor to the active roller.
[0130] The present invention determines the circumference of the conveyor belt according to the size of the detection platform 5, and determines the power of the motor driving the conveyor belt according to the actual weight of the hub and the conveying speed requirement of not less than 8 meters / minute.
[0131] Since the image area of the wheel hub weld is relatively large, in order to ensure the accuracy of the image, the image acquisition device of this system uses an area array CCD camera with more photosensitive lenses. The specific model is the BFS-U3-89S6C-C area array CCD sensor industrial camera developed and produced by Lingyun Optical Technology Group Co., Ltd. At the same time, USB3.0 is used as the output interface. This interface can directly output digital image signals, with low cost, wide application and fast transmission speed. After the device is started, the wheel hub to be inspected will be continuously transmitted to the inspection platform and imaged on the inspection platform. Generally, a wheel hub has 4 welds, and it is necessary to ensure that the image acquisition device can clearly and completely obtain the image of each weld. The industrial camera is installed directly above the center of the wheel hub and at a 30-degree angle to the weld. In order to reduce costs and save space, the electromechanical structure of the image acquisition device adopts a rotating detection frame solution. The structure is as follows: Figure 4 The utility model comprises: a disc conveyor belt 8, a disc 9, a disc support 10, and a rotating motor 11.
[0132] The disc conveyor 8 is installed on the disc 9; the disc 9 is installed on the upper end of the disc bracket 10; the rotating motor 11 is connected to the bottom of the disc 9 through a shaft sleeve. The disc conveyor 8 is basically the same as the conveyor belt of the above-mentioned conveying device 1 in structure and material selection. The difference is that the bottom of the disc conveyor 8 is connected to the disc 9. Driven by the rotating motor 11, the hub workpiece is rotated, making the industrial camera image more complete and clear. The industrial camera is connected to the disc bracket 10 through a fixed rod, and the installation angle of the industrial camera is adjusted so that it can obtain a more complete image of the hub weld to be detected.
[0133] The main function of the defective workpiece ejection device 3 is to push the determined defective workpiece from the original conveying device to another conveying device perpendicular to it for recycling or reprocessing. Considering that the wheel hub is a heavy metal workpiece, a double-acting single-rod piston hydraulic cylinder 12 is used as the power source, and an electromagnetic reversing valve is connected to the PLC for control, and the second photoelectric sensor 7 is used to realize the screening function of unqualified wheel hubs. The structure is as follows Figure 5 shown.
[0134] The double-acting single-rod piston hydraulic cylinder 12 is fixed on the sliding guide rod fixing plate; the sliding guide rod holes on both sides of the sliding guide rod fixing plate are penetrated by freely sliding sliding guide rods; including a left sliding guide rod 13 and a right sliding guide rod 14; the top end of the double-acting single-rod piston hydraulic cylinder 12, the left sliding guide rod 13 and the right sliding guide rod 14 are all connected to the push plate 15.
[0135] The electromechanical transmission controller selected in the present invention is Mitsubishi's Q35BPLC, which is used to control the stepper motor to achieve the function of controlling the start and stop of the conveyor belt, realize the accurate limit of the wheel hub to be tested and ensure that the camera is located directly above the wheel hub to ensure the quality of the image information. After the image acquisition device of the detection system starts working, the rotary motor is controlled to complete the rotation and imaging, and the acquired image is transmitted to the workstation through the interface for processing. After obtaining the output result of the detection system, the defective workpiece ejection device 3 is controlled to eject the unqualified wheel hub onto the defective workpiece recovery conveyor belt at the appropriate position.
[0136] The technical effects of the present invention are further described below in conjunction with specific embodiments.
[0137] Example:
[0138] 1.1 Construction of wheel hub weld detection experimental platform
[0139] In the production process of wheel hubs, the welding quality of wheel hub welds is manually inspected to screen out unqualified products. The main components of the inspection platform are a conveying device, an image acquisition device and a defective workpiece ejection device. The inspection process is as follows: In the actual production process, the wheel hub is conveyed from the previous process to the inspection platform by a conveying device. When the wheel hub reaches the predetermined position and triggers the photoelectric sensor, the image acquisition device takes an image of the weld. The acquired image information is transmitted to the computer through an interface for processing and judging whether the wheel hub weld is qualified. If the result is that the weld is free of defects, the inspection is terminated and transmitted to the next production process; if the inspection result is that there are defects in the weld, the ejection device is started when the wheel hub passes the second photoelectric sensor to eject the unqualified wheel hub onto the defective workpiece recovery raceway to recover the defective workpiece.
[0140] The conveying device is driven by a stepper motor and controlled by a PLC. The belt is used as a conveyor belt to convey the wheel hub to each workstation. The image acquisition device uses an array CCD camera. After the device is started, the wheel hub to be inspected will be continuously transported from the previous workstation to the inspection platform, and images will be taken on the inspection platform to ensure that the system can detect each weld through the camera. Generally, a wheel hub has 4 welds. The start and stop of the motor is strictly controlled by PLC to achieve accurate limit of the wheel hub to be tested and ensure that the camera is located directly above the wheel hub to ensure the quality of the collected image information. If the speed is too low during the whole process, it will affect the production efficiency. If the speed is too fast, it will affect the clarity of the image, thereby affecting the detection accuracy. Therefore, it is necessary to meet the production rhythm and be as accurate as possible. The reliable stability of the detection platform is also an important evaluation indicator.
[0141] 1.2 Design and test process
[0142] After building the detection system simulation platform, it is necessary to test and verify the detection effect of the intelligent detection system to prove that the algorithm performance of the intelligent detection system meets the standards and achieve the purpose of replacing manual detection. The YOLOv3 algorithm used in this invention converts the defect detection problem into a regression classification problem. The experimental process can be roughly divided into image data acquisition, data set production, model training, model testing and comparative analysis.
[0143] The test first needs to collect wheel hub weld images, then preprocess the collected images, adjust the image size and classify the images, then use image annotation tools to annotate various images, and create a data set of wheel hub weld defects. The data set includes a training set for model training, a validation set for evaluating model performance, and a test set for simulating real detection tests. The test uses the YOLOv3 algorithm and the improved YOLOv3 algorithm for training, and then conducts recognition and detection tests, analyzes the test result data, further adjusts the parameters through the analysis of the test results, and optimizes the wheel hub weld detection algorithm based on YOLOv3 to obtain a higher detection accuracy. The overall test flow chart is shown below. Figure 2 shown.
[0144] 1.3 Image data collection and annotation
[0145] Image data collection uses a camera to obtain images to ensure that the wheel hub weld in the image is clear and complete. The collected images are from the wheel hub weld defect samples in the factory, and the images of the training set and the validation set are manually annotated. The training of the target detection model based on deep learning requires a large number of annotated samples. In theory, the more samples there are, the better the detection effect of the trained model. Therefore, if you want to train a model with high recognition accuracy, you need to annotate a large number of data samples of multiple types. This experiment uses the open source image calibration tool LabelImg.
[0146] After analyzing and studying the common types of wheel hub weld defects, the present invention divides the weld defects into broken arc, weld nodule, deflection welding, poor arc starting and pores, and classifies and labels them as different categories for training and detection, such as Figure 6 These 5 common weld defects are shown. Figure 6 a. Arc breaking defect diagram; Figure 6 b. Welding nodule defect diagram; Figure 6 c. Welding defect diagram; Figure 6 d. Arc starting defect diagram; Figure 6 e. Porosity defect diagram.
[0147] Finally, a total of 1356 images were marked, and a part of them were randomly selected as the validation set, and the rest were used as the training set. Among them, 256 broken arc defects were marked, 219 were used as the training set, and 57 were divided into the validation set; 276 weld nodule defects were marked, 213 were used as the training set, and 63 were divided into the validation set; 273 partial welding defects were marked, 203 were used as the training set, and 70 were used as the validation set; 254 poor arc starting defects were marked, 188 were used as the training set, and 66 were used as the validation set; 277 porosity defects were marked, 209 were used as the training set, and 68 were divided into the validation set. The ratio of each data set is approximately 7:2:1. Because the defect of the weld is a low-probability event in the actual production process, 603 intact weld images were added to the test set as interference items, which can be more in line with practical applications. The statistical results are shown in Table 2.
[0148] Table 2 Number of images of each category in the dataset
[0149]
[0150]
[0151] 2 Algorithm Improvement
[0152] Loss function improvement
[0153] The YOLOv3 algorithm can detect targets of different sizes. The information size contained in each cell of the feature map is represented by the depth dimension D, and its calculation formula is shown in Formula 1.
[0154] D=B×(5+C)#(1)
[0155] Before training the model, the YOLOv3 algorithm converts the input image to the same size and normalizes the labeled real box coordinate data, as shown in the following formula (2). In formula (2), width and height are the width and height of the image, and x max ,y max and x min ,y min are the coordinates of the lower right corner and upper left corner of the real box (the origin is the upper left corner of the picture), x and y are the center coordinates of the real box, w and h are the width and height of the real box.
[0156]
[0157] The YOLOv3 algorithm uses a loss function to characterize the difference between the predicted value and the true value during iterative calculations. The loss function is optimized by continuously updating the weight value to continuously reduce the loss function value (Loss value). The YOLOv3 loss function is shown in Formula 3:
[0158]
[0159] Where obj means that the cell contains an object, noobj means that the cell does not contain an object; i means the i-th cell, j means the j-th box predicted by the cell; tx, ty, tw, th in the first two items respectively represent the coordinate offset value of the center point of the predicted box and the ratio of the width and height of the predicted box to the image, and the coordinate value is calculated using Formula 2, where the superscript is the position coordinate information of the real box; I represents the indicative function of whether the j-th box of the i-th cell has an object; C is the confidence score of the predicted box; p is the conditional category probability value; the first two items are positioning loss functions, items 3 and 4 are confidence loss functions, and the last item is the classification loss function. The category confidence score is calculated by multiplying the conditional category probability by the predicted box confidence score, as shown in Formula 4.
[0160]
[0161] In the process of calculating the loss function of the YOLOv3 algorithm, the first two items of the positioning loss function are calculated using the coordinate bi-norm value, that is, the sum of the squares of the differences between the first two items tx, ty, tw, and th in Formula 2. However, this method sometimes cannot reflect the overlap between the predicted box and the real box, that is, there may be a situation where the intersection over union (IoU) is different but the calculated bi-norm value is the same. Figure 7 As shown in the figure, the IoU of the left image is obviously greater than that of the right image. The left image should be a better prediction box, but the values of the bi-norm in the two cases in the figure are equal, which makes it impossible to find a better prediction box. If the IoU value is directly used as a metric in the positioning loss calculation, the above situation can be avoided.
[0162] However, there are also problems with using IoU as an evaluation indicator to participate in the calculation of the loss function. When the predicted box does not overlap with the true box, the IoU value becomes zero. At this time, when IoU is used as a loss function, its gradient is zero, so it cannot be optimized. Secondly, when the two boxes overlap in different directions, such as Figure 8 As shown in the figure, although the IoU values are the same, the effect of the left image is obviously better than that of the right image. Therefore, using the IoU value to substitute into the loss function calculation may affect the detection accuracy. Therefore, the generalized intersection-over-union (GIoU) can be introduced to make up for the shortcomings of IoU. The calculation formula of GIoU is as follows:
[0163]
[0164]
[0165] LGIoU=1-GIoU#(7)
[0166] In the formula, A and B represent two rectangular boxes, and C represents the minimum circumscribed rectangle containing A and B. It is easy to see that the value of GIoU ranges from -1 to 1, while IoU ranges from 0 to 1, and when it is greater than zero, the values of GIoU and IoU are similar, and GIoU is always less than or equal to IoU. When and only when A and B overlap, GIoU = IoU = 1. Therefore, GIoU is a better metric, which can not only measure the overlap but also take into account the non-overlapping area, which can better reflect the quality of the predicted box. LGIoU represents the value used when GIoU participates in the loss calculation, that is, the value range is changed to 2 to 0, so that the algorithm can converge iteratively. The improved algorithm using GIoU is YOLOv3-GIoU.
[0167] 2.3 Optimizing the Prior Box
[0168] Through the definition of the B parameter in formula 1, it can be known that each cell of the feature map extracted by YOLOv3 will generate 3 prediction boxes. In order to improve the convergence speed and prediction accuracy of the prediction box, YOLOv3 introduces a priori box (anchor box). The priori box limits the range of the prediction box of the cell, which is equivalent to adding a priori experience size, thereby accelerating the convergence speed of the model and also contributing to the multi-scale learning of the algorithm. By counting the sizes of all the annotated groundtruth boxes in the training set, the most common shape size is obtained as the priori box. The present invention uses K-means dimensional clustering method to optimize the priori box size.
[0169] K-means dimensional clustering is used to find the center point in the data. Euclidean distance is usually used as the calculation metric. The YOLOv3 algorithm expects to obtain a priori box value with a larger intersection over union (IoU) ratio with all data, so the value of 1-IoU is used as the metric for clustering calculation. Before training, use K-means clustering to calculate the priori box size of your own training set. After obtaining the result, modify the value of anchor box in the parameter file. The values of the 9 priori boxes used in the final training model are: (41×37), (52×63), (54×44), (69×97), (75×61), (83×132), (110×76), (117×143), (160×100).
[0170] 2.4 Improve YOLOv3 forward inference speed
[0171] During the training process of YOLOv3, its data distribution will experience internal covariate shift (Internal CovariateShift), that is, the input distribution of each hidden layer will change when the parameters of each layer are updated, so the input layer is usually randomized. However, this will slow down the training speed and increase the sensitivity to parameters such as the learning rate. Therefore, a batch normalization layer (BatchNormalization) is usually added after the convolution and full connection operations and before the nonlinear activation. The sample data of the same batch is processed with a standard Gaussian distribution and then used as the estimated value of the overall training set for calculation, as shown in formula (8).
[0172]
[0173] In the formula is the parameter value of the current layer, f i,j is the parameter value of the previous layer, W conv and b conv are the weight matrix and bias of the convolutional layer, W BN and b BN is the weight matrix and bias of the BN layer. Therefore, merging these two operations as shown in the following formulas (9) and (10) can reduce the amount of parameter calculation and the amount of memory used during runtime, thereby speeding up the forward reasoning process. In addition, the algorithm effect is not affected because the calculation formula has not changed.
[0174] W=W BN ·W conv # (9)
[0175] b=W BN b conv +b BN # (10)
[0176] 3 Experimental results and analysis
[0177] 3.1 Experimental operation platform
[0178] The YOLOv3 models trained and tested by the wheel hub weld intelligent detection system of the present invention are all run on a high-performance computer with Windows 10 operating system, which is configured with Intel 2.10GHz quad-core CPU, 32GB memory, and Nvidia GeForceRTX 2080Ti graphics card. The training and testing call the GPU for calculation, and also call CUDA, Cudnn and OpenCV software, using the 3.0 version of Python.
[0179] 3.2 Model Training
[0180] Before training, adjust the parameter values in the parameter file. Different parameters will affect the training convergence speed and model effect. The optimal parameter values are selected through the feedback of model verification results. Each training model is iterated 15,000 times, which takes about 20 hours. A total of 1.92 million sample images are involved in the calculation during the training process. After the training starts, a weight file is generated for every 1,000 iterations, so after the model training is completed, a total of 15 weight files are generated, which are the result models. By testing these models on the wheel hub weld verification set, the test results are used to adjust the training parameters, and finally a better model is obtained, and the model is used for test set testing.
[0181] 3.3 Model evaluation indicators
[0182] In order to objectively evaluate the model trained in the present invention, some evaluation indicators are needed, the common ones are accuracy, which represents the ratio of the number of correct samples to the number of incorrect samples in the samples predicted as positive examples; recall represents the ratio of the number of samples predicted as positive examples to the number of samples predicted as negative examples in the samples that are actually positive examples; PR curve (Precision-Recall curve) represents the relationship between the change of accuracy under different recall rates; average precision AP (AveragePrecision) is the average value of the accuracy under different recall rates; mean average precision mAP (mean average precision) is the average value of AP values of different categories; intersection over union (IOU) represents the overlap between the real box and the predicted box, and its threshold is generally 0.5, and the formula is as follows.
[0183]
[0184]
[0185] AP = ∫0 1 P(R)dR# (13)
[0186]
[0187]
[0188] Where TP is the positive sample predicted to be correct, FP is the negative sample predicted to be correct, FN is the positive sample predicted to be incorrect, k is the number of categories, and AP(i) represents the AP value of the i-th category. Since the detection of the present invention must consider both the accuracy and the recall rate, an auxiliary evaluation value F1 is added, and the formula is as follows.
[0189]
[0190] 3.4 Comparative analysis of test results
[0191] In this experiment, the YOLOv3 algorithm and the improved YOLOv3-GIoU algorithm were trained on the training set respectively, and then the validation set was used to verify the model performance, and the training parameters were continuously adjusted to obtain the model with the best effect. Taking into account the impact of different training parameters and different algorithm models, the following three algorithm models were selected for comparison: one is the YOLOv3 algorithm with better training parameters, but without optimizing the prior frame, represented by YOLOv3-1; the second is the YOLOv3 algorithm with the same training parameters and optimized prior frame, represented by YOLOv3-2; the third is the YOLOv3-GIoU algorithm with the same training parameters and optimized prior frame, represented by YOLOv3-GIoU. Fig. 9 and Fig.10 As shown in the figure, the training process of the three cases is visualized to facilitate the analysis of the changes in the loss function value (Loss value) and the average intersection over union (Average IoU) during the training process.
[0192] The Loss values of the algorithm models in the three different situations all dropped rapidly in the first 2000 trainings, and then gradually stabilized, but they still fluctuated slightly and continued to decrease. The average Loss value curves of the three models showed basically the same downward trend. Obviously, the Loss value of YOLOv3-GIoU is lower, and finally converges to about 0.04, while the values of YOLOv3-1 and YOLOv3-2 are slightly higher, and finally converge to about 0.066 and 0.07. For the average intersection-over-union ratio during training, the value of YOLOv3-GioU is generally higher and has a smaller degree of fluctuation, while the situation of YOLOv3-2 is better than that of YOLOv3-1, such as Fig.10 The average IoU gradually stabilized around 0.8 to 0.9 after 8,000 training cycles. This shows that using an optimized priori box can make the average IoU of training higher and more stable, and the positioning accuracy higher. Based on the above data, we can find that the algorithm using YOLOv3-GIoU has a lower loss value and more accurate positioning.
[0193] Through the above analysis, it is obvious that the change of the Loss value is very small after 2000 iterations of training. The Loss value at this time cannot accurately reflect the overall performance of the model, so it is necessary to find out the model that can achieve better performance after several iterations of training. The experiment uses the mAP value of formula 14 as the evaluation indicator, and uses the validation set to verify the models with different iterations of training under three different conditions, and measures their mAP values. The parameter condition for determining a positive sample during calculation is that the IoU value is greater than 0.6. The IoU value is the ratio of the model detection result to the labeled real box.
[0194] According to the test statistics, YOLOv3-1 obtained a better model with an mAP value of 87.66 and an average intersection-over-union ratio of 71.39% when the number of iterative training was 12000. YOLOv3-2 obtained a better model with an mAP value of 88.64% and an average intersection-over-union ratio of 72.53% when the number of iterative training was 9000. YOLOv3-GIoU obtained a better model with an mAP value of 89.16 and an average intersection-over-union ratio of 72.69% when the number of iterative training was 12000. Therefore, the better models of YOLOv3-2 and YOLOv3-GIoU are selected. Fig.11 Schematic diagram of the change of mAP value with the number of iterations provided by an embodiment of the present invention.
[0195] When testing the mAP results on the validation set, the positive sample judgment criteria have a greater impact on the result value. Therefore, the YOLOv3-2 model with 12,000 iterations and the YOLOv3-GIoU model with 12,000 iterations are used to test the validation set, and the mAP values are counted with different positive sample judgment criteria (different IoU thresholds). The test results are shown in Table 3. It can be clearly seen that YOLOv3-GIoU performs better, and its mAP values are higher than those of YOLOv3-2 at thresholds of 0.3, 0.35, 0.6, 0.7 and average values, especially at 0.7 and 0.75, which are relatively improved by 3.26% and 3.7%. According to the above data, it can be shown that the improved YOLOv3-GIoU model has higher positioning detection accuracy and higher accuracy, and is a better algorithm model.
[0196] Table 3 Validation set mAP of different models at different IoU thresholds
[0197]
[0198] 3.5 Test set detection results and analysis
[0199] After determining the model after 12,000 iterations of YOLOv3-GIoU as the final intelligent system detection model, in order to better fit the application in the actual production process, it is necessary to test its detection effect on the test set to verify the practicality of the detection model. When detecting hub weld defects, it is temporarily not necessary to accurately detect the location of the weld defect. It is only necessary to detect the corresponding defect category, and it is considered correct if it is greater than the given confidence threshold. The confidence threshold is set to 0.25, and the accuracy of the test set is statistically analyzed to detect 5 types of weld defects. The correct detection effect of the type is shown in the figure Fig.12 As shown, Fig.12 a. Arc breaking; Fig.12 b. Weld nodules; Fig.12 c. Biased welding; Fig.12 d. Poor arc starting; Fig.12 e. Stomata.
[0200] The statistics of the detection results on the test set are shown in Table 4.
[0201] Table 4 Detection results of YOLOv3-GIoU on the test set
[0202]
[0203]
[0204] Since the confidence threshold is set low, we can see that all defect categories can be detected. However, for the intact weld images, 11 of them are mistakenly detected as defects. A specific analysis of these 11 images shows that they are mainly misdetected as two types of defects: poor arc starting and pores. Fig.13 shown. Fig.13 a. Type 1; Fig.13 b. Type 2. It can be seen that these images are indeed similar to porosity defects. The real porosity defect is a large black spot in the weld, while the spot in the false detection image is golden or small in shape; the false detection of poor arcing may be due to the reflection of the image shooting, mistaking the gap for a groove, and detecting poor arcing. To address these issues, we can consider increasing the number and type of data sets and improving the intensity of the light source angle during image acquisition. Overall, the test set detection accuracy of the better model using YOLOv3-GIoU reached 98.54%, and its mAP value on the validation set with an IoU threshold of 0.6 was 89.16%, the F1 score was 0.92, and the average intersection over union (Average IoU) was 72.69%. The detection time for each image was between 21 and 19 milliseconds, and the model size was 234MB. Therefore, this algorithm model can be used in an intelligent detection system to realize intelligent detection of wheel hub weld defects and achieve the purpose of replacing manual detection.
[0205] The present invention proposes a new method for intelligent detection of wheel hub weld defects, and uses the YOLOv3-GIoU improved algorithm based on the deep convolutional neural network algorithm to detect wheel hub weld defects. GIoU is introduced as a new loss function calculation method, and the K-means clustering method is used to optimize the prior frame parameters, thereby improving the accuracy of the detection model and reducing the training time. Through the test verification, the YOLOv3-GIoU better result model can be used for the wheel hub weld defect intelligent detection system. The test results show that the improved result model has an F1 value of 0.92 in the validation set detection, and the mAP value reaches 89.16%. The overall accuracy of the detection on the test set is 98.54%, and the single-sheet detection speed does not exceed 22 milliseconds, which reflects that the model has high accuracy, fast efficiency and good robustness, and illustrates that the algorithm model based on YOLOv3 can realize automatic, fast and accurate identification, classification and positioning of wheel hub weld defects in practical applications, and realize intelligent detection of weld defects, replacing manual visual inspection.
[0206] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope of the present invention.
Claims
1. A wheel hub weld visual inspection method, characterized in that: The wheel hub weld visual inspection method comprises: Build a wheel hub weld visual inspection system based on YOLOV3; Verify the built wheel hub weld visual inspection system; Visual inspection of wheel hub welds using a validated wheel hub weld visual inspection system; The hub weld visual inspection system verification method comprises: (1) Using camera equipment to collect images of wheel hub weld defects in the factory, preprocess the collected images, adjust the image size and classify the images; (2) Use image annotation tools to classify and annotate various images and create a dataset of wheel hub weld defects; (3) The improved YOLOv3-GIoU algorithm based on the deep convolutional neural network algorithm is used to train the wheel hub weld defect detection, and the recognition detection verification is performed. The verification result data is analyzed, and the adjustment parameters are optimized through the verification result analysis to obtain the optimized wheel hub weld detection system based on YOLOv3; In step (3), the YOLOv3-GIoU improved algorithm based on the deep convolutional neural network algorithm includes: 1) Improve the YOLOv3 algorithm using loss function; The loss function of the YOLOv3 improved algorithm is as follows: Where obj means that the cell contains an object, noobj means that the cell does not contain an object; i means the i-th cell, j means the j-th box predicted by the cell; tx, ty, tw, th in the first two items respectively represent the center point coordinate offset value of the predicted box and the ratio of the predicted box width and height to the image, where the superscripts are the position coordinate information of the real box; I represents the indicative function of whether the j-th box of the i-th cell has an object; C is the confidence score of the predicted box; p is the conditional category probability value; the first two items are positioning loss functions, items 3 and 4 are confidence loss functions, and the last item is the classification loss function; The category confidence score is calculated by multiplying the conditional category probability by the prediction box confidence score, as follows: GIoU is introduced as the positioning loss function. The GIoU calculation formula is as follows: LGIoU=1-GIoU Where A and B represent two rectangular frames, and C represents the minimum circumscribed rectangle containing A and B; 2) Optimize the prior box: Use K-means clustering to calculate the prior box size of the training set, modify the value of anchorbox in the parameter file based on the calculation result, and optimize the prior box; 3) Calculate the parameters using the following formula: W=W BN ·IN conv b=W BN ·b conv +b BN Among them, W conv and b conv are the weight matrix and bias of the convolutional layer, W BN and b BN is the weight matrix and bias of the BN layer; In step (2), the image classification and labeling includes: classifying the weld defects into broken arc, weld nodule, weld deviation, poor arc starting and pores, and labeling them as different categories; In step (2), the wheel hub weld defect data set is divided into a training set, a validation set, and a test set in a ratio of 7:2:1; The training set is used for model training; The validation set is used to evaluate model performance; The test set is used to simulate a real detection test; The visual inspection method of wheel hub welds using a verified wheel hub weld visual inspection system includes: The conveying device conveys the wheel hub to the predetermined position; when the wheel hub triggers the photoelectric sensor at the predetermined position, the area array CCD camera is used to collect image information of the weld; The collected image information is processed and whether the wheel hub weld is qualified is determined based on the processed image information; if qualified, the inspected wheel hub is transferred to the next production process by a conveying device; if the wheel hub fails the inspection, the ejection device is started when the wheel hub passes the second photoelectric sensor, and the unqualified wheel hub is ejected onto the defective workpiece recovery raceway to recover the defective workpiece.
2. A wheel hub weld visual inspection system for implementing the wheel hub weld visual inspection method according to claim 1, characterized in that: The wheel hub weld visual inspection system comprises: Conveying module, image acquisition module, detection module, defective workpiece ejection module and recovery module; A conveying module, used for conveying the wheel hub to a corresponding position by using a conveying device; An image acquisition module is used to collect image information of the weld using an area array CCD camera when the wheel hub reaches a predetermined position and triggers the photoelectric sensor; A detection module, used to process the collected image information and determine whether the hub weld is qualified based on the processed image information; Defective workpiece ejection module, used to eject the unqualified wheel hub by using the ejection device when there are defects in the wheel hub weld; The recycling module is used to recycle unqualified wheels.
3. The wheel hub weld visual inspection system according to claim 2, characterized in that: The wheel hub weld visual inspection system further includes a conveying device; The wheel hub is transferred from the previous process to the inspection platform by the conveying device. When the wheel hub reaches the predetermined position and triggers the first photoelectric sensor, the image acquisition device starts to capture the wheel hub weld. The acquired image information is transmitted to the image workstation for processing and judging whether the wheel hub weld is qualified. If the result is that the weld is free of defects, the inspection is completed and the wheel hub is transferred to the next process. If the detection result shows that the weld is defective, the defective workpiece ejection device is activated when the wheel hub passes the second photoelectric sensor, and the unqualified wheel hub is ejected onto the defective workpiece recovery raceway to recover the defective workpiece; The actions of the conveying device, the image acquisition device and the defective workpiece ejecting device are controlled by PLC.
4. The wheel hub weld visual inspection system according to claim 3, characterized in that: The conveying device comprises a driving roller and a driven roller; a rubber conveyor belt is installed on the driving roller and the driven roller; The bearing and the bearing cup are assembled and fixed on the bearing sleeve with screws, and the bearing sleeve is on the active roller and the driven roller; there are multiple bearing sleeves; The aluminum profile components are respectively connected to the bearing sleeves at the same end of the active roller and the driven roller, and a tension block is added during the connection to adjust the distance between the active roller and the driven roller; A sprocket is installed on the active roller shaft and the stepper motor output shaft and connected with a chain for power transmission from the stepper motor to the active roller; The image acquisition device includes a CCD camera with more photosensitive lenses and a rotating detection frame; the CCD camera is installed on the rotating detection frame; the rotating detection frame includes a disc conveyor, a disc, a disc bracket, and a rotating motor; The disc conveyor is installed on the disc; the disc is installed on the upper end of the disc bracket; the rotating motor is connected to the bottom of the disc through a shaft sleeve; The defective workpiece ejection device is used to push the determined defective workpiece from the original conveying device to another conveying device perpendicular to it for recycling or reprocessing; a double-acting single-rod piston hydraulic cylinder is used as a power element, and an electromagnetic reversing valve is connected to the PLC for control, and the second photoelectric sensor is used to realize the screening of unqualified wheel hubs; the double-acting single-rod piston hydraulic cylinder is fixed on the sliding guide rod fixing plate; the sliding guide rod holes on both sides of the sliding guide rod fixing plate are penetrated by freely sliding sliding guide rods, including a left sliding guide rod and a right sliding guide rod; the top end of the double-acting single-rod piston hydraulic cylinder, the left sliding guide rod and the right sliding guide rod are all connected to the push plate.
5. A computer device, characterized in that: The computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the method according to claim 1 . 6 . A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor is caused to execute the method according to claim 1 .
Citation Information
Patent Citations
Detection method for automatically identifying and detecting weld defects
CN110570410A
Automatic welding and defect detection method based on self-learning
CN110636715A
Cited By
Equipment capable of automatically detecting welding seam and adjusting position of hub
CN120862240A