US 12,260,542 B2
Method for detecting product for defects, electronic device, and storage medium
Guo-Chin Sun, New Taipei (TW); and Chin-Pin Kuo, New Taipei (TW)
Assigned to HON HAI PRECISION INDUSTRY CO., LTD., New Taipei (TW)
Filed by HON HAI PRECISION INDUSTRY CO., LTD., New Taipei (TW)
Filed on Aug. 29, 2022, as Appl. No. 17/897,550.
Claims priority of application No. 202210716240.6 (CN), filed on Jun. 22, 2022.
Prior Publication US 2023/0419473 A1, Dec. 28, 2023
Int. Cl. G06T 7/00 (2017.01); G06F 17/16 (2006.01); G06T 7/70 (2017.01); G06V 10/44 (2022.01)
CPC G06T 7/0008 (2013.01) [G06F 17/16 (2013.01); G06T 7/70 (2017.01); G06V 10/44 (2022.01); G06T 2207/20081 (2013.01); G06T 2207/30108 (2013.01)] 20 Claims
OG exemplary drawing
 
1. An electronic device comprising:
at least one processor; and
a storage device coupled to the at least one processor and storing instructions for execution by the at least one processor to cause the at least one processor to:
detect images of a product for defects by using a first defect detection model in a preset period, and obtain a detection result, the detection result comprising a plurality of negative sample images and positive sample images of the product;
determine whether a ratio of the number of negative sample images in the detection result is greater than a preset threshold;
in response that the ratio of the number of negative sample images in the detection result is greater than the preset threshold, train an autoencoder model by using the positive sample images of the product in the detection result, and obtain a trained autoencoder model;
obtain historical positive sample images of the product, input the historical positive sample images into the trained autoencoder model, and calculate a latent feature of each historical positive sample image by an encoding layer of the trained autoencoder model;
input the latent feature of each historical positive sample image of the product into a decoding layer of the trained autoencoder model, and obtain newly added positive sample images;
train the first defect detection model according to the newly added positive sample images, the historical positive sample images of the product, and the positive sample images of the product, and obtain a second defect detection model; and
input images of a product to be detected to the second defect detection model, and obtain a detection result of the product to be detected.