Search

CN-121981974-A - Whole vehicle surface defect detection method based on synthetic data and antagonism domain self-adaption

CN121981974ACN 121981974 ACN121981974 ACN 121981974ACN-121981974-A

Abstract

The invention provides a method for detecting surface defects of a whole vehicle based on synthetic data and adaptive countermeasures, which comprises the steps of firstly, constructing a defect programming generation framework through image simulation software, carrying out physical simulation on regular defects and irregular defects, and generating a synthetic data set with labels by combining production scene domain randomization rendering. Secondly, constructing a contrast domain self-adaptive network comprising a feature encoder, a decoder, a condition generator, a domain discriminator and a classifier, separating domain invariant features and domain specific features through a feature decoupling mechanism, and adopting a staged contrast training strategy to jointly optimize a comprehensive loss function so that the network learns to feature representations with strong discrimination and unchanged domains. And finally, performing high-efficiency defect detection by using the trained feature encoder and classifier in the test stage. According to the invention, only synthetic data generated by an analog simulation program and a small amount of non-defective real background images are utilized, and the generalization capability and robustness of the model in a real scene are improved by resisting learning effective alignment domain differences.

Inventors

  • WANG XIAOQIAO
  • LUO KUI
  • LI YAN

Assignees

  • 合肥工业大学

Dates

Publication Date
20260505
Application Date
20260107

Claims (9)

  1. 1. The method for detecting the surface defects of the whole vehicle based on the synthetic data and the adaptive countering domain is characterized by comprising the following steps of: S1, constructing a defect data programming generation framework based on image simulation software, generating geometric and texture data of simulated painting surface defects in a parameterized modeling mode, and generating a synthetic defect image with pixel-level labels by combining a physical rendering and domain randomization technology to form a source domain data set; s2, acquiring a real workpiece surface image on an actual coating production line to form a target domain data set; s3, constructing a generation type reactance domain self-adaptive network comprising a feature encoder, a feature decoder, a condition generator, a domain discriminator and a classifier; The feature encoder is used for decoupling an input image into domain invariant features and domain specific features, the feature decoder is used for reconstructing the image according to the decoupled features, the condition generator is used for synthesizing defect samples based on the domain invariant features and class labels, the domain discriminator is used for discriminating the authenticity of the image and the domain to which the image belongs, and the classifier is used for predicting the defect class based on the domain invariant features; s4, optimizing the domain self-adaptive network by adopting a staged training strategy; the optimization comprises updating the domain discriminator to improve the discrimination capability thereof, updating the condition generator to improve the authenticity and semantic consistency of the generated samples thereof, and jointly updating the feature encoder, the feature decoder and the classifier to enable the network to learn the domain-invariant feature representation and have accurate classification capability by minimizing the comprehensive loss function; s5, fixing network parameters, forming an inference network by using the feature encoder and the classifier which are trained, extracting domain invariant features from the input real coating image, and outputting a defect detection result.
  2. 2. The method for detecting the surface defects of the whole vehicle based on the synthetic data and the adaptive reactive domain according to claim 1, wherein the parametric modeling mode comprises: for regular defects, simulating dust and sagging defect contours by adopting a closed curve generation method based on an elliptic Fourier descriptor, and simulating scratch defect paths by adopting a Bezier curve generation method; For irregular defects, a texture generation method based on multi-Gaussian superposition is adopted to simulate bubble and shrinkage defects, and a texture generation method based on fractal noise integration is adopted to simulate stain defects.
  3. 3. The synthetic data and counter domain adaptive whole vehicle surface defect detection method according to claim 1, wherein the feature encoder comprises a shared encoder and a private encoder; the shared encoder is used for extracting domain invariant features which are effective for judging the defect types and are irrelevant to domains; The private encoder is used for extracting domain-specific features related to imaging conditions; The feature encoder orthogonalizes the domain-invariant feature with the domain-specific feature in a feature space by an orthogonalization loss function constraint.
  4. 4. The method for detecting surface defects of a whole vehicle based on synthetic data and contrast domain adaptation according to claim 1, wherein the domain discriminator is a multi-task discriminator which performs a true-false image discriminating task and an image domain source classifying task simultaneously, and returns a contrast gradient to the feature encoder through a gradient inversion layer to drive domain alignment of the domain invariant features.
  5. 5. The method for detecting surface defects of a whole vehicle based on synthetic data and reactive domain adaptation as claimed in claim 1, wherein the comprehensive loss function comprises: classification loss, classifier output calculation based on source domain data; a domain countermeasure loss, calculated based on an output of the domain arbiter; the characteristic distribution alignment loss is used for measuring and reducing the characteristic distribution difference between the source domain and the target domain; Image reconstruction loss, which is used for measuring the difference between the output of the feature decoder and the original input image; Feature decoupling losses to ensure efficient separation of domain invariant features from domain specific features.
  6. 6. The method for detecting the surface defects of the whole vehicle based on the synthetic data and the opposite domain self-adaption according to claim 5, wherein the characteristic distribution alignment loss adopts a maximum mean difference loss or a second order statistic alignment loss of category perception.
  7. 7. The method for detecting surface defects of a whole vehicle based on synthetic data and reactive domain adaptation as claimed in claim 1, wherein the phased training strategy performs parameter updates within each training batch in the order of first updating the domain discriminators, second updating the condition generator, and finally jointly updating the feature encoder, feature decoder, and classifier.
  8. 8. The method of claim 1, wherein the physical rendering and domain randomization technique comprises randomizing sampling at least one of light source properties, camera parameters, material properties, and environmental maps in a virtual scene to increase diversity of the composite data and simulate imaging changes of a real industrial scene.
  9. 9. The method for detecting the defects of the whole vehicle surface based on the synthetic data and the domain-resistant self-adaption of claim 1 is characterized in that the inference network performs defect detection by inputting the preprocessed real image into a shared encoder in the feature encoder, extracting domain-invariant feature vectors, inputting the domain-invariant feature vectors into the classifier to obtain prediction probabilities of all defect types, and outputting final defect type identifiers according to the prediction probabilities.

Description

Whole vehicle surface defect detection method based on synthetic data and antagonism domain self-adaption Technical Field The invention relates to the technical field of industrial machine vision and deep learning, in particular to a method for detecting surface defects of a whole vehicle based on synthetic data and adaptive reactance domain. Background In the field of industrial manufacturing such as automobile manufacturing, a coating process is a core link for guaranteeing the appearance quality and the anti-corrosion performance of a product. In the coating process, the workpiece is influenced by a plurality of factors such as environmental cleanliness, equipment state, process parameters, operation flow and the like, and various defects such as dust, sagging, scratches, bubbles, shrinkage cavities, stains and the like can be generated on the surface of the workpiece. These defects not only seriously affect the appearance of the product and reduce the market competitiveness, but also may damage the integrity of the coating, leading to the failure of the anti-corrosion protection function thereof and bringing significant economic loss to manufacturing enterprises. Therefore, the high-efficiency and accurate automatic surface defect detection is realized on the coating production line, and the method has great significance in improving the product quality, optimizing the production flow and reducing the after-sale cost. The traditional surface defect detection mainly depends on manual visual observation, and the method has the inherent defects of low efficiency, high labor intensity, strong subjectivity, easiness in detection omission or misjudgment caused by fatigue and the like, and is difficult to meet the real-time quality inspection requirements of modern continuous and high-speed production lines. For this reason, automated inspection techniques based on machine vision have been developed. Early methods were based mainly on traditional image processing algorithms, and were based on manually designed and extracted features such as texture, shape, color, edges, etc. associated with defects, combined with thresholding, template matching or classifiers for discrimination. However, such methods rely heavily on expert experience, and feature design is highly targeted and weak in generalization capability, and have poor robustness to interference factors such as uneven illumination, high reflection of paint, complex background and the like commonly existing in practical environments of painting workshops, so that the method is difficult to stably apply to complex industrial sites. With the breakthrough progress of deep learning, in particular, deep Convolutional Neural Networks (DCNNs), data-driven visual detection methods have demonstrated excellent performance in a wide variety of fields. In the field of industrial quality inspection, researchers have designed various deep network models, such as Feature Pyramid Networks (FPNs) that introduce multi-scale feature fusion, attention mechanisms (Attention Mechanism) that enhance attention to critical areas, etc., to improve the accuracy of detection and classification of micro defects. However, the superior performance of deep learning models is highly dependent on a large scale, high quality and well-annotated training dataset. This requirement faces a serious challenge in the field of surface defect testing of whole vehicles in automotive paint shops, which is embodied as follows: 1. the defect sample is rare and difficult to start cold, namely under the control of a mature coating process, the qualification rate is usually high, and the occurrence probability of a true defect sample is extremely low. The randomness of defect morphology, size, and location of different batches and different vehicle models makes it extremely difficult and costly to collect labeled sample sets that cover all defect types and are sufficient in number to train the depth network. 2. Synthetic data fidelity and physical rationality are inadequate to solve the sample scarcity problem, there have been studies attempting to synthesize defective images using data generation techniques such as generation of countermeasure networks (GAN). However, such pure data driven methods lack physical constraints, and the generated defects often have significant differences from the real defects in geometry (such as sagging stereo stack feel, depth profile of scratches) and optical characteristics (such as fresnel reflection specific to paint surfaces, glossiness), and problems such as texture artifacts, structural distortions, and the like may occur, and physical interpretability is poor, which limits the ability of the model to learn effective generalized features from synthetic data. 3. The domain offset problem between the synthesized domain and the true domain is that the performance of the deep learning model is developed on the assumption that the training data and the test data are indep