Coating surface defect grade evaluation instrument and detection method
The identification of coating defects through industrial cameras and semantic segmentation models solves the problem of the inability of existing technologies to identify defect locations and grade assessments, achieves accurate identification and grade assessment of coating surface defects, and improves the accuracy and consistency of detection.
Patent Information
- Application Number
- CN202410250433.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-05
- Publication Date
- 2024-08-23
AI Technical Summary
The existing technology cannot accurately identify the specific location, area and size of coating defects, cannot perform standard grade assessment, and is difficult to evaluate the anti-aging ability of coatings.
Industrial cameras, industrial PC computers, semantic segmentation models and adaptive light sources are used to identify and mark coating surface defects through the semantic segmentation model, calculate the area and size of the defects, and conduct grade assessments according to GB standards.
It achieves accurate identification and grading of coating surface defects, reduces the subjectivity of manual rating, improves the accuracy and quantification of detection, supports the detection of multiple coating materials, and enhances the consistency of detection.
Smart Images

Figure CN118533838A
Abstract
Description
Technical Field
[0001] The invention relates to the field of coating surface defect detection and grade assessment, in particular to a coating surface defect grade assessment instrument and a detection method. Background Art
[0002] Paints are generally made of four major types of substances: film-forming substances, pigments / fillers, dispersing media and additives, and are produced and processed through a certain process. The paint industry plays an important role in serving and supporting multiple industries in the national economy and is widely used in machinery manufacturing, transportation, light industry, chemical industry, construction and other industries. The paint industry plays an important role in serving and supporting multiple industries in the national economy and is an indispensable functional material.
[0003] The stability of coatings is an important indicator. The quality of the coating surface not only determines the user experience, but also has a very important impact on the beauty, personalization and value retention rate of the coating object. However, due to problems such as manufacturing process, temperature and humidity, oxidation, etc., various coatings on the market may have defects in the coating, affecting its appearance and protective performance of the substrate material. Therefore, it is particularly important to test the performance of the coating under different experimental conditions and evaluate and grade the defects that occur during the experiment. However, due to the wide variety of coatings and the large changes in substrate materials, there are many types and forms of coating defects, and there is a lack of quantitative defect evaluation indicators. Therefore, the defect detection and evaluation of the coating is still carried out by staff with relevant knowledge background using naked eye observation, and it is difficult to ensure the efficiency of the detection and the consistency of the evaluation.
[0004] A coating defect detection system and method based on machine vision (CN113030108A) includes an image acquisition module, an image acquisition card, an industrial computer computing platform, a workpiece conveying device, a screening execution device, and a detection model based on a neural network. The industrial computer computing platform randomly cuts and scales the collected coating detection image of the workpiece to be tested and inputs it into the detection model based on the neural network in real time to output the detection classification result, and converts the classification result into a control signal and sends it to the screening execution device. This technology can automatically detect, classify and screen the surface defects of the workpiece coating. However, the prior art still has the following problems: it only identifies the type of defect, but cannot identify the specific location of the defect, nor can it calculate the area and size of the defect, the severity of the defect and other indicators. It is aimed at products with coatings to detect whether the coating is qualified, and it is impossible to perform standard grade assessment on defects generated under laboratory conditions, and it cannot be used to study the strength of the anti-aging ability index of the coating itself. Summary of the invention
[0005] In view of the above problems, the present invention proposes a coating surface defect grade assessment instrument and detection method, including an industrial camera, an industrial PC, a detection device, a semantic segmentation model, and an adaptive light source. Compared with the manual rating method, the device and method can count the geometric quantitative features such as the area and size of the defect, overcome the subjectivity of manual rating, and can continuously learn and deploy according to the data, thereby improving the accuracy and quantifiable statistics of the detection rating.
[0006] The purpose of the present invention is achieved by at least one of the following technical solutions.
[0007] A coating surface defect grade assessment instrument, comprising a chassis, an inner darkroom, a camera bracket, an industrial camera, light sources of different working conditions, an imaging background plate, a movable guide rail, and an industrial PC computer;
[0008] There is a moving rail at the bottom of the chassis. The industrial camera is installed at the top of the moving rail through the camera bracket. The light sources of different working conditions are installed below the moving rail through the light source bracket. The imaging background plate is fixed at the center of the bottom of the chassis. There are two linear sliders on both sides of the camera bracket and the light source bracket. The industrial PC is located at the rear of the chassis. The industrial camera obtains the image and transmits it to the detection system to complete a detection.
[0009] The board to be inspected is placed on the imaging background plate, the chassis is closed, the light source is turned on according to the inspection requirements, the industrial camera captures the image and sends it to the industrial PC, and the surface defects of the board to be inspected are graded through the inspection system.
[0010] Furthermore, the industrial camera is connected to the outer side of the camera bracket, and the camera bracket and the guide rail are connected via a linear slider, and the slider is fixed on the movable guide rail;
[0011] The light sources of different working conditions are connected to the movable guide rails through two linear sliders. The light source and the background plate have a fixed distance. There are two light sources, one high and one low. The inner groove of the low light source opens inwards, and the inner groove of the high light source opens downwards. A specific type of LED light strip is placed in the inner groove.
[0012] The background plate is a rectangular resin block located in the center of the bottom of the chassis, and has white and black colors for detecting paint plates of different colors, wherein the paint plates are placed in the area on the background plate;
[0013] The inner surface of the darkroom of the inner box is sprayed with black paint, and the darkroom is fixed to the bottom of the chassis;
[0014] The linear guides on both sides of the camera bracket and the light source perform up and down translational motion on the moving guides, thereby adjusting the relative positions of the industrial camera, light source, and imaging background plate to achieve the best imaging effect.
[0015] Furthermore, the detection system includes: an image acquisition module, a rating software module, a detection model system based on semantic segmentation, and an industrial computer computing platform;
[0016] The image acquisition module selects a light source for high-definition imaging and transmits the image to the rating software module;
[0017] The rating software module detects the image through a semantic segmentation model and performs post-processing and rating on the detection results;
[0018] The semantic segmentation detection model is used to build a semantic segmentation model for detecting defects and adjust it according to user data.
[0019] The industrial computer computing platform stores the results of the semantic segmentation detection model processing in a table and interacts with the user.
[0020] Further, the following steps are included:
[0021] (S1) The plate to be detected is placed on the imaging background plate, and a light source is selected according to the detection mode;
[0022] (S2) The industrial camera collects images and transmits the collected images to the industrial computer computing platform through the SDK;
[0023] (S3) The rating software preprocesses the image, and the semantic segmentation model identifies and annotates the coating surface defects in the image and assesses the defect level.
[0024] Furthermore, in step (S3), the preprocessing uses contour detection and threshold segmentation to extract the minimum enclosing area of the plate to be detected so as to remove the background, and uses the Lanczos interpolation algorithm to adjust the size of the foreground area;
[0025] In step (S3), the grade assessment is based on GB 1766-2008 as the general reference principle, the blister defect rating is based on GBT 30789.2-2015, the rust defect rating is based on GBT 30789.3-2015, the peeling defect rating is based on GBT 30789.8-2015, and the reference object is the binary comparison chart in the standard appendix.
[0026] To implement the detection method of the coating surface defect grade assessment instrument, the process of training, exporting and deploying the semantic segmentation model in step (S3) is as follows:
[0027] (S1) Use the inspection equipment to directly collect samples for each type of defect;
[0028] (S2) Annotate sample images at the pixel level, and use the annotated images combined with data augmentation strategies to train and evaluate the semantic segmentation model;
[0029] (S3) The trained semantic segmentation model is exported as an ONNX model using the ONNX export tool, and the corresponding model is loaded using ONNXRUNTIME on the software side to accelerate the processing of an image on the CPU.
[0030] Furthermore, the sample image in step (S1) is derived from an aging experiment of paint or varnish, where the paint is applied on a substrate and various surface defects are generated through the aging experiment, mainly including coating blistering, rusting, and coating peeling.
[0031] Furthermore, the data augmentation strategies in step (S2) include random center cropping, random noise, random padding, random horizontal and vertical flipping, random image distortion, and random affine transformation.
[0032] Furthermore, the semantic segmentation model in step (S2) includes: PPLiteSeg, DDRNet, SegFormer, and PreciseNet, wherein PPLiteSeg is used to detect the area covered by the coating, DDRNet and SegFormer are used to detect rust defects and peeling defects, and PreciseNet is used to detect blister defects;
[0033] The model parameter optimizer used in the training and evaluation in step (S2) is AdamW, and the parameters are updated with learning rate warm-up and learning rate polynomial decay. The training process uses a mixed loss function of cross entropy and mean square error, and the two are added with weights of 0.9 and 0.1 as the final calculation loss. The evaluation indicator uses Class IoU to focus on the category identification of the defect itself.
[0034] Furthermore, the semantic segmentation model uses InstanceNorm2D normalization to reduce the impact of huge differences between samples and huge differences in feature scales on model convergence;
[0035] The PreciseNet adopts a structure similar to SegFormer but uses convolution and local attention instead of VisionTransformer. It also adopts a structural design that retains sufficient detail features and considers lightweight design, so that the model can achieve both accuracy and real-time performance in images with large resolution.
[0036] Compared with the prior art, the present invention has the following beneficial effects:
[0037] The device of the present invention has a compact structure, and is composed of a chassis, a touch screen, an industrial camera, an industrial control computer, and an adaptive light source module. The operation is very simple and convenient, and it supports the detection and rating of various coating materials. It has the functions of data management and statistical analysis, and can more objectively evaluate the anti-aging performance of a coating. Compared with manual rating, it reduces the ambiguity in the rating process, can extract absolute quantitative indicators, and greatly increases the consistency of the evaluation of coating surface defect levels.
[0038] The surface defect identification method of the present invention adopts semantic segmentation, which is one of the branches of deep learning. Traditional defect detection methods rely on simple threshold segmentation or edge detection technology, which are prone to errors when dealing with complex backgrounds or defect shapes that vary. Semantic segmentation understands the semantic content of the image through a deep learning model, and can more accurately identify defects. It can maintain high accuracy even in complex backgrounds or changing lighting conditions. Semantic segmentation can not only identify the existence of defects, but also provide detailed information such as the precise location, shape and size of the defects. This information can further analyze coating surface defects. Furthermore, the semantic segmentation model of the present invention adopts the normalization method of Instance, and designs a model for detecting ultra-small defects that can be used for real-time reasoning, which can achieve higher accuracy and recognition.
[0039] The software system of the present invention adopts a loosely coupled design method, which is easy to embed ratings of new surface defect types. The calculation criteria for the ratings can be flexibly written according to the corresponding ISO standards. At the same time, the real-time reasoning of the semantic segmentation model uses ONNXRUNTIME, which can be significantly accelerated on the CPU, making the system more convenient to use. At the same time, the software does not rely on a specific deep learning framework, which brings greater flexibility. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is a schematic diagram of the device structure of the present invention;
[0041] Figure 2 A flowchart of defect level assessment in an embodiment of the present invention;
[0042] Figure 3 A flowchart of constructing and deploying a defect identification semantic segmentation model in an embodiment of the present invention;
[0043] Figure 4 It is a structural and process design diagram of the defect level assessment software in an embodiment of the present invention;
[0044] Figure 5 Schematic diagram of the architecture of the semantic segmentation model SegFormer used for rust and spalling defects in an embodiment of the present invention;
[0045] Figure 6Schematic diagram of the architecture of PreciseNet, a semantic segmentation model designed specifically for blister defects in an embodiment of the present invention;
[0046] Figure 7 Detailed schematic diagram of the internal modules of the PreciseNet model in an embodiment of the present invention;
[0047] Figure 8 Schematic diagram of the structural design of the internal submodules of the PreciseNet model in an embodiment of the present invention;
[0048] Fig. 9 A sample image of a blister defective plate in an embodiment of the present invention;
[0049] Fig.10 A sample image of a plate with peeling defects in an embodiment of the present invention;
[0050] Fig.11 is a sample image of a rust defective plate in an embodiment of the present invention;
[0051] Fig.12 is the Class IOU curve of the semantic segmentation model on the bubble dataset in an embodiment of the present invention;
[0052] Fig.13 PR curve of the semantic segmentation model on the bubble dataset in an embodiment of the present invention;
[0053] Explanation of the accompanying drawings: 1. Chassis; 2. Inner darkroom; 3. Camera bracket; 4. Industrial camera; 5. Light source and its clamping structure; 6. Imaging background plate; 7. Movable guide rail. DETAILED DESCRIPTION
[0054] The present invention is further described in detail below in conjunction with embodiments and drawings, but the embodiments of the present invention are not limited thereto.
[0055] Example:
[0056] like Figure 1 The coating surface defect grade assessment instrument shown includes a chassis 1, an inner darkroom 2, a camera bracket 3, an industrial camera 4, a light source 5, an imaging background plate 6, and a movable guide rail 7.
[0057] The detection board is placed on the background board 6, the chassis 1 is closed, the light source 5 is turned on according to the detection requirements, the camera captures the image and submits it to the industrial PC computer, and the surface defect level of the paint board on the background board 6 is evaluated through the detection system.
[0058] The bottom of the chassis 11 supports two smooth moving rails 7, the top of the moving rails 7 is connected to a group of industrial cameras 4, the bottom of the moving rails 7 is connected to light sources 5 for different working conditions, the imaging background plate 6 is fixed in the center of the bottom of the chassis, and there are two linear sliders on both sides of the camera bracket 3 and the light source bracket. The industrial PC is located at the rear of the chassis 1, and all operations are completed with the help of the touch screen installed on the chassis door. The camera 3 obtains the image and transmits it to the detection system to complete a detection.
[0059] The industrial camera 4 is connected to the outer side of the camera bracket 3, and the camera bracket 3 and the guide rail 7 are connected through a linear slider, and the slider is fixed on the movable guide rail 7 through a plum screw;
[0060] The light source 5 is connected to the movable guide rail 7 through two linear sliders. The light source 5 is at a fixed distance from the background plate 6. There are two light sources, one high and one low. The inner groove of the low light source opens inward, and the inner groove of the high light source opens downward. A specific type of LED light strip is placed in the inner groove. The background plate 6 is a rectangular resin block located at the bottom center of the chassis 1. The colors are white and black for detecting paint plates of different colors. The paint plate is placed in a certain area on the background plate. The inner surface of the inner darkroom 2 is sprayed with black paint, and the darkroom and the bottom of the chassis 1 are fixed by bolts.
[0061] The camera support 3 and the light source 5 perform up and down translational motion on the movable guide rail 7 via the linear guide rails on both sides thereof, thereby adjusting the relative positions of the industrial camera 4, the light source 5, and the imaging background plate 6 to achieve the best imaging effect.
[0062] As a preferred embodiment, the industrial camera 4 is connected to the outer side of the camera bracket 3, the camera bracket 3 and the guide rail 7 are connected through a linear slider, and the slider is fixed to the movable guide rail 7 through a plum screw;
[0063] The light sources 5 of different working conditions are connected to the movable guide rail 7 through two linear sliders. The light source 5 and the background plate 6 have a fixed distance. There are two light sources, one high and one low. The inner groove of the low light source opens inward, and the inner groove of the high light source opens downward. A specific type of LED light strip is placed in the inner groove.
[0064] The background plate 6 is a rectangular resin block located at the bottom center of the chassis 1, and has white and black colors for detecting paint plates of different colors, wherein the paint plates are placed in the area on the background plate 6;
[0065] The inner surface of the inner box darkroom 2 is sprayed with black paint, and the darkroom is fixed to the bottom of the chassis 1 by bolts;
[0066] The camera support 3 and the light source 5 perform up and down translational motion on the movable guide rail 7 via the linear guide rails on both sides thereof, thereby adjusting the relative positions of the industrial camera 4, the light source 5, and the imaging background plate 6 to achieve the best imaging effect.
[0067] like Figure 3 , Figure 4 As shown, the detection system includes: an image acquisition module, a rating software module, a detection model system based on semantic segmentation, and an industrial computer computing platform; the image acquisition module selects a suitable light source for high-definition imaging and submits the image to the rating software, the rating software module converts the image into a specific format and inputs the exported semantic segmentation model for detection and post-processes and grades the detection results, the semantic segmentation detection model system is used to construct a semantic segmentation model for detecting defects and adjust it according to user data, and the industrial computer computing platform stores the processed results in a table and interacts with the user.
[0068] The image acquisition module includes an industrial camera, a light source controller, and an imaging background plate. The combination of the three can fully capture the relevant defect information on the coating surface. The exposure and white balance of the industrial camera are adjusted and fixed in the experimental environment to ensure the accuracy of the image color, so that the analysis software can more accurately identify slight differences in color. The light source controller selects different types of light sources according to different detection modes so that the characteristics of the defects can be optimally highlighted to prevent missed detection and false detection of defects. The imaging background plate is used to produce a more obvious color difference with the board to be detected, so that the background removal algorithm can better locate the rectangular area of the detection board.
[0069] As an embodiment, the industrial camera selects a CMOS area array camera. Modern CMOS sensors can provide a wide dynamic range and can capture high-quality images in industrial environments with large changes in light conditions. At the same time, with the advancement of technology, the image quality of CMOS sensors continues to improve and can now compete with CCD sensors, and even surpass CCD in some applications. Due to the tiny nature of some coating defects, a relatively large resolution is required to capture them. The selected CMOS camera has a resolution of 5472×3648, a target size of 1 inch, a bit depth of 10 bits, a data interface of USB3.0, and a rolling shutter exposure. The focal length of the lens is selected to be 25mm, and the working distance is fixed at 50-60cm.
[0070] The distance between the camera and the light source is manually adjusted to an optimal value. The light sources include a ring light source for high-angle bright field lighting and a ring light source for low-angle dark field lighting. Bright field lighting is used to detect the peeling and rusting characteristics of the coating surface. The characteristics of this type of defect are obvious contrast and large size of the defect. This light source can well highlight the color characteristics. The ring light source ensures the uniformity of the light. The excess stray light is absorbed by the black inner wall to avoid glare that affects the imaging effect of the camera. Dark field lighting is used to highlight geometric features and has a good ability to highlight the blistering on the coating surface. With this low-angle light source, it can clearly image tiny bubbles. For coatings with reflective properties, normal top lighting may cause strong direct reflections, thereby interfering with image acquisition. Dark field lighting reduces this direct reflection. At the same time, because the light source is at a low angle, it reduces the shadows produced by the object itself, which may cover or simulate defects under normal lighting conditions. Using it can significantly improve the efficiency and accuracy of the detection process.
[0071] like Figure 5 As shown in the figure, the detection system is installed on an industrial PC computer. The industrial PC computer adopts a microcomputer host and uses a CPU to complete all the detection processes. The industrial computer is connected to an industrial camera to obtain images and is connected to a touch screen to complete the user interface interaction. In a complete defect level assessment process, the user first places the board to be inspected and selects the detection mode. Then the rating software preprocesses the image, and then passes the preprocessed image to the semantic segmentation model to identify and mark the coating surface defects in the image. Finally, the defect level is assessed according to GB 1766-2008 and the marked result is superimposed on the original image to show it to the user.
[0072] Industrial PC computers, light source controllers, light sources, touch screens, and power modules together constitute the hardware part of the computing platform. The power module supplies power to the entire device. The industrial computer is equipped with a Windows system and manages the data of each test by date. The modules in the rating software are designed separately to facilitate the addition of new detection functions. The semantic segmentation model is built through a deep learning framework. The constructed model is exported in ONNX format and loaded by the rating software. In actual use, the corresponding model file can be directly replaced to complete the update of the defect detection part. The pre-processing part of the image includes extracting the area of the test board and standardizing the size of the image. The post-processing part is to visualize the test results, including remapping the image and drawing the corresponding defect marks on the image.
[0073] like Figure 4 As shown in the figure, according to the corresponding tasks, a data set is established and a semantic segmentation model is trained and evaluated. Then, the corresponding semantic segmentation model is exported to the industrial computer software for deployment. The process is as follows:
[0074] (S1) Use the inspection equipment to directly collect a certain number of samples for each type of defect;
[0075] (S2) Annotate sample images at the pixel level, and use the annotated images combined with certain data augmentation strategies to train and evaluate the semantic segmentation model;
[0076] (S3) Export the successfully trained semantic segmentation model to an ONNX model using the ONNX export tool, load the corresponding model using ONNXRUNTIME on the software side, and accelerate the processing of an image on the CPU;
[0077] The specific methods of the above steps are as follows:
[0078] The sample image in step (S1) comes from the aging experiment of paint or varnish. The paint is applied on a 150x70cm base plate. Various surface defects are generated through the aging experiment, mainly including coating blistering, rusting, and coating peeling. The image sample is collected by the device after the experiment. The collected sample image is shown as follows: Figure 10-12 . Fig.10 For coating blister samples, 200 samples were collected. Fig.11 The samples are coating peeling samples, 300 of which were collected. Fig.12 For rust samples, the number collected is 500.
[0079] The data enhancement strategies in step (S2) include random center cropping, random noise, random padding, random horizontal and vertical flipping, random image distortion, and random affine transformation. The reason for using these data enhancements is to generate new visual samples from the original image. This can increase the diversity of training data, reduce the model's dependence on specific image features, help the model learn a wider range of feature representations, and reduce the risk of overfitting the model on the training set. When using these data enhancements, parameters need to be set to ensure that the feature structure is not destroyed. Specifically, in random image distortion, the image brightness enhancement range is 0.8 to 1.2, and the image contrast and saturation enhancement range is 0.9-1.1. Such a relatively small distortion can maintain the basic feature structure while bringing better generalization.
[0080] The semantic segmentation models in step (S2) include PPLiteSeg, DDRNet, SegFormer, and PreciseNet, the paddle lightweight semantic segmentation model PPLiteSeg (PPLiteSeg), the deep dual-resolution network (DDRNet), and the simple and efficient Transformer-based semantic segmentation model (SegFormer), wherein PPLiteSeg is used to detect the coating-covered area, DDRNet and SegFormer are used to detect larger-scale rust defects and peeling defects, and PreciseNet is used to detect tiny blister defects;
[0081] The specific method of training and evaluation in step (S2) is:
[0082] (S2.1) Select the corresponding semantic segmentation model;
[0083] (S2.2) Select optimizer, learning rate strategy, regularization term, batch size, and loss function;
[0084] (S2.3) Evaluate the successfully trained semantic segmentation model and select the better results;
[0085] Before the rise of deep learning, semantic segmentation usually relied on various image processing techniques, such as threshold segmentation, region growing, and edge detection. Now, deep learning provides an end-to-end solution that can learn semantic information directly from data, greatly improving the accuracy of segmentation.
[0086] In this implementation, models that perform well on public datasets are selected to learn semantic features, including PPLiteSeg, DDRNet, SegFormer, and PreciseNet designed for small defects at large resolutions. The structure of SegFormer is as follows: Figure 6 As shown in the figure, it uses the Transformer structure to obtain global semantic information, and uses convolution to reduce the size of the features involved in the attention matrix calculation in the self-attention mechanism, which improves the real-time performance of the model, and uses skip connections to take into account semantic information at different scales. Both PPLiteSeg and DDRNet use the basic structure of convolution, have good real-time performance, and can process large-resolution images in a shorter time. The PreciseNet uses a structure similar to SegFormer, but uses convolution and local attention instead of VisionTransfomer. At the same time, it adopts a structural design that retains sufficient detail features and considers lightweight design, so that the model can take into account both accuracy and real-time performance under large-resolution images.
[0087] In this implementation, all datasets are trained and compared on PPLiteSeg, DDRNet, and SegFormer, among which only the coating blister model uses the PreciseNet model to solve the problem of small blister extraction difficulties. For better consistency, the image resolution of the input model is also specified for each defect sample, where the input resolution of rust and peeling defects is 2048×1024, and the input resolution of the blister model is 4096×2048. Since the features of the same coating defect have different features in different coatings, all semantic segmentation models use InstanceNorm2D normalization instead of BatchNorm2D normalization to reduce the impact of huge sample differences and huge feature scale differences on model convergence.
[0088] The PreciseNet model structure is as follows Figure 7-Figure 9 As shown in Figure 1, in order to extract the extremely small bubble defect of about 8 pixels at a resolution of 4096×2048, the detail semantic branch of 1 / 4 resolution is retained, and two semantic branches are used to fully retain the detail features in the segmentation. The LSB branch with the smallest resolution is used. Figure 8 The MSCA convolutional self-attention layer in the model is used to obtain global semantic information, which improves the model's ability to recognize features with large scale differences.
[0089] The model in step (S2.1) is selected from PPLiteSeg, DDRNet, SegFormer, and PreciseNet, and is trained and evaluated on the coating blistering dataset. The corresponding training parameters in (S2.1) are selected as follows:
[0090] The optimizer uses AdamW, and the learning rate warm-up and learning rate polynomial decay are used to update the parameters. The training process uses a mixed loss function of cross entropy and mean square error. The two are added with weights of 0.9 and 0.1 as the final calculation loss. The evaluation indicator uses Class IoU to focus on the category identification of the defect itself.
[0091] Table 1 Training parameter settings
[0092]
[0093] AdamW is an optimization algorithm that is a variant of the Adam optimizer that improves the way weight decay (L2 regularization) is handled. Adam is an adaptive estimation-based method that combines the advantages of momentum and RMSprop, taking into account both momentum and the squared gradient of the parameters when adjusting each parameter. However, when it is combined with L2 regularization, the regularization term is not scaled for the adaptive learning rate of each update step, which may result in less than expected regularization effect. AdamW further improves the generalization ability of the model on this basis, and the AdamW optimizer fixes this problem by treating weight decay as a separate step. Before the parameter is updated, it first decays the parameter and then applies the adaptive learning rate, so that the regularization term can be independent of the influence of the adaptive learning rate. In practice, the AdamW optimizer can often provide better generalization performance than the standard Adam, especially in scenarios where weight decay is needed to prevent overfitting. Due to the correct handling of weight decay, AdamW can make the training process more stable, especially for training on deep networks and complex datasets. For semantic segmentation, choosing the AdamW optimizer can make training more stable.
[0094] In the semantic segmentation task, the loss function measures the inconsistency between the pixel-level classification predicted by the model and the actual annotation. It is the key basis for optimizing model parameters during training, guiding the model to learn the ability to distinguish different semantic categories. The gradient signal calculated by the loss function is the basis for the model to update weights through the back-propagation algorithm. These gradients indicate how the model parameters should be adjusted to reduce the prediction error.
[0095] In this implementation, the loss function is a mixture of cross entropy loss and mean square error loss, with a weighted ratio of 0.9 and 0.1. CrossEntrop loss can provide effective feedback on the accuracy of model predictions, especially when the model's predictions differ greatly from the actual labels, the gradient is large, thereby accelerating the learning process. MSE loss provides smooth gradient information, which helps to stably update the network weights during training. The calculation method is as follows:
[0096] Cross Entropy:
[0097] Mean square error: Loss = (input-label) 2
[0098] For cross entropy, where N is the total number of pixels in the image or the total number of pixels in all images in a batch, t ni and p niThey represent the true label and predicted probability that the nth pixel belongs to the i-th category, respectively, and C is the number of label categories. In the mean square error, input is the predicted value of the model, and label is the label value.
[0099] Intersection over Union (IoU) is a commonly used evaluation metric in semantic segmentation to measure the accuracy of model predictions. It calculates the ratio of the overlap between the predicted results and the true annotations to their respective union areas. IoU provides a separate score for each category, which can then be averaged to obtain the performance indicator on the entire dataset. The calculation formula for IoU is as follows:
[0100]
[0101] Among them: TP (True Positives) is the number of correctly predicted positive samples, that is, the number of pixels whose predicted and true labels are both a certain class. FP (False Positives) is the number of incorrectly predicted positive samples, that is, the number of pixels predicted to be a certain class but not actually that class. FN (False Negatives) is the number of incorrectly predicted negative samples, that is, the number of pixels that are actually a certain class but not predicted to be that class. The value of IoU ranges from 0 to 1, and the higher the value, the better the consistency between the prediction result and the actual situation.
[0102] like Fig.13 As shown in the figure, the Class IoU curves of the three models PreciseNet, PPLiteSeg, and DDRNet corresponding to the defect categories on the coating surface blistering dataset are changed with the number of training iterations. It can be seen that compared with other models, PreciseNet can stably obtain higher IoU indicators, indicating that the model performs best on this dataset. Its IoU can reach 0.762, indicating that the model can accurately identify defects. The corresponding data are as follows:
[0103] Table 2 Semantic segmentation evaluation performance of three models
[0104]
[0105] In the semantic segmentation task, the PR curve (Precision-Recall Curve) is a tool for evaluating model performance, especially when the dataset is unbalanced. The PR curve shows the change in model performance by plotting the precision (Precision) against the recall (Recall) under different threshold settings, where the precision is TP / (TP+FP) and the recall is TP / (TP+FN). Each point on the PR curve corresponds to a combination of precision and recall at a specific threshold. By changing the classification threshold that determines the positive and negative classes, a series of precision and recall values can be obtained to draw a curve. Ideally, a good model will make the curve as close to the upper right corner as possible, that is, it will maintain a high recall while maintaining a high precision.
[0106] like Fig.13 As shown in the figure, the PR curves of four models, PreciseNet, PPLiteSeg, DDRNet, and SegFormer, are drawn according to different segmentation thresholds after training on the coating surface blistering dataset. It can be seen that the PR curve of PreciseNet is closest to the upper right corner, indicating that the model has a higher accuracy for the semantic segmentation task.
[0107] The preferred embodiments of the present invention disclosed above are only used to help explain the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and use the present invention well.
Claims
1. A coating surface defect grade assessment instrument, characterized in that: It includes a chassis (1), an inner darkroom (2), a camera bracket (3), an industrial camera (4), light sources for different working conditions (5), an imaging background plate (6), a movable guide rail (7), and an industrial PC computer; A movable guide rail (7) is provided at the bottom of the chassis (1); an industrial camera (4) is installed at the top of the movable guide rail (7) via a camera bracket (3); light sources (5) of different working conditions are installed below the movable guide rail (7) via a light source bracket; an imaging background plate (6) is fixed at the center of the bottom of the chassis (1); two linear sliders are provided on both sides of the camera bracket (3) and the light source bracket; an industrial PC is located at the rear of the chassis (1); and the industrial camera (4) obtains an image and transmits it to a detection system to complete a detection; The board to be inspected is placed on an imaging background plate (6), the chassis (1) is closed, the light source (5) is turned on according to the inspection requirements, the industrial camera (4) captures the image and sends it to the industrial PC computer, and the surface defects of the board to be inspected are graded through the inspection system.
2. The coating surface defect grade assessment instrument according to claim 1, characterized in that: The industrial camera (4) is connected to the outer side of the camera bracket (3), and the camera bracket (3) and the guide rail (7) are connected via a linear slider, and the slider is fixed on the movable guide rail (7); The light sources (5) of different working conditions are connected to the movable guide rail (7) via two linear sliders. The light source (5) and the background plate (6) have a fixed distance. There are two light sources, one high and one low. The inner groove of the low light source opens inwards, while the inner groove of the high light source opens downwards. A LED light strip of a specific model is placed in the inner groove. The background plate (6) is a rectangular resin block, located at the center of the bottom of the chassis (1), and has white and black colors for detecting paint plates of different colors, wherein the paint plates are placed in the area on the background plate (6); The inner surface of the inner box darkroom (2) is sprayed with black baking varnish, and the darkroom is fixed to the bottom of the chassis (1); The linear guide rails on both sides of the camera support (3) and the light source (5) perform an up-and-down translation motion on the moving guide rail (7), thereby adjusting the relative positions of the industrial camera (4), the light source (5) and the imaging background plate (6) to achieve the best imaging effect.
3. The coating surface defect grade assessment instrument according to claim 1, characterized in that: The detection system includes: an image acquisition module, a rating software module, a detection model system based on semantic segmentation, and an industrial computer computing platform; The image acquisition module selects a light source for high-definition imaging and transmits the image to the rating software module; The rating software module detects the image through a semantic segmentation model and performs post-processing and rating on the detection results; The semantic segmentation detection model is used to build a semantic segmentation model for detecting defects and adjust it according to user data. The industrial computer computing platform stores the results of the semantic segmentation detection model processing in a table and interacts with the user.
4. A method for implementing the coating surface defect grade assessment instrument of claim 1, characterized in that: The following steps are involved: (S1) The plate to be detected is placed on the imaging background plate (6), and a light source is selected according to the detection mode; (S2) The industrial camera (4) collects images and transmits the collected images to the industrial computer computing platform through the SDK; (S3) The rating software preprocesses the image, and the semantic segmentation model identifies and annotates the coating surface defects in the image and assesses the defect level.
5. The detection method of a coating surface defect grade assessment instrument according to claim 4, characterized in that: In step (S3), the preprocessing uses contour detection and threshold segmentation to extract the minimum enclosing area of the plate to be detected to remove the background, and uses the Lanczos interpolation algorithm to adjust the size of the foreground area; In step (S3), the grade assessment is based on GB 1766-2008 as the general reference principle, the blister defect rating is based on GBT 30789.2-2015, the rust defect rating is based on GBT 30789.3-2015, the peeling defect rating is based on GBT 30789.8-2015, and the reference object is the binary comparison chart in the standard appendix.
6. A method for implementing the coating surface defect grade assessment instrument of claim 4, characterized in that: The process of training, exporting and deploying the semantic segmentation model in step (S3) is as follows: (S1) Use the inspection equipment to directly collect samples for each type of defect; (S2) Annotate sample images at the pixel level, and use the annotated images combined with data augmentation strategies to train and evaluate the semantic segmentation model; (S3) The trained semantic segmentation model is exported as an ONNX model using the ONNX export tool, and the corresponding model is loaded using ONNXRUNTIME on the software side to accelerate the processing of an image on the CPU.
7. The detection method of a coating surface defect grade assessment instrument according to claim 4, characterized in that: The sample image in step (S1) is derived from an aging experiment of paint or varnish. The paint is applied on a substrate and various surface defects are generated through the aging experiment, mainly including coating blistering, rusting, and coating peeling.
8. The detection method of a coating surface defect grade assessment instrument according to claim 6, characterized in that: The data augmentation strategies in step (S2) include random center cropping, random noise, random padding, random horizontal and vertical flipping, random image distortion, and random affine transformation.
9. The detection method of a coating surface defect grade assessment instrument according to claim 4, characterized in that: The semantic segmentation models in step (S2) include: PPLiteSeg, DDRNet, SegFormer, and PreciseNet, wherein PPLiteSeg is used to detect the area covered by the coating, DDRNet and SegFormer are used to detect rust defects and peeling defects, and PreciseNet is used to detect blister defects; The model parameter optimizer used in the training and evaluation in step (S2) is AdamW, and the parameters are updated with learning rate warm-up and learning rate polynomial decay. The training process uses a mixed loss function of cross entropy and mean square error, and the two are added with weights of 0.9 and 0.1 as the final calculation loss. The evaluation indicator uses Class IoU to focus on the category identification of the defect itself.
10. The detection method of a coating surface defect grade assessment instrument according to claim 9, characterized in that: The semantic segmentation model uses InstanceNorm2D normalization to reduce the impact of huge differences between samples and huge differences in feature scales on model convergence; The PreciseNet adopts a structure similar to SegFormer but uses convolution and local attention instead of VisionTransformer. It also adopts a structural design that retains sufficient detail features and considers lightweight design, so that the model can achieve both accuracy and real-time performance in images with large resolution.
Citation Information
Cited By
Switch cabinet surface plastic spraying quality detection system and method
CN118758964A
Fireplace surface defect detection method and system driven by machine vision
CN119624914A
Coating surface defect grade image recognition and evaluation method
CN120612470A
Robotic repair control systems and methods
US12728441B2
Systems and methods for post-repair inspection of a worksurface
US12818454B2
