Aluminum coating formula prediction method and system based on industrial vision and double-model fusion
By employing high-precision multispectral visual acquisition and dual-model fusion, the problems of accuracy and efficiency in determining aluminum coating formulations have been solved, enabling rapid and accurate prediction of aluminum coating formulations and significantly improving production efficiency and product quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-24
- Publication Date
- 2026-03-31
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing technologies suffer from low precision, low efficiency, and insufficient generalization ability in the process of determining aluminum coating formulations, resulting in long R&D cycles, high costs, and high defect rates in multi-variety, small-batch production scenarios.
An industrial vision-based dual-model fusion approach is adopted, which uses high-precision multispectral visual acquisition, multi-dimensional feature fusion and adaptive update mechanism, combined with random forest regression model and convolutional neural network model to predict aluminum coating formulations.
It improves the accuracy and efficiency of aluminum coating formulation prediction, shortens the sampling cycle from 48 hours to 2.5 hours, reduces the trial and error cost per batch and the defect rate, and improves the product qualification rate.
Smart Images

Figure CN121768503A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of industrial vision and artificial intelligence, and more specifically, to intelligent prediction technology for aluminum coating formulations, particularly to a method and system for predicting aluminum coating formulations based on industrial vision and dual-model fusion. Background Technology
[0002] In the field of aluminum powder coating production, precise control of the formulation directly determines the color consistency, weather resistance, and mechanical properties of the coating. With the automotive, construction, and other industries continuously raising their requirements for the quality of aluminum surface coatings, especially in scenarios involving multi-variety, small-batch production, how to quickly and accurately determine the coating formulation has become a key technical bottleneck restricting production efficiency and product quality.
[0003] Currently, aluminum coating formulations are primarily determined through manual color matching. Technicians adjust pigment ratios visually by comparing colors, relying on experience and repeated trial and error to approximate the target formulation. Some companies have also introduced machine learning methods based on RGB color values, using the establishment of a mapping relationship between color features and formulation components for prediction.
[0004] However, existing technical solutions have the following significant drawbacks: First, at the visual acquisition level, the spectral response range of ordinary industrial cameras is usually limited to the 450-650nm visible light band, unable to capture spectral information in the near-infrared region, and is severely affected by ambient light interference, leading to distortion of the acquired color data; the surface of aluminum coatings has high reflectivity, and traditional lighting methods cannot effectively eliminate specular reflections, and manual visual color comparison is affected by subjective factors, with color errors typically exceeding 2 color difference units, making it difficult to meet industrial-grade accuracy requirements. Second, at the feature extraction level, existing solutions mostly rely solely on RGB color values for formula derivation, without considering the complex physical properties of the aluminum coating surface, such as the texture flickering effect caused by metallic aluminum powder, the differences in scattering characteristics of aluminum powder with different particle sizes, and the influence of coating thickness on spectral reflectivity, resulting in frequent "same color, different texture" problems, and the limited feature set restricts prediction accuracy. Third, at the model prediction level, a single machine learning model is difficult to balance interpretability and the ability to fit complex patterns. Decision tree models can output feature importance but are not good at fitting nonlinear relationships, while deep neural networks can capture complex patterns but lack interpretability, which is not conducive to engineers' decisions on formula adjustment. Moreover, the model cannot adapt to feature drift caused by batch changes in raw materials.
[0005] The aforementioned technical deficiencies result in core technical problems in the determination of aluminum coating formulations using traditional methods, including low precision, low efficiency, and insufficient generalization ability. A single sample production requires 2-5 kg of powder and takes over 48 hours, leading to long development cycles and high costs in multi-variety, small-batch production scenarios. Furthermore, the rate of defective products with excessive color difference is as high as 8%, severely hindering the intelligent transformation and upgrading of the aluminum coating industry. Summary of the Invention
[0006] This invention provides a method and system for predicting aluminum coating formulations based on industrial vision and dual-model fusion, which solves the technical problems of low accuracy, low efficiency and insufficient generalization ability in the determination of aluminum coating formulations in related technologies.
[0007] This invention discloses a method for predicting aluminum coating formulations based on industrial vision and dual-model fusion, comprising: A multispectral image sequence of an aluminum coating surface is acquired, the multispectral image sequence covering the visible light band and the near-infrared band; Identify and generate a binary mask for defect areas on the surface of aluminum coating, the binary mask being used to mark valid coating areas and defect areas; Based on the binary mask, a multi-dimensional feature vector of the effective coating area is extracted. The multi-dimensional feature vector includes color features, texture features, and spectral reflectance features. The multi-dimensional feature vectors are input into the random forest regression model and the convolutional neural network model respectively to obtain the prediction results of the formula component content of each model. Calculate the fusion weights based on the prediction errors of the random forest regression model and the convolutional neural network model on the validation set; The prediction results of the formulation component content from the two models are weighted and fused to generate the final predicted value of the formulation component content, which includes the mass fraction of aluminum powder, titanium dioxide, pigment, and resin.
[0008] Furthermore, the acquisition of the multispectral image sequence of the aluminum coating surface includes: The high-precision visual acquisition device is geometrically calibrated, and the camera intrinsic parameter matrix and distortion coefficient vector are calculated using the calibration method. The distortion coefficient vector includes radial distortion coefficient and tangential distortion coefficient. The original image is then distorted using the homography transformation matrix. The light source color is calibrated using a standard white board, the actual color temperature deviation of the standard light source is calculated, and the color temperature deviation is compensated by adjusting the brightness parameters of the light source controller. Based on the geometric dimensions and detection accuracy requirements of the aluminum material, scanning path parameters are generated, including the starting position coordinates, scanning speed, and image acquisition interval. An equally spaced sequence of acquisition points is generated by the displacement signal fed back by the encoder. Multi-source collaborative imaging is performed by switching between a standard light source and a near-infrared light source, using symmetrical illumination in conjunction with a diffused light homogenizer to eliminate specular reflections, and triggering shooting according to the acquisition point sequence to generate a multispectral image sequence containing visible light information and near-infrared information.
[0009] Furthermore, the multi-source collaborative imaging process also includes: For each acquisition point, three images were captured using short, medium, and long exposure times respectively; Calculate the fusion weight for each pixel, which is related to the distance of the pixel's grayscale value from the median grayscale value; The three images are weighted and fused according to the fusion weights to generate a high dynamic range image.
[0010] Furthermore, the process of identifying and generating a binary mask for the defect region on the aluminum coating surface includes: The multispectral image sequence is input into a semantic segmentation model, which includes an encoder, a decoder, and an attention module. The attention module is embedded at the skip connection between the encoder and the decoder. The encoder extracts multi-scale features, and the attention module enhances the sensitivity to defect regions. The attention module includes a channel attention module and a spatial attention module. The channel attention module calculates feature channel weights through global average pooling and a fully connected network. The spatial attention module calculates a spatial weight map through convolution operations. The probability value of each pixel belonging to the defect category is output by the decoder, and binarized using a preset threshold to generate the binary mask; The binary mask is subjected to morphological post-processing, including opening operations to remove isolated noise points and closing operations to fill holes inside defective regions. Calculate the percentage of the effective coating area. If the percentage of the effective coating area is lower than a preset ratio, a quality warning signal is triggered.
[0011] Furthermore, the training process of the semantic segmentation model includes: The training set was created using images of aluminum surfaces containing labeled defect masks, and a batch training mode was employed. The loss function is a weighted combination of Dice loss and binary cross-entropy loss. The Dice loss is calculated based on the intersection and union of the predicted probability and the true label, and the binary cross-entropy loss is calculated based on the log-likelihood of the predicted probability and the true label. An adaptive optimization algorithm is used for training until the loss on the validation set no longer decreases.
[0012] Furthermore, the extraction of the multi-dimensional feature vector of the effective coating region includes: The pixels in the effective coating area are converted to color space, and the statistical characteristics in RGB color space, HSV color space, and Lab color space are calculated, including the mean and standard deviation of each channel, as well as the mean of color saturation and hue angle in Lab color space, to generate the color features. Texture features are extracted using two texture description methods: gray-level co-occurrence matrix and local binary mode. The gray-level co-occurrence matrix calculates and statistically analyzes contrast, correlation, energy, and entropy in multiple directions. The local binary mode compares the gray-level values of the center pixel and neighboring pixels in the neighborhood and encodes them into binary numbers. The histogram distribution of the pattern is statistically analyzed to generate the texture features. The reflectance data of the visible light band and the near-infrared band are analyzed, the RGB image is converted into a spectral reflectance curve, multiple bands are sampled at preset intervals in the visible light band and the average reflectance is calculated, the slope characteristics of the reflectance curve are calculated, and the spectral reflectance characteristics are generated. The color feature, texture feature, and spectral reflectance feature are concatenated to generate the multi-dimensional feature vector.
[0013] Furthermore, the prediction process of the random forest regression model includes: The random forest regression model consists of multiple decision trees. During the training phase, each decision tree randomly samples from the training set using a bootstrap sampling method, and randomly selects some features to find the optimal split point when splitting at each node. During the prediction phase, the multi-dimensional feature vector is input into each decision tree. Each decision tree traverses down the node splitting path to the leaf node and outputs the regression prediction value of the leaf node. The final prediction value of the random forest regression model is the average of the prediction values of all decision trees; The contribution of each feature to the prediction result is calculated by SHAP value analysis, and the feature importance ranking is output.
[0014] Furthermore, the prediction process of the convolutional neural network model includes: The convolutional neural network model receives an RGB image as input and extracts high-level features of the image through multiple convolutional blocks. Each convolutional block contains a convolutional layer, a batch normalization layer, and a max pooling layer. A global average pooling layer is used to convert the feature map into a feature vector. The feature vector is input into a fully connected layer, and a Dropout layer is applied to prevent overfitting. The predicted content values of the formula ingredients are output through the output layer.
[0015] Furthermore, the calculation of the fusion weights includes: Calculate the mean absolute error of the random forest regression model and the convolutional neural network model on the validation set; The fusion weights are calculated based on the inverse relationship between the mean absolute errors of the two models, so that the model with the smaller mean absolute error receives a larger fusion weight, and the sum of the fusion weights of the two models is 1. The predicted values of the formula components are obtained by weighted summation of the prediction results of the two models based on the fusion weights.
[0016] Furthermore, it also includes: Continuously collect image samples and actual formula label data of new production batches, and temporarily store the new samples in a buffer queue; When the number of samples accumulated in the buffer queue reaches the trigger threshold, the SHAP value matrix of the new sample is calculated. The distribution of SHAP values of the new sample is statistically tested against the historical baseline distribution. The distribution difference statistic for each feature is calculated to identify features that have experienced significant drift. Based on the proportion of drift features, a local update strategy or a global update strategy is selected to adjust the parameters of the random forest regression model. The local update strategy only retrains the decision trees that depend on drift features, while the global update strategy retrains all decision trees. Compare the prediction errors of the models before and after the update on the validation set, calculate the reduction in error, and if the reduction in error is greater than a preset revenue threshold, then deploy the updated model to the production system.
[0017] The present invention also discloses a system for executing the above-mentioned aluminum coating formulation prediction method based on industrial vision and dual-model fusion, including a high-precision vision acquisition device and an edge computing server. The high-precision vision acquisition device includes an industrial camera, a multi-light source system and a high-precision linear guide rail, and the edge computing server runs feature extraction algorithms and prediction models.
[0018] This invention fundamentally solves the core technical problems of low accuracy, low efficiency, and insufficient generalization ability in traditional aluminum coating formulation determination methods through four major technical means: high-precision multispectral visual acquisition, multi-dimensional feature fusion, dual-model dynamic fusion, and adaptive update mechanism. The invention achieves the following technical effects: First, at the visual acquisition level, a wide-spectrum response industrial camera covering the 380-1000nm wavelength band and multi-source collaborative illumination technology are used to eliminate the color distortion problems caused by the narrow spectral response range of ordinary cameras and ambient light interference. Symmetrical illumination from the D65 standard light source, combined with a diffused light-diffusing plate, effectively eliminates specular reflections. Geometric calibration and light source calibration ensure image consistency, reducing the color acquisition error from a color difference greater than 1.0 in traditional methods to a color difference less than or equal to 0.5, providing a data foundation for subsequent high-precision formula prediction.
[0019] Secondly, at the feature extraction level, three types of features—color, texture, and spectral reflectance—are integrated to overcome the problem of single-feature application caused by traditional methods that only use RGB color values. Color features capture the chromaticity and saturation information of the paint, texture features extract the scintillation effect and scattering characteristics caused by the particle size of metallic aluminum powder, and spectral reflectance features characterize the spectral distribution characteristics and coating thickness information of the paint. The synergistic effect of these three types of features enables the model to distinguish between samples with "same color but different textures," improving the prediction accuracy of complex metallic paint formulations by 30% and reducing the mean absolute error from 0.08 to 0.056.
[0020] Third, at the model prediction level, a dual-model fusion architecture combining a random forest regression model and a convolutional neural network model is adopted, balancing interpretability and the ability to fit complex patterns. The random forest model outputs feature importance rankings through SHAP value analysis, providing interpretable suggestions for formula adjustments to engineers; the convolutional neural network model automatically learns high-level image features, capturing the nonlinear influence of coating microstructure on color; the dynamic weighted fusion algorithm adaptively adjusts weights based on validation set errors, enabling the system to maintain high prediction accuracy on different types of aluminum coatings.
[0021] Fourth, at the systems engineering level, the introduction of defect masking preprocessing technology and an adaptive update mechanism based on SHAP values improves the robustness and long-term stability of the system. The defect masking technology identifies and eliminates surface defects through a semantic segmentation model with attention mechanisms, increasing the proportion of effective feature regions to over 98%. The adaptive update mechanism, through feature drift detection and selective model updates, enables the model to adapt to changes in raw material batches, achieving a feature-level drift localization accuracy of 92%. The local update strategy reduces computational costs by 81%, and the average absolute error of formula prediction decreases from 0.068 to 0.042.
[0022] In summary, this invention shortens the sampling cycle from 48 hours to 2.5 hours, reduces the trial-and-error cost per batch from 800 yuan to 300 yuan, reduces the non-conforming rate due to excessive color difference from 8% to 1.2%, and increases the product qualification rate from 96.2% to 99.1%. It significantly improves the accuracy and efficiency of aluminum coating formulation determination and provides effective technical support for the intelligent transformation and upgrading of the aluminum coating industry. Attached Figure Description
[0023] Figure 1 This is the main flowchart of the aluminum coating formulation prediction method based on industrial vision and dual-model fusion of the present invention; Figure 2 This is a flowchart of the multispectral image sequence acquisition process of the present invention; Figure 3 This is a flowchart of the model adaptive update method of the present invention. Detailed Implementation
[0024] According to an embodiment of this method, the aluminum coating formulation prediction method based on industrial vision and dual-model fusion is applied to an aluminum coating formulation prediction scenario. The hardware environment includes a high-precision visual acquisition device and an edge computing server. The high-precision visual acquisition device is mechanically integrated from an industrial camera (Basler Ace 2 12MP, spectral response range 380-1000nm), a multi-light source system (including a D65 standard light source and an 850nm near-infrared light source), and a high-precision linear guide rail (positioning accuracy ±25μm) to achieve scanning imaging of the aluminum surface. The edge computing server is equipped with a 16-core CPU and a GPU accelerator card (12GB video memory) to run feature extraction algorithms and prediction models.
[0025] Step 100: Obtain a multispectral image sequence of the aluminum coating surface.
[0026] A high-precision visual acquisition device scans the surface of the aluminum coating to acquire image data including visible and near-infrared wavelengths. Specifically, the aluminum material is fixed at the inspection station, and a linear guide rail drives an industrial camera to move along the aluminum surface. Simultaneously, a multi-light source system is controlled to illuminate the surface, triggering the camera to capture images at preset acquisition points, generating a sequence of multiple images. The multispectral image sequence contains spectral information covering the 380-1000nm wavelength band, with an image resolution of 4096×3072 pixels and a physical size of 50μm / pixel for each image.
[0027] It should be noted that the process of acquiring the multispectral image sequence includes the following sub-steps: Step 101: Perform system geometric calibration and calculate the camera intrinsic parameter matrix using Zhang Zhengyou's calibration method. and distortion coefficient vector ,in The radial distortion coefficient is... These are the tangential distortion coefficients. Utilizing the homography transformation matrix... For the original image Distortion correction is performed to obtain the corrected image. It eliminates geometric distortion caused by lens distortion, and the correction accuracy is controlled within 0.1 pixels.
[0028] Step 102: Perform light source color calibration. Use the BCRA standard white board (reflectivity 98% ± 0.5%) to conduct a white balance test and calculate the actual color temperature deviation of the D65 light source. By adjusting the brightness parameters of the light source controller to compensate for color temperature deviations, the color consistency of images acquired at different times is ensured to meet the requirements. .
[0029] Step 103: Generate scanning path parameters. Based on the geometric dimensions of the aluminum material and the required detection accuracy, calculate the starting position coordinates of the linear guide. Scanning speed (Range 50-200mm / s) and image acquisition interval (Range 20-100μm). A sequence of equally spaced acquisition points is generated based on the displacement signal fed back from the encoder. ,in The overlap rate of adjacent images is set to 20%-30%.
[0030] Step 104: Perform multi-light source collaborative imaging, switching the light source mode according to the acquisition requirements. For routine color detection, use the D65 standard light source (color temperature 5000K, illuminance 1000±50 lux), employing 45° symmetrical illumination with a diffused light-diffusing plate to eliminate specular reflections. For coating thickness detection, simultaneously activate the 850nm near-infrared light source to acquire near-infrared reflectance images. The camera triggers shooting according to the preset acquisition point sequence, with a single image exposure time of 10-30ms, continuously acquiring and generating a multispectral image sequence containing visible light and near-infrared information.
[0031] In this embodiment, to improve color measurement accuracy, a multi-exposure fusion technique is employed in step 104. For each acquisition point, three different exposure times (short exposure) are used. Exposure in China Long exposure Three images are captured and then synthesized into a single image using a high dynamic range (HDR) fusion algorithm. Specifically, the fusion weight for each pixel is calculated. ,in For the first The pixel grayscale value of the second exposure The pixel values of the synthesized image are weight distribution parameters. This method can simultaneously preserve texture details in both highlight and shadow areas, avoiding information loss caused by overexposure or underexposure.
[0032] Step 200: Identify and generate a binary mask for the defect area on the aluminum coating surface.
[0033] The multispectral image sequence acquired in step 100 is analyzed to detect and label surface defect areas (such as scratches, bubbles, exposed substrate, etc.), generating a binary mask image with the same size as the original image, where defect pixels are marked as 0 and effective coating pixels are marked as 1. This binary mask is used in subsequent feature extraction steps to exclude interference from defect areas, ensuring that only effective coating areas are analyzed.
[0034] It should be noted that the process of identifying and generating a binary mask is implemented using the U-Net semantic segmentation model with an attention mechanism. This model receives a 224×224×3 RGB image as input, extracts multi-scale features through an encoder-decoder architecture, and embeds channel attention modules and spatial attention modules at skip connections to enhance the model's sensitivity to defect regions. The encoder part consists of four convolutional downsampling layers, each including two 3×3 convolutional layers (with ReLU activation function) and a 2×2 max-pooling layer, with the number of feature channels being 64, 128, 256, and 512 respectively. The decoder part gradually restores the spatial resolution through upsampling and convolution operations, finally outputting a single-channel defect probability map. At each skip connection, the channel attention module calculates the feature channel weights through global average pooling and two fully connected layers. ,in For feature maps, For the Sigmoid function, These are learnable parameters; the spatial attention module computes the spatial weight map through convolution operations. ,in This indicates channel concatenation. The attention-weighted feature map is fused with the decoder features, and the probability value of each pixel belonging to the defect category is output. Binarization is performed using a threshold of 0.5 to generate the final defect mask.
[0035] The training process of the aforementioned U-Net semantic segmentation model includes: using 2000 aluminum surface images with labeled defect masks as the training set, employing batch training mode, and setting the batch size to 16. The loss function is a weighted combination of Dice loss and binary cross-entropy loss, calculated using the following formula: Dice loss is defined as , To predict probabilities, For the true labels; the binary cross-entropy loss is defined as... ,in Total number of pixels; weight coefficients set to , The optimization strategy employs the Adam optimization algorithm with a learning rate of 0.001, and training continues until the loss on the validation set no longer decreases. The model achieves a segmentation accuracy (IoU metric) of over 0.92 on the training set.
[0036] In this embodiment, to further improve the robustness of defect detection, morphological post-processing is performed after generating the binary mask. First, an opening operation (erosion followed by dilation) is performed on the initial mask, using a circular structuring element (radius 3 pixels) to remove isolated noise points and small false detection areas. Then, a closing operation (dilation followed by erosion) is performed to fill small holes inside the defect area, ensuring the connectivity of the mask area. Finally, the effective coating area ratio is calculated. ,in This represents the number of pixels with a mask value of 1. This represents the total number of pixels in the image. If... If the aluminum material has too many surface defects, a quality warning signal is triggered, and subsequent formula prediction is not performed; if If the coating quality is satisfactory, feature extraction will continue.
[0037] Step 300: Extract the multi-dimensional feature vector of the aluminum coating surface.
[0038] Based on the binary mask generated in step 200, features are extracted from the effective coating regions in the multispectral image sequence obtained in step 100 to generate a feature vector that integrates color, texture, and spectral reflectance information. The multidimensional feature vector contains 45 dimensions, including 15 dimensions for color features, 20 dimensions for texture features, and 10 dimensions for spectral reflectance features. This feature vector serves as the input data for the subsequent formula prediction model.
[0039] It should be noted that the color feature extraction process includes: performing color space conversion on the pixels of the effective coating area, and calculating the statistical features in RGB, HSV, and Lab color spaces. Specifically, the mean value of the red channel in the RGB space is calculated. Green channel average Mean of the blue channel and the corresponding standard deviation ; Calculate the hue mean in HSV space Mean saturation Mean brightness ; Calculate the average brightness in Lab space , mean chromaticity a , mean chromaticity b In addition, the color saturation in the Lab color space was calculated. And tone angle The mean and standard deviation The above 15 statistics constitute the color feature vector. .
[0040] It should be noted that the texture feature extraction process includes two texture description methods: Gray-Level Co-occurrence Matrix (GLCM) and Local Binary Pattern (LBP). For GLCM features, the RGB image is first converted to a grayscale image. Then, the gray-level co-occurrence matrix is calculated in the four directions of 0°, 45°, 90°, and 135°. ,in Grayscale For pixel spacing, The orientation angle is used. Four texture statistics are calculated based on the gray-level co-occurrence matrix: contrast ratio. Correlation ,energy ,entropy ,in and These represent the mean and standard deviation of the gray levels, respectively. The mean of the texture statistics in the four directions is taken to obtain a 4D GLCM feature vector. For LBP features, a unified mode LBP algorithm is used, comparing the gray levels of the center pixel with its neighboring pixels within an 8-neighborhood, encoding this as an 8-bit binary number, and statistically analyzing the histogram distribution of 256 patterns. Principal component analysis is then used to reduce the dimensionality to 16. Combining the GLCM features (4D) and LBP features (16D) results in a 20D texture feature vector. .
[0041] It should be noted that the spectral reflectance feature extraction process includes: analyzing reflectance data in the visible light band (400-700nm) and the near-infrared band (850nm, 940nm). For the visible light band, the RGB image is converted into a spectral reflectance curve, and the camera's spectral response function is used. and standard light source spectral power distribution The spectral reflectance of each pixel is calculated by reverse engineering. Eleven wavelengths were sampled at 30nm intervals within the 400-700nm range to calculate the average reflectivity of the effective coating area. After removing boundary bands with low signal-to-noise ratios, eight bands were retained. For the near-infrared band, the average reflectance was calculated directly from images acquired by an 850nm near-infrared camera. Furthermore, the slope characteristics of the reflectance curve were calculated, including the rising slope in the 400-500 nm band. and the descent slope in the 500-700nm band This slope feature can characterize the spectral distribution properties of the coating. Combining the eight spectral band reflectance and the two slope features forms a 10-dimensional spectral reflectance feature vector. .
[0042] Finally, the color feature vector, texture feature vector, and spectral reflectance feature vector are concatenated to generate a 45-dimensional multi-dimensional feature vector. ,in This indicates a vector concatenation operation.
[0043] In this embodiment of the application, to improve the quality of the feature vector, feature preprocessing is performed after feature extraction. First, missing values are processed in the 45-dimensional feature vector using the K-nearest neighbor interpolation method (K-nearest neighbor interpolation). Fill in missing features, specifically, for missing features Find the 5 samples in the training set that are closest to the current sample in terms of Euclidean distance, and calculate the feature distance of these 5 samples. Weighted average The weight , For Euclidean distance, This is the smoothing term. Then, the feature vectors are standardized, and the mean of each feature dimension on the training set is calculated. and standard deviation Standardize the eigenvalues to This ensures that features of different dimensions have the same numerical scale.
[0044] Step 400: Calculate the predicted content of the formulation components of the aluminum coating.
[0045] The multi-dimensional feature vectors extracted in step 300 are input into the random forest regression model and the convolutional neural network model, respectively, to obtain the prediction results of the formulation component content of each model. Then, based on the prediction errors of the two models on the validation set, the fusion weights are dynamically calculated, and the prediction results of the two models are weighted and fused to generate the final predicted value of the formulation component content. The predicted value of the formulation component content is expressed in the form of mass fraction, including the content of n components such as aluminum powder, titanium dioxide, pigment, and resin.
[0046] It should be noted that the prediction process of the random forest regression model includes: the model consists of 300 decision trees, each of which randomly samples from the training set during the training phase using a bootstrap method, and randomly selects at each node split. Features (of which) Find the optimal split point (for the total number of features). The construction parameters of a decision tree include: maximum depth. Minimum number of samples required for node splitting Minimum number of samples required for leaf nodes In the prediction phase, the 45-dimensional feature vector... The input is fed into each decision tree. Each tree traverses down the branching path from node to leaf node and outputs the regression prediction value of that leaf node. ,in The final prediction of the random forest is the average of the predictions from all decision trees. The predicted value is an n-dimensional vector, corresponding to the content of n components. Furthermore, SHAP value analysis is used to calculate the contribution of each feature to the prediction result, outputting a ranking of feature importance, providing an interpretable basis for formula adjustment.
[0047] The training process of the aforementioned random forest regression model includes: using historical production data containing 3000 feature-recipe label pairs as the training set, where each data set contains a 45-dimensional feature vector and a corresponding n-dimensional recipe vector. During training, each decision tree is trained independently, and node splitting employs the minimum mean squared error criterion, i.e., selecting features and thresholds from the candidate splitting feature set that minimize the sum of the mean squared errors of the child node samples. The loss function uses the mean squared error, defined as... ,in The number of training samples. For the actual recipe vector, This is the recipe vector predicted by the model. Training is conducted in parallel, with 300 decision trees trained simultaneously.
[0048] It should be noted that the prediction process of the convolutional neural network model includes: the model receives a 224×224×3 RGB image as input and extracts high-level features of the image through multiple convolutional and pooling operations. The network structure includes three convolutional blocks, each containing a convolutional layer, a batch normalization layer, and a max pooling layer. The first convolutional block has a 3×3 kernel size, 64 output channels, a stride of 1, same padding, and ReLU activation. After convolution, batch normalization is performed, followed by 2×2 max pooling (stride 2) downsampling. The second convolutional block has a 3×3 kernel size, 128 output channels, and the remaining parameters are the same as the first layer. The third convolutional block has a 3×3 kernel size, 256 output channels, and the remaining parameters are the same as the first layer. After three convolutional blocks, the feature map size is reduced to 28×28×256. Then, a global average pooling layer is used to convert each feature map into a scalar, resulting in a 256-dimensional feature vector. The feature vector is input into a fully connected layer (1024 neurons, LeakyReLU activation function). The algorithm employs a Dropout layer (with a dropout rate of 0.4) to prevent overfitting. Finally, the predicted concentrations of n components are output through an output layer (with n neurons and a linear activation function). .
[0049] The training process of the aforementioned convolutional neural network model includes: using the same 3000 image-recipe label pairs as the random forest regression model as the training set, employing batch training mode, and setting the batch size to 32. The loss function uses a combination of mean squared error and mean absolute error, calculated using the following formula: ,in , , The number of samples in the batch is set to a weighting factor of 1. , The optimization strategy uses the Adam optimization algorithm, with an initial learning rate of 0.001. A learning rate decay strategy is adopted, where the learning rate decays to 0.9 times its original value every 10 training epochs, and the loss no longer decreases after training on the validation set.
[0050] It should be noted that the dynamic weighted fusion process includes: dynamically calculating the fusion weights based on the prediction performance of the random forest regression model and the convolutional neural network model on the validation set. Specifically, the mean absolute error of the two models on the validation set is calculated, and the mean absolute error of the random forest regression model is... The mean absolute error of the convolutional neural network model is ,in To determine the number of samples in the validation set, This is the authentic formula. and These are the predicted values from the two models. Calculate the fusion weights of the random forest regression model. Fusion weights in convolutional neural network models ,satisfy The prediction results from the two models are weighted and fused to obtain the final predicted values of the formula component content. This dynamic weighting strategy adaptively adjusts the weights based on the model's actual performance on the validation set, ensuring that models with higher prediction accuracy receive greater weights.
[0051] In this embodiment, to further improve prediction accuracy, the following steps are also included: incremental learning to update model parameters based on historical production data. Specifically, actual formula data and corresponding visual feature data of aluminum coatings are collected during the production process to form new training samples. Every 2 hours, the new samples are merged with the historical training set to perform incremental training on the random forest regression model and the convolutional neural network model. For the random forest regression model, an incremental decision tree algorithm is used, retraining only a portion of the decision trees, with the training time controlled within 5 minutes; for the convolutional neural network model, a transfer learning strategy is used, fixing the parameters of the first two convolutional blocks and fine-tuning only the parameters of the third convolutional block and the fully connected layer, with the learning rate set to 0.1 times the initial learning rate. After incremental learning, the mean absolute error of the two models on the validation set is recalculated, and the dynamic fusion weights are updated. and This incremental learning method enables the model to automatically adapt to batch differences in pigments (such as fluctuations in the whiteness of titanium dioxide from different manufacturers) and changes in production processes, maintaining long-term stability in prediction accuracy.
[0052] In this embodiment, the method further includes the following steps: generating a formula adjustment work order and feeding it back to the production system. The predicted formula component content values calculated in step 400 are then... Compared with standard formula Compare and calculate the formula deviation vector. To determine whether the formula deviation exceeds a threshold, specifically, the theoretical color difference value of the coating color is calculated based on the predicted formula. .like If the formula deviation is within an acceptable range, then the standard formula can be used directly for production; if If the formula adjustment order is generated, it will include the adjustment amount for each component (expressed as a mass fraction), for example, "aluminum powder increased by 0.8%, titanium dioxide decreased by 1.2%". The adjustment order is sent to the MES (Manufacturing Execution System) via industrial Ethernet (Ethernet / IP protocol). The MES system controls the batching equipment to mix the raw materials according to the adjusted formula. Simultaneously, the image data, feature vectors, predicted formula, and actual production formula of the current batch are stored in a database as training samples for incremental learning, achieving closed-loop control of "detection-prediction-adjustment-feedback". Detailed Implementation Method 2 In practical production applications of aluminum coating formulation prediction systems, the model, trained based on historical data, needs to operate stably for an extended period. However, the dynamic changes in raw material batches in the production environment cause the model's prediction accuracy to gradually decline, becoming a key issue restricting the long-term stability of the system.
[0054] Specifically, the raw materials used in aluminum coating production, such as titanium dioxide, aluminum powder, and resin, are periodically changed in batches or by different suppliers. Different batches of raw materials exhibit significant differences in their microscopic physicochemical properties. For example, the crystal ratio (mass ratio of rutile to anatase) of titanium dioxide produced by different manufacturers may vary from 3:1 to 5:1, resulting in a 15%-20% increase in hiding power for the same dosage. Similarly, the median particle size distribution of aluminum powder from different batches may drift from 18μm to 25μm, altering the gloss and shimmering effect of the coating surface. These microscopic changes in raw material properties directly alter the mapping relationship between visual characteristics and the formulation. For instance, when a new batch of titanium dioxide has stronger hiding power, the amount of titanium dioxide required to achieve the same whiteness is reduced. However, if the model still predicts based on the patterns of older batches, the predicted titanium dioxide dosage will be 0.5%-1.2% higher, leading to wasted raw material costs or an excessively thick coating that affects mechanical properties.
[0055] Existing technical solutions suffer from the following technical bottlenecks when addressing model drift caused by batch variations in raw materials: At the drift detection level: Traditional methods only judge the performance degradation of the model by monitoring the statistical indicators of the model prediction error (such as mean absolute error MAE and root mean square error RMSE). However, this method cannot locate the root cause of the drift and cannot distinguish whether the drift is a systematic drift caused by changes in the performance of a certain type of raw material or an occasional fluctuation caused by the accumulation of random errors, resulting in a lack of targeted decision-making for model updates.
[0056] At the update strategy level: Although retraining the model with a full batch can adapt to the characteristics of new batches of raw materials, it requires accumulating a sufficient number of new batch samples (usually more than 500 samples are needed to ensure training stability). In scenarios with rapid batch switching (such as changing raw material batches every 2 weeks), this leads to a lag in model updates, and the computational cost of full training is high (a single training session takes 2-4 hours), making it unsuitable for online production environments. On the other hand, not updating the model leads to a continuous accumulation of prediction errors, which ultimately affects product quality.
[0057] Interpretability: Existing incremental learning methods mostly adopt black-box parameter update strategies, which cannot output interpretable analysis results of changes in feature importance. Engineers find it difficult to understand the reasons and effects of model updates, which is not conducive to production decisions and quality traceability.
[0058] Therefore, it is necessary to address the technical issues of model prediction drift, update lag, and insufficient interpretability caused by changes in raw material batches.
[0059] According to an embodiment of this method, the method serves as the model dynamic update module of the recipe prediction system in Implementation 1, and runs continuously during the production process. The hardware environment reuses the edge computing server of Implementation 1, and the software environment includes an incremental feature importance analysis engine and a selective model update engine.
[0060] Step 500: Obtain sample data for the new production batch and store it in the buffer queue.
[0061] During the operation of the aluminum coating formulation prediction system, image samples of new production batches and actual formulation label data are continuously collected, and the new samples are temporarily stored in a buffer queue. Specifically, for each aluminum material detected by the high-precision visual acquisition device, a 45-dimensional feature vector is extracted according to steps 100 to 300 of Specific Implementation Method 1. At the same time, obtain the actual formula label used in this batch from the MES system. (Containing the mass fractions of n components), feature-label pairs The samples are stored in a first-in, first-out (FIFO) buffer queue. The buffer queue has a capacity of 100 samples, and a trigger threshold is set when the number of samples accumulated in the queue reaches that threshold. At that time, the feature drift detection process is initiated.
[0062] It should be noted that the buffer queue uses a timestamp indexing method, with each sample appended with a collection timestamp. Raw material batch number (e.g., "Titanium Dioxide-20231015-A") and production shift information. When a change in the raw material batch number is detected in the MES system, the feature drift detection process is forcibly triggered even if the buffer queue has not reached the trigger threshold, ensuring timely capture of characteristic mutations caused by batch switching. In addition, to prevent buffer queue overflow, a sliding window method is used. When the queue is full, new samples entering the queue will automatically remove the oldest sample, maintaining a constant queue capacity.
[0063] Step 510: Calculate the incremental SHAP value matrix of the new sample.
[0064] Once the buffer queue reaches the trigger condition, the SHAP value of the random forest regression model is calculated for new samples in the queue, generating a feature contribution matrix. Specifically, the features in the buffer queue are extracted. A new sample ( ), and the 45-dimensional feature vector of each sample The input is fed into the random forest regression model trained in Implementation Method 1, and the SHAP value matrix is calculated using the TreeSHAP algorithm. ,in Number of features, matrix elements Indicates the first The first sample The contribution of each feature to the formulation prediction result. The sign of the SHAP value indicates the direction of contribution (positive value indicates an increase in component content, negative value indicates a decrease in component content), and the absolute value indicates the intensity of contribution.
[0065] It should be noted that the TreeSHAP algorithm calculates feature contribution based on the path information of each decision tree in the random forest. For the Decision trees, given input samples The sample traverses the tree path from the root node to the leaf node. The set of split nodes traversed along the path is denoted as For features Its SHAP value is calculated as the sum of all features used along the path. The sum of the marginal contributions of the nodes that perform the split is given by the following formula: in For nodes The change in the predicted value of child nodes after splitting. Indicator functions that are either 0 or 1 For nodes The splitting feature used. The SHAP values of the 300 decision trees were averaged to obtain the random forest model's performance on the samples. Features SHAP value For all Repeat this calculation process for each new sample to generate a complete SHAP value matrix. .
[0066] Step 520: Detect the statistical drift of the feature importance distribution.
[0067] The SHAP value distribution of the new sample is statistically tested against the historical baseline distribution to identify features indicating significant drift. Specifically, an equal number of historical samples (sample size) are randomly drawn from the historical database. ), calculate the SHAP value matrix of historical samples For each feature Extract the SHAP value vector of the new sample. SHAP value vector of historical samples Calculate the Kolmogorov-Smirnov statistic for the two groups of samples: in and Features of new samples and historical samples respectively The empirical cumulative distribution function of the SHAP value is defined as follows: The KS statistic The range of values is The larger the value, the more significant the difference between the two distributions.
[0068] It should be noted that the determination features A dual-threshold determination method is used to determine whether drift has occurred. First, a main threshold is set for the KS statistic. ,like Then the characteristics are initially determined. A drift occurs. Then, a statistical significance test is performed; at a significance level... Calculate the critical value of the KS test. ,like If the null hypothesis (both groups of samples come from the same distribution) is rejected, the characteristic is confirmed. A statistically significant drift occurred. Feature indices that meet the dual threshold condition are recorded in the drift feature set. .
[0069] Step 530: Generate a feature drift analysis report.
[0070] Based on the drift feature set detected in step 520, the type, degree, and physical meaning of the drift are analyzed, and an interpretable report is generated. Specifically, the proportion of drift features is calculated. ,in This represents the number of drift features. For each drift feature... Calculate the change in the mean of SHAP values. ,in , ; Calculate the change in the standard deviation of the SHAP value The mean change The variation in standard deviation reflects the systematic bias of the characteristics in formula prediction. It reflects the degree of fluctuation in the contribution of features.
[0071] It should be noted that the feature drift analysis report includes the following: (1) a list of drift features, in accordance with the KS statistic. Sort in descending order, output feature index, feature name (e.g., "Lab Spatial Mean Brightness"), and degree of drift. and statistical significance p-value; (2) Analysis of the physical meaning of drift characteristics, and the correlation between raw material properties through characteristic types (color characteristics, texture characteristics, spectral reflectance characteristics), for example, if spectral reflectance characteristics ( Drifting and The system determines that the optical properties of the raw materials have improved (e.g., increased hiding power of titanium dioxide), and outputs the message "A significant shift in spectral reflectance characteristics has been detected. Possible cause: The batch switching of titanium dioxide has led to an increase in hiding power of approximately..." “;(3)Drift feature proportion” and average drift amplitude This is used to determine the model update strategy in the future.
[0072] Step 540: Perform selective model update.
[0073] Based on the scope and degree of feature drift, a local or global update strategy is selected to adjust the parameters of the random forest regression model. Specifically, the proportion of drifting features is determined. Is it less than the threshold? .like Then, a local update strategy is implemented: only decision trees in the random forest that depend on drift features are retrained. For each decision tree... Calculate its dependence on the drift feature, defined as the proportion of nodes in the tree that use the drift feature as a splitting node. ,in For trees Using drift feature set The number of nodes that can be split based on any feature. For trees The total number of split nodes. If Then the decision tree The trees marked as needing updating are added to the update tree set. For sets For each tree in the process, the parameters of that tree are retrained using a mixed training set consisting of new samples from the buffer queue and an equal amount of historical samples, while the parameters of the remaining decision trees remain unchanged.
[0074] It should be noted that, if If necessary, a global update strategy is executed: all 300 decision trees in the random forest are fully retrained. The training sample set consists of new samples from the buffer queue and 1000 randomly selected historical samples from the historical database, for a total of 1050 samples, ensuring a balance between the old and new batches of data. The global update uses an incremental learning algorithm, initializing the decision tree parameters to the current model parameters, fine-tuning the parameters using gradient boosting, setting the learning rate to 0.05, the number of iterations to 50 epochs, and keeping the training time under 8 minutes. After the update is complete, the new model is saved as a version number. The original model is used as the version number. Backup, supports model rollback operations.
[0075] Step 550: Calculate the performance gains from model updates.
[0076] The prediction errors of the models before and after the update are compared on the validation set to quantify the effect of the model update. Specifically, 200 samples are randomly selected from the historical database to form the validation set, which is not used in the training process. The validation set samples are then input into the model before the update (version number). ) and the updated model (version number) ), calculate the mean absolute error of the two models: in To determine the number of samples in the validation set, This is the authentic formula. and These are the predicted values of the model before and after the update, respectively. Calculate the decrease in MAE. This indicator reflects the degree of improvement in prediction accuracy brought about by model updates.
[0077] It should be noted that the effectiveness of the model update is determined using a return threshold method. If... If the model update is deemed ineffective, it may be due to insufficient new samples or mild feature drift. In this case, a model rollback operation is performed: the model parameters are restored to the version number before the update. The samples in the buffer queue are marked as "samples to be observed," and new samples continue to accumulate until the buffer queue reaches the trigger threshold again. If the model update is confirmed to be valid, the updated model version number will be entered. Deploy to the production system and replace the original model version number. Simultaneously, update logs are recorded, including update timestamps, drift feature lists, update strategy types (local or global), and performance gains. And update the number of decision trees for subsequent auditing and optimization.
[0078] Step 560: Update the feature importance baseline and clear the buffer queue.
[0079] After the model update is confirmed to be effective, the SHAP value distribution of the new batch of samples is used as the new baseline for the next round of drift detection. Specifically, the SHAP value matrix of the new samples calculated in step 510 is used... Store to the historical SHAP baseline database and update the baseline timestamp to the current time. Calculate the baseline mean for each feature. and baseline standard deviation This serves as the reference distribution parameter for the next round of drift detection. All samples in the buffer queue are cleared, the queue state is reset to empty, and new production samples are collected.
[0080] It should be noted that, to maintain long-term drift tracking capabilities, the historical SHAP baseline database is managed using a sliding window approach. The database stores SHAP baseline records for the most recent 12 months (assuming an average of 2 model updates per month, totaling 24 baseline records). Each record includes a baseline timestamp, a SHAP value matrix, a list of drift features, and a model version number. When the database exceeds its limit, the oldest baseline record is automatically deleted. This sliding window approach can adapt to long-term changes in the raw material supply chain, such as abrupt changes in material properties due to a complete change in suppliers. The system can gradually adapt to the new feature distribution through multiple rounds of incremental updates.
[0081] In this embodiment of the application, to improve the real-time performance of drift detection, the following steps are also included: deploying a lightweight online monitoring module to calculate the SHAP value of each new sample in real time and compare it with the baseline mean. Specifically, for each newly acquired sample, the SHAP value vector of its 45-dimensional features is calculated. Calculate the Euclidean distance from the baseline mean. If 10 consecutive samples If a certain threshold is reached, an early warning signal is triggered, indicating a possible batch mutation. Even if the buffer queue has not reached the trigger threshold, the feature drift detection process is immediately initiated. The calculation latency of this online monitoring module is less than 50ms, which does not affect production cycle time.
[0082] In this embodiment, the method further includes the following steps: generating a raw material quality traceability report based on the feature drift analysis results. The physical meaning of the drift features is correlated with the raw material batch information; for example, if a set of spectral reflectance features is detected... Significant drift occurred and Simultaneously, the MES system records that the titanium dioxide batch switched from "20231015-A" to "20231022-B," generating a traceability report: "The hiding power of the new batch of titanium dioxide (20231022-B) is approximately 20% higher than the old batch. It is recommended to reduce the amount of titanium dioxide in the formulation by 0.8%-1.2% to maintain color consistency." This report is pushed to the production team through the MES system to guide the formulation fine-tuning decision-making, achieving closed-loop control of "feature drift detection - raw material traceability - proactive formulation adjustment."
[0083] This implementation method fundamentally solves the technical problems of formula prediction model drift, update lag, and insufficient interpretability caused by changes in raw material batches by constructing a technical architecture of incremental feature importance tracking, statistical significance testing, and selective model updating.
[0084] Firstly, at the drift detection level, the use of incremental SHAP value calculation and Kolmogorov-Smirnov statistical tests enables precise drift localization at the feature level. Traditional methods only monitor global prediction errors and cannot distinguish the sources of error, while this method, by calculating the SHAP value distribution changes of each feature, can quantitatively identify the specific features causing model drift. For example, after a batch switch of titanium dioxide, the system detected spectral reflectance characteristics ( KS statistic (corresponding to reflectivity in the 500nm band) The values were significantly higher than the threshold of 0.3, while the KS statistics for texture features were all less than 0.15, clearly indicating that the drift originated from changes in the optical properties of titanium dioxide rather than changes in the particle size of aluminum powder. The Kolmogorov-Smirnov test provided statistical significance assurance, indicating that the drift was at a statistically significant level. The detected drift features have a 95% confidence level, avoiding frequent invalid updates caused by false alarms. Experimental data show that the feature-level localization accuracy of this drift detection method reaches 92%, and the false alarm rate is reduced to below 3%.
[0085] Secondly, at the update strategy level, the adoption of selective model update technology achieves a dynamic balance between maintaining model stability and adaptability. The local update strategy is based on the proportion of feature drift. Selectively retrain part of the decision tree, when On average, only 60 decision trees (20% of the total number of trees) need to be updated, reducing the update time from 8 minutes during full training to 1.5 minutes, thus reducing computational costs by 81%. Selective updates avoid over-adjusting parameters caused by retraining the entire model due to minor feature drift. For example, in scenarios where only the aluminum powder particle size changes slightly (texture feature drift), local updates maintain the stability of color feature-related decision trees, avoiding new errors that might be introduced by global updates. The global update strategy is triggered only when the feature drift percentage exceeds 20%, handling major changes such as complete supplier replacement, ensuring the model can adapt to a wide range of feature changes. Production validation data shows that after adopting the selective update strategy, the model update frequency decreased from once a week in the traditional method to once every two weeks, and the temporal stability of model parameters (correlation coefficient between adjacent version parameters) improved from 0.65 to 0.88.
[0086] Furthermore, at the interpretability level, the introduction of SHAP value analysis and feature drift report generation technology provides engineers with a physical interpretation of model updates. The feature drift report not only outputs statistical indicators of the drift characteristics (KS statistics, mean change), but also correlates them with changes in raw material properties; for example, the report outputs "spectral reflectance feature drift". The mean increased The system predicts a 20% increase in hiding power for titanium dioxide and recommends a 1.0% reduction in its dosage. This allows engineers to understand the reasons for the model update and make targeted formulation adjustments. The interpretability of the SHAP value enhances production personnel's trust in the intelligent prediction system. In a case study at an automotive coatings manufacturer, the manual review time for formulation adjustment decisions was reduced from an average of 25 minutes per batch to 8 minutes, and the manual intervention rate decreased from 40% to 12%.
[0087] Finally, at the systems engineering level, the robustness of the system is improved by introducing model update benefit evaluation and rollback methods. (Update benefit threshold determination method) This prevents model fluctuations caused by ineffective updates. For example, in scenarios where raw material performance fluctuates only slightly, the MAE reduction due to model updates is only 2%, and the system automatically rolls back to the original model version, avoiding jumps in predicted values caused by frequent updates. In a 6-month application test on a production line, the system triggered 18 drift detections and performed 12 model updates (8 local updates and 4 global updates), rolling back 6 times due to insufficient benefits. Compared to the control method using fixed-period full retraining, the mean absolute error of formula prediction decreased from 0.068 to 0.042, a reduction of 38%; the model adaptation time after raw material batch switching was shortened from an average of 7 days to 1.5 days; the number of formula adjustment errors caused by model drift decreased from 5 times per month to 0.8 times per month; and the product qualification rate increased from 96.2% to 99.1%.
[0088] In summary, this implementation achieves feature-level drift localization through incremental SHAP value calculation, provides significance assurance for drift detection through Kolmogorov-Smirnov statistical tests, balances stability and adaptability through selective model updates, and prevents ineffective updates through update benefit evaluation. Therefore, it enables the formulation prediction model to adapt quickly and accurately to changes in raw material batches, solving the technical problems of model drift, update lag, and insufficient interpretability in traditional methods.
Claims
1. An aluminum material coating formula prediction method based on industrial vision and double model fusion, characterized in that, The method comprises the following steps: obtaining a multi-spectral image sequence of the aluminum material coating surface, the multi-spectral image sequence covering the visible light band and the near-infrared band; identifying and generating a binary mask of the aluminum material coating surface defect area, the binary mask being used to mark the effective coating area and the defect area; based on the binary mask, extracting a multi-dimensional feature vector of the effective coating area, the multi-dimensional feature vector including color features, texture features and spectral reflection features; inputting the multi-dimensional feature vector into a random forest regression model and a convolutional neural network model respectively to obtain the respective formula ingredient content prediction results of the two models; calculating a fusion weight according to the prediction errors of the random forest regression model and the convolutional neural network model on the validation set; performing weighted fusion on the formula ingredient content prediction results of the two models to generate a final formula ingredient content prediction value, the formula ingredient content prediction value including the mass fraction of aluminum powder, titanium dioxide, pigment and resin.
2. The method of claim 1, wherein, The method comprises the following steps: geometrically calibrating a high-precision visual acquisition device, calculating a camera intrinsic parameter matrix and a distortion coefficient vector including radial distortion coefficients and tangential distortion coefficients by using a calibration method, and correcting the distortion of the original image by using a homography transformation matrix; calibrating the color of the light source by using a standard white board, calculating the actual color temperature deviation of the standard light source, and compensating for the color temperature deviation by adjusting the brightness parameter of the light source controller; generating scanning path parameters including starting position coordinates, scanning speed and image acquisition intervals according to the geometric size of the aluminum material and the detection accuracy requirements, and generating an equidistant acquisition point sequence by using the displacement signal feedback by the encoder; performing multi-light source cooperative imaging, switching the standard light source and the near-infrared light source, eliminating the specular reflection by using symmetrical illumination combined with a diffuse light uniformization plate, triggering shooting according to the acquisition point sequence, and generating a multi-spectral image sequence containing visible light information and near-infrared information.
3. The method of claim 2, wherein, The method further comprises the following steps: for each acquisition point, shooting three images respectively by using short, medium and long exposure times; calculating a fusion weight for each pixel point, the fusion weight being related to the distance of the gray value of the pixel point from the intermediate gray value; performing weighted fusion on the three images according to the fusion weight to generate a high dynamic range image.
4. The method of claim 1, wherein, The method further comprises the following steps: inputting the multi-spectral image sequence into a semantic segmentation model, the semantic segmentation model including an encoder, a decoder and an attention module, the attention module being embedded in the skip connection between the encoder and the decoder; extracting multi-scale features by using the encoder and enhancing the sensitivity to the defect area by using the attention module, the attention module including a channel attention module and a spatial attention module, the channel attention module calculating feature channel weights by using global average pooling and a fully connected network, and the spatial attention module calculating a spatial weight map by using convolution operation; The probability value of each pixel belonging to the defect category is output by the decoder, and a preset threshold is used for binarization to generate the binary mask; Morphological post-processing is performed on the binary mask, including open operation to remove isolated noise points and close operation to fill holes in the defect area; The effective coating area ratio is calculated, and if the effective coating area ratio is lower than a preset proportion, a quality warning signal is triggered.
5. The method of claim 4, wherein, The training process of the semantic segmentation model includes: Using aluminum surface images containing labeled defect masks as the training set, and using batch training mode; The loss function uses a weighted combination of Dice loss and binary cross-entropy loss, the Dice loss is calculated according to the intersection and union of the predicted probability and the true label, and the binary cross-entropy loss is calculated according to the logarithmic likelihood of the predicted probability and the true label; Adaptive optimization algorithm is used for training, and training is stopped when the validation set loss no longer decreases.
6. The method of claim 1, wherein, The multi-dimensional feature vector of the effective coating area includes: Color space conversion is performed on the pixels of the effective coating area, and statistical features in RGB color space, HSV color space and Lab color space are calculated, including the mean and standard deviation of each channel, and the mean of color saturation and hue angle in Lab color space, to generate the color feature; Texture features are extracted using two texture description methods, gray level co-occurrence matrix and local binary pattern, the gray level co-occurrence matrix calculates and statistics contrast, correlation, energy and entropy in multiple directions, and the local binary pattern compares the gray level of the center pixel with the neighborhood pixels in the neighborhood and encodes it into a binary number, and the histogram distribution of the pattern is calculated to generate the texture feature; The reflectivity data in the visible light band and the near-infrared band are analyzed, the RGB image is converted into a spectral reflectivity curve, multiple bands are sampled at a preset interval in the visible light band and the average reflectivity is calculated, the slope feature of the reflectivity curve is calculated, and the spectral reflectance feature is generated; The color feature, texture feature and spectral reflectance feature are spliced to generate the multi-dimensional feature vector.
7. The method of claim 1, wherein, The prediction process of the random forest regression model includes: The random forest regression model is composed of multiple decision trees, each decision tree randomly selects samples from the training set by bootstrap sampling method in the training stage, and randomly selects part of the features to find the optimal split point when each node is split; In the prediction stage, the multi-dimensional feature vector is input into each decision tree, each decision tree traverses down to the leaf node along the node split path, and outputs the regression prediction value of the leaf node; The final prediction value of the random forest regression model is the average of all decision tree prediction values; The contribution of each feature to the prediction result is calculated by SHAP value analysis, and the feature importance ranking is output.
8. The method of claim 1, wherein, The prediction process of the convolutional neural network model includes: The convolutional neural network model receives an RGB image as input, extracts high-level features of the image through multiple convolutional blocks, each convolutional block contains a convolutional layer, a batch normalization layer and a max pooling layer; A global average pooling layer is used to convert the feature map into a feature vector; The feature vector is input to a fully connected layer, and a Dropout layer is applied to prevent overfitting; The content prediction value of the formula ingredient is output through the output layer; The calculation of the fusion weight includes: Calculate the mean absolute error of the random forest regression model and the convolutional neural network model on the validation set; According to the inverse relationship of the mean absolute error of the two models, the model with smaller mean absolute error obtains larger fusion weight, and the sum of the fusion weights of the two models is 1; According to the fusion weight, the prediction results of the two models are weighted and summed to obtain the formula ingredient content prediction value.
9. The method of claim 1, wherein, Also includes: Continuously collect image samples and actual formula label data of new production batches, and temporarily store new samples in a buffer queue; When the number of samples accumulated in the buffer queue reaches the trigger threshold, calculate the SHAP value matrix of the new samples; Statistical test the SHAP value distribution of the new samples with the historical baseline distribution, calculate the distribution difference statistics of each feature, and identify the features that have undergone significant drift; According to the proportion of the number of drift features, select a local update strategy or a global update strategy to adjust the parameters of the random forest regression model, the local update strategy only re-trains the decision trees that depend on the drift features, and the global update strategy re-trains all decision trees. Compare the prediction errors of the models before and after updating on the validation set, calculate the error reduction rate, and if the error reduction rate is greater than the preset benefit threshold, deploy the updated model to the production system.
10. A system for performing the aluminum material coating formulation prediction method based on industrial vision and double model fusion according to any one of claims 1-10, characterized in that, It includes a high-precision visual acquisition device and an edge computing server, the high-precision visual acquisition device includes an industrial camera, a multi-light source system and a high-precision linear guide rail, and the edge computing server runs a feature extraction algorithm and a prediction model.
Citation Information
Cited By
Coating formula matching recommendation method and system based on visual equivalence method
CN122087145A
A coating formulation matching and recommendation method and system based on visual equivalence.
CN122087145B