A high-reflective glue defect detection method
By training a detection model that combines grayscale, texture, and reflective features, the problem of high false detection rate in the detection of highly reflective glue was solved, and accurate identification and quality monitoring of glue defects were achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-11
- Publication Date
- 2026-03-31
AI Technical Summary
Existing defect detection methods are unable to effectively distinguish between reflective and defective areas of highly reflective adhesives, resulting in a high false detection rate and an inability to accurately monitor adhesive quality in industrial spraying.
By training a detection model, combining grayscale features, texture features, and reflective features, and using convolutional neural networks and machine learning algorithms, defect areas and reflective areas are distinguished. Model A is used to identify reflective features, and Model B is used for three-class classification detection.
It improves the accuracy of defect detection, effectively identifies defective areas of highly reflective adhesives, reduces the false detection rate, and enables accurate monitoring of adhesive quality.
Smart Images

Figure CN116862878B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of visual inspection of adhesive coatings, and more specifically to a method for detecting defects in highly reflective adhesives. Background Technology
[0002] In conventional applications of adhesive coating, it is mainly used to replace traditional welding processes to fix workpieces. However, with the diversification of adhesive applications, water-based damping materials (LASD) adhesives are widely used for sealing and noise reduction due to their advantages such as being solvent-free, having low density, facilitating automated application, and being suitable for robotic spraying. For example, applying this material to the surface of automotive parts can improve the overall NVH (Noise, Vibration, and Harshness) performance of the vehicle. However, after application, water-based damping materials (LASD) adhesives exhibit highly reflective properties, such as... Figure 1-3 As shown, the collected glue images contain randomly distributed bright reflective areas. Existing defect detection methods rely solely on the grayscale or texture features of the image. However, due to the reflective properties of the glue, the grayscale and texture information of the glue image is destroyed, making it difficult to effectively distinguish between reflective and defective areas. Reflective areas are easily misjudged as defects, resulting in an abnormally high false detection rate. Summary of the Invention
[0003] To address the aforementioned technical problems, this invention provides a method for detecting defects in highly reflective adhesives. This method targets adhesive images with high reflectivity features and adds reflectivity features to the analysis of grayscale and texture features. It can accurately distinguish between defective areas (missing or broken adhesives) and reflective areas, resulting in high accuracy. This method can solve the technical problem of difficulty in monitoring the quality of reflective adhesives (LASD) in industrial spraying.
[0004] Therefore, the technical solution of the present invention is as follows:
[0005] A method for detecting defects in highly reflective adhesives involves training a detection model using the following steps before actual testing:
[0006] S1. Collect multiple glue images with reflective areas, use the reflectivity score as the label for each glue image, and then divide the glue into training set A and test set B according to a preset ratio.
[0007] The initial reflectivity score is the sum of the product of the grayscale variance of the corrected single glue image and the product of the pixel percentage of the reflective area in the whole image with different scaling coefficients.
[0008] After all images in the training set have obtained initial reflectivity scores, each initial reflectivity score is normalized to obtain the final reflectivity score.
[0009] S2. Input the images from training set A into the convolutional neural network model for training. Let this model be model A, and the loss function be... Where k is the proportionality coefficient, which is a preset value. The predicted reflectance score of the i-th image output by model A;
[0010] Once the loss value converges or falls below a preset value, the accuracy of model A is validated using images from test set A: when the predicted value of model A's output... In the label If the value is within the specified range, the output prediction is considered accurate; otherwise, it is inaccurate.
[0011] If the accuracy is higher than the preset threshold, save the current model A; otherwise, expand the number of image samples in the training set A, or adjust the model parameters in model A, and retrain model A until the accuracy is higher than the preset threshold.
[0012] S3. Collect three types of samples: normal glue images, defective glue images, and glue images with reflective areas. Label each image according to its category to form a sample dataset. The number of images in each sample dataset shall not be less than 500.
[0013] The feature vector set is matched to each image and label in the following manner:
[0014] A single image is input into model A stored in step S2, and the fully connected layer of model A outputs a one-dimensional feature vector A.
[0015] Extract the grayscale feature vector and texture feature vector of a single image, and then concatenate the two into a one-dimensional feature vector A to form a feature vector set.
[0016] Then, the images of each type are divided into training set B and test set B according to a preset ratio;
[0017] S4. Train model B using the set of labels and feature vectors of each image in training set B. Model B is a machine learning model or a convolutional neural network model.
[0018] The accuracy of the trained model B is verified using images in the test set B. If the accuracy is lower than the preset threshold, the number of image samples in the training set B is increased, or the model parameters in model B are adjusted, and model B is retrained until the accuracy is higher than the preset threshold; otherwise, the current model B is saved and the model training ends.
[0019] During actual testing, the actual collected glue image is input into model A stored in step S2. The fully connected layer of model A outputs a one-dimensional feature A. The grayscale feature vector and texture feature vector of the image are extracted, and then the two are concatenated to the one-dimensional feature vector A to form a feature vector set.
[0020] The feature vector set is input into the trained model B, and model B outputs the category corresponding to the image: normal glue image, defective glue image, and glue image with reflective areas.
[0021] Complete defect detection.
[0022] Preferably, in step S2, the grayscale value of each pixel in the image in training set A is divided by 255, and the image size is scaled to a preset size.
[0023] Preferably, in step S1, the number of images is no less than 1000;
[0024] In steps S2 and S4, the preset threshold for accuracy is between 0.9 and 0.98.
[0025] Furthermore, in step S1, the initial reflectance intensity fraction S i The calculation method is as follows:
[0026] Calculate the product of the gray-level variances of a single image, denoted as C. i The reflective areas are segmented from the image, and the percentage of pixels in the reflective areas in the entire image is calculated and denoted as R. i ; i represents the i-th image, i=1,2...N, where N represents the total number of images;
[0027] Calculate the initial reflectance fraction S of a single image. i初始 = λ×R i +β×C i +σ, where λ and β are proportional coefficients, σ is a correction value, and all three are set values.
[0028] Furthermore, in step S1, after all images in the training set have obtained initial reflectance intensity scores, each initial reflectance intensity score is normalized to obtain the final reflectance intensity score, as follows:
[0029] Search for S i初始 The maximum and minimum initial reflectance fractions in the sample are denoted as S. 初始max S 初始min ;
[0030] The initial reflectance intensity scores for each image are normalized to obtain the final reflectance intensity score S. i = .
[0031] Furthermore, λ and β are set as follows:
[0032] Take R respectively i C i The mean is denoted as R. 均值 C 均值 Set λ and β to make The ratio is less than 10.
[0033] Preferably, in step S2, k is a multiple of 10;
[0034] Preferably, in step S2, the model parameters in model A are adjusted, including the number of fully connected layers, learning rate, decay, and image scaling size.
[0035] In step S4, the model parameters in model B are adjusted as follows:
[0036] When model B is a VGG16 model, a ReseNet model, or a MobileNet model, the model parameters include the number of fully connected layers, the learning rate, the decay rate, and the preset size of the image scaling.
[0037] When model B is a lightGBM model, the model parameters include the number of iterations, learning rate, minimum gain for node splitting, minimum data size per leaf, number of leaf nodes, and maximum depth.
[0038] Preferably, the number of nodes in the fully connected layer of Model A is between 512 and 2560.
[0039] Furthermore, in step S3, the methods for extracting gray-level feature vectors include: gray-level co-occurrence matrix method, gray-level co-occurrence gradient matrix method, and fuzzy entropy method;
[0040] Methods for extracting grayscale feature vectors include: HOG method, Gabor filter, SIFT method, and LBP method.
[0041] Furthermore, model A can be a VGG16 model, a ReseNet model, or a MobileNet model;
[0042] Model B can be a LightGBM model, an SVM model, a Random Forest model, a Naive Bayes model, a VGG16 model, a ReseNet model, or a MobileNet model.
[0043] Furthermore, in step S4, model B is trained using the set of labels and feature vectors corresponding to each image in training set B to obtain the initial model B, as follows:
[0044] When model B is a lightGBM model, SVM model, random forest model, or Naive Bayes model, input M sets of labels and feature vectors into model B simultaneously, and calculate the accuracy of the classification results of model B. If the accuracy does not reach the expected value, adjust the model parameters in model B, and input another M sets of labels and feature vectors into model B simultaneously again, and calculate the accuracy until the accuracy reaches the expected value, thus obtaining the initial model B.
[0045] When Model B is a VGG16 model, ReseNet model, or MobileNet model, the feature vector set is converted into a three-dimensional feature vector to match the feature dimension of the convolutional layer. The three-dimensional feature vector and its corresponding label are input into Model B. The loss function of Model B is loss = -(a×log(H1) + b×log(H2) + c×log(H3)), where a, b, and c represent the prediction coefficients corresponding to normal glue images, defective glue images, and glue images with reflective areas, respectively. When a new three-dimensional feature vector is input, the prediction coefficient corresponding to the label is set to 1, and other prediction coefficients are set to 0. H1, H2, and H3 represent the prediction probabilities of normal glue images, defective glue images, and glue images with reflective areas output by Model B, respectively.
[0046] Once the loss value converges or falls below a preset value, the initial model B is obtained.
[0047] This invention aims to solve the quality monitoring problem of reflective adhesive (LASD) in industrial spraying. The method first trains a model A to identify reflective features, and uses the fully connected layer of model A as a classifier for reflective features to construct the reflective features of the image. Then, a model B is trained to achieve three classifications (defective, normal, and reflective images). Model B, based on the reflective features output by the fully connected layer of model A, combined with grayscale features and texture features, identifies the category to which the image belongs, and the recognition result has high accuracy. Attached Figure Description
[0048] Figure 1 This is an image of the adhesive with reflective areas in a specific implementation embodiment;
[0049] Figure 2 This is an image of another type of adhesive with reflective areas in a specific embodiment;
[0050] Figure 3 This is an image of another type of adhesive with reflective areas in a specific embodiment;
[0051] Figure 4 This is a normal glue image in a specific implementation embodiment;
[0052] Figure 5Images of defective adhesive in a specific implementation embodiment;
[0053] Figure 6 This is an image of the adhesive with reflective areas in a specific implementation. Detailed Implementation
[0054] A method for detecting defects in highly reflective adhesives involves training a detection model using the following steps before actual testing:
[0055] S1. Collect multiple images of glue with reflective areas (e.g.) Figures 1-3 As shown), the reflectivity score is used as the label for each glue image, and then the dataset is divided into training set A and test set B according to a preset ratio; for example, 70% of the dataset is randomly assigned to the training set and 30% to the test set, or 80% of the dataset is randomly assigned to the training set and 20% to the test set.
[0056] The initial reflectivity score is the sum of the product of the grayscale variance of the corrected single glue image and the product of the pixel percentage of the reflective area in the whole image with different scaling coefficients.
[0057] Initial reflectance intensity fraction S i The specific calculation method is as follows:
[0058] Calculate the product of gray-level variances of a single image (which can be obtained using the SMD2 function), denoted as C. i The reflective areas are segmented from the image, and the percentage of pixels in the reflective areas in the entire image is calculated and denoted as R. i ; i represents the i-th image, i=1,2...N, where N represents the total number of images;
[0059] Calculate the initial reflectance fraction S of a single image. i初始 = λ×R i +β×C i +σ, where λ and β are proportional coefficients, σ is a correction value, and all three are set values.
[0060] The settings for λ and β are as follows:
[0061] Take R respectively i C i The mean is denoted as R. 均值 C 均值 Set λ and β to make The ratio is less than 10. That is: Let and Keep it on the same order of magnitude, so that It will not be much greater than or much less than .
[0062] The correction value σ is set manually, for example... Figures 1-3 middle, Figure 1 , Figure 2 The reflectivity is significantly higher than Figure 3 If the three images have the same σ during the solution process, but an error occurs... Figure 3 The reflectivity score is higher than Figure 1 , Figure 2 The reflectivity score needs to be reduced manually. Figure 3 The value of σ is corrected during calculation, or increased. Figure 1 , Figure 2 The value of correction σ is calculated to correct the reflectivity score of the image, preventing the reflectivity score of individual images from not matching the actual reflectivity area ratio of the image, thus making the overall reflectivity score more reasonable.
[0063] After all images in the training set have obtained initial reflectivity scores, each initial reflectivity score is normalized to obtain the final reflectivity score.
[0064] The specific method for normalization is as follows:
[0065] Search for S i初始 The maximum and minimum initial reflectance fractions in the sample are denoted as S. 初始max S 初始min ;
[0066] The initial reflectance intensity scores for each image are normalized to obtain the final reflectance intensity score S. i = .
[0067] S2. Input the images from training set A into the convolutional neural network model for training. Let this model be model A, and the loss function be... Where k is the proportionality coefficient, which is a preset value. The predicted reflectance score of the i-th image output by model A;
[0068] Once the loss value converges or falls below a preset value, the accuracy of model A is validated using images from test set A: when the predicted value of model A's output... In the label If the value is within the specified range, the output prediction is considered accurate; otherwise, it is inaccurate.
[0069] If the accuracy is higher than the preset threshold, save the current model A; otherwise, expand the number of image samples in the training set A, or adjust the model parameters in model A (such as adjusting the number of fully connected layers, learning rate, decay, image scaling, increasing the number of samples (sample expansion methods can be rotation, flipping, adding Gaussian noise, etc.)), and retrain model A until the accuracy is higher than the preset threshold.
[0070] S3, such as Figures 4-6 As shown, three types of samples are collected: normal glue images, defective glue images, and glue images with reflective areas. Each image is labeled according to its category to form a sample dataset. The number of images in each sample dataset is no less than 500.
[0071] It should be noted that although both step S1 and this step involve labeling, the content of the labels is different. In step S1, the label is the reflectivity score, while in this step, the label is: normal glue, defective glue, glue with reflective areas.
[0072] The feature vector set is matched to each image and label in the following manner:
[0073] A single image is input into model A stored in step S2, and the fully connected layer of model A outputs a one-dimensional feature vector A.
[0074] Extract the grayscale feature vector and texture feature vector of a single image, and then concatenate the two into a one-dimensional feature vector A to form a feature vector set.
[0075] Then, the images of each type are divided into training set B and test set B according to a preset ratio;
[0076] S4. Train model B using the set of labels and feature vectors of each image in training set B. Model B is a machine learning model or a convolutional neural network model.
[0077] The accuracy of the trained model B is verified using images in the test set B. If the accuracy is lower than the preset threshold, the number of image samples in the training set B is increased, or the model parameters in model B are adjusted, and model B is retrained until the accuracy is higher than the preset threshold; otherwise, the current model B is saved and the model training ends.
[0078] During actual testing, the actual collected glue image is input into model A stored in step S2. The fully connected layer of model A outputs a one-dimensional feature A. The grayscale feature vector and texture feature vector of the image are extracted, and then the two are concatenated to the one-dimensional feature vector A to form a feature vector set.
[0079] The feature vector set is input into the trained model B, and model B outputs the category corresponding to the image: normal glue image, defective glue image, and glue image with reflective areas.
[0080] Complete defect detection.
[0081] In a preferred embodiment, the number of images in step S1 is no less than 1000;
[0082] In step S2, in order to speed up the processing, the gray values of each pixel in the image in the training set A are divided by 255, and the image size is scaled to a preset size, such as (224, 224), and then input into the convolutional neural network model for training.
[0083] k takes the value of a multiple of 10, which serves to amplify the value;
[0084] In steps S2 and S4, the preset threshold for accuracy is between 0.9 and 0.98.
[0085] In step S4, the model parameters in model B are adjusted as follows:
[0086] When model B is a VGG16 model, a ReseNet model, or a MobileNet model, the model parameters include the number of fully connected layers, the learning rate, the decay rate, and the preset size of the image scaling.
[0087] When model B is a lightGBM model, the model parameters include the number of iterations, learning rate, minimum gain for node splitting, minimum data size per leaf, number of leaf nodes, and maximum depth.
[0088] In specific implementation, the methods for extracting gray-level feature vectors in step S3 include: gray-level co-occurrence matrix method, gray-level co-occurrence gradient matrix method, and fuzzy entropy method;
[0089] Methods for extracting grayscale feature vectors include: HOG method, Gabor filter, SIFT method, and LBP method.
[0090] More specifically, in this embodiment, grayscale features are extracted using the Gray-Level Co-occurrence Matrix (GLCM) and texture features are extracted using the Histogram of Oriented Gradients (HOG). The HOG parameters are set to a window size of 32, a block size of 16, a block stride of 8, a cell size of 8, and a gradient direction count of 9.
[0091] Model A can be a VGG16 model, a ReseNet model, or a MobileNet model; the number of nodes in the fully connected layer of Model A ranges from 512 to 2560.
[0092] Model B can use machine learning models (lightGBM model, SVM model, random forest model, Naive Bayes model) or convolutional neural network models (VGG16 model, ReseNet model or MobileNet model).
[0093] More specifically, in step S4, model B is trained using the set of labels and feature vectors corresponding to each image in training set B to obtain the initial model B, as follows:
[0094] When model B is a lightGBM model, SVM model, random forest model, or Naive Bayes model, input M sets of labels and feature vectors into model B simultaneously, and calculate the accuracy of the classification results of model B. If the accuracy does not reach the expected value, adjust the model parameters in model B, and input another M sets of labels and feature vectors into model B simultaneously again, and calculate the accuracy until the accuracy reaches the expected value, thus obtaining the initial model B.
[0095] When Model B is a VGG16 model, ReseNet model, or MobileNet model, the feature vector set is converted into a three-dimensional feature vector. This involves reconstructing the feature vector set so that the reconstructed input parameters W*H*C maintain the same feature dimension and satisfy the input size requirements of the convolutional neural network model. The three-dimensional feature vector and its corresponding label are then input into Model B. The loss function of Model B is loss = -(a×log(H1) + b×log(H2) + c×log(H3)), where a, b, and c represent the prediction coefficients for a normal glue image, a defective glue image, and a glue image with reflective areas, respectively. When a new three-dimensional feature vector is input, the prediction coefficient corresponding to the label is set to 1, and other prediction coefficients are set to 0. H1, H2, and H3 represent the predicted probabilities of the normal glue image, the defective glue image, and the glue image with reflective areas output by Model B, respectively. For example:
[0096] The image is classified as defective and labeled as 2. The probability of the model predicting the image as 2 is 0.6, the probability of predicting it as label 1 (normal image) is 0.1, and the probability of predicting it as label 3 (image with reflective areas) is 0.3. Therefore, the image loss is -0×log(0.1)-1×log(0.6)-0×log(0.3).
[0097] The training parameters are as follows: the initial learning rate is set to 0.001, the optimizer can be SGD or Adam, the learning rate decay factor is 0.005, and the loss function is calculated using cross entropy.
[0098] Once the loss value converges or falls below a preset value, the initial model B is obtained.
[0099] The method of this invention can solve the quality monitoring problem of reflective adhesive (LASD) in industrial spraying. By combining reflective features with grayscale features and texture features, it can effectively identify the category to which the image belongs, and the identification results are highly accurate.
[0100] The foregoing description of specific exemplary embodiments of the present invention is for illustrative and descriptive purposes. It is not intended to be exhaustive, nor to limit the invention to the precise forms disclosed; obviously, many changes and variations are possible in accordance with the foregoing teachings. The exemplary embodiments were chosen and described to explain the specific principles of the invention and its practical application, thereby enabling others skilled in the art to implement and utilize various exemplary embodiments of the invention, as well as their different alternatives and modifications. The scope of the invention is intended to be defined by the appended claims and their equivalents.
Claims
1. A high-reflective glue defect detection method, characterized in that: Before actual detection, the detection model is trained by the following steps: S1, collect multiple glue images with reflective regions, use the reflective intensity score as the label of each glue image, and divide the training set A and the test set B according to the preset proportion; The initial reflective intensity score is the product of the gray variance of the modified single glue image and the pixel ratio of the reflective region in the whole image, respectively multiplied by different proportion coefficients; After all the images in the training set obtain the initial reflective intensity score, normalize each initial reflective intensity score to obtain the final reflective intensity score; S2, input the images in the training set A into the convolutional neural network model respectively for training, record the model as model A, and the loss function wherein k is a proportional coefficient, and is a preset value, is the predicted value of the specular intensity score of the i-th image output by the model A. Once the loss value converges or falls below a preset value, the accuracy of model A is validated using images from test set A: when the predicted value of model A's output... In the label If the value is within the specified range, the output prediction is considered accurate; otherwise, it is inaccurate. If the accuracy is higher than the preset threshold, save the current model A; otherwise, expand the number of image samples in the training set A or adjust the model parameters in the model A, retrain the model A until the accuracy is higher than the preset threshold; S3, collect three types of samples: normal glue images, defective glue images, and glue images with reflective regions, label each image according to the category it belongs to, and form a sample data set, the number of images in each sample data set is not less than 500; Match the feature vector set for each image and label in the following way: Input a single image into the model A stored in step S2, and the fully connected layer of model A outputs a one-dimensional feature vector A; Extract the gray feature vector and texture feature vector of the single image, and then concatenate them to the one-dimensional feature vector A in turn to form a feature vector set; Then divide each type of image into the training set B and the test set B according to the preset proportion; S4, use the labels and feature vector sets of the images in the training set B to train model B, which is a machine learning model or a convolutional neural network model; Verify the accuracy of the trained model B using the images in the test set B, if the accuracy is lower than the preset threshold, expand the number of image samples in the training set B or adjust the model parameters in the model B, retrain the model B until the accuracy is higher than the preset threshold; otherwise, save the current model B, and the model training is completed; During actual detection, input the actually collected glue image into the model A stored in step S2, and the fully connected layer of model A outputs a one-dimensional feature A; extract the gray feature vector and texture feature vector of the image, and then concatenate them to the one-dimensional feature vector A in turn to form a feature vector set; Input the feature vector set into the trained model B, and the model B outputs the corresponding category of the image: normal glue image, defective glue image, or glue image with reflective region; Complete the defect detection.
2. The method of claim 1, wherein: In step S2, divide the gray value of each pixel point in the image in the training set A by 255, and scale the image size to a preset size.
3. The method of claim 1, wherein: In step S1, the number of images is not less than 1000; In steps S2 and S4, the preset threshold value corresponding to the accuracy is 0.9-0.
98.
4. The method of claim 1, wherein: In step S1, the initial reflection intensity fraction S i is calculated as follows: The gray variance product of a single image is calculated, denoted as C i ; in the image In step S1, after all the images in the training set obtain the initial reflective intensity score, normalize each initial reflective intensity score to obtain the final reflective intensity score, in the following way: The reflective region is segmented, and the proportion of the reflective region pixel points in the whole image is counted, denoted as R i ; i represents the i-th image, i=1, 2…N, and N represents the total number of images; An initial albedo intensity score S of a single image is calculated i初始 = λ x R i + β x C i + σ, wherein λ and β are proportional coefficients, and σ is a correction value, all of which are set values. The setting method of λ and β is as follows: Find the maximum, minimum initial reflectance fraction in S i初始 , respectively, denoted as S 初始max , S 初始min ; The initial back light intensity fraction corresponding to each image is normalized to obtain the final back light intensity fraction S i = .
5. The method of claim 4, wherein: Take the mean of R i , C i respectively as R 均值 , C 均值 , set λ, β so that the ratio of R is less than 10.
6. The method of claim 1, wherein: In step S2, k takes a multiple of 10; adjust the model parameters in model A, wherein the model parameters include the number of fully connected layers, learning rate, decay, and image scaling size; In step S4, the model parameters in model B are adjusted in the following manner: When model B is a VGG16 model, a resenet model, or a mobileNet model, the model parameters include the number of fully connected layers, learning rate, decay, and preset size of image scaling; When model B is a lightGBM model, the model parameters include the number of iterations, learning rate, minimum gain of node splitting, minimum data amount of single leaf, number of leaf nodes, and maximum depth.
7. The method of claim 1, wherein: The number of nodes of the fully connected layer of model A is 512-2560.
8. The method of claim 1, wherein: In step S3, the method for extracting the gray feature vector includes a gray co-occurrence matrix method, a gray co-occurrence gradient matrix method, and a fuzzy entropy method. The method for extracting the gray feature vector includes an HOG method, a Gabor filter, a SIFT method, and an LBP method.
9. The method of claim 1, wherein: Model A is a VGG16 model, a resenet model, or a mobileNet model. Model B is a lightGBM model, an SVM model, a random forest model, a naive Bayes model, a VGG16 model, a resenet model, or a mobileNet model.
10. The method of claim 1, wherein: In step S4, model B is trained using the labels corresponding to each image in training set B and the feature vector set to obtain an initial model B in the following manner: When model B is a lightGBM model, an SVM model, a random forest model, or a naive Bayes model, M sets of labels and feature vectors are simultaneously input into model B, the accuracy of the classification results of model B is counted, if the accuracy does not reach the expected value, the model parameters in model B are adjusted, and another M sets of labels and feature vectors are input into model B again, the accuracy is counted, until the accuracy reaches the expected value, and an initial model B is obtained; When model B is a VGG16 model, a resenet model, or a mobileNet model, the feature vector set is converted into a three-dimensional feature vector to keep consistent with the feature dimension of the convolutional layer, the three-dimensional feature vector and the corresponding label are input into model B, the loss function of model B is loss=- (a x log (H1) + b x log (H2) + c x log (H3)), wherein a, b, and c represent the prediction coefficients corresponding to normal glue images, defective glue images, and glue images with reflective regions, respectively, when a new three-dimensional feature vector is input, the prediction coefficient corresponding to the label is set to 1, and other prediction coefficients are set to 0; H1, H2, and H3 represent the prediction probabilities of normal glue images, defective glue images, and glue images with reflective regions output by model B, respectively; When the loss value converges or the loss value is less than a preset value, an initial model B is obtained.
Citation Information
Patent Citations
Defect detection method and device for reflective surface
CN113570549A
Glue defect determination method and device, equipment and storage medium
CN115358981A