Search

CN-121982448-A - Image defect evaluation method, image defect evaluation model training method and device

CN121982448ACN 121982448 ACN121982448 ACN 121982448ACN-121982448-A

Abstract

The application discloses an image defect evaluation method, an image defect evaluation model training method and an image defect evaluation model training device, and belongs to the technical field of image processing. The image defect evaluation method comprises the steps of obtaining an image to be evaluated, extracting a plurality of defect features of the image to be evaluated through a shared feature extraction layer, adjusting the modulus of the defect features based on a defect evaluation branch network, outputting the adjusted defect features as defect evaluation features of the image to be evaluated, carrying out semantic segmentation on the image to be evaluated based on a defect region segmentation branch network to obtain defect regions in the image to be evaluated, and evaluating according to the defect evaluation features in the defect regions to obtain defect degree grades of the defect regions. The application realizes high-precision image defect evaluation.

Inventors

  • YANG QIANG
  • SHI GUANGJUN

Assignees

  • 苏州凌云光工业智能技术有限公司
  • 凌云光技术股份有限公司

Dates

Publication Date
20260505
Application Date
20251230

Claims (10)

  1. 1. An image defect evaluation method, characterized by comprising: Acquiring an image to be evaluated, and extracting a plurality of defect features of the image to be evaluated through a shared feature extraction layer, wherein different defect features have different feature module lengths; Adjusting the mode length of the defect characteristic based on a defect evaluation branch network, and outputting the adjusted defect characteristic as the defect evaluation characteristic of the image to be evaluated; semantic segmentation is carried out on the image to be evaluated based on a defect area segmentation branch network, so that a defect area in the image to be evaluated is obtained; and evaluating according to the defect evaluation characteristics in the defect area to obtain the defect degree grade of the defect area.
  2. 2. The image defect evaluation method according to claim 1, wherein the evaluating according to the defect evaluation characteristics in the defect area to obtain the defect level of the defect area comprises: determining defect coefficients of any defect evaluation feature in the defect area; Obtaining a weighted module length of the aimed defect evaluation feature based on the feature module length of the aimed defect evaluation feature and the corresponding defect coefficient; and determining the defect degree grade of the defect area according to the weighted modular length of each defect evaluation characteristic.
  3. 3. The image defect review method of claim 2 wherein the defect area corresponds to at least one defect type, wherein the determining the defect coefficients for any defect review feature within the defect area comprises: Determining a weight parameter corresponding to the defect evaluation feature according to the defect type corresponding to the defect evaluation feature in the defect area; And determining the defect coefficient of the aimed defect evaluation feature according to the feature module length of the defect evaluation feature and the corresponding weight parameter.
  4. 4. The image defect review method of claim 1 wherein the modifying the modulus of the defect signature based on the defect review branch network and outputting the modified defect signature as the defect review signature of the image to be reviewed comprises: Determining defect types corresponding to each defect characteristic, wherein each defect type corresponds to an expected characteristic module length; For any defect feature, the module length of the defect feature is directionally adjusted based on the expected feature module length corresponding to the defect type, so that the adjusted defect feature presents distribution features related to different defect types in the module length dimension.
  5. 5. The image defect evaluation method according to claim 1, wherein the semantic segmentation is performed on the image to be evaluated based on a defect region segmentation branch network to obtain a defect region in the image to be evaluated, comprising: Downsampling the defect characteristics in the image to be evaluated, extracting semantic information in the image to be evaluated, and obtaining a semantic characteristic image of the image to be evaluated; up-sampling the semantic feature image to obtain a defect semantic feature image corresponding to the image to be evaluated; And carrying out semantic segmentation on the defect semantic feature image to obtain a defect region in the image to be evaluated.
  6. 6. An image defect evaluation model training method, comprising the steps of: Obtaining a sample image of a preset defect segmentation label, and extracting sample defect characteristics of the sample image through a shared characteristic extraction layer of a defect evaluation model, wherein the defect grade evaluation model is provided with a double-branch network, and comprises a defect evaluation branch network and a defect region segmentation branch network; adjusting the model length of the sample defect characteristic based on a defect evaluation branch network, and outputting the adjusted defect characteristic as a sample defect evaluation characteristic of the sample image; Performing semantic segmentation on the sample image based on a defect area segmentation branch network to obtain a sample defect area in the sample image and a sample defect type corresponding to the sample defect area; constructing a regularization loss function according to the difference between the sample defect evaluation characteristics in the sample defect area and preset reference characteristics under the sample defect type; constructing a segmentation loss function according to the difference between the sample defect area and the defect segmentation label; And constructing a total loss function based on the regularized loss function and the segmentation loss function, and training the defect grade assessment model based on the total loss function to obtain a trained defect grade assessment model.
  7. 7. The method according to claim 6, wherein constructing a regularization loss function based on a difference between a sample defect evaluation feature in the sample defect region and a preset reference feature for the sample defect type, comprises: Determining a feature vector of the sample defect evaluation feature and a feature vector of the preset defect type reference feature; Determining an angular margin value of the sample defect review feature based on an angular difference between the feature vector of the sample defect review feature and the feature vector of the sample defect review feature; And constructing a regularization loss function according to the angle marginal value.
  8. 8. The image defect review model training method of claim 6 wherein the constructing a segmentation loss function based on the difference between the sample defect region and the defect segmentation labels comprises: obtaining one or more prediction mask values of the sample defect region, wherein different prediction mask values correspond to different defect types; A segmentation loss function is constructed based on a difference between the prediction mask value and a reference mask value in the defect segmentation label.
  9. 9. An image defect evaluation apparatus, characterized by comprising: The system comprises an extraction module, a feature extraction layer, a feature module and a feature module, wherein the extraction module is used for acquiring an image to be evaluated and extracting a plurality of defect features of the image to be evaluated through the shared feature extraction layer; the adjusting module is used for adjusting the module length of the defect characteristic based on a defect evaluation branch network and outputting the adjusted defect characteristic as the defect evaluation characteristic of the image to be evaluated; The segmentation module is used for carrying out semantic segmentation on the image to be evaluated based on a defect region segmentation branch network to obtain a defect region in the image to be evaluated; and the evaluation module is used for evaluating according to the defect evaluation characteristics in the defect area to obtain the defect degree grade of the defect area.
  10. 10. An image defect review model training device, comprising: the system comprises an extraction module, a defect grade evaluation model, a defect area segmentation branch network, a defect grade analysis module and a defect analysis module, wherein the extraction module is used for obtaining a sample image of a preset defect segmentation label and extracting sample defect characteristics of the sample image through a shared characteristic extraction layer of the defect evaluation model; the adjusting module is used for adjusting the module length of the sample defect characteristic based on a defect evaluation branch network and outputting the adjusted defect characteristic as a sample defect evaluation characteristic of the sample image; the segmentation module is used for carrying out semantic segmentation on the sample image based on a defect area segmentation branch network to obtain a sample defect area in the sample image and a sample defect type corresponding to the sample defect area; The regularization loss module is used for constructing a regularization loss function according to the difference between the sample defect evaluation characteristics in the sample defect area and the preset reference characteristics under the belonging sample defect type; A segmentation loss module for constructing a segmentation loss function according to the difference between the sample defect region and the defect segmentation label; The training module is used for constructing a total loss function based on the regularized loss function and the segmentation loss function, and training the defect grade evaluation model based on the total loss function to obtain a trained defect grade evaluation model.

Description

Image defect evaluation method, image defect evaluation model training method and device Technical Field The application belongs to the technical field of image processing, and particularly relates to an image defect evaluation method, an image defect evaluation model training method and an image defect evaluation model training device. Background With the development of industrial visual inspection and artificial intelligence technology, intelligent identification and defect grading technology aiming at industrial product appearance defects appears, and defect areas can be automatically positioned from industrial product surface images, defect types can be judged, and the severity of the defects can be quantitatively evaluated. In the related art, defect detection and segmentation are generally performed on a product surface image, and then, according to an obtained defect area, a method based on an artificial experience rule or a method based on a characteristic threshold value is adopted to evaluate defects on the industrial product surface, for example, according to indexes such as a defect area, a contrast of the defect area, and the like. However, the mode based on the manual experience rule is strong in subjectivity, difficult to standardize and poor in portability depending on specific scenes and personnel experience, and the simple characteristic threshold judgment is difficult to capture the complex nonlinear relation between defect expression and severity, has limited distinguishing capability on weak characteristics and background interference, so that the evaluation result of the image defects is easily influenced by image quality, intra-class deformation and imaging environment change, and the requirement on evaluating the surface image defects of industrial products in industrial quality inspection is difficult to meet. Disclosure of Invention The present invention aims to solve at least one of the technical problems existing in the prior art. Therefore, the invention provides an image defect evaluation method, an image defect evaluation model training method and an image defect evaluation model training device, which realize high-precision image defect evaluation. In a first aspect, the present application provides an image defect evaluation method, the method comprising: Acquiring an image to be evaluated, and extracting a plurality of defect features of the image to be evaluated through a shared feature extraction layer, wherein different defect features have different feature module lengths; The model length of the defect characteristics is adjusted based on the defect evaluation branch network, and the adjusted defect characteristics are output as defect evaluation characteristics of the image to be evaluated; semantic segmentation is carried out on the image to be evaluated based on the defect area segmentation branch network, so that a defect area in the image to be evaluated is obtained; and evaluating according to the defect evaluation characteristics in the defect area to obtain the defect degree grade of the defect area. In a second aspect, the present application provides an image defect evaluation model training method, which includes: Obtaining a sample image of a preset defect segmentation label, and extracting sample defect characteristics of the sample image through a shared characteristic extraction layer of a defect evaluation model, wherein the defect grade evaluation model is provided with a double-branch network, and comprises a defect evaluation branch network and a defect region segmentation branch network; the model length of the sample defect characteristics is adjusted based on the defect evaluation branch network, and the adjusted defect characteristics are output as sample defect evaluation characteristics of a sample image; carrying out semantic segmentation on the sample image based on the defect area segmentation branch network to obtain a sample defect area in the sample image and a sample defect type corresponding to the sample defect area; constructing a regularization loss function according to the difference between the sample defect evaluation characteristics in the sample defect area and the preset reference characteristics under the belonging sample defect type; constructing a segmentation loss function according to the difference between the sample defect area and the defect segmentation label; And constructing a total loss function based on the regularized loss function and the segmentation loss function, and training the defect level assessment model based on the total loss function to obtain a trained defect level assessment model. In a third aspect, the present application provides an image defect evaluation apparatus comprising: the extraction module is used for acquiring the image to be evaluated and extracting a plurality of defect features of the image to be evaluated through the shared feature extraction layer; the adjusting module is used for