# US 2021/0342688 A1 · Neural network training method, device and storage medium based on memory score

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

- Number: US 2021/0342688 A1
- Document ID: US20210342688A1
- Status: Published application
- Kind: A1
- Application number: 17/226,596
- Filed: 2021-04-09
- Published: 2021-11-04
- Earliest claimed: 2020-04-30
- Assignees: UnitX, Inc.
- Applicants: UnitX, Inc.
- Inventors: Kedao Wang
- Web page: https://patentgrep.com/patent/US20210342688A1

## CPC

- G06V 10/82: using neural networks
- G06F 18/2113: by ranking or filtering the set of features, e.g. using a measure of variance or of feature cross-correlation
- G06F 18/214: Generating training patterns; Bootstrap methods, e.g. bagging or boosting
- G06F 18/2413: based on distances to training or reference patterns
- G06N 3/08: Learning methods
- G06N 3/09: Supervised learning
- G06T 7/0004: {Industrial image inspection}
- G06V 10/764: using classification, e.g. of video objects
- G06V 10/7747: {Organisation of the process, e.g. bagging or boosting}
- G06V 10/776: Validation; Performance evaluation
- G06T 2207/20081: Training; Learning
- G06T 2207/20084: Artificial neural networks [ANN]
- Y02P 90/30: Computing systems specially adapted for manufacturing
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- Y02P: CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS

## Abstract

The present disclosure relates to a method, devices, and storage medium for training neural networks based on memory scores. The said method comprises: establishing the memory scores of a plurality of first-sample images in the library, from their training ages and training indicators, and a preset discount rate; determining a plurality of second-sample images from these memory scores and a preset first count, and using them to establish the first training set; training the neural network by using the first training set, with the said neural network is used for defect detection. The neural network training method in the disclosed embodiment reduces the size of the training set and shortens the time to converge, thereby improving training efficiency.

## Claims

### Claim 1

A computer-implemented method for training a neural network based on memory scores, comprising:
determining, at a computing device having one or more processors, a memory score for each particular first-sample image of a plurality of first-sample images from a library based on a training age of the particular first-sample image, a training indicator of the particular first-sample image, and a preset discount rate, wherein the said first-sample images are images of an object to be inspected, the plurality of first-sample images including at least one newly-added image, the training indicator representing whether its corresponding first-sample image is added to a training set of each training session of the neural network, the training age indicating a number of times the neural network is trained after its corresponding first-sample image is added to the library, wherein the memory scores indicate a degree of involvement of the first-sample images in training;
determining, at the computing device, a plurality of second-sample images from the library, according to the memory scores of the first-sample images and a preset first count;
using, at the computing device, the plurality of second-sample images to establish a first training set; and
training, at the computing device, the neural network by using the first training set,
wherein the said neural network is used for defect detection.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, further comprising:
determining, at the computing device, a plurality of third-sample images from the library according to the memory scores and training ages of the first-sample images and a preset second count;
using, at the computing device, the plurality of third-sample images to establish a second training set; and
using, at the computing device, the second training set to train the neural network.

### Claim 3 (depends on 1)

The computer-implemented method of claim 1, wherein determining the memory scores of the plurality of first-sample images based on the training ages, the training indicators, and the preset discount rate comprises:
for each particular first-sample image, determining a discounted score when the neural network undergoes the ith training, based on the preset discount rate and the training indicator of the particular first-sample image in the ith training, where i is defined as the number of training sessions before the current one, with the i of the current training is set to 0, i is an integer and 0≤i≤N, N is an integer corresponding to the training age of the particular first-sample image, and N≥0;
a sum of the N discounted scores of the particular first-sample image is determined as the memory score of the particular first-sample image.

### Claim 4 (depends on 3)

The computer-implemented method of claim 3, wherein, when the particular first-sample image is added to the training set during the ith training of the neural network, the training indicator of the particular first-sample image in the ith training is set to 1, and
when the particular first-sample image is not added to the training set during the ith training of the neural network, the training indicator of the particular first-sample image in the ith training is set to 0.

### Claim 5 (depends on 3)

The computer-implemented method of claim 3, wherein determining the discounted scores of the first-sample images in the ith training of the neural network based on the training indicators during the ith training and the preset discount rate comprises:
setting the discounted score of each particular first-sample image during the ith training of the neural network as the product of the training indicator during the ith training and the preset discount rate raised to the ith power.

### Claim 6 (depends on 1)

The computer-implemented method of claim 1, wherein determining the plurality of second-sample images from the library and using the plurality of second-sample images to establish the first training set, based on the memory scores of the said first-sample images and the preset first count, comprises:
determining the second-sample images by selecting the first-sample images with the lowest memory scores from the library, according to the memory scores of the said first-sample images and the preset first count;
establishing the first training set based on the second-sample images.

### Claim 7 (depends on 1)

The computer-implemented method of claim 1, further comprising:
determining, at the computing device, a plurality of third-sample images from the library based on the memory scores and training ages of the said first-sample images and a preset second count;
using, at the computing device, the plurality of third-sample image to establish a second training set;
determining, at the computing device, fourth-sample images from the library by selecting the first-sample images with the lowest memory scores;
determining, at the computing device, fifth-sample images from the library by selecting the first-sample images with the smallest training ages, wherein the sum of the number of fourth-sample images and fifth-sample images is equal to the preset second count;
setting, at the computing device, the third-sample images as the union of the fourth-sample images and fifth-sample images;
establishing, at the computing device, the second training set based on the third-sample images.

### Claim 8 (depends on 1)

The computer-implemented method of claim 1, further comprising:
loading, at the computing device, labeled images into the neural network for defect detection to obtain a detection result of the labeled images, wherein the labeled images are newly-added images that have not been added to the library;
when the detection result of each particular labeled image is inconsistent with a preset expected result, modifying, at the computing device, a label of the particular labeled image to obtain a modified label of the particular labeled image;
adding, at the computing device, the labeled images and the modified labels of the labeled images to the library.

### Claim 9 (depends on 8)

The method according to claim 8, further comprising:
when the detection result of the particular labeled image is consistent with the expected result, discarding, at the computing device, the particular labeled image.

### Claim 10

A computing device for training a neural network based on memory scores, comprising:
one or more processors; and
a non-transitory computer-readable storage medium having a plurality of instructions stored thereon, which, when executed by the one or more processors, cause the one or more processors to perform operations comprising:
determining a memory score for each particular first-sample image of a plurality of first-sample images from a library based on a training age of the particular first-sample image, a training indicator of the particular first-sample image, and a preset discount rate, wherein the said first-sample images are images of an object to be inspected, the plurality of first-sample images including at least one newly-added image, the training indicator representing whether its corresponding first-sample image is added to a training set of each training session of the neural network, the training age indicating a number of times the neural network is trained after its corresponding first-sample image is added to the library, wherein the memory scores indicate a degree of involvement of the first-sample images in training;
determining a plurality of second-sample images from the library, according to the memory scores of the first-sample images and a preset first count;
using the plurality of second-sample images to establish a first training set; and
training the neural network by using the first training set,
wherein the said neural network is used for defect detection.

### Claim 11 (depends on 10)

The computing device of claim 10, wherein the operations further comprise:
determining a plurality of third-sample images from the library according to the memory scores and training ages of the first-sample images and a preset second count;
using the plurality of third-sample images to establish a second training set; and
using the second training set to train the neural network.

### Claim 12 (depends on 10)

The computing device of claim 10, wherein determining the memory scores of the plurality of first-sample images based on the training ages, the training indicators, and the preset discount rate comprises:
for each particular first-sample image, determining a discounted score when the neural network undergoes the ith training, based on the preset discount rate and the training indicator of the particular first-sample image in the ith training, where i is defined as the number of training sessions before the current one, with the i of the current training is set to 0, i is an integer and 0≤i≤N, N is an integer corresponding to the training age of the particular first-sample image, and N≥0;
a sum of the N discounted scores of the particular first-sample image is determined as the memory score of the particular first-sample image.

### Claim 13 (depends on 12)

The computing device of claim 12, wherein, when the particular first-sample image is added to the training set during the ith training of the neural network, the training indicator of the particular first-sample image in the ith training is set to 1, and
when the particular first-sample image is not added to the training set during the ith training of the neural network, the training indicator of the particular first-sample image in the ith training is set to 0.

### Claim 14 (depends on 12)

The computing device of claim 12, wherein determining the discounted scores of the first-sample images in the ith training of the neural network based on the training indicators during the ith training and the preset discount rate comprises:
setting the discounted score of each particular first-sample image during the ith training of the neural network as the product of the training indicator during the ith training and the preset discount rate raised to the ith power.

### Claim 15 (depends on 10)

The computing device of claim 10, wherein determining the plurality of second-sample images from the library and using the plurality of second-sample images to establish the first training set, based on the memory scores of the said first-sample images and the preset first count, comprises:
determining the second-sample images by selecting the first-sample images with the lowest memory scores from the library, according to the memory scores of the said first-sample images and the preset first count;
establishing the first training set based on the second-sample images.

### Claim 16 (depends on 10)

The computing device of claim 10, wherein the operations further comprise:
determining a plurality of third-sample images from the library based on the memory scores and training ages of the said first-sample images and a preset second count;
using the plurality of third-sample image to establish a second training set;
determining fourth-sample images from the library by selecting the first-sample images with the lowest memory scores;
determining fifth-sample images from the library by selecting the first-sample images with the smallest training ages, wherein the sum of the number of fourth-sample images and fifth-sample images is equal to the preset second count;
setting the third-sample images as the union of the fourth-sample images and fifth-sample images;
establishing the second training set based on the third-sample images.

### Claim 17 (depends on 10)

The computing device of claim 10, wherein the operations further comprise:
loading labeled images into the neural network for defect detection to obtain a detection result of the labeled images, wherein the labeled images are newly-added images that have not been added to the library;
when the detection result of each particular labeled image is inconsistent with a preset expected result, modifying a label of the particular labeled image to obtain a modified label of the particular labeled image;
adding the labeled images and the modified labels of the labeled images to the library.

### Claim 18 (depends on 17)

The computing device of claim 17, wherein the operations further comprise:
when the detection result of the particular labeled image is consistent with the expected result, discarding the particular labeled image.

### Claim 19

A non-transitory computer-readable storage medium having a plurality of instructions stored thereon, which, when executed by one or more processors, cause the one or more processors to perform operations comprising:
determining a memory score for each particular first-sample image of a plurality of first-sample images from a library based on a training age of the particular first-sample image, a training indicator of the particular first-sample image, and a preset discount rate, wherein the said first-sample images are images of an object to be inspected, the plurality of first-sample images including at least one newly-added image, the training indicator representing whether its corresponding first-sample image is added to a training set of each training session of the neural network, the training age indicating a number of times the neural network is trained after its corresponding first-sample image is added to the library, wherein the memory scores indicate a degree of involvement of the first-sample images in training;
determining a plurality of second-sample images from the library, according to the memory scores of the first-sample images and a preset first count;
using the plurality of second-sample images to establish a first training set; and
training the neural network by using the first training set,
wherein the said neural network is used for defect detection.

### Claim 20 (depends on 19)

The non-transitory computer-readable storage medium of claim 19, wherein the operations further comprise:
determining a plurality of third-sample images from the library according to the memory scores and training ages of the first-sample images and a preset second count;
using the plurality of third-sample images to establish a second training set; and
using the second training set to train the neural network.
