Method for detecting internal burr defects of a ball cage dust cover
By combining deep neural networks and Hough circle transform, the method of automatically detecting burr defects inside the dust cover of the ball cage solves the problem of low efficiency of manual inspection and achieves efficient and accurate automated inspection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-19
- Publication Date
- 2026-03-03
AI Technical Summary
In the existing technology, the detection of burr defects inside the dust cover of the ball cage relies on manual inspection, which is inefficient and costly, and lacks effective automation methods, especially the lack of datasets to support the application of deep neural networks.
By building an image acquisition system and creating a defect dataset, and using a combination of deep neural networks and Hough circle transform, different detection methods are adopted for burr defects of different sizes. Machine vision is used to detect large target defects, while deep neural networks are used to detect small target defects. The detection networks are connected in series to improve detection accuracy and efficiency.
It has achieved automated detection, reduced detection costs, improved detection efficiency and accuracy, reduced false detection rate, and provided a new approach to industrial defect detection.
Smart Images

Figure CN115456955B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer image defect detection, and in particular to a method for detecting burr defects inside a ball cage dust cover. Background Technology
[0002] In the field of computer image defect detection, traditional image processing algorithms are widely used in industrial production. With the development of deep neural networks, image processing technology is becoming increasingly prevalent in both production and daily life. However, in the field of CV joint dust cover defect detection, the most commonly used method is still the inefficient and costly manual inspection. Manual inspection requires a significant amount of manpower, and its accuracy is affected by the worker's physical strength and energy. Among the various types of defects that may occur during the production of CV joint dust covers, internal burrs have a relatively high probability of appearing. Internal burrs at the small opening of the CV joint dust cover can affect the connection of other automotive parts during the assembly process, and are considered structural defects, making them a key focus of inspection during CV joint dust cover defect detection.
[0003] Current research on burr defect detection inside automated ball cage dust covers is limited, partly due to the lack of defect datasets for each burr in the dust cover, while deep neural network detection requires substantial data support for its accuracy. Although machine vision methods do not require large amounts of data, their detection accuracy is generally lower than that of deep neural networks. Therefore, a method for detecting burr defects inside ball cage dust covers is needed to improve industrial production efficiency. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a method for detecting burr defects inside the dust cover of a ball cage. First, an industrial camera is used to collect images of burr defects inside the dust cover of the ball cage. Then, a defect dataset of the dust cover of the ball cage is created. The model is trained by a deep neural network. Finally, the method of combining the deep neural network with the Hough circle transform is used to locate and detect the burrs inside the dust cover of the ball cage, replacing the currently commonly used manual inspection method, so as to reduce the inspection cost and improve the inspection efficiency.
[0005] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0006] A method for detecting burr defects inside a ball cage dust cover includes the following steps:
[0007] Step 1: Set up an image acquisition system, use an industrial camera to capture images of burr defects inside the dust cover of the ball cage, and organize them to obtain the original sample set;
[0008] Step 2: Preprocess the images and manually label them to obtain the training set;
[0009] Step 3: Import the training set images obtained in Step 2 into the improved deep neural network to train the model and obtain the weight file;
[0010] Step 4: Use a detection network that connects the machine vision detection module and the deep neural network detection module to detect the input image of the ball cage dust cover, and output the detection results according to the weight file.
[0011] A further improvement of the technical solution of the present invention is that: in step 1, all images are divided into two categories. According to the different sizes of internal burr defects, defects with internal burr length greater than 1 / 6 of the perimeter of the inner edge of the small opening are classified as large target defects, and the rest are classified as small target defects.
[0012] A further improvement of the technical solution of the present invention is that: in step 2, the annotation information includes the defect type, the relative coordinates of the center position of the bounding box, and the relative length and relative width of the bounding box, thereby obtaining a training set for detecting burr defects inside the ball cage dust cover that can be used by a deep neural network.
[0013] A further improvement of the technical solution of the present invention is that: in step 3, the backbone of the target detection deep neural network includes a Focus module, a CSPNet module and an SPP module; the improved deep neural network is based on the target detection deep neural network structure with the addition of a CBAM attention mechanism; the CBAM attention mechanism network is set between the second and third layers of the CSPNet module.
[0014] A further improvement to the technical solution of the present invention is that step 3 specifically includes the following steps:
[0015] Specifically, the following steps are included:
[0016] Step 3.1: After scaling the input image, a mosaic enhancement operation is performed, resulting in four feature maps after passing through the Focus module. These feature maps are then fed into a convolutional network, specifically through two layers of a CSPNet network, before being fed into the CBAM attention mechanism network.
[0017] Step 3.2: The feature maps obtained through the attention mechanism network are fed into the subsequent network for feature fusion. The feature maps of different levels are concatted to exchange contextual information and then fed into the Prediction network. The output consists of three grids with different granularities, which contain all possible target bounding boxes in the input image. Finally, the weight file required for subsequent detection is obtained.
[0018] A further improvement of the technical solution of the present invention is that: in step 4, the first layer detection network is a machine vision detection module, and the machine vision detection module uses the Hough circle transform method to detect defects in large targets.
[0019] A further improvement of the technical solution of the present invention is that: in step 4, the second layer detection network is a deep neural network detection module, and the deep neural network detection module uses the improved deep neural network model to detect small target defects.
[0020] A further improvement of the technical solution of the present invention is that the machine vision detection module and the deep neural network detection module are connected in series. The input image first passes through the machine vision detection module. If internal burr defects are identified, the detection result is directly output as a defective product. Otherwise, it is sent to the deep neural network model for detection, and finally it is determined whether the dust cover of the ball cage is a good product.
[0021] The technological advancements achieved by this invention due to the adoption of the above technical solutions are as follows:
[0022] 1. This invention achieves improved detection accuracy and efficiency by setting up a detection network that combines a deep neural network with a Hough circular transform and adding an attention mechanism module to the deep neural network. It also provides a new approach to defect detection in industrial fields.
[0023] 2. This invention targets burr defects inside the dust cover of a ball cage, performing targeted detection based on feature differences. Considering the size of the dataset and detection costs, and combining the actual situation on an industrial production line, the proposed detection method combines Hough circle transform and deep neural networks. Hough circle transform is used to detect large target defects, while a deep neural network-trained model is used to detect small target defects. Using Hough circle transform reduces the training cost of the detection network, and training the deep neural network model only on small targets allows for better learning performance. Through a two-layer cascaded detection network, comprehensive detection of burr defects inside the dust cover of the ball cage can be achieved, reducing the false detection rate and improving the accuracy of the detection results to a certain extent. Attached Figure Description
[0024] Figure 1 This is a flowchart of the method for detecting burr defects inside a spherical cage dust cover, which combines deep neural networks and Hough circle transform, as proposed in this invention.
[0025] Figure 2 This is a schematic diagram of the data acquisition scheme in this invention;
[0026] Figure 3 This is a schematic diagram of the various defect types of the top mounting position in this invention;
[0027] Figure 4 This is a schematic diagram of the CBAM attention mechanism module structure in this invention;
[0028] Figure 5 This is a schematic diagram of some of the detection results in this invention. Detailed Implementation
[0029] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments:
[0030] like Figure 1 As shown, a method for detecting burr defects inside a ball cage dust cover includes the following steps:
[0031] Step 1: Set up an image acquisition system, use an industrial camera to capture images of burr defects inside the dust cover of the ball cage, and organize them to obtain the original sample set.
[0032] In step 1, based on manual inspection experience, burrs inside the dust cover of the ball cage can be identified as defective by observing whether the inner edge of the burr is perfectly round when viewed from above. If the internal shape is irregular, it is a defective product; otherwise, it is a good product. First, the images of burr defects inside the dust cover of the ball cage captured by a black-and-white industrial camera need to be cleaned, and images with consistent lighting conditions and clear defect locations are manually selected. Since the size of internal burr defects varies, to improve the defect detection rate, all images are divided into two categories: defects with internal burr lengths greater than 1 / 6 of the inner edge perimeter of the small opening are classified as large target defects, and the rest are small target defects.
[0033] Step 2: Preprocess the images and manually label them to obtain the training set.
[0034] In step 2, the annotation information includes the defect type, the relative coordinates of the center position of the bounding box, and the relative length and relative width of the bounding box, thereby obtaining a training set for detecting burr defects inside the ball cage dust cover that can be used by the deep neural network.
[0035] Step 3: Import the training set into the improved deep neural network, train the model, and obtain the weight file.
[0036] In step 3, the network structure mainly adopts a deep neural network for object detection. After scaling the input image, a mosaic enhancement operation is performed before feeding it into the subsequent deep neural network for object detection. The main backbone of the deep neural network for object detection mainly includes a Focus module, CSPNet (Cross-Stage Local Network), and SPP (Spatial Pyramid Pooling Module). To improve model performance, the improved deep neural network adds a CBAM (Convolutional Block Attention) attention mechanism to the structure of the deep neural network for object detection. The CBAM attention mechanism network is placed between the second and third layers of the CSPNet module to obtain more detailed information about the target that needs attention, while suppressing other useless information, which facilitates the detection of small target defects.
[0037] Specifically, the following steps are included:
[0038] Step 3.1: After scaling the input image, a mosaic enhancement operation is performed, resulting in four feature maps after passing through the Focus module. These feature maps are then fed into a convolutional network, specifically through two layers of a CSPNet network, before being fed into the CBAM attention mechanism network.
[0039] The CBAM attention mechanism network includes a channel attention mechanism module and a spatial attention mechanism module.
[0040] The steps of the channel attention mechanism are as follows: The input feature map is processed by global max pooling based on width and global mean pooling based on depth, and then by an MLP network. The features output by the MLP network are summed element-wise, followed by sigmoid activation to generate the final channel attention feature map. This channel attention feature map is then multiplied element-wise with the input feature map to generate the input features required by the spatial attention module. The calculation process is as follows:
[0041]
[0042] Among them, M c (F) represents the channel attention output feature map, σ represents the sigmoid activation function, and W0 and W1 are the weights of the MLP network. This represents the features obtained after global average pooling. This represents the feature obtained after global max pooling.
[0043] The steps of the spatial attention mechanism are as follows: The feature map output by the channel attention module is used as the input feature map of the spatial attention mechanism module. First, a channel-based global max pooling and global average pooling are performed. Then, these two results are concatenated based on the channels, followed by a convolution operation, and then a sigmoid function is used to generate the spatial attention feature map. Finally, this spatial attention feature map is multiplied by the input feature map of the module to obtain the final generated feature. The process is calculated as follows:
[0044]
[0045] Among them, M s (F) represents the spatial attention output feature map, F represents the input feature map, σ represents the sigmoid activation function, and f 7*7 This indicates a convolution operation with a 7x7 kernel. This represents the features obtained after global average pooling. This represents the feature obtained after global max pooling.
[0046] Step 3.2: The feature maps obtained through the attention mechanism network are fed into the subsequent network for feature fusion. The feature maps of different levels are concatted to exchange contextual information and fed into the subsequent network. Three grids with different granularities are output, which contain all possible target bounding boxes in the input image. Finally, the weight file required for subsequent detection is obtained.
[0047] Step 4: Use a detection network that connects the machine vision detection module and the deep neural network detection module to detect the input image of the ball cage dust cover, and output the detection results according to the weight file.
[0048] In step 4, different methods are used to detect internal burr defects of different sizes. The detection network designed in this application connects the Hough circle detection module and the deep neural network detection module. For internal burr defects of large targets, the Hough circle transform is used for detection. Images that are not detected by the previous detection module are sent to the subsequent deep neural network detection module, which uses the weight file trained in step 3 for detection.
[0049] The Hough circle transform uses (a, b, r) to define a circle. Since the shooting angle and the placement of the dust cover on the ball cage are fixed during image acquisition, the approximate perimeter *r* of the inner edge of the small opening can be determined. If the gradient of a circle is calculated, the gradient direction at all points on the circle points towards the center. When using the Hough circle transform to detect circles, the Sobel operator is first used to solve for the gradients in the x and y directions, then the Canny operator is used to obtain edge information. For all non-zero pixels, lines are drawn along the gradient direction. Each pixel has an accumulator to record the gradient line passing through that point. All accumulators are then sorted, and all possible center points are found based on a threshold. Finally, by limiting the radius range, circles that meet the requirements are detected. If the dust cover on the ball cage has internal burr defects, the Hough circle transform cannot detect circles that meet the parameter requirements, and the detection result is output. For internal burrs that the Hough circle transform cannot detect, a deep neural network model is used for detection. The weight file trained in step 3 is applied to detect small target defects, and the final detection result is output.
[0050] Example
[0051] A flowchart of a method for detecting burr defects inside a dust cover for a ball cage, specifically including the following steps:
[0052] Step 1: Set up an image acquisition system, use an industrial camera to capture images of burr defects inside the dust cover of the ball cage, and organize them to obtain the original sample set.
[0053] Using a monochrome industrial camera to capture images of burr defects inside the dust cover of the ball cage, a schematic diagram of the acquisition scheme is shown below. Figure 2As shown, images with basically consistent lighting conditions and clear defects were selected and compiled into a sample set. The images were then classified according to the size of internal burr defects; large defects were used in subsequent machine vision detection, while small defects were used in the training of deep neural network weight files.
[0054] Step 2: Preprocess the images and manually label them to obtain the training set.
[0055] Step 1 involves a total of 2820 images (4024*3036 pixels) in the original sample set, including 1179 good product images and 1641 images containing internal burr defects. All images in the sample set are converted to 8-bit single-channel images. Separately, for the images of internal burr defects on small targets, they need to be formatted into a YOLO dataset. These images are manually annotated using an image annotation tool, resulting in 968 images of internal burr defects on small targets. To reduce the false detection rate of the model, good product images are added to the original dataset. Specifically, the small target defect images are divided into training and testing sets in an 8:2 ratio. The bounding boxes of internal burrs in each image are annotated using the LabelImg image annotation tool, thus obtaining a training set for detecting internal burr defects in dust covers that can be used by the deep neural network.
[0056] Step 3: Import the training set into the deep neural network, train the model, and obtain the weight file.
[0057] First, data augmentation operations are uniformly performed on small target datasets. This mainly includes randomly horizontally flipping images with a probability of 0.5 and using mosaic enhancement to expand the original dataset. The deep neural network structure consists of... Figure 3 As shown, after inputting a 960*960 pixel image, it passes through the Focus module, where each 2*2 adjacent pixel in the image is divided into a patch. Then, pixels at the same position in the sphere used by the neural network in each patch are concatenated together to obtain four feature maps, which are then fed into the next convolutional layer. Further, the feature maps are fed into the convolutional network, specifically through two layers of CSPNet, and then into the CBAM attention mechanism network. After passing through a channel attention module to obtain a weighted result, it passes through a spatial attention module for final weighting to obtain the final result. This aims to obtain more detailed information about the target of interest while suppressing other useless information. The structure of the CBAM attention module is as follows: Figure 4As shown. Further, the feature maps obtained through the attention mechanism are fed into subsequent networks for feature fusion. Concat operations are performed on feature maps of different levels to exchange contextual information. These are then fed into subsequent networks, outputting three grids of different granularities, each containing all possible target bounding boxes in the input image. Finally, the weight file required for detection is obtained.
[0058] Step 4: Use a detection network that connects the machine vision detection module and the deep neural network detection module to detect the input image of the ball cage dust cover, and output the detection results according to the weight file.
[0059] Based on the size of the internal burr defect, a two-layer detection network is used. The first layer uses the Hough circle transform method to detect large target defects, and the second layer uses a model trained with a YOLOv5 network to detect small target defects. The two networks are concatenated. The input image first passes through the Hough circle transform detection network. If an internal burr defect is identified, the detection result is directly output as a defective product; otherwise, it is fed into the deep neural network model for detection, ultimately determining whether the dust cover of the ball cage is a good product. For ease of statistics, the detection result output includes whether the image contains an internal burr defect, the confidence level of the defect, the detection time, and the storage location of the detected image. Some image detection results are shown below. Figure 5 As shown.
Claims
1. A method for detecting burr defects inside a ball cage dust cover, characterized in that: Includes the following steps: Step 1: Set up an image acquisition system, use an industrial camera to capture images of burr defects inside the dust cover of the ball cage, and organize them to obtain the original sample set; Step 2: Preprocess the images and manually label them to obtain the training set; Step 3: Import the training set images obtained in Step 2 into the improved deep neural network to train the model and obtain the weight file; In step 3, the backbone of the object detection deep neural network includes a Focus module, a CSPNet module, and an SPP module; the improved deep neural network is based on the object detection deep neural network structure with the addition of the CBAM attention mechanism. The CBAM attention mechanism network is positioned between the second and third layer CSPNet modules; Step 4: Use a detection network that connects the machine vision detection module and the deep neural network detection module to detect the input image of the ball cage dust cover, and output the detection results according to the weight file; In step 4, the first layer of the detection network is a machine vision detection module, which uses the Hough circle transform method to detect defects in large targets. The second layer of the detection network is a deep neural network detection module, which uses an improved deep neural network model to detect defects in small targets. The machine vision detection module and the deep neural network detection module are connected in series. The input image first passes through the machine vision detection module. If internal burr defects are identified, the detection result is directly output as a defective product. Otherwise, it is sent to the deep neural network model for detection, and finally it is determined whether the dust cover of the ball cage is a good product.
2. The method for detecting burr defects inside a ball cage dust cover according to claim 1, characterized in that: In step 1, all images are divided into two categories. Based on the different sizes of internal burr defects, defects with internal burr lengths greater than 1 / 6 of the perimeter of the inner edge of the small opening are classified as large target defects, and the rest are classified as small target defects.
3. The method for detecting burr defects inside a ball cage dust cover according to claim 1, characterized in that: In step 2, the annotation information includes the defect type, the relative coordinates of the center position of the bounding box, and the relative length and relative width of the bounding box, thereby obtaining a training set for detecting burr defects inside the ball cage dust cover that can be used by the deep neural network.
4. The method for detecting burr defects inside a ball cage dust cover according to claim 1, characterized in that: Step 3 specifically includes the following steps: Specifically, the following steps are included: Step 3.1: After scaling the input image, a mosaic enhancement operation is performed. After passing through the Focus module, four feature maps are obtained. The feature maps are then fed into a convolutional network, specifically through two layers of CSPNet, and finally fed into the CBAM attention mechanism network. Step 3.2: The feature maps obtained through the attention mechanism network are fed into the subsequent network for feature fusion. The feature maps of different levels are concatted to exchange contextual information and then fed into the Prediction network. The output consists of three grids with different granularities, which contain all possible target bounding boxes in the input image. Finally, the weight file required for subsequent detection is obtained.
Citation Information
Patent Citations
Method for detecting defects of screen printing area of smart phone glass cover plate based on machine vision
CN110672617A
New material floor defect target detection system based on improved YOLOv5 algorithm
CN112990392A