Defect detecting apparatus and method
AssigneesHon Hai Precision Industry Co., Ltd., Foxconn Technology Group Co., Ltd.
InventorsYung-Hui Li, Kai-Lin Yang, Yi-Rong Lin
Life of this patent
Estimating the term…
Abstract
A defect detecting apparatus and method are provided. The defect detecting apparatus receives an image to be tested. The defect detecting apparatus detects the image to be tested through a defect detecting model to generate an anomaly score corresponding to the image to be tested, and the defect detecting model is generated based on the training of a generative adversarial network and a plurality of normalized loss functions. The defect detecting apparatus compares the anomaly score with an anomaly score threshold to determine whether the image to be tested is a defective image.
Claims18
A defect detecting apparatus, comprising:
- a storage, being configured to store a defect detecting model;
- a transceiver interface;
- and
- a processor, being electrically connected to the storage and the transceiver interface, and being configured to perform operations comprising:
- receiving an image to be tested from the transceiver interface;
- detecting the image to be tested received from the transceiver interface through the defect detecting model stored in the storage to generate an anomaly score corresponding to the image to be tested, wherein the defect detecting model is generated based on a training of a generative adversarial network and a plurality of normalized loss functions, wherein the anomaly score is generated by calculating a pixel squared difference between the image to be tested and a reconstructed image corresponding to the image to be tested;
- and
- comparing the anomaly score with an anomaly score threshold to determine whether the image to be tested is an image depicting a defective object;
- wherein the processor is further configured to perform the following operations:
- receiving a plurality of sample images;
- inputting the sample images to a training model constructed by the generative adversarial network;
- training the training model based on an encoder loss function, a contextual loss function, and an adversarial loss function after normalization, wherein the encoder loss function, the contextual loss function, and the adversarial loss function are individually normalized, and a value range of each of the normalized loss functions is constrained between 0 and 1;
- and
- setting the training model after training as the defect detecting model.
A defect detecting method, being adapted for use in an electronic apparatus, and comprising following steps:
- receiving an image to be tested;
- detecting the image to be tested through a defect detecting model to generate an anomaly score corresponding to the image to be tested, wherein the defect detecting model is generated based on a training of a generative adversarial network and a plurality of normalized loss functions, wherein the anomaly score is generated by calculating a pixel squared difference between the image to be tested and a reconstructed image corresponding to the image to be tested;
- and
- comparing the anomaly score with an anomaly score threshold to determine whether the image to be tested is an image depicting a defective object;
- wherein the defect detecting method further comprises the following steps:
- receiving a plurality of sample images;
- inputting the sample images to a training model constructed by the generative adversarial network;
- training the training model based on an encoder loss function, a contextual loss function, and an adversarial loss function after normalization, wherein the encoder loss function, the contextual loss function, and the adversarial loss function are individually normalized, and a value range of each of the normalized loss functions is constrained between 0 and 1;
- and
- setting the training model after training as the defect detecting model.
Dependencies are inferred from the claim text.