# US 12,112,522 B2 · Defect detecting method based on dimensionality reduction of data, electronic device, and 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,522 B2
- Document ID: US12112522B2
- Status: Granted
- Kind: B2
- Application number: 17/587,086
- Filed: 2022-01-28
- Published: 2022-08-11
- Granted: 2024-10-08
- Earliest claimed: 2021-02-09
- Assignees: Hon Hai Precision Industry Co., Ltd.
- Applicants: Hon Hai Precision Industry Co., Ltd.
- Inventors: Tzu-Chen Lin; Tung-Tso Tsai; Chin-Pin Kuo
- Web page: https://patentgrep.com/patent/US12112522B2

## CPC

- G06T 7/0004: {Industrial image inspection}
- G06V 10/7747: {Organisation of the process, e.g. bagging or boosting}
- G06T 7/0006: {using a design-rule based approach}
- G06V 10/32: Normalisation of the pattern dimensions
- G06V 10/758: {Involving statistics of pixels or of feature values, e.g. histogram matching}
- G06V 10/7715: {Feature extraction, e.g. by transforming the feature space, e.g. multi-dimensional scaling [MDS]; Mappings, e.g. subspace methods}
- G06T 2207/20081: Training; Learning
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING

## Abstract

A method for detecting product for defects implemented in an electronic device includes classifying a plurality of product images to be detected into linear images or non-linear images; performing dimension reduction processing on the product images after image classification according to a plurality of dimension reduction algorithms to obtain a plurality of dimension reduction data; determining an optimal dimension reduction data of the plurality of dimension reduction data; obtaining score data of the product image by inputting the optimal dimension reduction data into a Gaussian mixture model; comparing the score data with a threshold; determining whether the score data is less than the threshold; and determining that there is at least one defect in the product image in response that the score data is determined to be less than the threshold.

## Claims

### Claim 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:
classify each of a plurality of product images into a linear image or a non-linear image;
obtain a plurality of dimension reduction data by performing dimension reduction processing on the plurality of product images by applying a plurality of dimension reduction algorithms;
determine an optimal dimension reduction data of the plurality of dimension reduction data;
obtain score data of each of the plurality of product images by inputting the optimal dimension reduction data into a Gaussian mixture model;
determine whether the score data is less than a threshold; and
determine that at least one defect exists in a corresponding product image of the plurality of product images in response that the score data is determined to be less than the threshold.

### Claim 2 (depends on 1)

The electronic device according to claim 1, wherein the at least one processor is further caused to:
determine that no defect exists in the corresponding product image in response that the score data is determined to be greater than or equal to the threshold.

### Claim 3 (depends on 1)

The electronic device according to claim 1, wherein the at least one processor is further caused to:
perform normalization processing on the plurality of product images;
obtain a classification score respectively of the linear image and the non-linear image by inputting pixel values of each of the plurality of product images into a linear scoring function;
determine whether the classification score of the linear image is greater than the classification score of the non-linear image;
in response that the classification score of the linear image is determined to be greater than the classification score of the non-linear image, classify a corresponding product image of the plurality product images into the linear image; and
in response that the classification score of the linear image is determined to be not greater than the classification score of the non-linear image, classify the corresponding product image into the non-linear image.

### Claim 4 (depends on 1)

The electronic device according to claim 1, wherein the at least one processor is further caused to:
in response that the corresponding product image is a linear image, reduce dimension of the corresponding product image by applying a principal component analysis algorithm (PCA) and a random projection algorithm; and
in response that the corresponding product image is a non-linear image, reduce dimension of the product image by applying an isometric mapping algorithm and a t-distributed random neighborhood embedding algorithm.

### Claim 5 (depends on 4)

The electronic device according to claim 4, wherein the at least one processor is further caused to:
calculate an average distance between the plurality of dimension reduction data obtained by each dimension reduction algorithm; and
determine the plurality of dimension reduction data with a greatest distance average value as the optimal dimension reduction data.

### Claim 6 (depends on 1)

The electronic device according to claim 1, wherein the at least one processor is further caused to:
determine a number of Gaussian mixture models in the Gaussian mixture model according to a number of types of defects to be detected;
calculate an expected value and model parameter values of each iteration of the Gaussian mixture model according to the optimal dimension reduction data and an Expectation-Maximum (EM) algorithm; and
calculate an optimal parameter of the Gaussian mixture model according to the expected value and the model parameter values calculated in each iteration as the score data.

### Claim 7 (depends on 6)

The electronic device according to claim 6, wherein the threshold is a difference between a mean value of the model parameter values calculated in each iteration and three times a standard deviation of the score data.

### Claim 8 (depends on 1)

The electronic device according to claim 1, wherein the at least one processor is further caused to:
mark at least one area where the at least one defect is located in the corresponding product image; and
display the marked product image on a display device.

### Claim 9

A defect detecting method based on dimensionality reduction of data implemented in an electronic device comprising:
classifying each of a plurality of product images into a linear image or a non-linear image;
obtaining a plurality of dimension reduction data by performing dimension reduction processing on the plurality of product images by applying a plurality of dimension reduction algorithms;
determining an optimal dimension reduction data of the plurality of dimension reduction data;
obtaining score data of the plurality of product image by inputting the optimal dimension reduction data into a Gaussian mixture model;
determining whether the score data is less than a threshold; and
determining that at least one defect exists in a corresponding product image of the plurality of product images in response that the score data is determined to be less than the threshold.

### Claim 10 (depends on 9)

The method according to claim 9, further comprising:
determining that no defect exists in the corresponding product image in response that the score data is determined to be greater than or equal to the threshold.

### Claim 11 (depends on 9)

The method according to claim 9, wherein classifying a plurality of product images to be detected into linear images or non-linear images comprises:
performing normalization processing on the plurality of product images;
obtaining a classification score respectively of the linear image and the non-linear image by inputting pixel values of each of the plurality of product images into a linear scoring function;
determining whether the classification score of the linear image is greater than the classification score of the non-linear image;
in response that the classification score of the linear image is determined to be greater than the classification score of the non-linear image, classifying a corresponding product image of the plurality product images into the linear image; and
in response that the classification score of the linear image is determined to be not greater than the classification score of the non-linear image, classifying the corresponding product image into the non-linear image.

### Claim 12 (depends on 9)

The method according to claim 9, wherein performing dimension reduction processing on the product images after image classification according to a plurality of dimension reduction algorithms to obtain a plurality of dimension reduction data comprises
in response that the corresponding product image is a linear image, reducing dimension of the corresponding product image by applying a principal component analysis algorithm (PCA) and a random projection algorithm; and
in response that the corresponding product image is a non-linear image, reducing dimension of the product image by applying an isometric mapping algorithm and a t-distributed random neighborhood embedding algorithm.

### Claim 13 (depends on 9)

The method according to claim 9, wherein determining an optimal dimension reduction data of the plurality of dimension reduction data comprises:
calculating an average distance between the plurality of dimension reduction data obtained by each dimension reduction algorithm; and
determining the plurality of dimension reduction data with a greatest distance average value as the optimal dimension reduction data.

### Claim 14 (depends on 9)

The method according to claim 9, wherein obtaining score data of the product image by inputting the optimal dimension reduction data into a Gaussian mixture model comprises:
determining a number of Gaussian mixture models in the Gaussian mixture model according to a number of types of defects to be detected;
calculating an expected value and model parameter values of each iteration of the Gaussian mixture model according to the optimal dimension reduction data and an Expectation-Maximum algorithm; and
calculating an optimal parameter of the Gaussian mixture model according to the expected value and the model parameter values calculated in each iteration as the score data.

### Claim 15 (depends on 14)

The method according to claim 14, wherein the threshold is a difference between a mean value of the model parameter values calculated in each iteration and three times a standard deviation of the score data.

### Claim 16 (depends on 9)

The method according to claim 9, further comprising:
marking at least one area where the at least one defect is located in the corresponding product image; and
displaying the marked product image on a display device.

### Claim 17

A non-transitory storage medium having instructions stored thereon, when the instructions are executed by a processor of an electronic device, the processor is configured to perform a defect detecting method based on dimensionality reduction of data, wherein the method comprises:
classifying each of a plurality of product images into a linear image or a non-linear image;
obtaining a plurality of dimension reduction data by performing dimension reduction processing on the plurality of product images by applying a plurality of dimension reduction algorithms;
determining an optimal dimension reduction data of the plurality of dimension reduction data;
obtaining score data of the plurality of product image by inputting the optimal dimension reduction data into a Gaussian mixture model;
determining whether the score data is less than a threshold; and
determining that at least one defect exists in a corresponding product image of the plurality of product images in response that the score data is determined to be less than the threshold.
