# US 12,112,527 B2 · Method and device for detecting defects, electronic device using method, and non-transitory storage medium

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 12,112,527 B2
- Document ID: US12112527B2
- Status: Granted
- Kind: B2
- Application number: 17/564,512
- Filed: 2021-12-29
- Published: 2022-06-30
- Granted: 2024-10-08
- Earliest claimed: 2020-12-30
- Assignees: Hon Hai Precision Industry Co., Ltd.
- Applicants: Hon Hai Precision Industry Co., Ltd.
- Inventors: Tung-Tso Tsai; Chin-Pin Kuo; Tzu-Chen Lin; Shih-Chao Chien
- Web page: https://patentgrep.com/patent/US12112527B2

## CPC

- G06V 10/7796: {based on specific statistical tests}
- G06N 3/04: Architecture, e.g. interconnection topology
- G06N 3/045: Combinations of networks
- G06N 3/0455: Auto-encoder networks; Encoder-decoder networks
- G06N 3/0464: Convolutional networks [CNN, ConvNet]
- G06N 3/088: Non-supervised learning, e.g. competitive learning
- G06N 3/09: Supervised learning
- G06T 7/0002: {Inspection of images, e.g. flaw detection}
- G06T 7/0004: {Industrial image inspection}
- G06V 10/774: Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
- G06V 10/82: using neural networks
- G06V 10/95: {structured as a network, e.g. client-server architectures}
- G06T 2207/20081: Training; Learning
- G06T 2207/20084: Artificial neural networks [ANN]
- G06T 2207/30168: Image quality inspection
- G06V 2201/06: Recognition of objects for industrial automation
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL

## Abstract

In a method for defecting surface defects, a trained weighting generated when defect-free training samples are used to train an autoencoder and pixel convolutional neural network is obtained. A test encoding feature is obtained by inputting the trained weighting into the autoencoder and pixel convolutional neural network and a weighted autoencoder of the weighted autoencoder and pixel convolutional neural network encoding a test sample. The test encoding feature is input into a weighted pixel convolution neural network of the weighted autoencoder and pixel convolutional neural network to output a result of test. The test result is either no defect in the test sample or at least one defect in the test sample. Inaccurate determinations as to defects are thereby avoided. An electronic device and a non-transitory storage medium are also disclosed.

## Claims

### Claim 1

A method for detecting defects comprising:
obtaining a trained weighting generated when an autoencoder and pixel convolutional neural network is being trained with a plurality of defect-free training samples;
inputting the trained weighting into the autoencoder and the pixel convolutional neural network to obtain a test encoding feature; the test encoding feature is obtained by encoding test samples using a weighted autoencoder of the weighted autoencoder and pixel convolutional neural network; the test encoding feature is a feature generated when the test sample is being encoded by the encoder of the weighted autoencoder of the weighted autoencoder and pixel convolutional neural network, a hidden layer feature; and
inputting the test encoding feature into the pixel convolution neural network loaded the trained weighting to output a test result, the test result being either no defect in the test sample or at least one defect in the test sample.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the autoencoder and pixel convolutional neural network is an architecture of the autoencoder based on the pixel convolutional neural network.

### Claim 3 (depends on 1)

The method according to claim 1, wherein the inputting the test encoding feature into a weighted pixel convolution neural network of the weighted autoencoder and pixel convolutional neural network to output a test result comprises:
inputting the test encoding feature into a weighted pixel convolution neural network of the weighted autoencoder and pixel convolutional neural network to output a probability value;
outputting the test result according to the probability value.

### Claim 4 (depends on 3)

The method according to claim 3, wherein the output layer of the pixel convolution neural network is a softmax layer.

### Claim 5 (depends on 4)

The method according to claim 4, wherein the pixel convolution neural network comprises a convolution kernel with a size of 7×7, a plurality of residual modules, a plurality of convolution layers with a size of 1×1, and the softmax layer connected in sequence.

### Claim 6 (depends on 3)

The method according to claim 3, wherein:
if the probability value approaches 0, the test result is no defect in the test sample;
if the probability value approaches 1, the test result is at least one defect in the test sample.

### Claim 7 (depends on 1)

The method according to claim 1, wherein the method further comprises:
obtaining a plurality of defect-free training samples;
inputting the defect-free training samples into an autoencoder of the autoencoder and pixel convolutional neural network to obtain a plurality of training encoding features by the autoencoder encoding the defect-free training samples;
performing training by inputting the training encoding features into a pixel convolutional neural network of the autoencoder and pixel convolutional neural network to generate the trained weighting of the autoencoder and pixel convolutional neural network.

### Claim 8

An electronic device comprising:
a storage device;
at least one processor; and
the storage device storing one or more programs, which when executed by the at least one processor, cause the at least one processor to:
obtain a trained weighting generated when an autoencoder and pixel convolutional neural network is being trained with a plurality of defect-free training samples;
input the trained weighting into the autoencoder and pixel convolutional neural network to obtain a test encoding feature; the test encoding feature is obtained by encoding test samples using a weighted autoencoder of the weighted autoencoder and pixel convolutional neural network; the test encoding feature is a feature generated when the test sample is being encoded by the encoder of the weighted autoencoder of the weighted autoencoder and pixel convolutional neural network, a hidden layer feature; and
input the test encoding feature into a weighted pixel convolution neural network of the weighted autoencoder and pixel convolutional neural network to output a test result, the test result being either no defect in the test sample or at least one defect in the test sample.

### Claim 9 (depends on 8)

The electronic device according to claim 8, wherein the autoencoder and pixel convolutional neural network is an architecture of the autoencoder based on the pixel convolutional neural network.

### Claim 10 (depends on 8)

The electronic device according to claim 8, further causing the at least one processor to:
input the test encoding feature into a weighted pixel convolution neural network of the weighted autoencoder and pixel convolutional neural network to output a probability value;
output the test result according to the probability value.

### Claim 11 (depends on 10)

The electronic device according to claim 10, wherein the output layer of the pixel convolution neural network is a softmax layer.

### Claim 12 (depends on 11)

The electronic device according to claim 11, wherein the pixel convolution neural network comprises a convolution kernel with a size of 7×7, a plurality of residual modules, a plurality of convolution layers with a size of 1×1, and the softmax layer connected in sequence.

### Claim 13 (depends on 10)

The electronic device according to claim 10, wherein:
if the probability value approaches 0, the test result is no defect in the test sample;
if the probability value approaches 1, the test result is at least one defect in the test sample.

### Claim 14 (depends on 8)

The electronic device according to claim 8, further causing the at least one processor to:
obtain a plurality of defect-free training samples;
input the defect-free training samples into an autoencoder of the autoencoder and pixel convolutional neural network to obtain a plurality of training encoding features by the autoencoder encoding the defect-free training samples;
perform training by inputting the training encoding features into a pixel convolutional neural network of the autoencoder and pixel convolutional neural network to generate the trained weighting of the autoencoder and pixel convolutional neural network.

### Claim 15

A non-transitory storage medium storing a set of commands, when the commands being executed by at least one processor of an electronic device, causing the at least one processor to:
obtain a trained weighting generated when an autoencoder and pixel convolutional neural network is being trained with a plurality of defect-free training samples;
input the trained weighting into the autoencoder and pixel convolutional neural network to obtain a test encoding feature; the test encoding feature is obtained by encoding test samples using a weighted autoencoder of the weighted autoencoder and pixel convolutional neural network; the test encoding feature is a feature generated when the test sample is being encoded by the encoder of the weighted autoencoder of the weighted autoencoder and pixel convolutional neural network, a hidden layer feature; and
input the test encoding feature into a weighted pixel convolution neural network of the weighted autoencoder and pixel convolutional neural network to output a test result, the test result being either no defect in the test sample or at least one defect in the test sample.

### Claim 16 (depends on 15)

The non-transitory storage medium according to claim 15, wherein the autoencoder and pixel convolutional neural network is an architecture of the autoencoder based on the pixel convolutional neural network.

### Claim 17 (depends on 15)

The non-transitory storage medium according to claim 15, further causing the at least one processor to:
input the test encoding feature into a weighted pixel convolution neural network of the weighted autoencoder and pixel convolutional neural network to output a probability value;
output the test result according to the probability value.

### Claim 18 (depends on 17)

The non-transitory storage medium according to claim 17, wherein the output layer of the pixel convolution neural network is a softmax layer.

### Claim 19 (depends on 18)

The non-transitory storage medium according to claim 18, wherein the pixel convolution neural network comprises a convolution kernel with a size of 7×7, a plurality of residual modules, a plurality of convolution layers with a size of 1×1, and the softmax layer connected in sequence.

### Claim 20 (depends on 15)

The non-transitory storage medium according to claim 15, further causing the at least one processor to:
obtain a plurality of defect-free training samples;
input the defect-free training samples into an autoencoder of the autoencoder and pixel convolutional neural network to obtain a plurality of training encoding features by the autoencoder encoding the defect-free training samples;
perform training by inputting the training encoding features into a pixel convolutional neural network of the autoencoder and pixel convolutional neural network to generate the trained weighting of the autoencoder and pixel convolutional neural network.
