Vehicle part spraying hue online monitoring system based on machine learning
By extracting gradient and brightness features from the online monitoring of the hue of automotive parts paint, combining them with weights to calculate the probability of bubbles and drips, and using an SVM classifier, the problem of inaccurate monitoring caused by using only color features is solved, achieving higher monitoring accuracy.
Patent Information
- Application Number
- CN202511103231.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-07
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2045-08-07
AI Technical Summary
Existing technologies for online monitoring of the hue of automotive parts coatings only use color features while ignoring gradient and brightness features, resulting in inaccurate monitoring results.
By acquiring spraying images and dividing them into connected components, the gradient magnitude and direction differences of edge pixels are extracted using the Sobel operator. The probability of bubbles and drips is calculated by combining weights, and feature vectors of edge pixels are established. An SVM classifier is then used to monitor the hue of the spraying.
It improves the accuracy of online monitoring of the hue of automotive parts paint, effectively identifies bubbles and runs, and ensures the consistency of paint color.
Smart Images

Figure CN120997164A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and more specifically to an online monitoring system for the hue of automotive parts paint spraying based on machine learning. Background Technology
[0002] Online monitoring of automotive parts paint hue allows for real-time detection of the paint color of each part, promptly identifying and correcting color differences. This ensures color consistency across different parts on the same vehicle or between different batches of the same part, preventing defective or scrapped products due to hue issues and improving the overall aesthetics and perceived quality of the vehicle. Machine learning algorithms can learn from and analyze vast amounts of historical data to identify the characteristics and patterns of automotive parts paint hue, enabling online monitoring of automotive parts paint hue.
[0003] In the process of using machine learning algorithms to achieve online monitoring of the hue of automotive parts paint, the monitoring is generally based on the color features of the automotive parts. However, when defects such as bubbles and runs appear on the surface of automotive parts, the gradient and brightness features of the surface of the automotive parts are ignored, and the use of color features alone cannot completely and accurately identify defects such as bubbles and runs, which often leads to inaccurate online monitoring of the hue of automotive parts paint. Summary of the Invention
[0004] This invention provides an online monitoring system for the hue of automotive parts coating based on machine learning. This system addresses the problem of inaccurate monitoring results caused by using only color features and ignoring gradient and brightness features during online hue monitoring of automotive parts coating. The specific technical solution adopted is as follows:
[0005] One embodiment of the present invention provides an online monitoring system for the hue of automotive parts paint spraying based on machine learning. The system includes the following modules:
[0006] The data acquisition module is used to acquire the painted images of the finished automotive parts and divide the painted images into multiple connected components.
[0007] The bubble defect analysis module is used to denote any connected component as the target connected component and any edge pixel of the target connected component as the target edge pixel. Based on the difference in gradient magnitude and gradient direction between the target edge pixel and all pixels in its eight neighboring regions, the module determines the gradient magnitude difference, gradient direction difference, and bubble probability of the target edge pixel.
[0008] The drip defect analysis module is used to determine the directional gradient magnitude difference and drip probability of the target edge pixel based on the difference in gradient magnitude of the target edge pixel in the vertical and horizontal directions, and the difference in gradient magnitude between the target edge pixel and all pixels in its eight neighborhoods.
[0009] The online monitoring module for spray coating hue is used to establish the feature vectors of target edge pixels and obtain the spray coating hue monitoring results corresponding to the connected region based on the feature vectors of all edge pixels of the connected region.
[0010] Furthermore, the method for determining the gradient magnitude difference of the target edge pixels is as follows:
[0011] The average of the absolute values of the differences between the gradient magnitudes of the target edge pixel and all pixels in its eight-neighborhood is denoted as the gradient magnitude difference of the target edge pixel.
[0012] Furthermore, the method for determining the gradient direction difference is as follows:
[0013] The average of the absolute values of the differences in gradient directions between the target edge pixel and all pixels in its eight-neighborhood is denoted as the gradient direction difference of the target edge pixel.
[0014] Furthermore, the method for determining the bubble probability is as follows:
[0015] The preset first weight is used as the weight of the normalized value of the gradient magnitude difference of the target edge pixels, and the preset second weight is used as the weight of the normalized value of the gradient direction difference of the target edge pixels. The weighted sum is then performed to obtain the bubble probability of the target edge pixels.
[0016] Furthermore, the sum of the first weight and the second weight is 1.
[0017] Furthermore, the method for determining the difference in directional gradient magnitude of the target edge pixels is as follows:
[0018] The difference between the gradient magnitudes of the target edge pixels in the vertical and horizontal directions is denoted as the directional gradient magnitude difference of the target edge pixels.
[0019] Furthermore, the method for determining the sludge probability is as follows:
[0020] The average gradient magnitude of all pixels within the eight neighborhoods of the target edge pixel is denoted as the average magnitude of the neighboring gradient of the target edge pixel. The square of the difference between the gradient magnitude of the target edge pixel and the average magnitude of the neighboring gradient is denoted as the gradient magnitude variation of the target edge pixel.
[0021] The sag probability of target edge pixels is obtained based on the gradient magnitude change and directional gradient magnitude difference of the target edge pixels.
[0022] Furthermore, the specific steps for obtaining the sag probability of target edge pixels based on the gradient magnitude change and directional gradient magnitude difference of target edge pixels include:
[0023] The preset third weight is used as the weight of the gradient magnitude change of the target edge pixel, and the preset fourth weight is used as the weight of the difference in the directional gradient magnitude of the target edge pixel. The weighted sum is then used to obtain the sag probability of the target edge pixel. The sum of the third weight and the fourth weight is 1.
[0024] Furthermore, the specific steps for establishing the feature vector of the target edge pixels are as follows:
[0025] The feature vector of the target edge pixel is obtained by sequentially arranging the pixel values of the R, G, and B channels, gradient magnitude difference, gradient direction difference, bubble probability, directional gradient magnitude difference, and drip probability into a row vector.
[0026] Furthermore, the specific steps for obtaining the spraying hue monitoring result corresponding to the connected region based on the feature vectors of all edge pixels of the connected region are as follows:
[0027] The feature vectors of all edge pixels of a connected component are input into an SVM classifier to obtain the spray hue monitoring results corresponding to the connected component. The spray hue monitoring results include three types: no defects, sagging defects, and bubble defects.
[0028] The beneficial effects of this invention are:
[0029] This application evaluates the features of bubble defects on the surface of automotive parts based on the fact that the bubble's surface is raised relative to the entire painted surface by extracting the features of high-intensity reflection at the edge and center of the bubble. This determines the gradient amplitude difference, gradient direction difference, and bubble probability of the target edge pixels. Furthermore, it extracts features of run defects. Runs refer to the state where paint flows down the surface of automotive parts due to gravity during painting on a vertical surface, forming flow marks. Therefore, this application determines the directional gradient amplitude of the target edge pixels based on the feature that the gradient amplitude of the edge pixels in the corresponding run area is significantly greater in the vertical direction than in the horizontal direction. The difference in values is analyzed, and then, combined with the characteristic that the edge reflectivity of the drip defect is relatively strong, causing the gradient assignment near the edge pixel of the corresponding drip region to change significantly, the drip probability of the target edge pixel is determined. Finally, based on the features of bubble defects and drip defects of each edge pixel in the extracted connected region, the feature vector of the target edge pixel is established, and based on the feature vectors of all edge pixels in the connected region, the spray hue monitoring result corresponding to the connected region is obtained. This solves the problem that only color features are used in the online monitoring of the spray hue of automotive parts, ignoring gradient and brightness features, which leads to inaccurate monitoring results, and improves the accuracy of online monitoring of the spray hue of automotive parts. Attached Figure Description
[0030] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0031] Figure 1 This is a schematic flowchart of an online monitoring system for the hue of automotive parts spraying based on machine learning, provided in one embodiment of the present invention.
[0032] Figure 2 This is a schematic diagram of the structure of an online monitoring system for the hue of automotive parts spraying based on machine learning, provided in one embodiment of the present invention. Detailed Implementation
[0033] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0034] Please see Figure 1 The diagram illustrates a flowchart of an online monitoring system for the hue of automotive parts paint based on machine learning, according to an embodiment of the present invention. Figure 2 The diagram illustrates the structure of an online monitoring system for the hue of automotive parts spraying based on machine learning, according to an embodiment of the present invention. The system includes: a data acquisition module, a bubble defect analysis module, a sagging defect analysis module, and an online monitoring module for spraying hue.
[0035] The data acquisition module collects images of the painted automotive parts and divides the painted images into multiple connected regions.
[0036] Using a high-resolution color industrial camera with compensated direct and diffuse light sources, images of the finished automotive parts are acquired to obtain the painting images. Noise reduction is then applied to these images to minimize the interference of shadows caused by the lighting.
[0037] The role of the light source is to reduce color shift on the surface of automotive parts caused by highlights; the sprayed image is an RGB image; denoising the sprayed image is a well-known technique and will not be elaborated further. Preferably, as an embodiment of this application, Gaussian filtering is used to denoise the sprayed image. In practical applications, as other implementation methods, while achieving the goal of denoising the sprayed image, the implementer may use other existing methods such as bilateral filtering or mean filtering to denoise the sprayed image. This application does not impose any special limitations.
[0038] Connectivity analysis is performed on the spraying image to divide it into multiple connected components and obtain the connected components.
[0039] At this point, the connected components have been obtained.
[0040] The bubble defect analysis module designates any connected component as the target connected component and any edge pixel of the target connected component as the target edge pixel. Based on the differences in gradient magnitude and gradient direction between the target edge pixel and all pixels in its eight neighboring regions, it determines the gradient magnitude difference, gradient direction difference, and bubble probability of the target edge pixel.
[0041] First, the bubble defects on the surface of the car parts are analyzed. The bubbles themselves are round or nearly round, and the surface of the bubble is raised compared to the entire painted surface. Therefore, the center of the connected area corresponding to the bubble shows obvious and stronger reflection compared to other areas.
[0042] Let any connected component be designated as the target connected component. The Sobel operator is used to process the sprayed image to obtain the gradient magnitude and gradient direction of all pixels within the image. Let any edge pixel of the target connected component be designated as the target edge pixel. The average of the absolute values of the differences between the gradient magnitudes of the target edge pixel and all pixels in its eight-neighborhood is designated as the gradient magnitude difference of the target edge pixel. The average of the absolute values of the differences between the gradient directions of the target edge pixel and all pixels in its eight-neighborhood is designated as the gradient direction difference of the target edge pixel.
[0043] The use of the Sobel operator to obtain the gradient magnitude and gradient direction of a pixel is a well-known technique and will not be elaborated further.
[0044] The bubble probability of the target edge pixels is determined based on the differences in gradient magnitude and gradient direction of the target edge pixels.
[0045] Preferably, as an embodiment of this application, a preset first weight is used as the weight of the normalized value of the gradient magnitude difference of the target edge pixels, and a preset second weight is used as the weight of the normalized value of the gradient direction difference of the target edge pixels. The gradient magnitude difference and gradient direction difference of the target edge pixels are weighted and summed to obtain the bubble probability of the target edge pixels.
[0046] In this embodiment, the first weight and the second weight are both preset parameters, and the sum of the first weight and the second weight is 1. The values of the first weight and the second weight are 0.6 and 0.4, respectively.
[0047] It should be noted that this embodiment uses the Z-Score standard normalization method to calculate the normalized value. In practical applications, implementers may use other methods of existing technology, such as the maximum-minimum normalization method or the sigmoid function, to calculate the normalized value, and no limitation is made here.
[0048] When the gradient magnitude difference of the target edge pixels is greater, the target edge pixels are more likely to correspond to the center of the bubble on the surface of the car parts. At the same time, when the gradient direction difference of the target edge pixels is greater, the target edge pixels are more likely to correspond to the edge of the bubble on the surface of the car parts. In this case, the probability of the target edge pixels being a bubble is greater, and the target edge pixels are more likely to correspond to the bubble position on the surface of the car parts.
[0049] The gradient magnitude difference, gradient direction difference, and bubble probability of each edge pixel in each connected region can be obtained using the same method.
[0050] At this point, the gradient magnitude difference, gradient direction difference, and bubble probability of each edge pixel in each connected region are obtained.
[0051] The drip defect analysis module determines the directional gradient magnitude difference and drip probability of the target edge pixel based on the difference in gradient magnitude between the vertical and horizontal directions of the target edge pixel, and the difference in gradient magnitude between the target edge pixel and all pixels in its eight neighborhoods.
[0052] This study analyzes the run defects on the surface of automotive parts. Runs refer to the condition where paint, during painting on a vertical surface, flows down the surface due to gravity, forming run marks. When a connected component corresponds to a run area on an automotive part, the gradient amplitude of the edge pixels of the connected component is significantly greater in the vertical direction than in the horizontal direction. The gradient direction of the edge pixels of the connected component is relatively concentrated. Simultaneously, the edge reflectivity of run defects is strong, and the gradient values near the edge pixels of the connected component change considerably.
[0053] The Sobel operator is used to obtain the gradient magnitudes of all pixels in the sprayed image in the horizontal and vertical directions.
[0054] The sag probability of the target edge pixel is determined based on the difference in gradient magnitude between the vertical and horizontal directions of the target edge pixel, and the difference in gradient magnitude between the target edge pixel and all pixels in its eight-neighborhood.
[0055] The difference between the gradient magnitudes of the target edge pixel in the vertical and horizontal directions is denoted as the directional gradient magnitude difference of the target edge pixel. The mean of the gradient magnitudes of all pixels within the eight neighborhoods of the target edge pixel is denoted as the average magnitude of the neighboring gradients of the target edge pixel. The square of the difference between the gradient magnitude of the target edge pixel and the average magnitude of the neighboring gradients is denoted as the gradient magnitude change of the target edge pixel. A preset third weight is used as the weight of the gradient magnitude change of the target edge pixel, and a preset fourth weight is used as the weight of the directional gradient magnitude difference of the target edge pixel. The gradient magnitude change and the directional gradient magnitude difference of the target edge pixel are weighted and summed to obtain the sag probability of the target edge pixel.
[0056] The third and fourth weights are preset parameters, and the sum of the third and fourth weights is 1. In this embodiment, the values of the third and fourth weights are 0.5 and 0.5, respectively.
[0057] When the difference in the directional gradient magnitude of the target edge pixels is greater, the target pixel will more significantly exhibit the characteristic that the gradient magnitude in the vertical direction is significantly greater than that in the horizontal direction. At the same time, when the gradient magnitude of the target edge pixels changes more, the target edge pixels will exhibit the characteristic of stronger reflectivity, and the target pixel will be more likely to correspond to the edge of the drip defect. In this case, the drip probability of the target edge pixels is greater.
[0058] The same method can be used to obtain the difference in directional gradient magnitude and the probability of sag for each edge pixel in each connected region.
[0059] At this point, the difference in directional gradient magnitude and the probability of sag are obtained for each edge pixel in each connected region.
[0060] The online monitoring module for spray coating hue establishes the feature vectors of target edge pixels and obtains the spray coating hue monitoring results corresponding to the connected region based on the feature vectors of all edge pixels of the connected region.
[0061] The feature vector of the target edge pixel is obtained by sequentially arranging the pixel values of the R, G, and B channels, gradient magnitude difference, gradient direction difference, bubble probability, directional gradient magnitude difference, and drip probability into a row vector.
[0062] The same method can be used to obtain the difference in directional gradient magnitude and the probability of sag for each edge pixel in each connected region.
[0063] Following the same method, 1000 images of painted automotive parts were collected, including those without defects, those with sagging defects, and those with bubble defects. Feature vectors of all edge pixels within the connected components of each image were obtained. The painting hue monitoring results corresponding to each connected component were manually labeled, including three categories: no defects, sagging defects, and bubble defects. The feature vectors of all edge pixels within the connected components of 700 collected images were used as the training set, and the feature vectors of all edge pixels within the connected components of 300 images were used as the test set to train an SVM classifier, resulting in the trained SVM classifier.
[0064] Training the SVM classifier and obtaining the trained SVM classifier are well-known techniques and will not be elaborated further.
[0065] Input the feature vectors of all edge pixels of a connected component into a trained SVM classifier to obtain the spray hue monitoring results corresponding to the connected component.
[0066] This enables online monitoring of the hue of paint applied to automotive parts.
[0067] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the principles of the present invention should be included within the protection scope of the present invention.
Claims
1. An online monitoring system for the hue of automotive parts paint spraying based on machine learning, characterized in that, The system includes the following modules: The data acquisition module is used to acquire the painted images of the finished automotive parts and divide the painted images into multiple connected components. The bubble defect analysis module is used to denote any connected component as the target connected component and any edge pixel of the target connected component as the target edge pixel. Based on the difference in gradient magnitude and gradient direction between the target edge pixel and all pixels in its eight neighboring regions, the module determines the gradient magnitude difference, gradient direction difference, and bubble probability of the target edge pixel. The drip defect analysis module is used to determine the directional gradient magnitude difference and drip probability of the target edge pixel based on the difference in gradient magnitude of the target edge pixel in the vertical and horizontal directions, and the difference in gradient magnitude between the target edge pixel and all pixels in its eight neighborhoods. The online monitoring module for spray coating hue is used to establish the feature vectors of target edge pixels and obtain the spray coating hue monitoring results corresponding to the connected region based on the feature vectors of all edge pixels of the connected region.
2. The online monitoring system for the hue of automotive parts paint based on machine learning as described in claim 1, Its features are, The method for determining the gradient magnitude difference of the target edge pixels is as follows: The average of the absolute values of the differences between the gradient magnitudes of the target edge pixel and all pixels in its eight-neighborhood is denoted as the gradient magnitude difference of the target edge pixel.
3. The online monitoring system for the hue of automotive parts paint based on machine learning according to claim 1, characterized in that, The method for determining the gradient direction difference is as follows: The average of the absolute values of the differences in gradient directions between the target edge pixel and all pixels in its eight-neighborhood is denoted as the gradient direction difference of the target edge pixel.
4. The online monitoring system for the hue of automotive parts paint based on machine learning according to claim 1, characterized in that, The method for determining the bubble probability is as follows: The preset first weight is used as the weight of the normalized value of the gradient magnitude difference of the target edge pixels, and the preset second weight is used as the weight of the normalized value of the gradient direction difference of the target edge pixels. The weighted sum is then performed to obtain the bubble probability of the target edge pixels.
5. The online monitoring system for the hue of automotive parts paint based on machine learning according to claim 4, characterized in that, The sum of the first weight and the second weight is 1.
6. The online monitoring system for the hue of automotive parts paint based on machine learning as described in claim 1, Its features are, The method for determining the difference in directional gradient magnitude of the target edge pixels is as follows: The difference between the gradient magnitudes of the target edge pixels in the vertical and horizontal directions is denoted as the directional gradient magnitude difference of the target edge pixels.
7. The online monitoring system for the hue of automotive parts paint based on machine learning according to claim 1, characterized in that, The method for determining the sag probability is as follows: The average gradient magnitude of all pixels within the eight neighborhoods of the target edge pixel is denoted as the average magnitude of the neighboring gradient of the target edge pixel. The square of the difference between the gradient magnitude of the target edge pixel and the average magnitude of the neighboring gradient is denoted as the gradient magnitude variation of the target edge pixel. The sag probability of target edge pixels is obtained based on the gradient magnitude change and directional gradient magnitude difference of the target edge pixels.
8. The online monitoring system for the hue of automotive parts paint based on machine learning according to claim 7, characterized in that, The specific steps for obtaining the sag probability of target edge pixels based on the gradient magnitude change and directional gradient magnitude difference of target edge pixels are as follows: The preset third weight is used as the weight of the gradient magnitude change of the target edge pixel, and the preset fourth weight is used as the weight of the difference in the directional gradient magnitude of the target edge pixel. The weighted sum is then used to obtain the sag probability of the target edge pixel. The sum of the third weight and the fourth weight is 1.
9. The online monitoring system for the hue of automotive parts paint based on machine learning according to claim 1, characterized in that, The specific steps for establishing the feature vector of the target edge pixels are as follows: The feature vector of the target edge pixel is obtained by sequentially arranging the pixel values of the R, G, and B channels, gradient magnitude difference, gradient direction difference, bubble probability, directional gradient magnitude difference, and drip probability into a row vector.
10. The online monitoring system for the hue of automotive parts paint based on machine learning according to claim 1, characterized in that, The specific steps for obtaining the spray hue monitoring result corresponding to the connected component based on the feature vectors of all edge pixels of the connected component are as follows: The feature vectors of all edge pixels of a connected component are input into an SVM classifier to obtain the spray hue monitoring results corresponding to the connected component. The spray hue monitoring results include three types: no defects, sagging defects, and bubble defects.
Citation Information
Patent Citations
Ventilation equipment blade quality detection method, device and system based on image processing
CN114359274A
Textile quality detection method based on optical means
CN114820627A
Visual inspection method for production quality of laminated glass
CN117058137A
Electroplated product surface flaw detection method based on image features
CN117314924A
Unmanned aerial vehicle spraying defect image detection method
CN117670834A