Two-stage tool surface defect detection method and system

Through the two-stage tool surface defect detection method, the Radon transformation and edge structure operator extract features, combined with the residual network and support vector machine for preliminary screening, and then accurately segmented the defect area through the twin transformation detection network, solving the problems of low detection accuracy and limited efficiency in the existing technology, realizing more efficient and reliable defect detection.

CN120031791AActive Publication Date: 2025-05-23JINAN UNIVERSITY

Patent Information

Application Number
CN202411877675.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-05-23
Estimated Expiration
2044-12-19

AI Technical Summary

Technical Problem

The prior art relies on a large amount of labeled data, complex model calculation costs, poor interpretability and low generalization performance, resulting in low accuracy of tool surface defect detection, poor reliability and limited efficiency.

Method used

Using a two-stage tool surface defect detection method, firstly, features are extracted through Radon transformation and edge structure operator convolution, classification model is designed using residual network and support vector machine to coarsely locate the abnormal areas; secondly, based on the twin transformation detection network, the difference information between the normal image and the abnormal image in each defect pair is learned, and the defect areas in the abnormal images are accurately segmented.

Benefits of technology

It improves the accuracy, reliability and efficiency of tool surface defect detection, reduces the demand for massive annotated samples, reduces the cost of model calculation, and enhances the interpretability and robustness of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120031791A_ABST
    Figure CN120031791A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, in particular to a two-stage tool surface defect detection method and system, and the method comprises the steps: carrying out the graying, posture correction, cutting and marking operation of a to-be-detected tool surface channel image, and obtaining a to-be-detected tool surface correction grayscale image corresponding to each subimage and a serial number of each subimage; respectively inputting each sub-image into the trained residual network and the support vector machine, outputting a first prediction defect probability value and a second prediction defect probability value of each sub-image, and obtaining a fusion defect probability value of each sub-image; the sub-images with the fusion defect probability values larger than or equal to a threshold value serve as abnormal sub-images; forming defect pairs of the abnormal sub-images based on the abnormal sub-images and the normal sub-images with the same serial numbers; and inputting the defect pairs of all the abnormal sub-images into the trained twin transformation detection network, and outputting defect region features and segmentation results in all the abnormal sub-images. The tool surface defect detection accuracy, reliability and efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of image processing, and in particular to a two-stage tool surface defect detection method and system. Background Art

[0002] Tool surface defect detection is an important part of ensuring tool performance and processing quality. Its purpose is to identify problems such as cracks, collisions, wear, coating peeling, etc. that occur during tool use or production. However, due to the complexity of the tool surface, the variety of defect types and the usually small size, and the fact that tools often have high reflectivity and curved surfaces, the detection process faces significant difficulties, including the diversity and irregularity of defect characteristics, as well as the influence of external light and environmental noise.

[0003] Traditional detection methods mainly include manual detection and contact detection. Manual detection relies on the experience of technical workers and identifies defects through visual inspection or simple instruments. Although it is low-cost, it is inefficient, highly subjective, and difficult to ensure consistency. The contact detection method uses probe measurement or hardness tester detection. Although it improves the accuracy to a certain extent, it may cause damage to the tool surface and cannot meet the needs of complex surfaces and batch detection.

[0004] In order to overcome the limitations of traditional methods, non-contact automated detection technology has been widely used and developed rapidly in recent years. Existing non-contact automated detection technologies include: computer vision-based detection technology, which can identify common defects on the tool surface through high-resolution image acquisition, edge detection and texture analysis; laser scanning technology, which achieves high-precision surface morphology detection through three-dimensional modeling, and is particularly suitable for the analysis of complex-shaped tools; ultrasonic and acoustic emission technology, which uses signal analysis to detect deep cracks or internal defects; infrared thermal imaging technology, which reveals hidden defects by monitoring surface temperature distribution; multi-sensor fusion technology, which combines vision, laser, infrared and other means, and integrates features using fusion algorithms to achieve high-precision, multi-angle defect analysis; artificial intelligence technology, which uses deep learning models (such as CNN) to train and learn the relationship between the features and defects of pre-processed tool images, and then uses the trained model to detect new images to determine the defect situation.

[0005] In recent years, artificial intelligence technology based on deep learning convolutional neural networks (CNN) and target detection algorithms (such as YOLO and Faster R-CNN) has been widely used in defect detection, significantly improving the automation level and accuracy of detection. However, this technology relies on a large amount of labeled data, has complex models and high computational costs, poor interpretability and low generalization performance, is easily affected by the environment, and has poor robustness, resulting in low accuracy, poor reliability and limited efficiency in tool surface defect detection. Summary of the invention

[0006] To this end, the technical problem to be solved by the present invention is to overcome the existing technology that relies on a large amount of labeled data, has complex models with high computational costs, poor interpretability and low generalization performance, is easily affected by the environment, has poor robustness, and results in low accuracy, poor reliability and limited efficiency in tool surface defect detection.

[0007] In order to solve the above technical problems, the present invention provides a two-stage tool surface defect detection method, comprising:

[0008] Acquire multiple tool surface channel images, perform grayscale operation on each tool surface channel image to obtain each tool surface grayscale image; perform posture correction operation on each tool surface grayscale image to obtain a tool surface correction grayscale image; perform cropping operation on each tool surface correction grayscale image according to a preset size to obtain multiple sub-images corresponding to each tool surface correction grayscale image; and mark each sub-image corresponding to each tool surface correction grayscale image in turn according to the cropping order to obtain the number of each sub-image corresponding to each tool surface correction grayscale image;

[0009] The Radon transform is used to extract the Radon domain features of each sub-image corresponding to the tool surface correction grayscale image, which is used to annotate the Radon true label of each sub-image corresponding to the tool surface correction grayscale image; a Radon training set is constructed based on each sub-image corresponding to each tool surface correction grayscale image and its Radon true label; the Radon training set is used to train the residual network to obtain the trained residual network, which is used to output the first predicted defect probability value of each sub-image corresponding to the tool surface correction grayscale image;

[0010] The edge structure operator convolution is used to extract the edge structure features of each sub-image corresponding to the tool surface correction grayscale image, which is used to mark the edge true label of each sub-image corresponding to the tool surface correction grayscale image; based on each sub-image corresponding to each tool surface correction grayscale image and its edge true label, an edge structure feature data set is constructed; using the edge structure feature data set, a support vector machine is trained to obtain a trained support vector machine, which is used to output the second predicted defect probability value of each sub-image corresponding to the tool surface correction grayscale image;

[0011] Taking a weighted average of the first predicted defect probability value and the second predicted defect probability value of each sub-image corresponding to each tool surface corrected grayscale image, to obtain a fused defect probability value of each sub-image corresponding to each tool surface corrected grayscale image;

[0012] The sub-images whose fusion defect probability values ​​are greater than or equal to the threshold are regarded as abnormal sub-images;

[0013] The sub-images with the same number corresponding to the corrected grayscale images of each tool surface are divided into a group to obtain sub-image groups with different numbers; according to the number of the abnormal sub-image, a normal sub-image is found in the sub-image group corresponding to the abnormal sub-image to form a defect pair of the abnormal sub-image, and the defect pairs of all abnormal sub-images are obtained in turn to form a defect pair data set; the twin transformation detection network is trained using the defect pair data set to obtain a trained twin transformation detection network, which is used to detect the feature information and segmentation results of the defect area in each abnormal sub-image.

[0014] Preferably, the twin transform detection network comprises: an input layer, two weight-sharing convolutional layers, a transformation layer and an output layer; wherein the two weight-sharing sub-networks each comprise: a shared convolutional layer and a feature vector output layer;

[0015] The input layer is used to input defect pairs of all abnormal sub-images and output normal sub-images and abnormal sub-images of all image pairs;

[0016] The first weight-sharing convolution layer is composed of two convolutions with a convolution kernel size of 3, one with a convolution kernel size of 8, and one with a convolution kernel size of 12, which is used to extract the features of the normal sub-image of each defect pair and output the feature vector of the normal sub-image of each defect pair;

[0017] The second weight-sharing convolution layer is composed of a convolution stack of two convolution kernels with a size of 3, one convolution kernel with a size of 8, and one convolution kernel with a size of 12, and is used to extract the features of the abnormal sub-image of each defect pair and output the feature vector of the abnormal sub-image of each defect pair; wherein, while the normal sub-image of each defect pair is input into the first shared convolution layer, the abnormal sub-image of the image pair is input into the second shared convolution layer;

[0018] The transformation layer consists of three convolution stacks, which is used to align the feature vectors of the normal sub-image of each defect pair with the feature vectors of the abnormal sub-image of the image pair, and output the transformation matrix corresponding to each defect pair;

[0019] The output layer is used to output the feature information and segmentation results of the defect area in each abnormal sub-image according to the transformation matrix corresponding to each defect pair.

[0020] Preferably, performing a grayscale operation on the tool surface channel image to obtain a tool surface grayscale image includes:

[0021] The CCD linear array camera is used to collect the channel images of the tool surface. According to the weighted average method, combined with the weight corresponding to each channel, a grayscale mathematical model is constructed, and its expression is:

[0022] ;

[0023] in, Indicates the grayscale image of the tool surface The gray value of each pixel; Represents the weight corresponding to the red channel in the tool surface channel image; Indicates the first The component value of the red channel of each pixel; Represents the weight corresponding to the green channel in the tool surface channel image; Indicates the first The component value of the green channel of each pixel; Represents the weight corresponding to the blue channel in the tool surface channel image; Indicates the first The component value of the blue channel of each pixel;

[0024] According to the grayscale mathematical model, the tool surface channel image is grayscaled to obtain the tool surface grayscale image.

[0025] Preferably, performing a posture correction operation on the tool surface grayscale image to obtain a tool surface corrected grayscale image includes:

[0026] A vertical reference line is determined through the center point of the grayscale image of the tool surface; an angle bisector of the tool is obtained based on a line connecting the center point of the grayscale image of the tool surface and the top angle of the tool; and an angle between the angle bisector of the tool and the reference line is used as a rotation angle;

[0027] Based on the coordinates and rotation angle of each pixel in the grayscale image of the tool surface, a mathematical model for posture correction is constructed, and its expression is:

[0028] ;

[0029] in, Indicates the grayscale image of the tool surface The horizontal coordinate component of the pixel after correction; Indicates the grayscale image of the tool surface The vertical coordinate component of the pixel after correction; Indicates the grayscale image of the tool surface The horizontal coordinate component of the pixel point; Indicates the grayscale image of the tool surface The vertical coordinate component of each pixel; Angle representing the rotation angle;

[0030] According to the mathematical model of posture correction, the grayscale image of the tool surface is subjected to posture correction operation to obtain the corrected horizontal and vertical coordinate components of each pixel point in the grayscale image of the tool surface; based on the corrected horizontal and vertical coordinate components of each pixel point in the grayscale image of the tool surface, the corrected grayscale image of the tool surface is obtained.

[0031] Preferably, the step of extracting edge structure features of each sub-image corresponding to each tool surface corrected grayscale image by using edge structure operator convolution comprises:

[0032] The edge structure operator convolution includes HOG operator convolution and LBP operator convolution;

[0033] By using HOG operator convolution, the HOG operator feature matrix of each sub-image corresponding to each tool surface corrected grayscale image is obtained; by using LBP operator convolution, the LBP operator feature matrix of each sub-image corresponding to each tool surface corrected grayscale image is obtained; through matrix splicing, the HOG operator feature matrix and LBP operator feature matrix of each sub-image corresponding to each tool surface corrected grayscale image are fused to obtain the edge structure feature matrix of each sub-image corresponding to each tool surface corrected grayscale image.

[0034] Preferably, the residual network loss function is a cross entropy loss function, which is expressed as:

[0035] ;

[0036] in, represents the residual network loss function; Represents the number of corrected grayscale images of all tool surfaces; Indicates the number of all sub-images corresponding to each tool surface corrected grayscale image; Indicates The corrected grayscale image of the tool surface corresponds to The Radon true label of the sub-image is It means that the sub-image has no defects. It means that the sub-image is defective; Indicates The corrected grayscale image of the tool surface corresponds to The first predicted defect probability value of the sub-image.

[0037] Preferably, the loss function for training the support vector machine includes: a hinge loss function for the training standard support vector machine classifier stage and a cross entropy loss function for the training logistic regression stage;

[0038] The expression of the hinge loss function in the training standard support vector machine classifier stage is:

[0039] ;

[0040] in, represents the hinge loss function during the training of a standard support vector machine classifier; Indicates The corrected grayscale image of the tool surface corresponds to The true edge label of the sub-image is It means that the sub-image has no defects. It means that the sub-image is defective; represents the decision function; Indicates The corrected grayscale image of the tool surface corresponds to Zhangzi image;

[0041] The expression of the cross entropy loss function in the training logistic regression stage is:

[0042] ;

[0043] in, Represents the cross entropy loss function during the logistic regression training phase; Represents the number of corrected grayscale images of all tool surfaces; Indicates the number of all sub-images corresponding to each tool surface corrected grayscale image; Indicates The corrected grayscale image of the tool surface corresponds to The true edge label of the sub-image is It means that the sub-image has no defects. It means that the sub-image is defective; Indicates The corrected grayscale image of the tool surface corresponds to A second predicted defect probability value of the sub-image.

[0044] Preferably, the twin transformation detection network loss function is a contrast loss function, which is expressed as:

[0045] ;

[0046] in, represents the loss function of the twin transformation detection network; represents the number of all image pairs; Indicates The distance measure between the feature vector of the normal sub-image and the feature vector of the abnormal sub-image in the defect pair is ; Indicates Feature vector of the normal sub-image in the defect pair; Indicates The feature vector of the abnormal sub-image in the defect pair; Indicates If the label of a defect pair It means that the image pair is a similar sample. Then the image pair is a dissimilar sample; Indicates the boundary threshold.

[0047] Preferably, acquiring the channel image of the tool surface to be detected and obtaining the feature information and segmentation result of the corresponding defective area includes:

[0048] Acquire a channel image of the tool surface to be detected; perform grayscale conversion, posture correction, cropping and labeling operations on the channel image of the tool surface to be detected in sequence to obtain each sub-image and its number corresponding to the corrected grayscale image of the tool surface to be detected;

[0049] Input each sub-image corresponding to the corrected grayscale image of the tool surface to be inspected into the trained residual network, and output a first predicted defect probability value of each sub-image corresponding to the corrected grayscale image of the tool surface to be inspected;

[0050] Input each sub-image corresponding to the corrected grayscale image of the tool surface to be inspected into the trained support vector machine, and output a second predicted defect probability value of each sub-image corresponding to the corrected grayscale image of the tool surface to be inspected;

[0051] Taking a weighted average of the first predicted defect probability value and the second predicted defect probability value of each sub-image corresponding to the corrected grayscale image of the tool surface to be inspected, to obtain a fused defect probability value of each sub-image corresponding to the corrected grayscale image of the tool surface to be inspected;

[0052] The sub-images whose fusion defect probability values ​​are greater than or equal to the threshold are regarded as abnormal sub-images;

[0053] Obtain a normal tool surface sub-image set, find a normal sub-image with the same number as the abnormal sub-image in the normal tool surface sub-image set according to the number of each abnormal sub-image, and combine the abnormal sub-image with the normal sub-image with the same number to form a defect pair of the abnormal sub-image, and sequentially obtain defect pairs of all abnormal sub-images;

[0054] The defect pairs of all abnormal sub-images are input into the trained twin transformation detection network, and the feature information and segmentation results of the defect area in each abnormal sub-image are output, so as to obtain the feature information and segmentation results of the defect area corresponding to the tool surface channel image to be detected.

[0055] The present invention also provides a two-stage tool surface defect detection system, comprising:

[0056] Image annotation module: obtain multiple tool surface channel images, perform grayscale operation on each tool surface channel image, and obtain each tool surface grayscale image; perform posture correction operation on each tool surface grayscale image to obtain a tool surface correction grayscale image; perform cropping operation on each tool surface correction grayscale image according to a preset size to obtain multiple sub-images corresponding to each tool surface correction grayscale image; and perform labeling on each sub-image corresponding to each tool surface correction grayscale image in turn according to the cropping order to obtain the number of each sub-image corresponding to each tool surface correction grayscale image;

[0057] The first detection module: using Radon transform, extracting Radon domain features of each sub-image corresponding to each tool surface corrected grayscale image; based on the Radon domain features of each sub-image corresponding to each tool surface corrected grayscale image, marking the defect results of each sub-image corresponding to each tool surface corrected grayscale image; constructing a Radon training set based on each sub-image corresponding to each tool surface corrected grayscale image and its defect results; using the Radon training set, training the residual network to obtain a trained residual network for outputting a first probability value of defects in each sub-image corresponding to the tool surface corrected grayscale image;

[0058] The second detection module: using the edge structure operator convolution to extract the edge structure features of each sub-image corresponding to each tool surface corrected grayscale image; based on the edge structure features of each sub-image corresponding to each tool surface corrected grayscale image, marking the defect results of each sub-image corresponding to each tool surface corrected grayscale image; constructing an edge structure feature data set based on each sub-image corresponding to each tool surface corrected grayscale image and its defect results; using the edge structure feature data set, training a support vector machine to obtain a trained residual network for outputting a second probability value of defects in each sub-image corresponding to the tool surface corrected grayscale image;

[0059] Fusion detection module: weighted average the first probability value and the second probability value of defects in each sub-image corresponding to each tool surface corrected grayscale image, to obtain a third probability value of defects in each sub-image corresponding to each tool surface corrected grayscale image;

[0060] An abnormal sub-image determination module: taking a sub-image whose third probability value is greater than or equal to a threshold as an abnormal sub-image;

[0061] Defect feature detection module: the sub-images with the same number corresponding to the corrected grayscale images of each tool surface are divided into a group to obtain sub-image groups with different numbers; according to the number of the abnormal sub-image, a normal sub-image is found in the sub-image group corresponding to the abnormal sub-image to form a defect pair of the abnormal sub-image, and the defect pairs of all abnormal sub-images are obtained in turn to form a defect pair data set; the defect pair data set is used to train the twin transformation detection network to obtain the trained twin transformation detection network, which is used to detect the feature information of the defect area in each abnormal sub-image.

[0062] The above technical solution of the present invention has the following beneficial effects compared with the prior art:

[0063] The two-stage tool surface defect detection method described in the present invention processes all tool surface grayscale images through a posture correction link to ensure the standardized processing of each tool surface grayscale image, laying a foundation for the subsequent improvement of the generalization performance of the tool surface defect detection model; the tool surface defect detection process is divided into two stages: in the first stage, based on the fusion of Radon domain features and edge structure features, a classification model is designed through a residual network and a support vector machine to roughly locate the abnormal area; in this stage, the intrinsic features of the image are respectively mined through Radon transform and edge structure operator convolution operations, reducing the demand for massive labeled samples, so as to achieve preliminary screening and positioning of effective defect areas in the case of few samples, reduce data acquisition and labeling costs and workload, improve detection efficiency, and have significant advantages in data scarce scenarios; at the same time, Radon domain features and edge structure features increase the interpretability of the model; In addition, the use of residual networks and support vector machines can extract deep semantic features while avoiding overly complex structures, reducing the computational cost of the model. In the second stage, based on the designed lightweight twin transformation detection network, the difference information between the normal image and the abnormal image in each defect pair is learned to accurately segment the defect area in the abnormal image. In this stage, the twin transformation detection network focuses on the difference between image pairs, efficiently mines defect features from a relatively small amount of data, alleviates the pressure and cost of data annotation, effectively controls the number of parameters and computational complexity, improves the running speed of the twin transformation detection network, and enhances the interpretability of the twin transformation detection network. At the same time, in the process of screening abnormal images, the scope of influence of environmental noise is reduced. When learning the diverse difference features of image pairs, the commonality is weakened, the defect characteristics are highlighted, and the robustness and generalization of the twin transformation detection network are enhanced, thereby improving the accuracy, reliability and efficiency of tool surface defect detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] In order to make the content of the present invention more clearly understood, the present invention is further described in detail below according to specific embodiments of the present invention in conjunction with the accompanying drawings, wherein:

[0065] Figure 1 It is a flow chart of a two-stage tool surface defect detection method provided by the present invention;

[0066] Figure 2 is a schematic diagram of the posture correction of the tool image;

[0067] Figure 3 It is a schematic diagram of the cutting process of the tool image;

[0068] Figure 4 It is a schematic diagram of Radon transform of tool image;

[0069] Figure 5 This is a schematic diagram of the ResNet network structure configuration;

[0070] Figure 6 is a schematic diagram of the classification process of tool images;

[0071] Figure 7 is a schematic diagram of defect pair data of tool image; among them, Figure 7 (a) in the figure represents a normal sub-image; Figure 7 (b) in the figure represents an abnormal sub-image;

[0072] Figure 8 It is a schematic diagram of the twin transformation detection network and segmentation results;

[0073] Fig. 9 It is a schematic diagram of a two-stage tool surface defect detection system provided by the present invention. DETAILED DESCRIPTION

[0074] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention.

[0075] Reference Figure 1 As shown, Figure 1 A flow chart of a two-stage tool surface defect detection method provided by the present invention; specifically comprising:

[0076] S1: Acquire multiple tool surface channel images, perform grayscale operation on each tool surface channel image to obtain each tool surface grayscale image; perform posture correction operation on each tool surface grayscale image to obtain a tool surface correction grayscale image; perform cropping operation on each tool surface correction grayscale image according to a preset size to obtain multiple sub-images corresponding to each tool surface correction grayscale image; label each sub-image corresponding to each tool surface correction grayscale image in turn according to the cropping order to obtain the number of each sub-image corresponding to each tool surface correction grayscale image;

[0077] Among them, the grayscale operation is performed on the tool surface channel image to obtain the tool surface grayscale image including:

[0078] The CCD linear array camera is used to collect the channel images of the tool surface. According to the weighted average method, combined with the weight corresponding to each channel, a grayscale mathematical model is constructed, and its expression is:

[0079] ;

[0080] in, Indicates the grayscale image of the tool surface The gray value of each pixel; Represents the weight corresponding to the red channel in the tool surface channel image; Indicates the first The component value of the red channel of each pixel; Represents the weight corresponding to the green channel in the tool surface channel image; Indicates the first The component value of the green channel of each pixel; Represents the weight corresponding to the blue channel in the tool surface channel image; Indicates the first The component value of the blue channel of each pixel;

[0081] According to the grayscale mathematical model, each tool surface channel image is grayscaled to obtain each tool surface grayscale image; the grayscale image can simplify the image processing task, and for Radon transform, the intrinsic features of the image will not be excessively lost;

[0082] Among them, a CCD linear array industrial camera is used to collect image data of the track surface. It should be noted that in the image collection process, in order to facilitate subsequent data processing, the light source of the collection environment should be kept good to reduce the impact of the environment on the classification effect;

[0083] Among them, performing posture correction operation on the tool surface grayscale image to obtain the tool surface correction grayscale image includes:

[0084] A vertical reference line is determined through the center point of the grayscale image of the tool surface; the angle bisector of the tool is obtained based on the line connecting the center point of the grayscale image of the tool surface and the top angle of the tool; the angle between the angle bisector of the tool and the reference line is used as the rotation angle; the coordinate system is rotated around the angle Rotate to adjust the direction of the tool image; this adjustment ensures that the symmetry line of the tool is aligned with the vertical reference line, providing a standardized reference for subsequent defect detection and analysis; this step is crucial to reducing the variability in the tool direction, thereby achieving consistent and accurate defect feature extraction; in addition, the tool image alignment method has good generalization ability and is applicable to a variety of tool types, further enhancing its practicality in a variety of detection scenarios. Figure 2 As shown;

[0085] Based on the coordinates and rotation angle of each pixel in the grayscale image of the tool surface, a posture correction mathematical model is constructed, and its expression is:

[0086] ;

[0087] in, Indicates the grayscale image of the tool surface The horizontal coordinate component of the pixel after correction; Indicates the grayscale image of the tool surface The vertical coordinate component of the pixel after correction; Indicates the grayscale image of the tool surface The horizontal coordinate component of the pixel point; Indicates the grayscale image of the tool surface The vertical coordinate component of each pixel; Angle representing the rotation angle;

[0088] According to the posture correction mathematical model, a posture correction operation is performed on each tool surface grayscale image to obtain the corrected horizontal coordinate component and vertical coordinate component of each pixel point in each tool surface grayscale image; based on the corrected horizontal coordinate component and vertical coordinate component of each pixel point in each tool surface grayscale image, a corrected grayscale image of each tool surface is obtained;

[0089] The preset size is Pixels; the cropping order is from left to right and from top to bottom, numbered ; The clipping operation is as follows Figure 3 As shown;

[0090] S2: Using Radon transform, extract the Radon domain features of each sub-image corresponding to the tool surface correction grayscale image, which is used to annotate the Radon true label of each sub-image corresponding to the tool surface correction grayscale image; construct a Radon training set based on each sub-image corresponding to each tool surface correction grayscale image and its Radon true label; use the Radon training set to train the residual network to obtain the trained residual network, which is used to output the first predicted defect probability value of each sub-image corresponding to the tool surface correction grayscale image; wherein the Radon transform process is as follows: Figure 4 As shown; the ResNet network structure configuration is as follows Figure 5 As shown;

[0091] Wherein, the Radon transform includes:

[0092] Using Radon transform to process a sub-image is essentially to perform a spatial transformation on the sub-image, mapping the points on the sub-image to a line determined by an angle. The value of the line determined by the angle is the accumulation of the points on the mapping line. The mathematical description of Radon transform is:

[0093] ;

[0094] ;

[0095] ;

[0096] ;

[0097] ;

[0098] in, Indicates that the sub-image is Line integrals on rays; express Rays and The angle between the axes determines The direction of the ray is changed by Can scan sub-image features in different directions; express The vertical distance parameter from the ray to the origin is determined Ray position; and The horizontal and vertical variables representing the sub-image plane coordinates; the second formula above represents Ray About and parametric equations; Represents the sub-image in plane coordinates The pixel value function of the above third formula represents the sub-image about The fourth formula is the generalization of the first to third formulas. The fifth formula is the mathematical expression of Radon transform. Radon transform is a linear transform. The transformed image has rotation invariance and has a strong interpretability optimization for deep learning classification tasks that rely on feature extraction. After Radon transform, the deep features of the defects are further extracted. Converting the features to Radon domain helps to represent the features more stably.

[0099] The Radon dataset is trained using the Resnet network. Resnet is a residual neural network that can effectively extract deeper semantic features.

[0100] Among them, the residual network loss function is the cross entropy loss function, and its expression is:

[0101] ;

[0102] in, represents the residual network loss function; Represents the number of corrected grayscale images of all tool surfaces; Indicates the number of all sub-images corresponding to each tool surface corrected grayscale image; Indicates The corrected grayscale image of the tool surface corresponds to The Radon true label of the sub-image is It means that the sub-image has no defects. It means that the sub-image is defective; Indicates The corrected grayscale image of the tool surface corresponds to A first predicted defect probability value of the sub-image;

[0103] S3: using edge structure operator convolution, extracting edge structure features of each sub-image corresponding to the tool surface correction grayscale image, and marking the edge true label of each sub-image corresponding to the tool surface correction grayscale image;

[0104] The edge structure operator convolution includes HOG operator convolution and LBP operator convolution; these two operators can well describe the edge structure characteristics of the image. For the defect detection task, the large difference between the defect area of ​​the foreground and the background area is an important judgment method for defect detection, so extracting edge structure information is helpful for the detection of defect areas.

[0105] Utilizing HOG operator convolution, the HOG operator feature matrix of each sub-image corresponding to each tool surface correction grayscale image is obtained; utilizing LBP operator convolution, the LBP operator feature matrix of each sub-image corresponding to each tool surface correction grayscale image is obtained; through matrix splicing, the HOG operator feature matrix and the LBP operator feature matrix of each sub-image corresponding to each tool surface correction grayscale image are fused to obtain the edge structure feature matrix of each sub-image corresponding to each tool surface correction grayscale image;

[0106] Among them, the fusion formula of the HOG operator feature matrix and the LBP operator feature matrix of any sub-image is:

[0107] ;

[0108] in, Represents the edge structure feature matrix of the sub-image; Represents the HOG operator feature matrix of the sub-image; Represents the LBP operator feature matrix of the sub-image;

[0109] Based on each sub-image corresponding to each tool surface corrected grayscale image and its true edge label, an edge structure feature data set is constructed; using the edge structure feature data set, a support vector machine is trained to obtain a trained support vector machine for outputting a second predicted defect probability value of each sub-image corresponding to the tool surface corrected grayscale image;

[0110] Among them, the loss functions for training the support vector machine include: the hinge loss function in the stage of training the standard support vector machine classifier and the cross entropy loss function in the stage of training the logistic regression;

[0111] The expression of the hinge loss function in the training standard support vector machine classifier stage is:

[0112] ;

[0113] in, represents the hinge loss function during the training of a standard support vector machine classifier; Indicates The corrected grayscale image of the tool surface corresponds to The true edge label of the sub-image is It means that the sub-image has no defects. It means that the sub-image is defective; represents the decision function; Indicates The corrected grayscale image of the tool surface corresponds to Zhangzi image;

[0114] The expression of the cross entropy loss function in the training logistic regression stage is:

[0115] ;

[0116] in, Represents the cross entropy loss function during the logistic regression training phase; Represents the number of corrected grayscale images of all tool surfaces; Indicates the number of all sub-images corresponding to each tool surface corrected grayscale image; Indicates The corrected grayscale image of the tool surface corresponds to The true edge label of the sub-image is It means that the sub-image has no defects. It means that the sub-image is defective; Indicates The corrected grayscale image of the tool surface corresponds to A second predicted defect probability value of the sub-image.

[0117] S4: weighted average the first predicted defect probability value and the second predicted defect probability value of each sub-image corresponding to each tool surface corrected grayscale image to obtain the fused defect probability value of each sub-image corresponding to each tool surface corrected grayscale image; wherein, in a specific embodiment of the present invention, for an original image corresponding to a defect-free sub-image, based on the first predicted defect probability value, the second defect probability value and the fused defect probability value of the sub-image, the support vector machine classification result, the Resent classification result and the fused classification result are obtained, such as Figure 6 As shown;

[0118] S5: taking the sub-images whose fusion defect probability values ​​are greater than or equal to the threshold as abnormal sub-images;

[0119] S6: Divide the sub-images with the same number corresponding to each tool surface correction grayscale image into a group to obtain sub-image groups with different numbers; according to the number of the abnormal sub-image, find a normal sub-image in the sub-image group corresponding to the abnormal sub-image to form a defect pair of the abnormal sub-image, and sequentially obtain the defect pairs of all abnormal sub-images to form a defect pair data set; use the defect pair data set to train the twin transformation detection network to obtain the trained twin transformation detection network, which is used to detect the feature information and segmentation results of the defect area in each abnormal sub-image; wherein, the defect pair schematic diagram is as follows Figure 7 As shown; the twin transformation detection network and segmentation results are shown Figure 8As shown in the figure, the twin transformation network detects the difference between the two images. For defect detection tasks, the features of the complex and variable, random defect areas are difficult to extract. The twin network learns the difference between the background and the defect, thereby revealing the composition features of the defect, which is helpful for learning defect features.

[0120] The twin transform detection network includes: an input layer, two weight-sharing convolutional layers, a transform layer and an output layer; wherein the two weight-sharing sub-networks each include: a shared convolutional layer and a feature vector output layer;

[0121] The input layer is used to input defect pairs of all abnormal sub-images and output normal sub-images and abnormal sub-images of all image pairs;

[0122] The first weight-sharing convolution layer is composed of two convolutions with a convolution kernel size of 3, one with a convolution kernel size of 8, and one with a convolution kernel size of 12, which is used to extract the features of the normal sub-image of each defect pair and output the feature vector of the normal sub-image of each defect pair;

[0123] The second weight-sharing convolution layer is composed of a convolution stack of two convolution kernels with a size of 3, one convolution kernel with a size of 8, and one convolution kernel with a size of 12, and is used to extract the features of the abnormal sub-image of each defect pair and output the feature vector of the abnormal sub-image of each defect pair; wherein, while the normal sub-image of each defect pair is input into the first shared convolution layer, the abnormal sub-image of the image pair is input into the second shared convolution layer;

[0124] The transformation layer consists of three convolution stacks, which is used to align the feature vectors of the normal sub-image of each defect pair with the feature vectors of the abnormal sub-image of the image pair, and output the transformation matrix corresponding to each defect pair;

[0125] The output layer is used to output the feature information and segmentation results of the defect area in each abnormal sub-image according to the transformation matrix corresponding to each defect pair;

[0126] Among them, the loss function of the twin transformation detection network is a contrast loss function, and its expression is:

[0127] ;

[0128] in, represents the loss function of the twin transformation detection network; represents the number of all image pairs; Indicates The distance measure between the feature vector of the normal sub-image and the feature vector of the abnormal sub-image in the defect pair is ; Indicates Feature vector of the normal sub-image in the defect pair; Indicates The feature vector of the abnormal sub-image in the defect pair; Indicates If the label of a defect pair It means that the image pair is a similar sample. Then the image pair is a dissimilar sample; Indicates the boundary threshold.

[0129] In summary, the two-stage tool surface defect detection method provided by the present invention is inspired by the physical properties of the cutting tool structure and the specific requirements of the surface defect detection task; compared with traditional image processing technology, this method has better generalization performance and shows excellent results in the classic semantic segmentation network; the present invention is accurate for most defect classifications and has stronger robustness than the original image classification task.

[0130] In a specific embodiment of the present invention, obtaining a channel image of a tool surface to be detected and obtaining feature information and segmentation results of the corresponding defective area includes:

[0131] Acquire a channel image of the tool surface to be detected; perform grayscale conversion, posture correction, cropping and labeling operations on the channel image of the tool surface to be detected in sequence to obtain each sub-image and its number corresponding to the corrected grayscale image of the tool surface to be detected;

[0132] Input each sub-image corresponding to the corrected grayscale image of the tool surface to be inspected into the trained residual network, and output a first predicted defect probability value of each sub-image corresponding to the corrected grayscale image of the tool surface to be inspected;

[0133] Input each sub-image corresponding to the corrected grayscale image of the tool surface to be inspected into the trained support vector machine, and output a second predicted defect probability value of each sub-image corresponding to the corrected grayscale image of the tool surface to be inspected;

[0134] Taking a weighted average of the first predicted defect probability value and the second predicted defect probability value of each sub-image corresponding to the corrected grayscale image of the tool surface to be inspected, to obtain a fused defect probability value of each sub-image corresponding to the corrected grayscale image of the tool surface to be inspected;

[0135] The sub-images whose fusion defect probability values ​​are greater than or equal to the threshold are regarded as abnormal sub-images;

[0136] Obtain a normal tool surface sub-image set, find a normal sub-image with the same number as the abnormal sub-image in the normal tool surface sub-image set according to the number of each abnormal sub-image, and combine the abnormal sub-image with the normal sub-image with the same number to form a defect pair of the abnormal sub-image, and sequentially obtain defect pairs of all abnormal sub-images;

[0137] The defect pairs of all abnormal sub-images are input into the trained twin transformation detection network, and the feature information and segmentation results of the defect area in each abnormal sub-image are output, so as to obtain the feature information and segmentation results of the defect area corresponding to the tool surface channel image to be detected.

[0138] Reference Fig. 9 As shown, the present invention also provides a two-stage tool surface defect detection system; specifically comprising:

[0139] Image annotation module 100: acquiring multiple tool surface channel images, performing grayscale operation on each tool surface channel image to obtain each tool surface grayscale image; performing posture correction operation on each tool surface grayscale image to obtain a tool surface correction grayscale image; performing cropping operation on each tool surface correction grayscale image according to a preset size to obtain multiple sub-images corresponding to each tool surface correction grayscale image; annotating each sub-image corresponding to each tool surface correction grayscale image in turn according to the cropping order to obtain the number of each sub-image corresponding to each tool surface correction grayscale image;

[0140] The first detection module 200: using Radon transform, extracting Radon domain features of each sub-image corresponding to each tool surface corrected grayscale image; based on the Radon domain features of each sub-image corresponding to each tool surface corrected grayscale image, marking the defect results of each sub-image corresponding to each tool surface corrected grayscale image; constructing a Radon training set based on each sub-image corresponding to each tool surface corrected grayscale image and its defect results; using the Radon training set, training a residual network to obtain a trained residual network for outputting a first probability value of defects in each sub-image corresponding to the tool surface corrected grayscale image;

[0141] The second detection module 300: using edge structure operator convolution to extract edge structure features of each sub-image corresponding to each tool surface corrected grayscale image; based on the edge structure features of each sub-image corresponding to each tool surface corrected grayscale image, marking the defect results of each sub-image corresponding to each tool surface corrected grayscale image; constructing an edge structure feature data set based on each sub-image corresponding to each tool surface corrected grayscale image and its defect results; using the edge structure feature data set, training a support vector machine to obtain a trained residual network for outputting a second probability value of the existence of defects in each sub-image corresponding to the tool surface corrected grayscale image;

[0142] Fusion detection module 400: weighted average the first probability value and the second probability value of defects in each sub-image corresponding to each tool surface corrected grayscale image, to obtain a third probability value of defects in each sub-image corresponding to each tool surface corrected grayscale image;

[0143] Abnormal sub-image determination module 500: taking a sub-image whose third probability value is greater than or equal to a threshold as an abnormal sub-image;

[0144] Defect feature detection module 600: divide the sub-images with the same number corresponding to each tool surface correction grayscale image into a group to obtain sub-image groups with different numbers; according to the number of the abnormal sub-image, find a normal sub-image in the sub-image group corresponding to the abnormal sub-image to form a defect pair of the abnormal sub-image, and obtain the defect pairs of all abnormal sub-images in turn to form a defect pair data set; use the defect pair data set to train the twin transformation detection network to obtain the trained twin transformation detection network, which is used to detect the feature information of the defect area in each abnormal sub-image.

[0145] The device of this embodiment is used to implement the aforementioned two-stage tool surface defect detection method. Therefore, the specific implementation method of the two-stage tool surface defect detection device can be seen in the embodiment part of the two-stage tool surface defect detection method in the previous text. For example, the image annotation module 100, the first detection module 200, the second detection module 300, the fusion detection module 400, the abnormal sub-image determination module 500, and the defect feature detection module 600 are respectively used to implement S1 to S6 in the above-mentioned two-stage tool surface defect detection method. Therefore, its specific implementation method can refer to the description of the corresponding two-stage tool surface defect detection method. The description of each part of the embodiment will not be repeated here.

[0146] Obviously, the above embodiments are merely examples for the purpose of clear explanation and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived therefrom are still within the scope of protection of the present invention.

Claims

1. A two-stage tool surface defect detection method, characterized in that: include: Acquire multiple tool surface channel images, perform grayscale operation on each tool surface channel image, and obtain each tool surface grayscale image; Performing posture correction operation on each tool surface grayscale image to obtain a tool surface corrected grayscale image; According to a preset size, each tool surface correction grayscale image is cropped to obtain a plurality of sub-images corresponding to each tool surface correction grayscale image; according to a cropping order, each sub-image corresponding to each tool surface correction grayscale image is labeled in turn to obtain a number of each sub-image corresponding to each tool surface correction grayscale image; The Radon transform is used to extract the Radon domain features of each sub-image corresponding to the tool surface correction grayscale image, and is used to annotate the Radon true label of each sub-image corresponding to the tool surface correction grayscale image; Based on each sub-image corresponding to each tool surface correction grayscale image and its Radon true label, a Radon training set is constructed; using the Radon training set, a residual network is trained to obtain a trained residual network for outputting a first predicted defect probability value of each sub-image corresponding to the tool surface correction grayscale image; The edge structure operator convolution is used to extract the edge structure features of each sub-image corresponding to the tool surface correction grayscale image, which is used to mark the edge true label of each sub-image corresponding to the tool surface correction grayscale image; Based on each sub-image corresponding to each tool surface corrected grayscale image and its true edge label, an edge structure feature dataset is constructed; Using the edge structure feature data set, a support vector machine is trained to obtain a trained support vector machine for outputting a second predicted defect probability value corresponding to each sub-image of the tool surface correction grayscale image; Taking a weighted average of the first predicted defect probability value and the second predicted defect probability value of each sub-image corresponding to each tool surface corrected grayscale image, to obtain a fused defect probability value of each sub-image corresponding to each tool surface corrected grayscale image; The sub-images whose fusion defect probability values ​​are greater than or equal to the threshold are regarded as abnormal sub-images; The sub-images with the same number corresponding to the grayscale images of the tool surface correction are divided into a group to obtain sub-image groups with different numbers; according to the number of the abnormal sub-image, a normal sub-image is found in the sub-image group corresponding to the abnormal sub-image to form a defect pair of the abnormal sub-image, and the defect pairs of all abnormal sub-images are obtained in turn to form a defect pair data set; The defect pair dataset is used to train the twin transformation detection network, and the trained twin transformation detection network is obtained to detect the feature information and segmentation results of the defect area in each abnormal sub-image.

2. A two-stage tool surface defect detection method according to claim 1, characterized in that: The twin transformation detection network includes: an input layer, two weight-sharing convolutional layers, a transformation layer and an output layer; wherein the two weight-sharing sub-networks each include: a shared convolutional layer and a feature vector output layer; The input layer is used to input defect pairs of all abnormal sub-images and output normal sub-images and abnormal sub-images of all image pairs; The first weight-sharing convolution layer is composed of two convolutions with a convolution kernel size of 3, one with a convolution kernel size of 8, and one with a convolution kernel size of 12, which is used to extract the features of the normal sub-image of each defect pair and output the feature vector of the normal sub-image of each defect pair; The second weight-sharing convolution layer is composed of a convolution stack of two convolution kernels with a size of 3, one convolution kernel with a size of 8, and one convolution kernel with a size of 12, and is used to extract the features of the abnormal sub-image of each defect pair and output the feature vector of the abnormal sub-image of each defect pair; wherein, while the normal sub-image of each defect pair is input into the first shared convolution layer, the abnormal sub-image of the image pair is input into the second shared convolution layer; The transformation layer consists of three convolution stacks, which is used to align the feature vectors of the normal sub-image of each defect pair with the feature vectors of the abnormal sub-image of the image pair, and output the transformation matrix corresponding to each defect pair; The output layer is used to output the feature information and segmentation results of the defect area in each abnormal sub-image according to the transformation matrix corresponding to each defect pair.

3. A two-stage tool surface defect detection method according to claim 1, characterized in that: The tool surface channel image is grayed out to obtain a tool surface gray image including: The CCD linear array camera is used to collect the channel images of the tool surface. According to the weighted average method, combined with the weight corresponding to each channel, a grayscale mathematical model is constructed, and its expression is: ; in, Indicates the grayscale image of the tool surface The gray value of each pixel; Represents the weight corresponding to the red channel in the tool surface channel image; Indicates the first The component value of the red channel of each pixel; Represents the weight corresponding to the green channel in the tool surface channel image; Indicates the first The component value of the green channel of each pixel; Represents the weight corresponding to the blue channel in the tool surface channel image; Indicates the first The component value of the blue channel of each pixel; According to the grayscale mathematical model, the tool surface channel image is grayscaled to obtain the tool surface grayscale image.

4. A two-stage tool surface defect detection method according to claim 1, characterized in that: Performing posture correction operation on the tool surface grayscale image to obtain the tool surface correction grayscale image includes: A vertical reference line is determined through the center point of the grayscale image of the tool surface; an angle bisector of the tool is obtained based on a line connecting the center point of the grayscale image of the tool surface and the top angle of the tool; and an angle between the angle bisector of the tool and the reference line is used as a rotation angle; Based on the coordinates and rotation angle of each pixel in the grayscale image of the tool surface, a mathematical model for posture correction is constructed, and its expression is: ; in, Indicates the grayscale image of the tool surface The horizontal coordinate component of the pixel after correction; Indicates the grayscale image of the tool surface The vertical coordinate component of the pixel after correction; Indicates the grayscale image of the tool surface The horizontal coordinate component of the pixel point; Indicates the grayscale image of the tool surface The vertical coordinate component of each pixel; Angle representing the rotation angle; According to the mathematical model of posture correction, the grayscale image of the tool surface is subjected to posture correction operation to obtain the corrected horizontal and vertical coordinate components of each pixel point in the grayscale image of the tool surface; based on the corrected horizontal and vertical coordinate components of each pixel point in the grayscale image of the tool surface, the corrected grayscale image of the tool surface is obtained.

5. A two-stage tool surface defect detection method according to claim 1, characterized in that: The edge structure operator convolution is used to extract the edge structure features of each sub-image corresponding to each tool surface correction grayscale image, including: The edge structure operator convolution includes HOG operator convolution and LBP operator convolution; By using HOG operator convolution, the HOG operator feature matrix of each sub-image corresponding to each tool surface corrected grayscale image is obtained; by using LBP operator convolution, the LBP operator feature matrix of each sub-image corresponding to each tool surface corrected grayscale image is obtained; through matrix splicing, the HOG operator feature matrix and LBP operator feature matrix of each sub-image corresponding to each tool surface corrected grayscale image are fused to obtain the edge structure feature matrix of each sub-image corresponding to each tool surface corrected grayscale image.

6. A two-stage tool surface defect detection method according to claim 1, characterized in that: The residual network loss function is the cross entropy loss function, which is expressed as: ; in, represents the residual network loss function; Represents the number of corrected grayscale images of all tool surfaces; Indicates the number of all sub-images corresponding to each tool surface corrected grayscale image; Indicates The corrected grayscale image of the tool surface corresponds to The Radon true label of the sub-image is It means that the sub-image has no defects. It means that the sub-image is defective; Indicates The corrected grayscale image of the tool surface corresponds to The first predicted defect probability value of the sub-image.

7. A two-stage tool surface defect detection method according to claim 1, characterized in that: The loss functions for training the SVM include: the hinge loss function in the stage of training the standard SVM classifier and the cross entropy loss function in the stage of training the logistic regression; The expression of the hinge loss function in the training standard support vector machine classifier stage is: ; in, represents the hinge loss function during the training of a standard support vector machine classifier; Indicates The corrected grayscale image of the tool surface corresponds to The true edge label of the sub-image is It means that the sub-image has no defects. It means that the sub-image is defective; represents the decision function; Indicates The corrected grayscale image of the tool surface corresponds to Zhangzi image; The expression of the cross entropy loss function in the training logistic regression stage is: ; in, Represents the cross entropy loss function during the logistic regression training phase; Represents the number of corrected grayscale images of all tool surfaces; Indicates the number of all sub-images corresponding to each tool surface corrected grayscale image; Indicates The corrected grayscale image of the tool surface corresponds to The true edge label of the sub-image is It means that the sub-image has no defects. It means that the sub-image is defective; Indicates The corrected grayscale image of the tool surface corresponds to A second predicted defect probability value of the sub-image.

8. A two-stage tool surface defect detection method according to claim 1, characterized in that: The loss function of the twin transformation detection network is a contrast loss function, which is expressed as: ; in, represents the loss function of the twin transformation detection network; represents the number of all image pairs; Indicates The distance measure between the feature vector of the normal sub-image and the feature vector of the abnormal sub-image in the defect pair is ; Indicates Feature vector of the normal sub-image in the defect pair; Indicates The feature vector of the abnormal sub-image in the defect pair; Indicates If the label of a defect pair It means that the image pair is a similar sample. Then the image pair is a dissimilar sample; Indicates the boundary threshold.

9. A two-stage tool surface defect detection method according to claim 1, characterized in that: Obtain the channel image of the tool surface to be inspected, and obtain the feature information and segmentation results of the corresponding defect area, including: Acquire a channel image of the tool surface to be detected; perform grayscale conversion, posture correction, cropping and labeling operations on the channel image of the tool surface to be detected in sequence to obtain each sub-image and its number corresponding to the corrected grayscale image of the tool surface to be detected; Input each sub-image corresponding to the corrected grayscale image of the tool surface to be inspected into the trained residual network, and output a first predicted defect probability value of each sub-image corresponding to the corrected grayscale image of the tool surface to be inspected; Input each sub-image corresponding to the corrected grayscale image of the tool surface to be inspected into the trained support vector machine, and output a second predicted defect probability value of each sub-image corresponding to the corrected grayscale image of the tool surface to be inspected; Taking a weighted average of the first predicted defect probability value and the second predicted defect probability value of each sub-image corresponding to the corrected grayscale image of the tool surface to be inspected, to obtain a fused defect probability value of each sub-image corresponding to the corrected grayscale image of the tool surface to be inspected; The sub-images whose fusion defect probability values ​​are greater than or equal to the threshold are regarded as abnormal sub-images; Obtain a normal tool surface sub-image set, find a normal sub-image with the same number as the abnormal sub-image in the normal tool surface sub-image set according to the number of each abnormal sub-image, and combine the abnormal sub-image with the normal sub-image with the same number to form a defect pair of the abnormal sub-image, and sequentially obtain defect pairs of all abnormal sub-images; The defect pairs of all abnormal sub-images are input into the trained twin transformation detection network, and the feature information and segmentation results of the defect area in each abnormal sub-image are output, so as to obtain the feature information and segmentation results of the defect area corresponding to the tool surface channel image to be detected.

10. A two-stage tool surface defect detection system, characterized in that: include: Image annotation module: obtain multiple tool surface channel images, perform grayscale operation on each tool surface channel image, and obtain a grayscale image of each tool surface; Performing posture correction operation on each tool surface grayscale image to obtain a tool surface corrected grayscale image; According to a preset size, each tool surface correction grayscale image is cropped to obtain a plurality of sub-images corresponding to each tool surface correction grayscale image; according to a cropping order, each sub-image corresponding to each tool surface correction grayscale image is labeled in turn to obtain a number of each sub-image corresponding to each tool surface correction grayscale image; The first detection module: using Radon transform, extracting Radon domain features of each sub-image corresponding to each tool surface corrected grayscale image; based on the Radon domain features of each sub-image corresponding to each tool surface corrected grayscale image, marking the defect results of each sub-image corresponding to each tool surface corrected grayscale image; constructing a Radon training set based on each sub-image corresponding to each tool surface corrected grayscale image and its defect results; Using the Radon training set, the residual network is trained to obtain a trained residual network, which is used to output a first probability value of defects in each sub-image corresponding to the tool surface correction grayscale image; The second detection module: using edge structure operator convolution, extracting edge structure features of each sub-image corresponding to each tool surface corrected grayscale image; based on the edge structure features of each sub-image corresponding to each tool surface corrected grayscale image, marking the defect results of each sub-image corresponding to each tool surface corrected grayscale image; constructing an edge structure feature dataset based on each sub-image corresponding to each tool surface corrected grayscale image and its defect results; Using the edge structure feature data set, a support vector machine is trained to obtain a trained residual network, which is used to output a second probability value of defects in each sub-image corresponding to the tool surface correction grayscale image; Fusion detection module: weighted average the first probability value and the second probability value of defects in each sub-image corresponding to each tool surface corrected grayscale image, to obtain a third probability value of defects in each sub-image corresponding to each tool surface corrected grayscale image; An abnormal sub-image determination module: taking a sub-image whose third probability value is greater than or equal to a threshold as an abnormal sub-image; Defect feature detection module: divide the sub-images with the same number corresponding to each tool surface correction grayscale image into a group to obtain sub-image groups with different numbers; according to the number of the abnormal sub-image, find a normal sub-image in the sub-image group corresponding to the abnormal sub-image to form a defect pair of the abnormal sub-image, and sequentially obtain the defect pairs of all abnormal sub-images to form a defect pair data set; The defect pair dataset is used to train the twin transformation detection network, and the trained twin transformation detection network is obtained to detect the feature information of the defect area in each abnormal sub-image.

Citation Information

Patent Citations

  • Mobile phone screen defect detection method, device and system, computer equipment and medium

    CN111612763A

  • Rail locomotive surface defect detection method and system

    CN116416234A

  • Strip steel surface defect detection method and system, electronic equipment and medium

    CN116596878A

  • Numerical control equipment tool detection method based on machine vision

    CN118967687A

Cited By

  • Polishing quality detection method for processing LED braider track

    CN120431084A