Search

CN-122023229-A - Industrial defect grouping refinement method and device based on anomaly perception

CN122023229ACN 122023229 ACN122023229 ACN 122023229ACN-122023229-A

Abstract

The invention discloses an industrial defect grouping refinement method based on anomaly perception, which comprises the steps of taking a batch of industrial product images as input, dividing the batch of images into a plurality of groups with fixed image quantity, carrying out preliminary detection on the images of the current group through the existing zero sample defect detection algorithm, screening pseudo normal samples, synthesizing pseudo abnormal samples and masks thereof, training a defect refinement decoding network provided by the invention by using the synthesized pseudo abnormal samples and masks thereof, carrying out preliminary detection on the images in the next group, obtaining refinement output results by using the trained defect refinement decoding network, synthesizing the pseudo abnormal samples based on the results for continuing training the defect refinement decoding network, and repeating the previous operation until all images are detected. The invention can greatly improve the accuracy of the zero sample defect detection algorithm in defect positioning. The invention also provides a corresponding industrial defect grouping refinement device based on abnormal perception.

Inventors

  • ZHOU YU
  • HUANG DAYOU
  • LI XIURUI

Assignees

  • 华中科技大学

Dates

Publication Date
20260512
Application Date
20251126

Claims (10)

  1. 1. An industrial defect grouping refinement method based on anomaly perception is characterized by comprising the following steps: Step S1, for a batch of industrial product images, the number of images is Uniformly dividing it into several mutually non-overlapping groups Wherein For the number of groups, each group is fixedly provided with Sheet image, for each group of images From which to screen out The image is used as pseudo-normal samples, and each pseudo-normal sample is further synthesized Pseudo-abnormal sample Training samples and masks for providing a defect-refined decoding network; Step S2, the obtained pseudo-abnormal sample is processed Inputting the images into the existing zero sample defect detection algorithm to generate corresponding pseudo-abnormal characteristics and abnormal score maps, inputting the images into a defect refinement decoding network, gradually up-sampling the images to restore the original resolution, enhancing the characteristics of a defect area through an abnormal score map and characteristic aggregation module, an abnormal perception refinement module and a bidirectional perception and interaction module, finally outputting the refined abnormal score maps, and using a pseudo-abnormal mask Performing supervision training as a target; step S3, progressive grouping inference training, for the first Group image All parameters of the defect refinement decoding network are initialized randomly, the network is initially trained by using the pseudo-abnormal samples synthesized by the group of images to establish basic defect refinement capability, and the defect refinement decoding network is subsequently inferred and iteratively trained until all images are detected.
  2. 2. The method for grouping refinement of industrial defects based on anomaly perception according to claim 1, wherein said step S3 comprises: Step S3-1, for the first Images in a group , The abnormal score outputted by the zero sample defect detection algorithm is The image features are Inputting it into the image group The network parameters after training are as follows In a defect refinement decoding network of (2), outputting a refinement anomaly score map Finally, will And Obtaining a final defect segmentation result on average; Step S3-2, starting from the second group of images, introducing a progressive parameter migration mechanism, and processing the first group of images Group image When the network is no longer initialized, but loaded on the first Group image Parameters of defect refinement decoding network for training completion Further training of the model is performed on the basis of this.
  3. 3. The method of grouping refinement of industrial defects based on anomaly awareness according to claim 1 or 2, wherein in said step S1, for each group of images From which to screen out The sheet image is used as a pseudo normal sample, and concretely comprises: Step S1-1 for the first Group image Generating corresponding region-level features and anomaly score maps using any one of a zero sample defect detection algorithm for images therein The resulting region-level features are defined as The generated anomaly score graph is defined as Wherein And For the length and width of the image, For the number of channels of the feature, the anomaly score map As an image Is selected by the global anomaly score of The global anomaly score in (a) is the lowest The image is treated as a pseudo normal sample.
  4. 4. The method for grouping refinement of industrial defects based on anomaly awareness according to claim 1 or 2, wherein in said step S1, each pseudo-normal sample is further synthesized The false-false abnormal sample specifically comprises: Step S1-2, for the screened Zhang Wei normal samples, synthesizing each pseudo normal sample by using Perlin noise and DTD auxiliary data set Pseudo-abnormal sample and mask corresponding to the same, for pseudo-normal image The synthesized pseudo-outlier samples are defined as The corresponding mask is defined as 。
  5. 5. The method for grouping refinement of industrial defects based on anomaly awareness according to claim 1 or 2, wherein said step S2 comprises: Step S2-1, all pseudo-abnormal samples are taken Input into the existing zero sample defect detection algorithm, for the pseudo-abnormal sample in the zero sample defect detection algorithm Extracting corresponding pseudo-abnormal characteristics And anomaly score graph Inputting the two into a follow-up defect refinement decoding network; Step S2-2, aggregating the anomaly score map and the features, and using a 1X 1 convolution layer to aggregate the anomaly score map The number of channels is expanded to obtain the characteristic of abnormal score The feature and the pseudo-abnormal feature After channel splicing, obtaining initial abnormal perceived image characteristics through a 1X 1 convolution layer ; Step S2-3, the anomaly score feature obtained in step S2-2 is obtained And anomaly-aware features Inputting the image features into an anomaly perception refinement module for feature enhancement and resolution recovery to obtain image features And anomaly score ; S2-4, processing the image features processed by the two abnormal perception refinement modules And anomaly score feature Respectively obtaining image characteristics after up-sampling and convolution layers And anomaly score feature Inputting the two images into a bidirectional sensing and interaction module, and realizing mutual refinement of the image features and the abnormal score features through a bidirectional convolution path; Step S2-5, outputting the characteristics of step S2-4 Restoring the original image size resolution through up-sampling and 3×3 convolution layer, and finally outputting refined abnormal score image through a dividing head composed of 3×3 convolution layer and ReLU activation function 。
  6. 6. The method for grouping refinement of industrial defects based on anomaly awareness according to claim 1 or 2, wherein said step S2-3 comprises: First to characteristic Up-sampling to obtain features Further processing the obtained product by using a 5X 5 convolution layer to obtain characteristics For the characteristics of Processing with 2-up sampling and 3 x 3 convolutional layers to align their spatial dimensions to obtain features Features of the following And Is input into an anomaly attention block for anomaly enhancement, specifically, And Respectively passing through 3×3 convolution layers, and adding to obtain image fusion characteristics Using the feature and a matrix of learnable coefficients Computing adaptive feature importance weights The formula is as follows: Wherein the method comprises the steps of Representing the multiplication by element, Is a full 1 matrix, will And (3) with After multiplying element by element, generating abnormal attention weight by two 3X 3 convolution layers and Sigmoid function Will finally And (3) with Element-by-element multiplication followed by anomaly score characterization Splicing in the channel dimension to obtain the output characteristics of the current abnormality perception refinement module Features of And Is input into a new abnormality perception refinement module for further up-sampling abnormality enhancement to obtain final output And 。
  7. 7. The method for grouping refinement of industrial defects based on anomaly awareness according to claim 1 or 2, wherein the step S2-4 of implementing mutual refinement of image features and anomaly score features through a bidirectional convolution path specifically comprises: Wherein the method comprises the steps of And Respectively representing the abnormal score characteristics and the image characteristics after the bidirectional convolution operation; A3 x 3 convolutional layer is shown, To modify the linear activation function, then characterizing And Channel splicing is carried out to obtain the output characteristics of the bidirectional sensing and interaction module 。
  8. 8. The method for refining industrial defect groups based on anomaly awareness according to claim 1 or 2, wherein the parameter learning of the defect-refining decoding network is performed in an end-to-end manner in the step S2-5, and the optimized objective function is: Wherein the method comprises the steps of As a pseudo-abnormal sample Is used as a mask for the mask, Is the binary Dice loss between the fractional graph of the defect refinement decoding network output and the sample mask.
  9. 9. The anomaly-aware-based industrial defect packet refinement method of claim 1 or 2, wherein in the step S2-1, an existing zero-sample defect detection algorithm comprises MuSc and AnomalyCLIP.
  10. 10. An industrial defect packet refinement apparatus based on anomaly perception, comprising at least one processor and a memory, the at least one processor and the memory being connected by a data bus, the memory storing instructions for execution by the at least one processor, the instructions, when executed by the processor, for performing the industrial defect packet refinement method based on anomaly perception of any one of claims 1-9.

Description

Industrial defect grouping refinement method and device based on anomaly perception Technical Field The invention belongs to the technical field of computer vision, and particularly relates to an industrial defect grouping refinement method and device based on anomaly perception, which are mainly used for detecting zero-sample industrial defects. Background In industrial automation and quality control, industrial defect detection technology is critical to automatically identifying product defects and guaranteeing quality. The traditional method relies on a large number of samples for model training, and is high in cost and large in manpower investment. With the development of a multi-mode Pre-training model, a zero sample defect detection algorithm is paid attention to gradually, for example, an Image is analyzed on a semantic level by using a visual-language model such as a CLIP (Contrastive Language-Image Pre-training, contrast language-Image Pre-training), so that the method has good generalization capability and the dependence on labeling data is relieved. The existing zero sample defect detection algorithm realizes defect detection and positioning by calculating the similarity between the image and text features or the similarity between the features of image areas. However, these methods generally use pre-trained Vision Transformer as a backbone network, and the resolution of the output feature map is low, so that accurate positioning of the defect area is difficult to achieve, and therefore, the actual requirement of high-precision positioning of the defect in the industrial scene still cannot be met. In view of the above problems, the current research is generally turned to adopting a network architecture based on a decoder for fine defect localization, which is collectively called an industrial defect refinement method. The core of the method is that a plurality of decoding modules with special structures, such as semantic decoders integrating cavity space pyramid pooling (ASPP, atrous SPATIAL PYRAMID Pooling), U-Net with jump connection structures and the like, are introduced, and a progressive up-sampling operation and a multi-level feature fusion mechanism are combined to gradually reconstruct low-resolution abstract features output by a backbone network into a high-precision anomaly score map matched with the resolution of an input image. However, the performance of such methods is highly dependent on the synthetic pseudo-abnormal samples used in the supervised training phase. Because of the huge distribution difference between the pseudo-abnormal sample and the real industrial defect data in the aspects of texture distribution, morphological structure and the like, the positioning capability of the model on the real defects is limited. Therefore, although the method shows good refinement effect on the training set, the problems of over-detection of a normal area, omission of defects and the like still occur in practical application, and finally, strict requirements of an industrial quality inspection scene on high-precision defect positioning are difficult to achieve. Disclosure of Invention Aiming at the problems or improvement demands of the prior art, the invention provides an industrial defect grouping refinement method based on anomaly perception. The method comprises the following steps of 1, carrying out preliminary detection on the images of the current group through the existing zero sample defect detection algorithm, screening false normal samples, synthesizing false abnormal samples and masks thereof, 2, training a defect refinement decoding network provided by the invention by using the synthesized false abnormal samples and masks thereof, 3, obtaining refinement output results by using the defect refinement decoding network after carrying out preliminary detection on the images in the next group, synthesizing the false abnormal samples based on the results and continuing to train the defect refinement decoding network, and 4, repeating the operation of the step 3 until all the images are detected. The invention can greatly improve the accuracy of the zero sample defect detection algorithm in defect positioning. To achieve the above object, according to one aspect of the present invention, there is provided an industrial defect grouping refinement method based on anomaly perception, comprising the steps of: Step S1, for a batch of industrial product images, the number of images is Uniformly dividing it into several mutually non-overlapping groupsWhereinFor the number of groups, each group is fixedly provided withSheet image, for each group of imagesFrom which to screen outThe image is used as pseudo-normal samples, and each pseudo-normal sample is further synthesizedPseudo-abnormal sampleTraining samples and masks for providing a defect-refined decoding network; Step S2, the obtained pseudo-abnormal sample is processed Inputting the images into the existing zero sample defect detec