Machine vision-based industrial part quality detection method and system
By using a machine vision-based industrial component quality inspection method, combined with image preprocessing and deep learning technology, the problems of misjudgment and missed detection of minute defects have been solved, achieving high-precision quality inspection and report generation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 西航思创(陕西)自动化科技有限公司
- Filing Date
- 2026-03-16
- Publication Date
- 2026-06-26
AI Technical Summary
Existing technologies are prone to misjudgment when detecting small defects with complex shapes or similar background textures, and are also prone to losing defect information in the area covered by the light spot, leading to missed detection problems.
A machine vision-based method for industrial component quality inspection is adopted, which generates component quality inspection reports through image preprocessing, coarse localization candidate processing, histogram statistics, pooling principal component analysis, and support vector machine processing.
It significantly improves the accuracy and robustness of detecting minute defects, solves the problems of inaccurate defect location, easy breakage of segments, and poor real-time performance, and provides standardized reports for quality inspection.
Smart Images

Figure CN122289150A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, and in particular to a method and system for quality inspection of industrial parts based on machine vision. Background Technology
[0002] Image recognition refers to the technology of using computers to process, analyze, and understand images in order to identify targets and objects of various patterns. Traditional industrial parts visual inspection mainly relies on digital image processing technology to identify features. First, the original images of the parts are acquired by industrial cameras. Based on the characteristics and defect types of the parts, features that can describe their state are designed manually. Then, methods such as linear discriminant analysis are used to reduce the dimensionality of the features and select the most discriminative feature combinations. Finally, the system makes a judgment on whether the parts are qualified or not based on the classification results and separates the unqualified products.
[0003] Existing technologies often use local binary mode to extract texture features. For minor defects with complex shapes or similar to the background texture, misjudgment is easy to occur. On the other hand, due to the sensitivity to changes in illumination, texture information is easily lost in overexposed areas. Taking the surface inspection of precision bearing rollers as an example, the part is made of high-gloss mirror metal material. Under the illumination of an LED ring light source, a through-type vertical high-brightness spot will be formed in the middle of the cylindrical surface of the roller. When there is a fine vertical scratch on the roller surface, if only existing technology is used for feature extraction, the original grayscale gradient information of the scratch will be completely submerged in the overexposed area. In small-sample industrial scenarios, when local high-brightness spots appear on the surface of the part, the defect information of the area covered by the spot will be lost, resulting in missed detection. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention provides a machine vision-based method and system for quality inspection of industrial parts. This solves the technical problems of existing technologies, which are prone to misjudging small defects with complex shapes or similar to background textures, and easily lose defect information in the area covered by the light spot, leading to missed detections.
[0005] To solve the above-mentioned technical problems, the present invention provides the following technical solution: a machine vision-based method for quality inspection of industrial parts, the method comprising the following steps: acquiring the original image of the target part, and obtaining a preprocessed image by image preprocessing based on the original image; Coarse localization candidate processing is performed on the preprocessed image to generate candidate box parameters. Based on the candidate box parameters, image cropping and masking are performed to generate component masks. Histogram statistical processing is performed on the preprocessed image and component mask to obtain LBP feature vectors. Based on the LBP feature vectors, pooling principal component analysis is performed to obtain dimensionality-reduced feature vectors. The hidden layer activation values are obtained by processing the dimensionality-reduced feature vectors through a support vector machine. The hidden layer activation values are then processed to obtain the classification confidence scores, resulting in the final category and confidence score. The final category and confidence level are comprehensively processed to obtain the component quality inspection report.
[0006] Preferably, image preprocessing based on the original image includes: performing grayscale processing on the original image to generate a grayscale image; Gaussian filtering is performed on the grayscale image to denoise it, resulting in a filtered image. The filtered image is subjected to adaptive equalization to obtain a preprocessed image.
[0007] Preferably, coarse localization candidate processing based on the preprocessed image includes: generating a coarse localization convolution feature map by performing coarse localization convolution processing on the preprocessed image; Convolutional pooling is performed on the coarse localization convolutional feature map to obtain the convolutional pooling feature map; The convolutional pooling feature map is processed with a fully connected candidate layer to generate candidate box parameters.
[0008] Preferably, the image cropping mask processing based on the candidate box parameters includes: obtaining a local image by image cropping based on the preprocessed image and the candidate box parameters; Precision segmentation is performed on local images to generate precision segmentation feature maps. The precision segmentation feature map is transposed and convolutionally masked to generate a component mask.
[0009] Preferably, histogram extraction and statistical processing are performed on the preprocessed image and the component mask, including: obtaining the component region image by image extraction processing based on the preprocessed image and the component mask; Gaussian pyramid processing is performed on the part region image to generate a multi-scale pyramid image; The LBP feature vector is obtained by performing uniform histogram statistical processing on the multi-scale pyramid image.
[0010] Preferably, the pooling principal component analysis based on LBP feature vectors includes: generating pooling feature vectors by performing global average pooling processing on the part region image; Feature concatenation is performed based on LBP feature vectors and pooled feature vectors to obtain fused features; Principal component analysis is performed on the fused features to obtain dimensionality-reduced feature vectors.
[0011] Preferably, the process of processing the dimensionality-reduced feature vectors using a support vector machine includes: performing one-to-many support vector machine processing on the dimensionality-reduced feature vectors to obtain support score vectors; The scores are normalized based on the support score vectors to obtain the vector machine probability values. The dimensionality-reduced feature vectors are subjected to fully connected linear rectification to generate hidden layer activation values.
[0012] Preferably, the classification confidence processing of the hidden layer activation values includes: obtaining a multilayer perceptron score vector by performing fully connected linear processing on the hidden layer activation values; The multi-layer perception score vector is used to perform score normalization processing to generate multi-layer perception probability values. The final category and confidence level are obtained by weighted fusion classification based on vector machine probability values and multilayer perceptron probability values.
[0013] Preferably, the text processing for the final category and confidence level is comprehensive, including: performing a pass / fail check based on the final category to obtain a pass / fail mark; A comprehensive quality score is obtained by processing the final category and confidence level; Text generation processing is performed on the final category, confidence level, and quality score to obtain the component quality inspection report.
[0014] The technical solution also provides a machine vision-based industrial component quality inspection system, which includes: a preprocessing module for acquiring the original image of the target component, and obtaining a preprocessed image based on the original image through image preprocessing; The mask module is used to perform coarse localization candidate processing based on the preprocessed image, generate candidate box parameters, and generate component masks by image cropping and masking based on the candidate box parameters; The dimensionality reduction module is used to extract histograms and perform statistical processing on the preprocessed image and component mask to obtain LBP feature vectors. Based on the LBP feature vectors, pooling principal component analysis is performed to obtain dimensionality-reduced feature vectors. The classification confidence module is used to process the dimensionality-reduced feature vectors through a support vector machine to obtain the hidden layer activation values, and then process the hidden layer activation values for classification confidence to obtain the final category and confidence score. The inspection report module is used to perform comprehensive quality text processing on the final category and confidence level to obtain the component quality inspection report.
[0015] By employing the above technical solution, the present invention provides a method and system for quality inspection of industrial parts based on machine vision, which has at least the following beneficial effects: 1. This invention combines candidate box parameters normalized by direct regression in a fully connected layer, which can efficiently eliminate the influence of bright interference objects in complex backgrounds. Even if reflection causes local edge blurring, it avoids the positioning offset caused by local light spots in single-level detection. It eliminates most background interference through a fine segmentation network, repairs the outline blurred by highlights, and accurately maps the local probability map back to the corresponding position in the original image and binarizes it through bilinear interpolation. It solves the three major problems of inaccurate defect positioning, easy segmentation breakage, and poor real-time performance, and significantly improves the accuracy and robustness of mask extraction for metal parts.
[0016] 2. This invention constructs a three-layer Gaussian pyramid and extracts local binary pattern histograms for each layer. Even when local overexposure is caused by reflection, the pixel comparison-based encoding method can still partially retain texture structure information. It adopts pre-trained global average pooling and vector concatenation, which includes both fine microstructure and abstract shape semantics. The introduction of principal component analysis reduces the dimensionality of the fused features, removes redundant noise, reduces computational complexity, and improves computational efficiency. It solves the problem of information loss of single features under reflection interference and significantly enhances the ability to represent small defects and the detection stability.
[0017] 3. This invention employs a one-to-many radial basis function through a support vector machine branch, which can effectively characterize the boundary of defect categories under small sample conditions. Through a multilayer perceptron branch, using a two-layer fully connected network, it can automatically discover complex texture features in defect data, thus overcoming the limitations of support vector machines in fitting highly nonlinear distributions. By fusing the two probability vectors through equal-weighted averaging, the accuracy and robustness of small defect classification are significantly improved, avoiding the failure problem that may occur in a single model under specific disturbances.
[0018] 4. This invention maps defect categories to intuitive pass / fail indicators through rule-based judgment, ensuring seamless integration with automated sorting systems. It introduces comprehensive quality score calculation to achieve numerical differentiation of defect severity. Through information formatting, it integrates pass / fail indicators, defect types, confidence levels, and quality scores into a standardized text report, which is not only used for real-time sorting but also provides quantitative basis for quality traceability, process optimization, and priority ranking of manual re-inspection, significantly improving the utilization rate of quality data and re-inspection efficiency of the production line. Attached Figure Description
[0019] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a flowchart of the machine vision-based industrial parts quality inspection method of the present invention; Figure 2This is a structural block diagram of the machine vision-based industrial parts quality inspection system of the present invention. Detailed Implementation
[0020] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. This will allow for a full understanding of how the present application uses technical means to solve technical problems and achieve technical effects, and to facilitate its implementation.
[0021] Example 1: Because small defects with complex shapes or similar textures to the background are prone to misjudgment, and defect information in the area covered by the light spot is easily lost, leading to missed detections, please refer to... Figure 1 This embodiment provides a machine vision-based method and system for quality inspection of industrial parts, which can avoid misjudgment caused by minor defects, and can still partially retain texture structure information even when reflection causes local overexposure. The method includes the following steps: S1. Obtain the original image of the target component. Based on the original image, perform image preprocessing to obtain the preprocessed image. Existing technologies often use simple averaging or single weighting in the grayscale conversion process, which leads to distortion of brightness information during subsequent feature extraction. The kernel size and standard deviation of Gaussian filtering are usually set based on experience, which is difficult to adapt to the noise levels of components of different sizes. It is easy to over-smooth edge details while denoising. To solve the above problems, the specific implementation steps are as follows: S11. Perform grayscale processing on the original image to generate a grayscale image. In this step, the red, green, and blue components of the pixel are first obtained. Then, the red component is multiplied by a weighting coefficient of 0.299, the green component by 0.578, and the blue component by 0.114. The three products are then summed, and the sum is the grayscale value of the corresponding position in the grayscale image. This calculation process is performed on all pixels of the original image one by one, and finally a complete grayscale image is generated. The brightness value of each pixel reflects the brightness information of the original color image. In the quality inspection of industrial parts, grayscale processing significantly reduces the amount of data by removing color information, thereby reducing the computational burden of subsequent processing algorithms and enabling the inspection system to run faster.
[0022] S12. Perform Gaussian filtering denoising on the grayscale image to obtain the filtered image. In this step, for each pixel in the grayscale image, a 3x3 square neighborhood is determined with the pixel as the center. This neighborhood includes the pixel itself and its eight neighboring pixels. For each pixel in this neighborhood, a corresponding weight coefficient needs to be calculated. These coefficients are generated based on the Gaussian function, involving a key parameter, namely the standard deviation, which is set to 0.8. The specific calculation method of the weight coefficient is as follows: First, obtain the horizontal and vertical offsets of each pixel in the neighborhood relative to the center pixel. Then, square these two offsets respectively and sum them to obtain the sum of squares of the offsets. Then, divide this sum of squares by the square of twice the standard deviation, and take an exponential function with the natural constant as the base, the exponent of which is the opposite of the above result. Finally, multiply the exponent value by a normalization constant, that is, multiply two by pi and then by the reciprocal of the square of the standard deviation, to obtain the final weight coefficient. The weight coefficients calculated in this way have the characteristics of being high in the center and low at the edges, and the sum of all weight coefficients is equal to 1. After the weight coefficients are determined, multiply the gray value of each pixel in the neighborhood with its corresponding weight coefficient to obtain a series of products. Then, sum these products, and the sum is used as the new gray value of the central pixel position in the filtered image. Repeat the above operation for each pixel in the original grayscale image, and finally generate a complete filtered image.
[0023] S13. Perform adaptive equalization on the filtered image to obtain a preprocessed image. In this step, the entire filtered image is first evenly divided into multiple non-overlapping small blocks, specifically into 64 rectangular blocks in 8 rows and 8 columns. For each small block, the distribution of all pixel gray values within it is statistically analyzed to obtain the gray-level histogram of that block. Next, a contrast limit parameter is set with a value of 2.0. This parameter is used to control the upper limit of the histogram height. For the histogram of each small block, each gray level is checked. If the number of pixels of a certain gray level exceeds the upper limit, the excess part is cropped out, and these cropped pixels are evenly redistributed to all gray levels. This way, while suppressing noise amplification, the image details are preserved. After cropping and redistribution... Traditional histogram equalization is performed independently on each small block, which involves calculating the cumulative distribution function of the block and establishing a mapping relationship from the original gray value to the new gray value based on this function. Since the image is processed in blocks, the mapping functions between adjacent blocks may differ. Direct use would result in obvious stitching marks between blocks. Therefore, bilinear interpolation is used when performing gray-scale transformation on each pixel. For pixels inside the image that are not on the block boundary, the mapping functions of the block to which the pixel belongs and the three adjacent blocks are taken based on its location, and the final gray value of the pixel is calculated by distance-weighted summation. For pixels at the image edge, interpolation is performed according to the available blocks. In this way, each pixel obtains a smoothly transitioned enhanced gray value. Finally, the above interpolation calculation is performed on all pixels to obtain a complete preprocessed image.
[0024] This invention employs a weighted average grayscale method with weighting coefficients that align with human visual perception, accurately preserving brightness information and providing a more accurate grayscale foundation for subsequent processing. Gaussian filtering effectively suppresses sensor noise while maximizing the sharpness of component edges, preventing detail loss. By limiting the cropping amplitude of the contrast adaptive histogram equalization and performing bilinear interpolation stitching, adaptive enhancement of local contrast is achieved, significantly improving the visibility of weak textures and minor defects on metal surfaces, and effectively suppressing noise amplification.
[0025] S2. Based on the preprocessed image, coarse localization candidate processing is performed to generate candidate box parameters. Based on the candidate box parameters, image cropping mask processing is performed to generate component masks. Existing technologies generally use a single semantic segmentation network to directly segment the entire image. The drastic fluctuations in pixel values caused by reflective areas often lead to breaks or holes in the segmentation results. When there are metal supports or fixtures in the background with brightness similar to the reflective areas, the network will missegment part of the background into components, resulting in adhesion or artifacts. Or, due to the specular gloss on the surface of the components, local bright spots will be formed under specific lighting conditions, causing the gray-level gradient between the edge of the component and the background in the image to reverse or disappear, making conventional edge detection algorithms fail. At the same time, if there are metal supports or fixtures in the background with brightness similar to the reflective areas, it will further aggravate the problem of missegmentation. To solve the above problems, the specific implementation steps are as follows: S21. Based on the preprocessed image, coarse localization convolution is performed to generate a coarse localization convolution feature map. In this step, the preprocessed image has a specific height and width, and each pixel position contains a gray value. In order to generate the first layer feature map, the image needs to be convolved. The size of the convolution kernel is 3 rows and 3 columns, and each convolution kernel corresponds to one output channel. A total of 16 different convolution kernels are used in this layer. Therefore, the output feature map contains 16 channels. The spatial size of each channel is the result of dividing the height and width of the input image by two and then rounding down. When calculating the pixel value at a specific horizontal and vertical position on a certain channel in the output feature map, a starting point is first determined on the input image. The horizontal coordinate of the starting point is the current horizontal position multiplied by 2, and the vertical coordinate is the current vertical position multiplied by 2. Then, taking the starting point as the top left corner, a 3x3 local image region is selected. Next, the gray value of each pixel in the region is multiplied by the weight coefficient at the same relative position in the corresponding convolution kernel, resulting in 9 products. Then, these 9 products are summed to obtain a weighted sum for the region. This sum is then added to a bias term corresponding to the channel to obtain a preliminary result. Finally, this preliminary result is compared with 0, and the larger of the two values is taken as the final output value. This operation is the linear rectified activation function. The above calculation process is repeated for each position of each channel in the output feature map, eventually generating a coarse localization convolutional feature map containing 16 channels.
[0026] S22. Perform convolutional pooling processing on the coarse localization convolutional feature map to obtain a convolutional pooling feature map. In this step, for each possible position on the input feature map, use 32 three-dimensional convolutional kernels with a size of 3 rows and 3 columns and a depth equal to the number of input channels. Multiply each kernel element-wise with the local region of the corresponding position in the input feature map and sum them. Here, the depth of each convolutional kernel is 16, which is consistent with the number of input channels. When calculating each position of each output channel, multiply the feature values of all channels in the local region covered by the convolutional kernel with the corresponding weights of the convolutional kernel to obtain multiple products. Then, sum all these products and add a bias term corresponding to the output channel to obtain a preliminary value. This value is then input into a linear rectified activation function, which compares it with zero and takes the maximum value to obtain the convolution result at that position. This process iterates through all output positions, generating a temporary feature map with 32 channels and the same spatial size as the input feature map. Next, max pooling is performed on the temporary feature map: a 2x2 region is used as a window, and the window slides on the temporary feature map with a stride of 2. The maximum value of all values in each window is taken as the output value at the corresponding position of that window. After this pooling operation, the spatial size of the feature map is reduced to half of its original height and width, finally resulting in the convolutionally pooled feature map.
[0027] S23. Perform fully connected candidate processing on the convolutional pooling feature map to generate candidate box parameters. In this step, firstly, arrange all pixel values in all channels of the input feature map in sequence to form a one-dimensional long vector. The dimension of this vector is equal to the height of the feature map multiplied by the width and then multiplied by the number of channels. Then, input this long vector into the first fully connected layer. This layer contains a weight matrix and a bias vector. The weight matrix has 128 rows and the same number of columns as the dimension of the input vector. The bias vector contains 128 values. During the operation, the input vector is multiplied by the weight matrix, that is, each element of the input vector is multiplied by each element of the corresponding column of the weight matrix, and all products are summed according to the output dimension to obtain 128 preliminary values. Then, these preliminary values are added to the corresponding bias values in the bias vector to obtain 128 results. A linear rectified activation function is then applied to each of these results, which is compared with zero and the larger value is taken, resulting in 128 non-negative activation values. These constitute the output vector of the first hidden layer. This 128-dimensional hidden layer vector is then input into the second fully connected layer. The second fully connected layer also contains a weight matrix and a bias vector. The weight matrix has 4 rows and 128 columns, and the bias vector contains four values. During computation, the hidden layer vector is multiplied by the weight matrix, that is, each element of the hidden layer vector is multiplied by each element of the corresponding column of the weight matrix. The product is then summed according to the four output dimensions to obtain four preliminary values. These four preliminary values are then added to the four corresponding bias values in the bias vector to obtain the final four values, which are the candidate box parameters.
[0028] S24. Based on the preprocessed image and candidate box parameters, a local image is obtained through image cropping. In this step, the candidate box parameters first contain four normalized values, which represent the horizontal proportional coordinates, vertical proportional coordinates, width proportions, and height proportions of the center point of the component, respectively. In order to determine the actual position of the cropped area on the original image, these proportional values need to be converted into pixel indices. Specifically, the horizontal proportional coordinates of the center point are multiplied by the total number of horizontal pixels in the original image to obtain the horizontal pixel coordinates of the center point. Similarly, the vertical proportional coordinates of the center point are multiplied by the total number of vertical pixels in the original image to obtain the vertical pixel coordinates of the center point. Next, the width ratio is multiplied by the total number of horizontal pixels in the original image to obtain the horizontal pixel width of the cropping region. The height ratio is multiplied by the total number of vertical pixels in the original image to obtain the vertical pixel height of the cropping region. Then, the boundaries of the cropping rectangle are calculated based on the center point coordinates and the width and height of the region: the left boundary is the center point horizontal coordinate minus half the width, the right boundary is the center point horizontal coordinate plus half the width, the upper boundary is the center point vertical coordinate minus half the height, and the lower boundary is the center point vertical coordinate plus half the height. In this way, all pixels within the rectangular region are extracted from the preprocessed image to form the initial cropped image. Since the size of this region is not fixed, it needs to be scaled to a uniform size of 128 by 128 pixels. Bilinear interpolation is used for scaling. For a pixel in the target image located at a certain horizontal and vertical position, the floating-point coordinates corresponding to it in the original cropping region are first calculated, that is, the horizontal position multiplied by the scaling ratio plus the left boundary offset, and the vertical position multiplied by the scaling ratio plus the top boundary offset. Then, the four nearest integer pixels around the floating-point coordinate are determined, located at the top left, top right, bottom left, and bottom right respectively. Next, the horizontal and vertical distances from the floating-point coordinate to the four integer points are calculated, and these distances are used as weights: first, the two pixels in the same row are weighted and summed according to the horizontal distance to obtain two intermediate values, and then the two intermediate values are weighted and summed according to the vertical distance to finally obtain the gray value of the target pixel. This process is repeated for all target pixel positions to generate the final local image.
[0029] S25. Perform precision segmentation processing based on the local image to generate a precision segmentation feature map. In this step, in order to generate each value in the precision segmentation feature map, thirty-two different convolutional kernels are needed. Each convolutional kernel has a size of three rows and three columns, and each convolutional kernel corresponds to one channel of the output feature map. When calculating the pixel value at a specific horizontal and vertical position on a certain channel of the output feature map, a starting point is first determined on the input local image. The horizontal coordinate of the starting point is the current horizontal position multiplied by 2, and the vertical coordinate is the current vertical position multiplied by 2. Then, with the starting point as the upper left corner, a three-row, three-column square region is delineated on the local image. Next, the gray value of each pixel in the region is multiplied by the weight coefficient at the same relative position in the corresponding convolution kernel, resulting in nine products. These nine products are then summed to obtain a weighted sum for the region. This sum is then added to a bias term corresponding to the output channel to form a preliminary calculation result. Finally, this preliminary result is input into a linear rectified activation function for processing, which compares it with zero. If the result is greater than zero, the original value is retained; if it is less than or equal to zero, the value is set to zero. This process is repeated for each possible position of each channel in the precision segmentation feature map to generate a precision segmentation feature map containing 32 channels.
[0030] S26. Perform transposed convolutional mask processing on the precision segmentation feature map to generate a component mask. In this step, the input precision segmentation feature map is first input into a decoder consisting of multiple transposed convolutional layers and convolutional layers. These layers gradually restore the spatial resolution of the feature map and compress the number of channels to a single channel. Finally, a fraction map with the same size as the cropped local image is generated, but each pixel corresponds to an original score value. The number of pixels in the horizontal and vertical directions of the fraction map is 128. Then, the Sigmoid function is applied to each pixel in the fraction map to perform probability transformation. That is, for the score value at each position, the exponent of the negative number of the score value with the natural constant as the base is calculated to obtain the exponent value. Then, the sum of 1 and the exponent value is calculated. Finally, 1 is divided by this sum. The result is the probability value of the pixel belonging to the component region. The probability values of all pixels constitute a probability map. Next, this 128x128 probability map needs to be mapped back to the corresponding position in the original image. Based on the candidate box parameters output by the coarse localization network, the actual position and size of the cropping region in the original image are determined. Using bilinear interpolation, the probability map is enlarged to the same pixel width and height as the cropping region, and the enlarged probability map is precisely placed back into the cropping region of the original image. For pixels in the original image located outside the cropping region, their probability values are directly set to zero, thus obtaining a complete probability map of the same size as the original image. Finally, this probability map is binarized: a threshold of 0.5 is set. For each pixel, if its probability value is greater than 0.5, the value of that pixel in the final component mask is set to 1, indicating that it belongs to a component; if the probability value is less than or equal to 0.5, it is set to 0, indicating that it is the background, thus generating a more accurate component mask.
[0031] This invention combines candidate box parameters normalized by direct regression in a fully connected layer, which can efficiently eliminate the influence of bright interference in complex backgrounds. Even if reflection causes local edge blurring, the network can still provide reasonable candidate positions based on the overall shape prior, avoiding the positioning offset caused by local light spots in single-level detection. The fine segmentation network eliminates most background interference and can effectively use local context information to fill edge breaks caused by reflection and repair the outline blurred by highlights. Through bilinear interpolation, the local probability map is accurately mapped back to the corresponding position in the original image and binarized. This solves the three major problems of inaccurate positioning, easy segmentation breakage, and poor real-time performance of a single network in reflective scenes, and significantly improves the accuracy and robustness of mask extraction for metal parts.
[0032] S3. Histogram statistical processing is performed on the preprocessed image and component mask to obtain LBP feature vectors. Principal component pooling analysis is then performed on the LBP feature vectors to obtain dimensionality-reduced feature vectors. Existing technologies, using only traditional texture features such as local binary patterns, struggle to encode high-level semantic information about defects. For minor defects with complex shapes or similar textures to the background, misjudgments are common. Furthermore, the technology is sensitive to changes in illumination, especially in highly reflective metallic scenes where overexposure leads to texture information loss, causing the network to extract incorrect activation patterns. This is particularly relevant for precision bearing roller surfaces. Taking inspection as an example, the part is made of high-brightness mirror metal. Under the illumination of the LED ring light source on the production line, a through-line high-brightness spot will be formed in the middle of the cylindrical surface of the roller. When there is a fine longitudinal scratch on the surface of the roller, if only a convolutional neural network is used for feature extraction, the original grayscale gradient information of the scratch will be completely submerged in the overexposed area because the pixel grayscale value in the spot area is saturated to the highest brightness. In small sample industrial scenarios, the generalization ability is limited. When a local high-brightness spot appears on the surface of the part, the defect information of the spot-covered area will be lost, resulting in missed detection. To solve the above problems, the specific steps are as follows: S31. Based on the preprocessed image and the component mask, an image of the component region is obtained through image extraction processing. In this step, the preprocessed image is a grayscale enhanced image with the same height and width as the original image. Each pixel position contains a grayscale value. The component mask is a binary image with the same size as the preprocessed image. Each pixel value is either 0 or 1. A pixel with a value of 1 indicates that the position belongs to the component entity region, and a pixel with a value of 0 indicates that the position belongs to the background region. In the element-wise multiplication operation, for each pixel position in the image with the same horizontal and vertical coordinates, the grayscale value of that position in the preprocessed image is multiplied by the value of the same position in the component mask. Since the mask value is either 0 or 1, there are two possible results for the multiplication: when the mask value is 1, the result is the original grayscale value of that position in the preprocessed image; when the mask value is zero, the result is 0. After performing this multiplication operation on all pixel positions in the entire image, a completely new image of the component region is obtained.
[0033] S32. Perform Gaussian pyramid processing on the part region image to generate a multi-scale pyramid image. The input in this step is the part region image obtained after masking and multiplication. Only the grayscale value of the part entity region is retained in this image, while the value of the background region is zero. The output is a set of multi-scale pyramid images, which contain three levels: the first level is the part region image of the original size, the second level image has a height and width of half of the original size, and the third level image has a height and width of one-quarter of the original size. This processing method is called Gaussian pyramid downsampling. The specific calculation process is as follows: First, the input part area image is directly used as the first layer image of the pyramid. In order to generate the second layer image, the first layer image needs to be downsampled. However, Gaussian smoothing is required before sampling to avoid frequency aliasing. Specifically, for a pixel located at a certain horizontal and vertical position in the second layer image, its value is calculated as follows: find the corresponding position on the first layer image. The horizontal coordinate of this position is the current horizontal position multiplied by 2, and the vertical coordinate is the current vertical position multiplied by 2. Then, take this position as the center and determine a 5-row, 5-column square neighborhood. Next, the gray value of each pixel in the neighborhood is multiplied by the weight coefficients of the same relative position in a pre-designed 5x5 Gaussian kernel, resulting in 25 products. Finally, these 25 products are summed, and the sum is the pixel value of the second layer image at that position. The weight coefficients in the Gaussian kernel are distributed with high values in the center and low values at the edges, so that pixels closer to the center contribute more to the result. The process of generating the third layer image is similar to that of the second layer, except that its input is the already generated second layer image. That is, the above 5x5 neighborhood weighted summation and intermittent sampling operation is performed again on the second layer image. After the above steps, three scale images are finally obtained, which together constitute a multi-scale pyramid image.
[0034] S33. Perform uniform histogram statistical processing on the multi-scale pyramid image to obtain the LBP feature vector. In this step, for each scale of the image, the local binary pattern coding value needs to be calculated for each pixel. When calculating the coding of a certain central pixel, a circular neighborhood with a radius of one pixel unit is determined with the pixel as the center. Eight neighboring pixels are uniformly selected on the circumference. Each neighboring pixel has a specific horizontal and vertical offset relative to the central pixel. Then, the gray value of each neighboring pixel is compared with the gray value of the central pixel. A step function is used: if the neighboring pixel value is greater than or equal to the central pixel value, the function outputs 1; otherwise, it outputs 0. This yields eight comparison results, each of which is 0 or 1. Then, these eight binary values are weighted and summed, where each value is multiplied by two powers of its position. Specifically, the first neighboring point is multiplied by 2 to the power of 0, the second by 2 to the power of 1, and so on until the seventh by 2 to the power of 7. The eight products are added together to obtain an integer between 0 and 255, which is the local binary pattern code of the center pixel. This process is repeated for all pixels in the current scale image to obtain an encoded image. Then, the histogram of the encoded image is calculated: for each possible encoded value, i.e., from 0 to 255, its frequency in the encoded image is calculated, and this frequency is divided by the total number of pixels in the current scale image to obtain a normalized frequency value, thus forming a histogram vector containing 256 values. The above encoding and statistical operations are performed on the images at the three scales respectively to obtain three histogram vectors. Finally, these three vectors are concatenated end to end in scale order to form an LBP feature vector with a total dimension of 768.
[0035] S34. Based on the part region image, a pooling feature vector is generated through global average pooling. In this step, the part region image is first fed into a VGG16 deep convolutional neural network pre-trained on a large-scale image dataset. This network consists of multiple convolutional layers, pooling layers, and fully connected layers stacked together. The image propagates forward through multiple convolution and pooling operations until it reaches the last convolutional layer of the network, which is the third convolutional layer in the fifth convolutional stage. At this time, the network outputs a set of feature maps. The spatial size of this set of feature maps is 14 pixels horizontally and 14 pixels vertically, and it contains 512 independent channels. Each channel corresponds to a specific feature response map learned by the convolutional kernel, reflecting the activation intensity of different modes in the image. To extract a compact and representative vector representation from these high-dimensional feature maps, a global average pooling operation is employed. Specifically, for each channel, the sum of the feature values at all fourteen horizontal and fourteen vertical positions within that channel is calculated. This sum is then divided by the total number of pixels in that channel, which is 196, to obtain the arithmetic mean of the feature values for that channel. This summation and division operation is performed sequentially on all 512 channels, ultimately resulting in a one-dimensional vector composed of 512 average values, which is the pooled feature vector. The VGG16 deep convolutional neural network is a classic deep convolutional neural network architecture, which will not be elaborated upon here.
[0036] S35. Based on the LBP feature vector and the pooling feature vector, feature concatenation is performed to obtain the fused feature. In this step, the local binary pattern feature vector itself is formed by sequentially connecting histogram vectors at three different scales. Each scale histogram contains 256 values, so the total dimension of the feature vector is 768. On the other hand, the pooling feature vector obtained from the last convolutional layer of the convolutional neural network through global average pooling has a dimension of 512. When performing feature fusion, these two feature vectors are regarded as two independent sequences, and they are directly connected end to end in order. That is, all 768 values of the local binary pattern feature vector are arranged sequentially, followed by all 512 values of the pooling feature vector, thus combining them into a new, longer one-dimensional vector. The total dimension of this new vector is equal to the sum of the dimensions of the two original vectors, i.e., 1280. In the entire concatenation process, only the order of data is rearranged, so the information in the original features is completely preserved and integrated together, and finally the fused feature is obtained.
[0037] S36. Perform principal component analysis on the fused features to obtain a dimensionality-reduced feature vector. In this step, a mean vector needs to be pre-calculated using a large number of training samples. This mean vector has the same dimension as the fused feature vector, and the value at each position represents the average value of all samples in the training set in that dimension. When performing dimensionality reduction, for an input fused feature vector, the value in each dimension is subtracted from the value in the mean vector in the corresponding dimension to obtain a difference vector. This operation is equivalent to digitizing the original feature data and removing the overall offset. Then, this difference vector is multiplied by a pre-calculated projection matrix. This projection matrix consists of the first 256 principal components, and each principal component is a 1280-dimensional vector with the same dimension as the fused feature vector. These principal components represent the directions of maximum data variance and are orthogonal to each other. The projection matrix has 256 rows and 1280 columns. During multiplication, the difference vector is treated as a matrix with 1280 columns and multiplied by the transpose of the projection matrix. That is, each element of the difference vector is multiplied by each element of the corresponding column in the projection matrix, and the results are summed according to the output dimension. Specifically, for the first value of the final eigenvector, the 1280 elements of the difference vector are multiplied by the 1280 weight coefficients of the first column of the projection matrix, and all products are summed. For the second value, the difference vector is multiplied by the second column of the projection matrix and summed, and so on, until all 256 values are calculated. These new values constitute the 256-dimensional final eigenvector.
[0038] This invention constructs a three-layer Gaussian pyramid and extracts local binary pattern histograms for each layer, enabling it to simultaneously capture texture defects of varying sizes, from minor scratches to significant wear. Even when local overexposure occurs due to reflection, the pixel-comparison-based encoding method can still partially preserve texture structure information. Pre-trained global average pooling compensates for the lack of semantic hierarchy in local texture features. Through vector concatenation, it encompasses both fine microstructure and abstract shape semantics. Principal component analysis is introduced to reduce the dimensionality of fused features, removing redundant noise and reducing computational complexity, thus improving computational efficiency. This solves the problem of information loss in single features under reflective interference, significantly enhancing the representation ability and detection stability of minute defects.
[0039] S4. Based on the dimensionality reduction feature vector, the hidden layer activation values are obtained through support vector machine processing. The hidden layer activation values are then processed for classification confidence to obtain the final category and confidence. Existing technologies, when using only support vector machines, although they have good generalization ability under small sample conditions, may experience drastic fluctuations in decision values when the ambient light in the production line changes abruptly. Using only multilayer perceptrons relies on a large amount of labeled data and is prone to overfitting when there are few training samples or the classes are imbalanced. Taking the detection of engine connecting rod cracks as an example, there are forging patterns on the surface of the parts, which are similar to crack morphology. When the batch change causes the illumination angle to shift, the change in the shadow of the pattern causes the support vector machine to misjudge the normal pattern as a crack, while the multilayer perceptron outputs random probability due to insufficient such illumination samples in the training set. To solve the above problems, the specific steps are as follows: S41. Perform one-to-many support vector machine processing on the dimensionality-reduced feature vector to obtain the support score vector. In this step, the defect categories are summarized based on the historical data of component quality inspection. For each defect category, an independent binary classification support vector machine model is pre-trained. During the training phase, the model selects a set of support vectors from the samples and assigns a coefficient to each support vector. At the same time, a bias term and a kernel function parameter, namely the G value, are determined. When calculating the score of a specific category, the input feature vector is operated one by one with all the trained support vectors of that category. For each support vector, the difference between the input feature vector and the support vector is calculated first, and each component of the difference is squared. Then, the squares of all components are summed to obtain the square of the Euclidean distance between the two vectors. Then, this squared distance value is multiplied by the negative G value to obtain a new value. Next, an exponential operation is performed with the natural constant as the base and this value as the exponent to obtain the radial basis function value corresponding to the support vector. This value reflects the similarity between the input feature vector and the support vector in high-dimensional space. Then, this similarity value is multiplied by the coefficient corresponding to the support vector, and then multiplied by the sample label value corresponding to the support vector during training. The label value is +1 or -1, representing the positive class or the negative class, thus obtaining a weighted contribution value. The above calculation is repeated for all support vectors, and all weighted contribution values are summed. Finally, the bias term of the class is added. The sum is the decision value of the input feature vector in that class. The above complete calculation process is performed for each defect category in sequence, and finally a set of values is obtained, which constitutes the support score vector.
[0040] S42. Based on the support score vector, score normalization is performed to obtain the vector machine probability value. In this step, each score value in the input score vector is first subjected to exponential operation, that is, with the natural constant as the base and the score value as the exponent, the exponential function value corresponding to each score is calculated. This operation converts all scores into positive numbers and amplifies the relative differences between scores. After completing the exponential calculation for all categories, a set of exponential values corresponding to the original scores is obtained. Then, these exponential values are summed, that is, the exponential values of all categories are added together to obtain a total value. This total value will be used as the denominator for subsequent normalization. Then, for each category, its corresponding exponential value is divided by the sum value calculated above to obtain a new quotient value. This division operation compresses the output value of each category to the range of 0 to 1, and the sum of the output values of all categories is exactly equal to 1. After performing the above division operation on all categories in sequence, the vector machine probability value is finally obtained.
[0041] S43. Perform fully connected linear rectification on the dimensionality-reduced feature vector to generate hidden layer activation values. In this step, the fully connected layer is first pre-trained with a weight matrix and a bias vector. The weight matrix has 128 rows and 256 columns, meaning each output neuron corresponds to a set of 256 weight coefficients. The bias vector contains 128 values, with each output neuron corresponding to a bias value. When calculating the hidden layer activation vector, for each neuron, all 256 components of the input feature vector need to be multiplied by the 256 weight coefficients corresponding to that neuron to obtain 256 products. These products are then summed to obtain a weighted sum. This sum is then added to the bias value corresponding to the neuron to obtain the initial linear output value of the neuron. After completing the linear calculation for all 128 neurons, 128 initial values are obtained. Next, these initial values are iterated one by one and a linear rectified activation function is applied, which compares them with zero: if a certain initial value is greater than zero, it is retained as the final activation value of the neuron; if it is less than or equal to zero, the final activation value of the neuron is set to zero. After the larger value operation, the hidden layer activation vector consisting of 128 non-negative values is finally obtained.
[0042] S44. The hidden layer activation values are processed linearly through a fully connected layer to obtain the multilayer perceptron score vector. In this step, a fully connected layer is constructed. This fully connected layer is pre-trained with a weight matrix and a bias vector. The weight matrix has the same number of rows as the total number of defect categories and 128 columns, meaning each output category corresponds to a set of 128 weight coefficients. The bias vector contains the same number of values as the total number of defect categories, with one bias value corresponding to each output category. When calculating the multilayer perceptron score vector, for each defect category, each of the 128-dimensional hidden layer activation values needs to be processed. Each component is multiplied by a set of 128 weight coefficients corresponding to the category, resulting in 128 products. Then, all products are summed to obtain a weighted sum, which reflects the projection intensity of the hidden layer activation vector in the direction of the category. Next, the weighted sum is added to the bias value corresponding to the category to obtain a preliminary linear output value for the category. The above operations of multiplying weight coefficients, summing products, and adding to the bias are performed sequentially for all defect categories to finally obtain a set of values, the number of which is the same as the total number of defect categories. These values are the multilayer perceptron score vector.
[0043] S45. Based on the multi-layer perception score vector, perform score normalization processing to generate multi-layer perception probability values. In this step, firstly, perform exponential operation on each score value in the input score vector, that is, use the natural constant as the base and the score value as the exponent to calculate the exponential function value corresponding to each score. This operation can convert all original scores into positive numbers, and at the same time amplify the relative differences between scores, so that the originally larger scores occupy a larger proportion after transformation. After completing the exponential calculation of all categories, a set of exponential values corresponding to the original scores are obtained. Next, these index values are summed, that is, the index values of all categories are added together to obtain a total value. This total value will be used as the common denominator in the subsequent normalization step. Then, for each category, its corresponding index value is divided by the previously calculated total value to obtain a new quotient value. This division operation ensures that the output result of each category is compressed within the closed interval of 0 to 1, and the sum of the output results of all categories is exactly equal to 1, thus forming a normalized vector that conforms to the definition of probability distribution. After performing the above division operation on all categories in sequence, a set of values is finally obtained, which is the multilayer perception probability value.
[0044] S46. Perform weighted fusion classification based on the probability values of the support vector machine and the multilayer perceptron to obtain the final category and confidence score. In this step, a fusion weight coefficient is first set, which is 0.5 here, to balance the contributions of the two classifiers in the final decision. For each defect category, the probability value of that category in the support vector machine probability vector is multiplied by 0.5 to obtain a weighted value. At the same time, the probability value of the same category in the multilayer perceptron probability vector is also multiplied by 0.5 to obtain another weighted value. Then, the two weighted values are summed to obtain the fusion probability value of that category. The above multiplication and summation operations are performed on all defect categories in turn to obtain a fusion probability vector with the same dimension as the input. Each value in this vector combines the discriminative information of the two classifiers. Next, the final result needs to be determined from the fusion probability vector: compare the fusion probability values of all categories in the vector one by one, find the maximum value, and the defect category corresponding to the maximum value is the final category label. At the same time, the maximum value itself is used as the confidence score of this detection.
[0045] This invention employs a one-to-many radial basis function through a support vector machine branch, which can effectively characterize the boundaries of defect categories under small sample conditions. Through a multilayer perceptron branch, using a two-layer fully connected network, it can automatically discover complex texture features in defect data, thus overcoming the limitations of support vector machines in fitting highly nonlinear distributions. By fusing the two probability vectors through equal-weighted averaging, the accuracy and robustness of small defect classification are significantly improved, avoiding the failure problem that may occur in a single model under specific disturbances.
[0046] S5. Perform comprehensive quality text processing on the final category and confidence level to obtain the component quality inspection report; Existing technologies lack quantitative descriptions and traceability information of inspection results, making it impossible to understand the specific type and severity of defects and the confidence level of the inspection system, resulting in a lack of data support for process improvement. The output format of existing technologies is mostly fixed codes or simple signals, which are difficult to integrate directly into the enterprise's quality management system. To solve the above problems, the specific implementation steps are as follows: S51. Perform conformity inspection based on the final category to obtain a conformity mark. In this step, the input defect category label is first compared with the preset conformity benchmark. The conformity benchmark is defined as the specific category of no defects. That is, only when no defects are detected on the surface of the part is it considered a conformity product. During the comparison, a logical equivalence test is performed: check whether the string content of the input category label is exactly the same as no defects. If the comparison result is consistent, that is, the input category is indeed no defects, then the judgment condition is met. At this time, the value of the conformity mark is set to true, which means that the part has passed the quality inspection and can enter the next process or packaging stage. Conversely, if the comparison result is inconsistent, that is, the input category is scratches, cracks or any other category that indicates the existence of defects, then the judgment condition is not met. At this time, the value of the conformity mark is set to false, which means that the part has not passed the quality inspection and needs to be marked as a defective or scrap product for subsequent re-inspection or rejection.
[0047] S52. Based on the final category and confidence level, a comprehensive quality score is obtained. The specific calculation process in this step is divided into two cases depending on whether it is qualified or not. First, it is determined whether the current part is qualified according to the defect category label, that is, whether it belongs to the defect-free category. If it is determined to be qualified, the quality score is calculated by multiplying the confidence level value by 100. The product is the final quality score. This means that the more confident the detection system is in the qualified judgment, the closer the score is to the full score of 100. If it is determined to be unqualified, that is, the part has a certain defect, the quality score is calculated differently: first, subtract the confidence level value from 1 to get the absolute value of the difference, and then multiply this difference by 50. The product is the final quality score. In this case, the higher the confidence level, the more obvious the defect, but the smaller the value after subtracting the confidence level from 1, the lower the score, which reflects that the more serious the defect, the lower the quality score.
[0048] S53. Perform text generation processing on the final category, confidence level, and quality score to obtain the component quality inspection report. In this step, the Boolean data of the pass / fail judgment mark is first converted into the corresponding text description, such as converting true to yes or false to no, so that it becomes a string that can be embedded in text. Then, the converted pass / fail text description is concatenated with a preset first guiding phrase, which is pass / fail, to form the beginning of the report. Then, the text string of defect category label is concatenated with the second guiding phrase, which is the defect type, and appended to the beginning to describe the specific defect name detected. The confidence score is then converted from a numeric format to a string format and concatenated with the third guiding phrase, which represents the confidence level and is appended to the existing text to indicate the degree of credibility of the judgment. Finally, the quality score is also converted to a string format and concatenated with the fourth guiding phrase, which represents the quality score and serves as the end of the report. Through this sequential concatenation operation, the four originally separate data points are integrated into a continuous, semantically clear, and complete text string, generating a component quality inspection report.
[0049] This invention maps defect categories to intuitive pass / fail indicators through rule-based judgment, ensuring seamless integration with automated sorting systems. It introduces comprehensive quality score calculation to achieve numerical differentiation of defect severity. Through information formatting, it integrates pass / fail indicators, defect types, confidence levels, and quality scores into a standardized text report, which is not only used for real-time sorting but also provides quantitative basis for quality traceability, process optimization, and priority ranking of manual re-inspection, significantly improving the utilization rate of quality data and re-inspection efficiency of the production line.
[0050] Example 2: Because small defects with complex shapes or similar textures to the background are prone to misjudgment, and defect information in the area covered by the light spot is easily lost, resulting in missed detections, please refer to [link to relevant documentation]. Figure 2 The diagram shown is a structural block diagram of the machine vision-based industrial parts quality inspection system provided in this embodiment. The system includes: a preprocessing module, a mask module, a dimensionality reduction module, a classification confidence module, and an inspection report module. The preprocessing module is used to acquire the original image of the target component and obtain the preprocessed image by preprocessing the original image. The mask module is used to perform coarse localization candidate processing based on the preprocessed image, generate candidate box parameters, and generate component masks by image cropping and masking based on the candidate box parameters; The dimensionality reduction module is used to extract histograms and perform statistical processing on the preprocessed image and component mask to obtain LBP feature vectors. Based on the LBP feature vectors, pooling principal component analysis is performed to obtain dimensionality-reduced feature vectors. The classification confidence module is used to process the dimensionality-reduced feature vectors through a support vector machine to obtain the hidden layer activation values, and then process the hidden layer activation values for classification confidence to obtain the final category and confidence score. The inspection report module is used to perform comprehensive quality text processing on the final category and confidence level to obtain the component quality inspection report.
[0051] Those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, this application can take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code, including but not limited to disk storage, CD-ROM, optical storage, etc.
[0052] The above embodiments provide a detailed description of the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for detecting the quality of industrial parts based on machine vision, characterized in that, The steps of this method are as follows: acquire the original image of the target component, and obtain a preprocessed image by image preprocessing based on the original image; Coarse localization candidate processing is performed on the preprocessed image to generate candidate box parameters. Based on the candidate box parameters, image cropping and masking are performed to generate component masks. Histogram statistical processing is performed on the preprocessed image and component mask to obtain LBP feature vectors. Based on the LBP feature vectors, pooling principal component analysis is performed to obtain dimensionality-reduced feature vectors. The hidden layer activation values are obtained by processing the dimensionality-reduced feature vectors through a support vector machine. The hidden layer activation values are then processed to obtain the classification confidence scores, resulting in the final category and confidence score. The final category and confidence level are comprehensively processed to obtain the component quality inspection report.
2. The machine vision based industrial component quality inspection method as claimed in claim 1, wherein, Image preprocessing is performed on the original image, including: converting the original image to grayscale to generate a grayscale image; Gaussian filtering is performed on the grayscale image to denoise it, resulting in a filtered image. The filtered image is subjected to adaptive equalization to obtain a preprocessed image.
3. The machine vision based industrial component quality inspection method as claimed in claim 1, wherein, Coarse localization candidate processing based on preprocessed images includes: generating coarse localization convolution feature maps by coarse localization convolution processing based on preprocessed images; Convolutional pooling is performed on the coarse localization convolutional feature map to obtain the convolutional pooling feature map; The convolutional pooling feature map is processed with a fully connected candidate layer to generate candidate box parameters.
4. The machine vision based industrial component quality inspection method as claimed in claim 1, wherein, The image cropping mask process based on candidate bounding box parameters includes: obtaining a local image by cropping the image based on the preprocessed image and candidate bounding box parameters. Precision segmentation is performed on local images to generate precision segmentation feature maps. The precision segmentation feature map is transposed and convolutionally masked to generate a component mask.
5. The machine vision based industrial component quality inspection method as claimed in claim 1, wherein, Histogram statistical processing is performed on the preprocessed image and the component mask, including: obtaining the part region image by image extraction processing based on the preprocessed image and the component mask; Gaussian pyramid processing is performed on the part region image to generate a multi-scale pyramid image; The LBP feature vector is obtained by performing uniform histogram statistical processing on the multi-scale pyramid image.
6. The machine vision-based industrial component quality inspection method of claim 1, wherein, Pooling principal component analysis based on LBP feature vectors includes: generating pooling feature vectors by global average pooling based on the part region image; Feature concatenation is performed based on LBP feature vectors and pooled feature vectors to obtain fused features; Principal component analysis is performed on the fused features to obtain dimensionality-reduced feature vectors.
7. The machine vision-based industrial component quality inspection method of claim 1, wherein, The support vector is processed by a support vector machine based on the dimensionality-reduced feature vector, including: performing one-to-many support vector machine processing on the dimensionality-reduced feature vector to obtain the support score vector; The scores are normalized based on the support score vectors to obtain the vector machine probability values. The dimensionality-reduced feature vectors are subjected to fully connected linear rectification to generate hidden layer activation values.
8. The machine vision-based industrial component quality inspection method of claim 1, wherein, The classification confidence processing of the hidden layer activation values includes: obtaining the multilayer perceptron score vector by performing fully connected linear processing on the hidden layer activation values; The multi-layer perception score vector is used to perform score normalization processing to generate multi-layer perception probability values. The final category and confidence level are obtained by weighted fusion classification based on vector machine probability values and multilayer perceptron probability values.
9. The machine vision-based industrial component quality inspection method of claim 1, wherein, Comprehensive quality text processing is performed on the final category and confidence level, including: performing pass / fail detection based on the final category to obtain a pass / fail mark; A comprehensive quality score is obtained by processing the final category and confidence level; Text generation processing is performed on the final category, confidence level, and quality score to obtain the component quality inspection report.
10. A system for use in the machine vision based industrial component quality inspection method according to any one of the preceding claims 1 to 9, characterized in that, The system includes: The preprocessing module is used to acquire the original image of the target component and obtain the preprocessed image by preprocessing the original image. The mask module is used to perform coarse localization candidate processing based on the preprocessed image, generate candidate box parameters, and generate component masks by image cropping and masking based on the candidate box parameters; The dimensionality reduction module is used to extract histograms and perform statistical processing on the preprocessed image and component mask to obtain LBP feature vectors. Based on the LBP feature vectors, pooling principal component analysis is performed to obtain dimensionality-reduced feature vectors. The classification confidence module is used to process the dimensionality-reduced feature vectors through a support vector machine to obtain the hidden layer activation values, and then process the hidden layer activation values for classification confidence to obtain the final category and confidence score. The inspection report module is used to perform comprehensive quality text processing on the final category and confidence level to obtain the component quality inspection report.