Method for segmenting paint defects based on mucl framework
By combining the MobileUnetConvLSTM framework with the MobilenetV3-large backbone network and ConvLSTM modules, the problems of insufficient speed and accuracy in vehicle paint defect detection are solved, achieving efficient vehicle paint defect segmentation and adapting to different types of vehicle paint defects.
Patent Information
- Application Number
- CN202310470514.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-27
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2043-04-27
AI Technical Summary
Existing technologies for detecting defects in vehicle paint suffer from low detection efficiency and low accuracy, and are difficult to achieve high-speed, high-precision segmentation of vehicle paint defects, especially lacking adaptability to small targets.
A vehicle paint defect segmentation method based on the MobileUnetConvLSTM framework is adopted. It combines an encoder and a decoder, uses the MobilenetV3-large backbone network and ConvLSTM module, incorporates the scSE attention mechanism, and performs supervised and weakly supervised online learning through a copy-paste data augmentation method with kmeans clustering constraints.
It achieves high-speed, high-precision, and highly adaptable segmentation of automotive paint defects, improving detection efficiency and segmentation accuracy, and adapting to different types of automotive paint defects.
Smart Images

Figure CN116630616B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of machine learning and digital image processing, in particular to a vehicle paint defect segmentation method based on a MUCL framework. BACKGROUND
[0002] Vehicle paint has important functions such as aesthetics, corrosion resistance and sun protection. The surface quality of vehicle paint has become one of the important indicators of vehicles, and the quality control of the surface of vehicle paint plays an increasingly significant role in industrial production. For surface defects such as scratches, cracks and defects produced in the production process, the traditional manufacturing industry mainly detects them by visual inspection with the human eye. The detection has many missed detections and low production efficiency, and cannot provide accurate data. Moreover, it has high labor intensity, high damage to workers, and high recruitment cost.
[0003] As a new type of detection technology that is rapidly developing, automatic surface defect detection based on machine vision has the advantages of high speed and high quality, and can change the current long time-consuming and low one-time detection rate of manual detection, while reducing labor costs. The current industrial scene uses tunnel scanning and phase deflection to obtain paint defect images. Due to the design of the image scanning system and the development of paint processing technology, the paint defect in an image containing defects usually only occupies a small part of the image, and the background is relatively simple. As a whole, the number of different types of paint defects is quite different, and the images containing paint defects are few. Paint defects are typical small targets with the characteristics of small number, class imbalance, weak texture and low contrast.
[0004] The task of semantic segmentation is to classify the input image pixel by pixel and label the object at the pixel level. Most current deep learning-based defect detection methods only frame the defects (object detection), and the actual defect detection effect is not ideal. In fact, if the defect area is extracted at the pixel level (semantic segmentation), not only the position information of the defect is extracted, but also it is closer to the real application scene requirement.
[0005] The Unet framework is widely used in the segmentation field. It is constructed on the basis of FCN, and its U-shaped structure solves the disadvantages of FCN that cannot provide context information and position information. The Unet framework is composed of a feature extraction network and a feature fusion network.
[0006] The Copy-paste data augmentation method obtains rich and novel training data by pasting different objects of different sizes to new background images. Its main idea is: mixed paste + large-scale jitter.
[0007] Therefore, how to complete the vehicle paint defect segmentation task based on the Unet framework with high speed, high precision and high adaptability has become a key problem in current research. Summary of the Invention
[0008] In view of the above problems, the present invention provides a method for segmenting automotive paint defects based on a MUCL framework that at least solves some of the above-mentioned technical problems.
[0009] This invention provides a method for segmenting automotive paint defects based on the MUCL framework, comprising the following steps:
[0010] Obtain the target vehicle paint image;
[0011] The target paint image is input into the trained paint defect segmentation model, and the paint defect segmentation image corresponding to the target paint image is output.
[0012] The paint defect segmentation model adopts the MobileUnetConvLSTM framework and includes an encoder and a decoder.
[0013] Furthermore, the training process of the vehicle paint defect segmentation model is as follows:
[0014] Step 1: Obtain a large number of car paint defect images with segmentation annotations as a supervised training dataset; obtain a large number of unlabeled car paint defect images as a weakly supervised training dataset; preprocess the supervised training dataset and the weakly supervised training dataset respectively.
[0015] Step 2: Perform data augmentation on the preprocessed supervised training dataset and weakly supervised training dataset;
[0016] Step 3: Set up the MobileUnetConvLSTM framework: The MobileUnetConvLSTM framework includes an encoder and a decoder; the encoder uses the MobilenetV3-large backbone network; the decoder uses a ConvLSTM module as the feature fusion network, and the scSE attention mechanism is used after the feature fusion network.
[0017] Step 4: Train the supervised training dataset after data augmentation using the MobileUnetConvLSTM framework to generate the initial model;
[0018] Step 5: Input the data-augmented weakly supervised training dataset into the initial model, output a mask image with defects, and use the mask image as a pseudo-label;
[0019] Step 6: Use the pseudo-labels as labels for the weakly supervised training dataset after data augmentation, and input them into the MobileUnetConvLSTM framework for a new round of training to update the model;
[0020] Step 7: Repeat steps 5 and 6 until the algorithm converges.
[0021] Further, in step one, the supervised training dataset and the weakly supervised training dataset are preprocessed respectively, specifically including:
[0022] The supervised training dataset is divided using cross-validation to obtain K non-overlapping supervised training subsets.
[0023] The weakly supervised training dataset is pre-enhanced using the copy-paste method.
[0024] Furthermore, step two specifically includes:
[0025] The copy-paste method constrained by the kmeans clustering method is used to perform data augmentation on the preprocessed supervised training dataset.
[0026] The copy-paste method is used to directly augment the preprocessed weakly supervised training dataset.
[0027] Furthermore, the copy-paste method constrained by the k-means clustering method performs data augmentation on the preprocessed supervised training dataset; specifically, it includes:
[0028] The k-means clustering method is used to divide the images in the preprocessed supervised training dataset into bright and dark regions. The copy-paste method is then used in the bright and dark regions respectively to perform data augmentation on the preprocessed supervised training dataset.
[0029] Furthermore, the MobileUnetConvLSTM framework includes a 3-layer encoder-decoder structure.
[0030] Furthermore, the MobilenetV3-large backbone network includes 15 bottleneck layers, 1 standard convolutional layer, and 3 pointwise convolutional layers.
[0031] Furthermore, step four also includes updating the weight values; the specific update steps are as follows:
[0032] Perform forward propagation;
[0033] Calculate the loss using a weighted loss function;
[0034] Based on the loss function results, multiple rounds of backpropagation are performed using gradient descent to update and record the weight values.
[0035] The average weight values obtained from the multiple rounds of backpropagation are calculated using the SWA average weight method.
[0036] Furthermore, the weighted loss function is expressed as:
[0037] Loss=aL bce +(2-a)L dice
[0038] Where Loss represents the weighted loss function; L bce L represents the BCE loss function; dice denoted by Dice loss function; 'a' represents the weight.
[0039] Furthermore, in step seven, convergence is achieved when the model's IOU index no longer increases.
[0040] Compared with the prior art, the vehicle paint defect segmentation method based on the MUCL framework described in this invention has the following beneficial effects:
[0041] The paint defect segmentation model of the present invention adopts the Unet framework and includes an encoder and a decoder. The paint defect segmentation model can effectively complete the task of segmenting paint defects.
[0042] The Unet framework of this invention employs a bidirectional ConvLSTM module and an scSE attention mechanism, which improves the segmentation accuracy of the vehicle paint defect segmentation model.
[0043] This invention sets the encoder-decoder structure in the Unet framework to three layers, thereby achieving a lightweight Unet framework structure; at the same time, it combines the Mobilenetv3 structure to improve the speed of the vehicle paint defect segmentation model.
[0044] This invention achieves high adaptability of the vehicle paint defect segmentation model using k-means copypaste and a supervised + weakly supervised online learning method.
[0045] This invention uses a weighted loss function and the SWA average weight method to improve the generalization ability of the paint defect segmentation model.
[0046] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings.
[0047] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0048] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0049] Figure 1 This is a schematic diagram of the framework of the vehicle paint defect segmentation method based on the MUCL framework provided in the embodiments of the present invention.
[0050] Figure 2 This is a schematic diagram of the training process for the paint defect segmentation model provided in an embodiment of the present invention.
[0051] Figure 3 This is a schematic diagram of images in a supervised training dataset provided in an embodiment of the present invention.
[0052] Figure 4 This is a schematic diagram of images in the weakly supervised training dataset provided in an embodiment of the present invention.
[0053] Figure 5 This is a schematic diagram of the MobilenetV3 structure provided in an embodiment of the present invention.
[0054] Figure 6 This is a schematic diagram of a bidirectional ConvLSTM block structure provided in an embodiment of the present invention.
[0055] Figure 7 This is a schematic diagram of the scSE attention mechanism structure provided in an embodiment of the present invention. Detailed Implementation
[0056] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0057] See Figure 1 As shown, this embodiment of the invention provides a method for segmenting automotive paint defects based on the MUCL framework, specifically including the following steps:
[0058] Obtain the target vehicle paint image;
[0059] The target paint image is input into the trained paint defect segmentation model, and the corresponding paint defect segmentation image is output. The paint defect segmentation model adopts a specially designed MobileUnetConvLSTM framework, which includes a specially designed encoder and decoder.
[0060] The training process for the paint defect segmentation model can be found in [link to training process]. Figure 2As shown, the specific steps include the following:
[0061] Step 1: Obtain a large number of car paint defect images with segmentation annotations as a supervised training dataset; obtain a large number of unlabeled car paint defect images as a weakly supervised training dataset; preprocess the supervised training dataset and the weakly supervised training dataset respectively.
[0062] Step 2: Perform data augmentation on the preprocessed supervised training dataset and weakly supervised training dataset;
[0063] Step 3: Set up the MobileUnetConvLSTM framework: The MobileUnetConvLSTM framework includes an encoder and a decoder; the encoder uses the MobilenetV3-large backbone network; the decoder uses a ConvLSTM module as the feature fusion network, and the scSE attention mechanism is used after the feature fusion network.
[0064] Step 4: Train the supervised training dataset after data augmentation using the MobileUnetConvLSTM framework to generate the initial model;
[0065] Step 5: Input the data-augmented weakly supervised training dataset into the initial model, output a mask image with defects, and use the mask image as a pseudo-label;
[0066] Step 6: Use the pseudo-labels as labels for the weakly supervised training dataset after data augmentation, and input them into the MobileUnetConvLSTM framework for a new round of training to update the model;
[0067] Step 7: Repeat steps 5 and 6 until the algorithm converges.
[0068] The following sections will provide a detailed explanation of steps one through seven.
[0069] In step one above, to complete the segmentation task, this invention uses the copy-paste approach to fuse a varying number of images with different defects into a single image, and uses all of the generated images as the training set; the specific method is as follows:
[0070] In this embodiment of the invention, more than 200 960x480 images of vehicle paint defects with segmentation annotations were prepared; each image of vehicle paint defects contains a number and size of defects, as detailed below. Figure 3These images of paint defects with segmentation annotations are used as a supervised training dataset. Cross-validation is used to divide the supervised training dataset into K non-overlapping supervised training subsets. Then, the model is trained and validated K times. Each time, one subset is used to validate the model, and the other K-1 subsets are used to train the model. Finally, the average of the training error and validation error of these K iterations is calculated.
[0071] In addition, in this embodiment of the invention, more than one thousand unlabeled images of vehicle paint defects were prepared, see details below. Figure 4 These unlabeled images of paint defects were used as a weakly supervised training dataset, and the dataset was also divided using cross-validation. The copy-paste method was then used to pre-enhance this weakly supervised training dataset.
[0072] In step two above, due to the small number of training datasets, small target size, and large brightness variations, the traditional copy-paste method was first used in this embodiment to enrich the dataset and mitigate the impact of insufficient data. The copy-paste method is essentially a combination of hybrid pasting and large-scale jittering. Hybrid pasting involves copying the object from the original image and then pasting it into a new image to increase the number of positive samples. Large-scale jittering involves significant size changes in the pasted object. This method copies different objects of varying sizes into a new background image, creating rich and novel training data. However, due to the undulating surface of the car, the reflection components in the image change significantly, resulting in a clear regional distribution of brightness. This causes the copied and pasted target to carry the domain information of the original target. Therefore, directly using the copy-paste method is ineffective.
[0073] K-means clustering is a classic clustering method. This method first randomly selects K centroids, then assigns all data points to the nearest centroid based on distance, resulting in K clusters. The mean of these clusters is then calculated to obtain K new centroids. These new centroids are further divided into K new clusters, and this process is repeated until the algorithm converges. This algorithm divides the dataset into K clusters, ensuring small intra-cluster distances and large inter-cluster distances. Therefore, in this embodiment of the invention, the K-means clustering method is chosen to constrain the copy-paste process; the K-means clustering method is first used to divide the image into regions based on brightness, and the silhouette coefficient is used as an evaluation metric.
[0074] The profile coefficient is expressed as
[0075]
[0076] The formula for calculating the average distance is:
[0077]
[0078] Where a(i) represents the average distance of other samples within the cluster to which sample i belongs. If there is only one sample i in the cluster, then let S(i) = 0. In the formula for average distance, i represents the i-th sample; j represents other sample points in the same class as sample i; n is the number of sample points in the same class as i; b(i) represents the minimum average distance between the i-th sample and samples from other clusters. At this time, j represents a sample point in a class that is different from i; n is the number of sample points in that class. The effect is better when S approaches 1.
[0079] After analyzing and testing the data, this embodiment of the invention ultimately decided to use the k-means clustering method to divide the preprocessed supervised training dataset into four regions (bright, moderately bright, moderately dark, and dark) according to brightness. Within the same region, the copy-paste method is used to reduce the negative impact of direct copy-paste and effectively compensate for the small size and limited number of defects in the supervised training dataset, thus achieving data augmentation processing on the preprocessed supervised training dataset. For the weakly supervised training dataset, the copy-paste method is directly used for data augmentation processing. Two to five images are extracted from the weakly supervised training dataset and merged into a single image using the copy-paste method. Each time, 400 to 1000 defect images are generated for training.
[0080] In step three above, the original Unet network structure is a 5-layer encoder-decoder structure. Since excessively deep networks are not easy to converge on small datasets and are prone to overfitting, and the 5-layer encoder-decoder structure has the defect of over-extracting semantic information for the purpose of this embodiment of the invention, this embodiment of the invention performs a lightweight operation on the Unet framework, reducing the encoder-decoder structure of the Unet framework to 3 layers. On the one hand, this avoids semantic information redundancy and makes it easier to converge; on the other hand, it accelerates the network inference speed and prevents overfitting. Based on this, the MobileUnetConvLSTM framework, abbreviated as MUCL framework, is formed in this application.
[0081] The MobileUnetConvLSTM framework proposed in this embodiment uses the MobilenetV3-large backbone network as the encoder; this MobilenetV3-large backbone network includes 15 bottleneck layers, 1 standard convolutional layer, and 3 pointwise convolutional layers; firstly, the bottleneck part of the MobilenetV3 network uses... Figure 5The model is constructed from the blocks shown. This block has an inverted residual structure, utilizing the linear bottleneck structure of the bottleneck layer and the inverted residual structure to improve feature extraction capabilities while controlling the number of parameters, thus helping to solve the vanishing and exploding gradient problems. Secondly, within some blocks, standard 5x5 depthwise convolutions are used instead of the original 3x3 depthwise convolutions, reducing the number of parameters while maintaining a certain level of accuracy. Furthermore, an improved compression-activation mechanism is used within the structure to increase the proportion of effective weights, resulting in a more efficient model. Finally, some blocks use hard-swish activation functions instead of ReLU activation functions to improve model accuracy.
[0082] This invention uses a MobilenetV3-large backbone network as the encoder. In existing Unet networks, if the MobilenetV3 structure is used directly, the output channels for each skip layer are set to (16, 24, 40, 48, 96). However, in this invention, a MobilenetV3-large backbone network is used, where the MobilenetV3 network structure is adjusted to output channels of (16, 32, 64) per layer. Furthermore, considering the characteristics of weak targets, this invention removes two skip output layers and adjusts the network structure accordingly to achieve the corresponding channel outputs. Based on this, this invention ensures high accuracy while significantly reducing the number of network parameters, making the network easier to converge and improving the convergence speed.
[0083] In this embodiment of the invention, the decoder in the MobileUnetConvLSTM framework uses a bidirectional ConvLSTM module as the feature fusion network, and employs an scSE attention mechanism after the feature fusion network to suppress invalid information. Existing Unet decoders use a concatenated fusion + fully convolutional network structure; concatenated feature fusion is too simplistic and lacks effectiveness, while the feature extraction structure of fully convolutional networks is too cumbersome. The decoder in this embodiment is a bidirectional ConvLSTM network, which enables feature fusion and feature extraction to be performed in one step with higher accuracy. The scSE mechanism added to the decoder enhances the network's ability to capture weak targets.
[0084] Next, the ConvLSTM module and scSE attention mechanism in this step will be explained separately:
[0085] 1. ConvLSTM module:
[0086] Long Short-Term Memory (LSTM) networks evolved from Recurrent Neural Networks (RNNs). An RNN is a network containing loops. In this loop structure, each module A of the neural network reads an input x(t) and outputs a value h(t), continuously looping to pass information from the current step to the next. The formula is expressed as:
[0087] h t+1 =F(Wx t+1 +h t +b)
[0088] Where h represents the output of the RNN network; x represents the input of the RNN network; t is the time step; W represents a linear transformation; b is the bias; and F represents the activation function.
[0089] Because the structure of RNNs cannot solve the problem of long-term dependencies, LSTM networks were proposed. LSTM and RNNs use different functions to compute the hidden states. The mechanism of LSTM can be summarized as input-forget-output. The first step in LSTM determines what information to discard from the cell state, then determines what new information to store in the cell state, then updates the old cell state, and finally outputs the filtered data. This can be summarized by the following formula:
[0090] g t =σ(W f .[h t-1 ,x t ]+b f )
[0091] i t =σ(W i .[h t-1 ,x t ]+b i )
[0092]
[0093]
[0094] o t =σ(W o .[h t-1 ,x t ]+b o )
[0095] h t =o t *tanh(c t )
[0096] In the formula, g represents the forgotten information; i represents the input of the LSTM network; c represents the output of the LSTM network; h is the hidden layer output; o and These represent the results of fusing the previous hidden layer output and the current input using different methods; the subscript t indicates the time step; f indicates the forget gate; c indicates the output gate; and i indicates the input gate.
[0097] The ConvLSTM module enables LSTM networks to process two-dimensional information. It replaces the multiplication in the LSTM network with convolution, thereby gaining the ability to extract spatial and temporal information simultaneously.
[0098] The bidirectional ConvLSTM module structure used in this embodiment of the invention is as follows: Figure 6 As shown, this embodiment of the invention uses a bidirectional ConvLSTM module to replace the feature fusion process in the Unet framework to enhance the fusion context information, and utilizes a bidirectional structure to comprehensively consider information from both the forward and backward paths. This module enables the network to have faster convergence speed and higher accuracy.
[0099] 2. scSE attention mechanism:
[0100] The scSE attention mechanism consists of two parts: the SSE spatial attention mechanism and the CSE channel attention mechanism. The structure is as follows: Figure 7 As shown.
[0101] The CSE channel attention mechanism is a compression and activation network. The compression part compresses global spatial information and learns features in the channel dimension. The activation part assigns different weights to each channel. Specifically, the feature map is compressed in spatial dimension using global average pooling. Then, two 1×1×1 convolutions are used to process the information to obtain a C-dimensional vector. Then, the sigmoid function is used for normalization. Finally, channel-wise multiplication is used to obtain the information-calibrated feature map.
[0102] The SSE spatial attention mechanism can transform various deformed data in space and automatically capture important regional features. It ensures that after image cropping, translation, or rotation, the result is still the same as the original image before the operation. Specifically, it directly applies a 1×1×1 convolution to the feature map to compress the number of channels to 1; then it uses sigmoid activation to obtain a spatial attention map; finally, it is directly applied to the original feature map to complete the spatial information calibration.
[0103] The scSE attention mechanism used in this embodiment of the invention combines the SSE spatial attention mechanism with the CSE channel attention mechanism. It focuses on information that is more critical to the current task from a large amount of input information, reduces attention to other information, and filters out irrelevant information. This can solve the problem of information overload and improve the efficiency and accuracy of task processing. Using spatial and channel attention mechanisms on the traditional Unet framework can solve the problem of false detection in non-defect areas similar to defects.
[0104] In steps four and six, during the training process, the weight values are also updated. The specific update steps are as follows: perform forward propagation; obtain the weighted loss function; based on the loss function results, perform multiple rounds of backpropagation using gradient descent, update the weight values and record them; and use the SWA average weight method to calculate the average value of the weight values obtained in the last few rounds of backpropagation.
[0105] BCE and Dice loss functions are two commonly used loss functions in segmentation tasks. BCE focuses on addressing uneven segmentation, while Dice focuses on addressing uneven segmentation between foreground and background. Furthermore, the contributions of BCE and Dice differ for different tasks. Therefore, this embodiment selects a weighted sum of BCE and Dice loss functions as the weighted loss function, comprehensively considering their advantages to address uneven segmentation. This weighted loss function is expressed as:
[0106] L bce =-(ylog(p(x))+(1-y)log(1-p(x)))
[0107]
[0108] Loss=aL bce +(2-a)L dice
[0109] Where Loss represents the weighted loss function; L bce Let p(x) represent the BCE loss function; p(x) is the model output, and y is the true label; L dice denoted by Dice loss function; X represents the pixel label of the real segmented image; Y represents the pixel category of the segmented image predicted by the model; a represents the weight.
[0110] After several rounds of weight updates, the training enters its later stages. To address the weight oscillation problem and obtain a more generalized solution, this embodiment of the invention uses the SWA (Scattered Average Weight) method. The SWA method takes k nodes on the optimization trajectory at the end of the optimization process and uses the average weight as the final weight to obtain the final network weight. This makes the final weight located more centrally on the loss surface, alleviating the weight oscillation problem, obtaining a smoother solution, and achieving a more generalized solution compared to traditional training.
[0111] In this embodiment of the invention, a round of supervised training is completed using a weighted loss function and the SWA average weight method to generate an initial model.
[0112] In step five above, the generated initial model is used to perform inference on the unlabeled image, that is: the weakly supervised training dataset after data augmentation is input into the initial model, the defective mask image is output, and the mask image is used as a pseudo label;
[0113] In step six above, pseudo-labels are used to input learning and update weights. That is, the pseudo-labels are used as labels for the weakly supervised training dataset after data augmentation and input into the Unet framework for a new round of training to update the model.
[0114] In step seven above, the updated model is used to re-infer the labels of the unlabeled images, and then the updated labels are used to learn and update the weights. This process is repeated until the algorithm converges, that is, until the model's IOU index no longer increases.
[0115] This invention provides a method for segmenting car paint defects based on the MUCL framework, proposing a "supervised + weakly supervised" training mode. This supervised + weakly supervised online learning method is a learning approach between supervised and unsupervised learning. This method utilizes a large number of unlabeled samples and a small number of labeled samples to train the classifier, solving the problem of insufficient labeled samples. In this embodiment, a supervised learning process is first used to generate an initial model. Then, the initial model is used to infer pseudo-labels from unlabeled images. These pseudo-labels are then used to re-invest in learning and updating the weights. The new model is then used to regenerate pseudo-labels. After several iterations, a more accurate and generalized model is obtained. Through these steps, this method can obtain a high-precision, high-speed, and highly adaptable car paint defect segmentation model. This model can segment images containing car paint defects and output the results.
[0116] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A method for segmenting automotive paint defects based on the MUCL framework, characterized in that, Includes the following steps: Obtain the target vehicle paint image; The target paint image is input into the trained paint defect segmentation model, and the paint defect segmentation image corresponding to the target paint image is output. The paint defect segmentation model adopts the MobileUnetConvLSTM framework and includes an encoder and a decoder; The training process of the vehicle paint defect segmentation model is as follows: Step 1: Obtain a large number of car paint defect images with segmentation annotations as a supervised training dataset; obtain a large number of unlabeled car paint defect images as a weakly supervised training dataset; preprocess the supervised training dataset and the weakly supervised training dataset respectively. Step 2: Perform data augmentation on the preprocessed supervised training dataset and weakly supervised training dataset; Step 3: Set up the MobileUnetConvLSTM framework: The MobileUnetConvLSTM framework includes an encoder and a decoder; the encoder uses the MobilenetV3-large backbone network; the decoder uses a ConvLSTM module as the feature fusion network, and the scSE attention mechanism is used after the feature fusion network. Step 4: Train the supervised training dataset after data augmentation using the MobileUnetConvLSTM framework to generate the initial model; Step 5: Input the data-augmented weakly supervised training dataset into the initial model, output a mask image with defects, and use the mask image as a pseudo-label; Step 6: Use the pseudo-labels as labels for the weakly supervised training dataset after data augmentation, and input them into the MobileUnetConvLSTM framework for a new round of training to update the model; Step 7: Repeat steps 5 and 6 until the algorithm converges.
2. The method for segmenting automotive paint defects based on the MUCL framework as described in claim 1, characterized in that, In step one, the supervised training dataset and the weakly supervised training dataset are preprocessed respectively, specifically including: The supervised training dataset is divided using cross-validation to obtain K non-overlapping supervised training subsets. The weakly supervised training dataset is pre-enhanced using the copy-paste method.
3. The method for segmenting automotive paint defects based on the MUCL framework as described in claim 1, characterized in that, Step two specifically includes: The copy-paste method constrained by the kmeans clustering method is used to perform data augmentation on the preprocessed supervised training dataset. The copy-paste method is used to directly augment the preprocessed weakly supervised training dataset.
4. The method for segmenting automotive paint defects based on the MUCL framework as described in claim 3, characterized in that, The copy-paste method constrained by the k-means clustering method performs data augmentation on the preprocessed supervised training dataset; specifically, it includes: The k-means clustering method is used to divide the images in the preprocessed supervised training dataset into bright and dark regions. The copy-paste method is then used in the bright and dark regions respectively to perform data augmentation on the preprocessed supervised training dataset.
5. The method for segmenting automotive paint defects based on the MUCL framework as described in claim 1, characterized in that, The MobileUnetConvLSTM framework includes a 3-layer encoder-decoder structure.
6. The method for segmenting automotive paint defects based on the MUCL framework as described in claim 1, characterized in that, The MobilenetV3-large backbone network includes 15 bottleneck layers, 1 standard convolutional layer, and 3 pointwise convolutional layers.
7. The method for segmenting automotive paint defects based on the MUCL framework as described in claim 1, characterized in that, Step four also includes updating the weight values; the specific update steps are as follows: Perform forward propagation; Calculate the loss using a weighted loss function; Based on the loss function results, multiple rounds of backpropagation are performed using gradient descent to update and record the weight values. The average weight values obtained from the multiple rounds of backpropagation are calculated using the SWA average weight method.
8. The method for segmenting automotive paint defects based on the MUCL framework as described in claim 7, characterized in that, The weighted loss function is expressed as follows: Loss=aL bce +(2-a)L dice Where Loss represents the weighted loss function; L bce L represents the BCE loss function; dice denoted by Dice loss function; 'a' represents the weight.
9. The method for segmenting automotive paint defects based on the MUCL framework as described in claim 1, characterized in that, In step seven, convergence is achieved when the model's IOU index stops increasing.
Citation Information
Patent Citations
Construction method of automobile paint film defect recognition system based on deep learning
CN110335238A
Lightweight defect detection method for automobile body paint surface defect detection
CN115619726A
Retinal vessel segmentation method and system
CN115661168A