CPC G06T 7/001 (2013.01) [G06V 10/774 (2022.01); G06T 2207/20076 (2013.01); G06T 2207/20081 (2013.01)] | 20 Claims |
1. An image defect detection method comprising:
obtaining flawless sample training images;
inputting the flawless sample training images into an autoencoder, and calculating first latent features of the flawless sample training images by coding layers of the autoencoder;
inputting the first latent features into decoding layers of the autoencoder, and calculating first reconstructed images of the flawless sample training images by the decoding layers, calculating the flawless sample training images and the first reconstructed images by a preset error function to obtain first reconstruction errors between the flawless sample training images and the first reconstructed images;
inputting the first latent features into a depth learning model and calculating a first probability distribution of the first latent features by the depth learning model;
inputting the first latent features into a Gaussian mixture model and calculating a second probability distribution of the first latent features by the Gaussian mixture model;
calculating a Kullback-Leible divergence between the first probability distribution and the second probability distribution;
obtaining a total loss according to the first reconstruction errors and the Kullback-Leible divergence, optimizing the autoencoder, the depth learning model and the Gaussian mixture model according to the total loss, and setting a threshold according to the total loss;
obtaining testing sample images, inputting the testing sample images into the autoencoder, calculating second latent features of the testing sample images by the coding layers of the autoencoder, inputting the second latent features into the decoding layers of the autoencoder to calculate the second reconstructed images of the testing sample images;
using the preset error function to calculate the second reconstruction errors between the testing sample images and the second reconstruction images, inputting the second latent features into the depth learning model, calculating a third probability distribution of the second latent features, and calculating the total error according to the third probability distribution and the second reconstruction errors; and
when the total error is greater than or equal to the threshold, determining that the testing sample images are defect images, and when the total error is less than the threshold, determining that the testing sample images are flawless images.
|