Method and apparatus for automatic optical inspection
A method for automatic optical inspection includes (i) receiving an image of an object, (ii) classifying the image of the object as one of a plurality of categories by a classification model, (iii) determining a label for the image of the object as being qualified if the category obtained by the classification model is a first category, and (iv) performing defect measurement for the image by a segmentation model and determining a label for the image as being qualified or unqualified based on the defect measurement obtained by the segmentation model if the category obtained by the classification model is a second category.
1 . A method for automatic optical inspection, comprising:
receiving an image of an object;
classifying the image of the object as one of a plurality of categories using a classification model;
in response to the image of the object being classified as a first category of the plurality of categories, labeling the image of the object as being qualified;
in response to the image of the object being classified as a second category of the plurality of categories, (i) determining a defect measurement by segmenting the image of the object using a segmentation model and (ii) labeling the image as being qualified or unqualified based on the defect measurement; and
in response to the image of the object being classified as a third category of the plurality of categories, (i) determining an anomaly score for the image of the object using an anomaly detection model and (ii) labeling the image as being qualified or unqualified based on the anomaly score.
2 . The method of claim 1 , further comprising:
in response to the image of the object being classified as a fourth category of the plurality of categories, labeling the image as being unqualified.
3 . The method of claim 2 , wherein one of:
the first category indicates that the object is qualified, the second category indicates that defect measurement needed, the fourth category being unqualified, and the third category indicates another situation;
the first category indicates that the object is qualified with uncertainty that is less than a first threshold uncertainty, the second category indicates that defect measurement needed with uncertainty that is less than a second threshold uncertainty, the fourth category being unqualified with low uncertainty, and the third category indicates another situation; or
the first category indicates that the object is qualified with uncertainty that is less than the first threshold uncertainty, the second category indicates that defect measurement needed with uncertainty that is less than the second threshold uncertainty or is greater than a third threshold uncertainty, the fourth category indicates that the object is unqualified with uncertainty that is less than a fourth threshold uncertainty, and the third category indicates another situation.
4 . The method of claim 1 , wherein one of:
the first category indicates that the object is qualified and the second category indicates another situation; or
the first category indicates that the object is qualified with uncertainty that is less than a first threshold uncertainty and the second category indicates another situation.
5 . The method of claim 1 , wherein one of:
the first category indicates that the object is qualified, the second category indicates that defect measurement is needed, and the third category indicates another situation;
the first category indicates that the object is qualified with uncertainty that is less than a first threshold uncertainty, the second category indicates that defect measurement needed with uncertainty that is less than a second threshold uncertainty, and the third category indicates another situation; or
the first category indicates that the object is qualified with uncertainty that is less than the first threshold uncertainty, the second category indicates that defect measurement needed with uncertainty that is less than the second threshold uncertainty or is greater than a third threshold uncertainty, and the third category indicates another situation.
6 . The method of claim 1 , the determining the defect measurement further comprising:
identifying a defect region of each of one or more defects on the image;
determining a size of each of the one or more defects based on the defect region; and
labeling the image as being qualified or unqualified based on at least one of the size of each of the one or more defects, a position of each of the one or more defects and a number of the one or more defects.
7 . The method of claim 6 , wherein the size of each of the one or more defects being one of diameter of a circumcircle of the defect region each of the one or more defects, an area of the circumcircle of the defect region each of the one or more defects, and an area of the defect region each of the one or more defects.
8 . The method of claim 1 , wherein the anomaly detection model determines the anomaly score based on a feature map of the image obtained by the classification model.
9 . The method of claim 8 , wherein:
the classification model is a Bayesian convolutional neural network (CNN) model including a plurality of CNN models, and
the feature map of the image is one of (i) a feature map obtained by a fixed one of the plurality of CNN models, (ii) a feature map obtained by a randomly selected one of the plurality of CNN models, and (iii) a feature map averaged over feature maps of at least a part of the plurality of CNN models.
10 . The method of claim 1 , wherein the classification model is a convolutional neural network (CNN) model or a Bayesian convolutional neural network (CNN) model.
11 . The method of claim 10 , wherein the segmentation model is a fully convolutional network (FCN) model.
12 . The method of claim 1 , wherein the object is one of a precision-machinery component, weld assembly, coated part, an intermediate product, and a semi-finished product during manufacturing.
13 . An apparatus for automatic optical inspection, comprising:
an optical unit configured to capture an image of an object;
one or more processors; and
one or more storage devices storing computer-executable instructions that, when executed, cause the one or more processors to perform the method of claim 1 .
14 . A computer system, comprising:
one or more processors; and
one or more storage devices storing computer-executable instructions that, when executed, cause the one or more processors to perform the method of claim 1 .
15 . One or more non-transitory computer readable storage media storing computer-executable instructions that, when executed, cause one or more processors to perform the method of claim 1 .
16 . An apparatus for automatic optical inspection, comprising:
a classification module configured to classify an image of an object as one of a plurality of categories using a classification model;
a decision module configured to, in response to the image of the object being classified as a first category of the plurality of categories, label the image of the object as being qualified;
a segmentation module configured to, in response to the image of the object being classified as a second category of the plurality of categories, (i) determine a defect measurement by segmenting the image of the object using a segmentation model, and label the image as being qualified or unqualified based on the defect measurement; and
an anomaly detection module configured to, in response to the image of the object being classified as a third category of the plurality of categories, (i) determine an anomaly score for the image of the object using an anomaly detection model and (ii) label the image as being qualified or unqualified based on the anomaly score.
17 . The apparatus of claim 16 , wherein the decision module is further configured to label the image as being unqualified if the category obtained by the classification module is a fourth category.