Burr defect detection method and device, equipment and storage medium

By converting the burr defect image set into a standard image set and performing histogram equalization and low-light enhancement, a cross-scale convolutional kernel model is constructed, which solves the problems of high false detection rate and high false negative rate in traditional burr detection methods and achieves high accuracy in burr defect detection.

CN121724949APending Publication Date: 2026-03-24SHENZHEN FII-LUSTER LIGHTTECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-16
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Traditional burr defect detection methods struggle to accurately distinguish between dirt and burrs, leading to high false positive and false negative rates. Furthermore, burr defects occupy only a very small number of pixels in an image, affecting detection accuracy.

Method used

The burr defect image set is converted into a standard image set, and histogram equalization and low-light enhancement are performed. A burr detection model based on multiple cross-scale convolution kernels is constructed, and the model with training accuracy that meets the set requirements is used for analysis.

Benefits of technology

It improves the accuracy of burr defect detection, suppresses background interference, prevents the global features of small-sized burr defects from being overwhelmed, and enhances the accuracy of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121724949A_ABST
    Figure CN121724949A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, and discloses a burr defect detection method and device, equipment and a storage medium, and a burr defect image set is converted into a standard image set. And performing histogram equalization processing on each standard image contained in the standard image set to obtain an equalized image. And according to a set low-illumination enhancement rule, enhancing the brightness of the burr defect position in each equalized image. And training a burr detection model based on the enhanced image set. The burr detection model comprises a feature extraction unit, a feature fusion unit and a classification output unit. Through histogram equalization processing and low illumination enhancement processing, the image quality of the burr defect image set is improved, and a good training sample is provided for model training. And a plurality of cross-scale convolution kernels are constructed in the classification output unit, the to-be-detected image is analyzed by using the burr detection model of which the training precision meets the set requirement, and the burr identification result is output, so that the burr defect detection precision is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to a method, apparatus, device, and storage medium for detecting burr defects. Background Technology

[0002] The 3C industry refers to the industry that combines computers, communications, and consumer electronics, and is a core component of the electronics and information industry. In the manufacturing process of 3C products, the outer casing and internal structural components are mostly manufactured using processes such as injection molding, stamping, and computer numerical control (CNC) machining, which can easily produce burrs.

[0003] For datasets used for burr defect detection, there are challenges such as interference from dirt and foreign objects, the tiny size of burrs, the influence of image size, and sensitivity to scale changes. Traditional detection methods struggle to accurately distinguish between dirt, foreign objects, and burrs, leading to high false positive rates. Furthermore, burrs occupy only a very small number of pixels in an image, making them difficult for traditional algorithms to detect effectively, resulting in high false negative rates. Large original image sizes, when compressed, further reduce the size and blurriness of burrs, increasing detection difficulty and impacting accuracy.

[0004] It is evident that improving the detection accuracy of burr defects is a problem that needs to be solved by those skilled in the art. Summary of the Invention

[0005] The purpose of this application is to provide a method, apparatus, device, and storage medium for detecting burr defects, which can improve the detection accuracy of burr defects.

[0006] This application provides a method for detecting burr defects, including:

[0007] Convert the burr defect image set into a standard image set;

[0008] Histogram equalization is performed on each standard image in the standard image set to obtain an equalized image;

[0009] According to the set low-light enhancement rules, the brightness of the burr defect locations in each equalized image is enhanced to obtain the enhanced image set;

[0010] The spur detection model is trained based on the enhanced image set to obtain a spur detection model with training accuracy that meets the set requirements. The spur detection model includes a feature extraction unit, a feature fusion unit, and a classification output unit. The classification output unit includes multiple cross-scale convolutional kernels constructed based on spur detection.

[0011] The burr detection model, trained to meet the set accuracy requirements, is used to analyze the image to be detected and output the burr recognition result.

[0012] On the one hand, according to the set low-light enhancement rules, the brightness of the burr defect locations in each equalized image is enhanced to obtain an enhanced image set, including:

[0013] Based on the maximum and average gray values ​​of the target equalized image, the target equalized image is mapped to a logarithmic space image through a logarithmic transformation; where the target equalized image is any equalized image among all equalized images;

[0014] Based on the maximum and minimum pixel values ​​of the logarithmic space image, the logarithmic space image is stretched to obtain the enhanced target image;

[0015] All enhanced target images are aggregated to obtain an enhanced image set.

[0016] On the one hand, based on the maximum and average gray values ​​of the target equalization image, mapping the target equalization image to a logarithmic space image through logarithmic transformation includes:

[0017] The log-domain operation formula is used to perform a logarithmic transformation on the target equalized image to obtain a log-space image; the log-domain operation formula is:

[0018] ;

[0019] Where i represents the pixel value of the target equalization image, max represents the maximum gray value of the target equalization image, avg represents the average gray value of the target equalization image, σ represents the logarithmic transformation coefficient, and tab[i] represents the pixel value of the logarithmic space image.

[0020] On the one hand, based on the maximum and minimum pixel values ​​of the logarithmic space image, the logarithmic space image is stretched to obtain an enhanced target image, including:

[0021] The pixel difference is determined based on the maximum and minimum pixel values ​​of the logarithmic space image.

[0022] The enhanced target image is obtained by multiplying the ratio of each pixel value to the pixel difference in the logarithmic space image by a set pixel value.

[0023] On the one hand, a spur detection model with training accuracy meeting set requirements is used to analyze the image to be detected, so as to output spur recognition results, including:

[0024] Based on the feature extraction unit, features are extracted from the image to be detected to obtain multi-scale image features;

[0025] Feature extraction and feature fusion are performed on multi-scale image features based on feature fusion units to obtain image fusion features after burr defect enhancement;

[0026] A global attention mechanism is used to assign weights to image fusion features to obtain image enhancement features;

[0027] The image enhancement features are fused using multiple cross-scale convolutional kernels contained in the classification output unit to obtain cross-scale fused features;

[0028] The dynamic detection head contained in the classification output unit analyzes image enhancement features and cross-scale fusion features to output spur recognition results.

[0029] On the one hand, multiple cross-scale convolutional kernels contained in the classification output unit are used to perform cross-scale feature fusion on image enhancement features to obtain cross-scale fused features, including:

[0030] Image enhancement features are input into the first, second, third, and fourth convolutional kernels respectively to obtain initial output features; wherein, the initial output features include the first output feature, the second output feature, the third output feature, and the fourth output feature; the size of the fourth convolutional kernel is larger than the size of the third convolutional kernel, the size of the third convolutional kernel is larger than the size of the second convolutional kernel, and the size of the second convolutional kernel is larger than the size of the first convolutional kernel;

[0031] According to the weights of the first layer corresponding to each convolution kernel, the first output feature and the second output feature are weighted and summed to obtain the fifth output feature, the second output feature and the third output feature are weighted and summed to obtain the sixth output feature, and the third output feature and the fourth output feature are weighted and summed to obtain the seventh output feature.

[0032] According to the second layer weights corresponding to each convolution kernel, the fifth output feature and the sixth output feature are weighted and summed to obtain the eighth output feature, and the sixth output feature and the seventh output feature are weighted and summed to obtain the ninth output feature;

[0033] The eighth and ninth output features are concatenated to obtain cross-scale fused features.

[0034] On the one hand, the burr defect image set is converted into a standard image set, including:

[0035] The burr defect image set is segmented and labeled to obtain a labeled image set; the labeled image set contains each burr defect image and its corresponding label information; the label information includes burr category and burr location information;

[0036] The labeled image set is normalized to obtain a standard image set.

[0037] This application embodiment also provides a burr defect detection device, including a conversion unit, an equalization unit, an enhancement unit, a training unit, and an analysis unit;

[0038] A conversion unit is used to convert a set of burr defect images into a standard image set.

[0039] The equalization unit is used to perform histogram equalization on each standard image in the standard image set to obtain an equalized image.

[0040] The enhancement unit is used to enhance the brightness of the burr defect locations in each equalized image according to the set low-light enhancement rules, so as to obtain the enhanced image set.

[0041] The training unit is used to train the spur detection model based on the enhanced image set to obtain a spur detection model with training accuracy that meets the set requirements. The spur detection model includes a feature extraction unit, a feature fusion unit, and a classification output unit. The classification output unit includes multiple cross-scale convolutional kernels constructed based on spur detection.

[0042] The analysis unit is used to analyze the image to be detected using a burr detection model that has been trained to meet the set accuracy requirements, so as to output the burr recognition result.

[0043] This application also provides an electronic device, including:

[0044] Memory, used to store computer programs;

[0045] A processor is used to implement the steps of any of the above-mentioned burr defect detection methods when executing a computer program.

[0046] This application also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of any of the above-described burr defect detection methods.

[0047] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described burr defect detection methods.

[0048] As can be seen from the above technical solution, the burr defect image set is converted into a standard image set. Considering that the pixel values ​​of burr defects are often too low, histogram equalization can be performed on each standard image in the standard image set to obtain an equalized image. Since the pixel values ​​of burr defects are low, they often belong to dark areas in the entire image. Therefore, the brightness of the burr defect locations in each equalized image can be enhanced according to a set low-light enhancement rule to obtain an enhanced image set. The burr detection model is then trained based on the enhanced image set to obtain a burr detection model with training accuracy meeting the set requirements. The burr detection model can include a feature extraction unit, a feature fusion unit, and a classification output unit. The classification output unit includes multiple cross-scale convolutional kernels constructed based on burr detection. By setting multiple cross-scale convolutional kernels in the classification output unit, the global relationship between the target and the background can be more clearly distinguished, background interference can be suppressed, and small-sized burr defects can be prevented from being overwhelmed by global features. After training the model, the burr detection model, whose training accuracy meets the set requirements, is directly used to analyze the images to be detected, thus outputting burr recognition results. In this technical solution, histogram equalization and low-light enhancement processing of the image set effectively improve the image quality at the location of burr defects in the burr defect image set, thereby providing good training samples for model training. Furthermore, constructing multiple cross-scale convolutional kernels in the classification output unit of the burr detection model can effectively improve the detection accuracy of burr defects. Subsequent analysis of the images to be detected using the burr detection model whose training accuracy meets the set requirements further improves the detection accuracy of burr defects. Attached Figure Description

[0049] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0050] Figure 1 A flowchart of a burr defect detection method provided in an embodiment of this application;

[0051] Figure 2 A schematic diagram of the architecture of a burr detection model provided in an embodiment of this application;

[0052] Figure 3 A flowchart illustrating a method for analyzing an image to be detected using a burr detection model whose training accuracy meets set requirements, as provided in this application embodiment;

[0053] Figure 4 A schematic diagram of a cross-scale convolution kernel provided for an embodiment of this application;

[0054] Figure 5 This is a schematic diagram of a burr defect detection device provided in an embodiment of this application. Detailed Implementation

[0055] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0056] The terms "comprising" and "having," and any variations thereof, in the specification and accompanying drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may include steps or units not listed.

[0057] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0058] Next, a method for detecting burr defects provided in the embodiments of this application will be described in detail. Figure 1 A flowchart of a burr defect detection method provided in this application embodiment, the method including:

[0059] S101: Convert the burr defect image set into a standard image set.

[0060] In a specific implementation, the burr defect image set can be segmented and labeled to obtain a labeled image set; wherein, the labeled image set contains each burr defect image and its corresponding label information; the label information may include burr category label and burr defect location information.

[0061] To facilitate low-light enhancement of images with spiking defects, the labeled image set needs to be normalized to obtain a standard image set. Normalization eliminates differences in image pixel value ranges, accelerating model training convergence.

[0062] By normalizing, the set of defect location points can be normalized to the range [0, 1].

[0063] S102: Perform histogram equalization on each standard image in the standard image set to obtain an equalized image.

[0064] Considering that the pixel value of burrs is often too low, the burr defect locations of the standard image can be enhanced in this embodiment.

[0065] Enhancement methods can include global contrast enhancement and local contrast enhancement.

[0066] Local contrast enhancement primarily involves enhancing the dark areas where burrs and defects are located, and suppressing the bright areas of the background. Low-light enhancement rules can be set for local contrast enhancement.

[0067] Global contrast enhancement can be achieved by using histogram equalization to adjust the global contrast of a standard image.

[0068] S103: According to the set low-light enhancement rules, the brightness of the burr defect positions in each equalized image is enhanced to obtain the enhanced image set.

[0069] Low-light enhancement rules can include logarithmic transformation and stretching operations on the equalized image. Logarithmic transformation enhances dark areas containing glitch defects and suppresses bright background areas. Stretching restores the image's pixel values ​​to between 0 and 255.

[0070] The enhancement methods for each equalized image are similar. Taking any equalized image among all equalized images, i.e., the target equalized image, as an example, the target equalized image can be mapped to a logarithmic space image through a logarithmic transformation based on its maximum and average gray values. Based on the maximum and minimum pixel values ​​of the logarithmic space image, the logarithmic space image is stretched to obtain the enhanced target image. By summing all the enhanced target images, the enhanced image set can be obtained.

[0071] In this embodiment, the logarithmic transformation of the equalized image can be achieved using a log-domain operation formula. Specifically, the log-domain operation formula can be used to perform a logarithmic transformation on the target equalized image to obtain a log-space image; the log-domain operation formula is:

[0072] ;

[0073] Where i represents the pixel value of the target equalization image, max represents the maximum gray value of the target equalization image, avg represents the average gray value of the target equalization image, σ represents the logarithmic transformation coefficient, and tab[i] represents the pixel value of the logarithmic space image. The pixel range of i is [0, 255].

[0074] After obtaining the logarithmic space image, the pixel difference can be determined based on the maximum and minimum pixel values ​​of the logarithmic space image. The ratio of each pixel value in the logarithmic space image to the pixel difference is then multiplied by a set pixel value to obtain the enhanced target image.

[0075] In practice, the image stretching operation can be performed using the following formula:

[0076] ;

[0077] Where b represents the maximum pixel value of the logarithmic space image, a represents the minimum pixel value of the logarithmic space image, and k represents the enhanced target image. The pixel range of k is [0, 255].

[0078] In this embodiment, global contrast adjustment is achieved through histogram equalization, dark area enhancement and background brightness suppression are achieved through log domain operations, and finally, automatic stretching restores the image to pixel values ​​in the 0-255 range. By combining global contrast adjustment through histogram equalization and local dark area enhancement through logarithmic transformation, the low-light areas with burrs are enhanced, while the interference from bright background areas is suppressed, making the location of burr defects clearer.

[0079] In the embodiments of this application, the standard images contained in the standard image set can also be scaled and rotated to increase the diversity of the dataset, enabling the model to better adapt to defect detection at different scales and enhance the generalization performance and robustness of the model.

[0080] S104: Train the burr detection model based on the enhanced image set to obtain a burr detection model with training accuracy that meets the set requirements.

[0081] When training a model, the augmented image set can be divided into a training set, a validation set, and a test set according to a certain ratio. The training set is used for training the model, the validation set is used to evaluate the model's performance and adjust hyperparameters during training, and the test set is used to finally evaluate the model's generalization ability.

[0082] The spur detection model can include a feature extraction unit (Backbone), a feature fusion unit (Neck), and a classification output unit (head); the classification output unit includes multiple cross-scale convolutional kernels constructed based on spur detection.

[0083] After the spur detection model is trained, its performance can be evaluated using methods such as precision, recall, mean precision, and intersection over union (IoU).

[0084] S105: Analyze the image to be detected using a burr detection model whose training accuracy meets the set requirements, and output the burr recognition result.

[0085] A burr detection model that meets the training accuracy requirements has high detection accuracy. Therefore, when it is necessary to perform burr detection on the image to be detected, the burr detection model that meets the training accuracy requirements can be directly used to analyze the image to be detected, thus ensuring high accuracy of burr defect detection.

[0086] Figure 2 This is a schematic diagram of the architecture of a burr detection model provided in an embodiment of this application. Figure 2 The three dashed boxes from left to right correspond to the feature extraction unit (Backbone), the feature fusion unit (Neck), and the classification output unit (head), respectively. The Backbone consists of multiple Conv, multiple C2f, and one SPPF. During the bottom-up feature extraction process, as the network depth increases, the spatial resolution of the features gradually decreases, causing details such as edges and textures in shallow features to be gradually lost. Small objects occupy few pixels in the image and may have disappeared or become very blurry in the deep feature map.

[0087] In this embodiment, a 3x3 convolution is added to the burr detection model from the Backbone to the Neck module. This convolution serves to further extract and fuse features, reducing loss. Specifically, in… Figure 2 Layers 10, 12, and 17 further extract features. Layers 20, 23, and 26 detect small, medium, and large targets, respectively. For small targets, the acquired features undergo three additional stages of convolutional feature extraction, fusing high-level semantic features with shallow detail features to better preserve and enhance the feature information of small target defects such as burrs. After Neck feature fusion, a global attention mechanism (GAM) is used, acting on both shallow detail information and high-level semantic information to increase the weight of key features of small targets, suppress background interference, and process feature correlations in spatial and channel dimensions. The final output is then sent to the classification output unit, i.e., the small target detection head.

[0088] The small target detection head is a fusion of JVCEM and Dyhead dynamic detection head. Figure 2 The JVCEM_Dyhead is used in this paper. The Dyhead detection head applies scale awareness, spatial awareness, and task awareness attention operations to detect targets of various sizes. It focuses on the coordinates of defective targets, coordinates classification and localization weights, and combines them in a concatenated manner to enhance the perception capabilities of various dimensions of the image.

[0089] The spur detection model employs an improved YOLOv8 model structure, refining the feature fusion method in the Neck part to enhance feature representation and fully utilize multi-scale feature information. After feature fusion, a GAM global attention mechanism is used to increase the weight of key target features and reduce background interference. A JVCEM_Dyhead fusion detection head is introduced. JVCEM provides Dyhead with richer and more accurate feature information, while Dyhead processes this information using an attention mechanism. Through this multi-dimensional attention mechanism synergy, the JVCEM_Dyhead fusion detection head comprehensively enhances the model's ability to detect different targets, significantly improving detection accuracy.

[0090] As can be seen from the above technical solution, the burr defect image set is converted into a standard image set. Considering that the pixel values ​​of burr defects are often too low, histogram equalization can be performed on each standard image in the standard image set to obtain an equalized image. Since the pixel values ​​of burr defects are low, they often belong to dark areas in the entire image. Therefore, the brightness of the burr defect locations in each equalized image can be enhanced according to a set low-light enhancement rule to obtain an enhanced image set. The burr detection model is then trained based on the enhanced image set to obtain a burr detection model with training accuracy meeting the set requirements. The burr detection model can include a feature extraction unit, a feature fusion unit, and a classification output unit. The classification output unit includes multiple cross-scale convolutional kernels constructed based on burr detection. By setting multiple cross-scale convolutional kernels in the classification output unit, the global relationship between the target and the background can be more clearly distinguished, background interference can be suppressed, and small-sized burr defects can be prevented from being overwhelmed by global features. After training the model, the burr detection model, whose training accuracy meets the set requirements, is directly used to analyze the images to be detected, thus outputting burr recognition results. In this technical solution, histogram equalization and low-light enhancement processing of the image set effectively improve the image quality at the location of burr defects in the burr defect image set, thereby providing good training samples for model training. Furthermore, constructing multiple cross-scale convolutional kernels in the classification output unit of the burr detection model can effectively improve the detection accuracy of burr defects. Subsequent analysis of the images to be detected using the burr detection model whose training accuracy meets the set requirements further improves the detection accuracy of burr defects.

[0091] Figure 3 A flowchart illustrating a method for analyzing an image to be detected using a burr detection model trained to meet set accuracy requirements, as provided in this application embodiment, includes:

[0092] S301: Based on the feature extraction unit, perform feature extraction on the image to be detected to obtain multi-scale image features.

[0093] The input image is processed by Backbone to extract features from shallow edge texture to high-level semantic features. The SPPF module performs max pooling at different scales to generate multi-resolution feature maps. Further feature extraction is then performed to reduce the loss of shallow detail information. Finally, upsampling and feature fusion stitching operations are performed to fuse shallow and deep features.

[0094] S302: Based on the feature fusion unit, feature extraction and feature fusion are performed on multi-scale image features to obtain the image fusion features after burr defect enhancement.

[0095] In this embodiment, a convolution kernel is added on top of the traditional Neck. Through convolution feature extraction, high-level semantic features are fused with shallow detail features, which better preserves and enhances the feature information of small target burr defects.

[0096] S303: Use a global attention mechanism to assign weights to image fusion features to obtain image enhancement features.

[0097] After obtaining the image fusion features enhanced by burr defects, the Global Attention (GAM) mechanism is used to apply to shallow detail information and high-level semantic information, increasing the weight of key features of small targets and suppressing background interference.

[0098] S304: Use the multiple cross-scale convolution kernels contained in the classification output unit to perform cross-scale feature fusion on the image enhancement features to obtain cross-scale fused features.

[0099] By fusing image enhancement features across multiple scales using multiple cross-scale convolution kernels, background interference can be effectively reduced, thus lowering the false detection rate of target defects.

[0100] S305: Based on the dynamic detection head contained in the classification output unit, the image enhancement features and cross-scale fusion features are analyzed to output spur recognition results.

[0101] For burr defect detection, the classification output unit uses JVCEM_Dyhead. JVCEM_Dyhead focuses on small and medium-sized targets, suppresses background interference, and can more accurately output the location of target defects, thus improving the target detection capability and reducing the false negative and false positive rates.

[0102] Taking a multi-scale convolution kernel with four kernels, namely the first convolution kernel, the second convolution kernel, the third convolution kernel, and the fourth convolution kernel, as an example, in the specific implementation, the image enhancement features can be input into the first convolution kernel, the second convolution kernel, the third convolution kernel, and the fourth convolution kernel respectively to obtain the initial output features; wherein, the initial output features include the first output feature, the second output feature, the third output feature, and the fourth output feature; the size of the fourth convolution kernel is larger than the size of the third convolution kernel, the size of the third convolution kernel is larger than the size of the second convolution kernel, and the size of the second convolution kernel is larger than the size of the first convolution kernel.

[0103] According to the weights of the first layer corresponding to each convolution kernel, the first output feature and the second output feature are weighted and summed to obtain the fifth output feature, the second output feature and the third output feature are weighted and summed to obtain the sixth output feature, and the third output feature and the fourth output feature are weighted and summed to obtain the seventh output feature.

[0104] According to the second layer weights corresponding to each convolution kernel, the fifth and sixth output features are weighted and summed to obtain the eighth output feature, and the sixth and seventh output features are weighted and summed to obtain the ninth output feature.

[0105] The eighth and ninth output features are concatenated to obtain cross-scale fused features.

[0106] Figure 4 This is a schematic diagram of a cross-scale convolution kernel provided in an embodiment of this application. The improved JVCEM adds 7x7 convolution feature processing on the basis of the original 1x1, 3x3, and 5x5 cross-scale convolution feature processing, and performs two feature fusion enhancement operations using appropriate feature fusion weights. Figure 4 In this context, the value of w corresponding to each convolutional kernel represents its feature fusion weight. The feature fusion weight can be viewed as the convolution weight of the convolutional kernel.

[0107] By adding 7x7 convolutions, the receptive field is expanded, capturing a wider range of contextual information. Appropriate feature fusion weights are used, focusing more on the features of the 1x1, 3x3, and 5x5 branches for small targets, while also utilizing the contextual information provided by the 7x7 branch to reduce background interference and lower the false detection rate of target defects.

[0108] Figure 4In the first feature fusion, the 1x1 convolution weight is set to 1.0, and the 3x3 and 5x5 convolutions maintain a larger weight (0.8). The 7x7 convolution provides a larger receptive field, focusing on large targets and distinguishing the global relationship between the target and the background, suppressing background interference. Its weight is set to 0.3 to prevent the global features from overshadowing small targets. In the second feature fusion, the 1x1 convolution weight is set to 1.0, and the 3x3 and 5x5 convolutions maintain a larger weight (0.8). The feature values ​​of the 7x7 convolution-fused feature map are then weighted with 0.5 for secondary fusion, suppressing background interference while preserving key target features. After fusion, the feature maps are stitched together, and further feature enhancement (FAM) is performed, improving the handling of defect features for small and medium-sized targets while suppressing background interference.

[0109] The Dyhead dynamic inspection head possesses scale awareness, spatial awareness, and task awareness attention. Through scale awareness and spatial awareness, it can focus on the coordinates of the defect target, coordinate classification, and determine the localization weights. Coordination classification refers to the type being focused on; this application focuses on the burr defect category. Localization weight represents the weight corresponding to the burr defect location; the higher the weight, the higher the probability that the location belongs to a burr defect.

[0110] In this embodiment, the perception capability of images across various dimensions is enhanced by combining JVCEM with the Dyhead dynamic detection head in series. First, JVCEM is used to enhance the features of small and medium-sized targets, focusing more on these targets, suppressing background interference, and inhibiting the detection of some large targets. Finally, the scale perception, spatial perception, and task-aware attention of the dynamic head are applied, greatly improving the detection capability of small and medium-sized targets.

[0111] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0112] Figure 5 A schematic diagram of a burr defect detection device provided in an embodiment of this application includes a conversion unit 51, an equalization unit 52, an enhancement unit 53, a training unit 54, and an analysis unit 55;

[0113] The conversion unit 51 is used to convert the burr defect image set into a standard image set;

[0114] The equalization unit 52 is used to perform histogram equalization processing on each standard image contained in the standard image set to obtain an equalized image.

[0115] The enhancement unit 53 is used to enhance the brightness of the burr defect positions in each equalized image according to the set low-light enhancement rules, so as to obtain the enhanced image set.

[0116] Training unit 54 is used to train the spur detection model based on the enhanced image set to obtain a spur detection model with training accuracy that meets the set requirements; wherein, the spur detection model includes a feature extraction unit, a feature fusion unit, and a classification output unit; the classification output unit includes multiple cross-scale convolutional kernels constructed based on spur detection;

[0117] Analysis unit 55 is used to analyze the image to be detected using a burr detection model whose training accuracy meets the set requirements, so as to output burr recognition results.

[0118] In some embodiments, the enhancement unit includes a mapping subunit, a stretching subunit, and a summarizing subunit;

[0119] The mapping subunit is used to map the target equalization image to a logarithmic space image through logarithmic transformation based on the maximum gray value and the average gray value of the target equalization image; wherein, the target equalization image is any equalization image among all equalization images;

[0120] The stretching subunit is used to stretch the logarithmic space image based on the maximum and minimum pixel values ​​of the logarithmic space image to obtain the enhanced target image.

[0121] The summarization sub-unit is used to summarize all enhanced target images to obtain an enhanced image set.

[0122] In some embodiments, the mapping subunit is used to perform a logarithmic transformation on the target equalized image by invoking the log domain operation formula to obtain a log-space image; the log domain operation formula is:

[0123] ;

[0124] Where i represents the pixel value of the target equalization image, max represents the maximum gray value of the target equalization image, avg represents the average gray value of the target equalization image, σ represents the logarithmic transformation coefficient, and tab[i] represents the pixel value of the logarithmic space image.

[0125] In some embodiments, the stretching subunit is used to determine the pixel difference based on the maximum and minimum pixel values ​​of the logarithmic space image; and multiply the ratio of each pixel value of the logarithmic space image to the pixel difference by a set pixel value to obtain the enhanced target image.

[0126] In some embodiments, the analysis unit includes a feature extraction subunit, a feature fusion subunit, a weight allocation subunit, a cross-scale fusion subunit, and an output subunit;

[0127] The feature extraction subunit is used to extract features from the image to be detected based on the feature extraction unit, so as to obtain multi-scale image features;

[0128] The feature fusion subunit is used to extract and fuse features from multi-scale image features based on the feature fusion unit to obtain the image fusion features after burr defect enhancement;

[0129] The weight allocation subunit is used to allocate weights to image fusion features using a global attention mechanism to obtain image enhancement features;

[0130] The cross-scale fusion subunit is used to perform cross-scale feature fusion on image enhancement features by utilizing multiple cross-scale convolution kernels contained in the classification output unit to obtain cross-scale fused features;

[0131] The output subunit is used to analyze image enhancement features and cross-scale fusion features based on the dynamic detection head contained in the classification output unit, so as to output spur recognition results.

[0132] In some embodiments, the cross-scale fusion subunit is used to input image enhancement features into a first convolutional kernel, a second convolutional kernel, a third convolutional kernel, and a fourth convolutional kernel, respectively, to obtain initial output features; wherein, the initial output features include a first output feature, a second output feature, a third output feature, and a fourth output feature; the size of the fourth convolutional kernel is larger than the size of the third convolutional kernel, the size of the third convolutional kernel is larger than the size of the second convolutional kernel, and the size of the second convolutional kernel is larger than the size of the first convolutional kernel;

[0133] According to the weights of the first layer corresponding to each convolution kernel, the first output feature and the second output feature are weighted and summed to obtain the fifth output feature, the second output feature and the third output feature are weighted and summed to obtain the sixth output feature, and the third output feature and the fourth output feature are weighted and summed to obtain the seventh output feature.

[0134] According to the second layer weights corresponding to each convolution kernel, the fifth output feature and the sixth output feature are weighted and summed to obtain the eighth output feature, and the sixth output feature and the seventh output feature are weighted and summed to obtain the ninth output feature;

[0135] The eighth and ninth output features are concatenated to obtain cross-scale fused features.

[0136] In some embodiments, the conversion unit includes a labeling subunit and a normalization subunit;

[0137] The annotation subunit is used to segment and annotate the burr defect image set to obtain an annotated image set; wherein, the annotated image set contains each burr defect image and its corresponding label information; the label information includes burr category and burr location information;

[0138] The normalization subunit is used to normalize the labeled image set to obtain a standard image set.

[0139] Figure 5 For a description of the features in the corresponding embodiments, please refer to Figure 1 The relevant descriptions of the corresponding embodiments will not be repeated here.

[0140] As can be seen from the above technical solution, the burr defect image set is converted into a standard image set. Considering that the pixel values ​​of burr defects are often too low, histogram equalization can be performed on each standard image in the standard image set to obtain an equalized image. Since the pixel values ​​of burr defects are low, they often belong to dark areas in the entire image. Therefore, the brightness of the burr defect locations in each equalized image can be enhanced according to a set low-light enhancement rule to obtain an enhanced image set. The burr detection model is then trained based on the enhanced image set to obtain a burr detection model with training accuracy meeting the set requirements. The burr detection model can include a feature extraction unit, a feature fusion unit, and a classification output unit. The classification output unit includes multiple cross-scale convolutional kernels constructed based on burr detection. By setting multiple cross-scale convolutional kernels in the classification output unit, the global relationship between the target and the background can be more clearly distinguished, background interference can be suppressed, and small-sized burr defects can be prevented from being overwhelmed by global features. After training the model, the burr detection model, whose training accuracy meets the set requirements, is directly used to analyze the images to be detected, thus outputting burr recognition results. In this technical solution, histogram equalization and low-light enhancement processing of the image set effectively improve the image quality at the location of burr defects in the burr defect image set, thereby providing good training samples for model training. Furthermore, constructing multiple cross-scale convolutional kernels in the classification output unit of the burr detection model can effectively improve the detection accuracy of burr defects. Subsequent analysis of the images to be detected using the burr detection model whose training accuracy meets the set requirements further improves the detection accuracy of burr defects.

[0141] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above embodiments of the burr defect detection method.

[0142] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above embodiments of the burr defect detection method when it is run.

[0143] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0144] The embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the embodiments of the burr defect detection method described above.

[0145] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above embodiments of the burr defect detection method.

[0146] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0147] The foregoing has provided a detailed description of a burr defect detection method, apparatus, device, and storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only intended to aid in understanding the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of this application.

Claims

1. A method for detecting burr defects, characterized in that, include: Convert the burr defect image set into a standard image set; Histogram equalization is performed on each standard image in the standard image set to obtain an equalized image; According to the set low-light enhancement rules, the brightness of the burr defect locations in each of the equalized images is enhanced to obtain the enhanced image set; The spur detection model is trained based on the enhanced image set to obtain a spur detection model with training accuracy that meets the set requirements; wherein, the spur detection model includes a feature extraction unit, a feature fusion unit, and a classification output unit; the classification output unit includes multiple cross-scale convolutional kernels constructed based on spur detection; The burr detection model, trained to meet the set accuracy requirements, is used to analyze the image to be detected and output the burr recognition result.

2. The burr defect detection method according to claim 1, characterized in that, The step involves enhancing the brightness of burr defect locations in each of the equalized images according to a set low-light enhancement rule to obtain an enhanced image set, including: Based on the maximum and average gray values ​​of the target equalized image, the target equalized image is mapped to a logarithmic space image through a logarithmic transformation; wherein, the target equalized image is any equalized image among all equalized images; Based on the maximum and minimum pixel values ​​of the logarithmic space image, the logarithmic space image is stretched to obtain an enhanced target image; All enhanced target images are aggregated to obtain an enhanced image set.

3. The burr defect detection method according to claim 2, characterized in that, The step of mapping the target equalized image to a logarithmic space image through logarithmic transformation based on the maximum and average gray values ​​of the target equalized image includes: The target equalized image is logarithmically transformed using the log-domain operation formula to obtain a log-space image; the log-domain operation formula is: ; Where i represents the pixel value of the target equalization image, max represents the maximum gray value of the target equalization image, avg represents the average gray value of the target equalization image, σ represents the logarithmic transformation coefficient, and tab[i] represents the pixel value of the logarithmic space image.

4. The burr defect detection method according to claim 2, characterized in that, The step of stretching the logarithmic space image based on the maximum and minimum pixel values ​​to obtain the enhanced target image includes: The pixel difference is determined based on the maximum and minimum pixel values ​​of the logarithmic space image. The enhanced target image is obtained by multiplying the ratio of each pixel value in the logarithmic space image to the pixel difference by a set pixel value.

5. The burr defect detection method according to any one of claims 1 to 4, characterized in that, The process of analyzing the image to be detected using a burr detection model trained to meet set accuracy requirements, and outputting burr recognition results, includes: The feature extraction unit performs feature extraction on the image to be detected to obtain multi-scale image features; Based on the feature fusion unit, feature extraction and feature fusion are performed on the multi-scale image features to obtain the image fusion features after burr defect enhancement; The image fusion features are weighted using a global attention mechanism to obtain image enhancement features; The image enhancement features are fused using multiple cross-scale convolutional kernels contained in the classification output unit to obtain cross-scale fused features; The image enhancement features and the cross-scale fusion features are analyzed based on the dynamic detection head included in the classification output unit to output spur recognition results.

6. The burr defect detection method according to claim 5, characterized in that, The step of using multiple cross-scale convolutional kernels contained in the classification output unit to perform cross-scale feature fusion on the image enhancement features to obtain cross-scale fused features includes: The image enhancement features are respectively input into a first convolutional kernel, a second convolutional kernel, a third convolutional kernel, and a fourth convolutional kernel to obtain initial output features; wherein, the initial output features include a first output feature, a second output feature, a third output feature, and a fourth output feature; the size of the fourth convolutional kernel is larger than the size of the third convolutional kernel, the size of the third convolutional kernel is larger than the size of the second convolutional kernel, and the size of the second convolutional kernel is larger than the size of the first convolutional kernel; According to the weights of the first layer corresponding to each convolution kernel, the first output feature and the second output feature are weighted and summed to obtain the fifth output feature, the second output feature and the third output feature are weighted and summed to obtain the sixth output feature, and the third output feature and the fourth output feature are weighted and summed to obtain the seventh output feature. According to the second layer weights corresponding to each convolution kernel, the fifth output feature and the sixth output feature are weighted and summed to obtain the eighth output feature, and the sixth output feature and the seventh output feature are weighted and summed to obtain the ninth output feature; The eighth output feature and the ninth output feature are concatenated to obtain cross-scale fused features.

7. The burr defect detection method according to claim 1, characterized in that, The process of converting the burr defect image set into a standard image set includes: The burr defect image set is segmented and labeled to obtain a labeled image set; wherein, the labeled image set contains each burr defect image and its corresponding label information; the label information includes burr category and burr location information; The labeled image set is normalized to obtain a standard image set.

8. A burr defect detection device, characterized in that, It includes a conversion unit, an equalization unit, an enhancement unit, a training unit, and an analysis unit; The conversion unit is used to convert the burr defect image set into a standard image set; The equalization unit is used to perform histogram equalization processing on each standard image contained in the standard image set to obtain an equalized image. The enhancement unit is used to enhance the brightness of the burr defect locations in each of the equalized images according to the set low-light enhancement rules, so as to obtain an enhanced image set. The training unit is used to train the spur detection model based on the enhanced image set to obtain a spur detection model with training accuracy that meets the set requirements; wherein, the spur detection model includes a feature extraction unit, a feature fusion unit, and a classification output unit; the classification output unit includes multiple cross-scale convolutional kernels constructed based on spur detection; The analysis unit is used to analyze the image to be detected using a burr detection model whose training accuracy meets the set requirements, so as to output the burr recognition result.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the burr defect detection method as described in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, it implements the steps of the burr defect detection method as described in any one of claims 1 to 7.