# US 2024/0203103 A1 · Method for training model, 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 2024/0203103 A1
- Document ID: US20240203103A1
- Status: Published application
- Kind: A1
- Application number: 18/591,205
- Filed: 2024-02-29
- Published: 2024-06-20
- Earliest claimed: 2022-07-19
- Assignees: Mashang Consumer Finance Co., Ltd.
- Applicants: MaShang Consumer Finance Co., Ltd.
- Inventors: Yongchun Lv; Hui Zhu; Xunyi Zhou; Ning Jiang; Haiying Wu
- Web page: https://patentgrep.com/patent/US20240203103A1

## CPC

- G06V 10/7753: {Incorporation of unlabelled data, e.g. multiple instance learning [MIL]}
- G06V 10/764: using classification, e.g. of video objects
- G06V 10/774: Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
- G06V 10/776: Validation; Performance evaluation
- G06V 10/82: using neural networks
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING

## Abstract

The present application discloses a method for training a model, an electronic device and a storage medium. The method includes obtaining an image set used for training a model and discriminating the labeled image and the unlabeled image by a target sub-model of the model and determining first classification reference information of the labeled image and first classification reference information of the unlabeled image. The method further includes discriminating the unlabeled image by a non-target sub-model of the model, and determining second classification reference information of the unlabeled image and determining a classification loss of the target sub-model based on the first classification reference information of the labeled image, the category label of the labeled image, and the second classification reference information of the unlabeled image and tuning a model parameter of the model according to the classification loss.

## Claims

### Claim 1

A method for training a model, comprising:
obtaining an image set used for training a model, the image set comprises a labeled image, an unlabeled image and a category label of the labeled image;
discriminating the labeled image and the unlabeled image by a target sub-model of the model, and determining first classification reference information of the labeled image and first classification reference information of the unlabeled image;
discriminating the unlabeled image by a non-target sub-model of the model, and determining second classification reference information of the unlabeled image;
determining a classification loss of the target sub-model based on the first classification reference information of the labeled image, the category label of the labeled image, and the second classification reference information of the unlabeled image; and
tuning a model parameter of the model according to the classification loss.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the method further comprises:
obtaining an initial unlabeled image; and
augmenting the initial unlabeled image via different augmentation strategies and determining the unlabeled images, wherein the number of the unlabeled images is more than one, and each of the unlabeled images corresponding to one of the different augmentation strategies.

### Claim 3 (depends on 2)

The method according to claim 2, wherein the unlabeled images comprise a first unlabeled image and a second unlabeled image, and an augmentation strategy of the first unlabeled image is lighter than an augmentation strategy of the second unlabeled image;
wherein determining the classification loss of the target sub-model based on the first classification reference information of the labeled image, the category label of the labeled image, and the second classification reference information of the unlabeled image comprises:
generating a first pseudo label of the first unlabeled image according to the second classification reference information of the first unlabeled image;
determining a first unsupervised loss of the target sub-model according to the first classification reference information of the second unlabeled image and the first pseudo label;
determining a supervised loss of the target sub-model according to the first classification reference information of the labeled image and the category label of the labeled image; and
determining the classification loss of the target sub-model according to the first unsupervised loss of the target sub-model and the supervised loss of the target sub-model.

### Claim 4 (depends on 3)

The method according to claim 3, wherein before determining the first unsupervised loss of the target sub-model according to the first classification reference information of the second unlabeled image and the first pseudo label, the method further comprises:
determining a loss weight of the first unlabeled image according to the first pseudo label and a second pseudo label, wherein the second pseudo label is generated according to the first classification reference information of the first unlabeled image;
wherein determining the supervised loss of the target sub-model according to the first classification reference information of the labeled image and the category label of the labeled image comprises:
determining a second unsupervised loss of the first unlabeled image according to the first classification reference information of the second unlabeled image and the first pseudo label; and
determining the first unsupervised loss of the target sub-model according to the loss weight and the second unsupervised loss.

### Claim 5 (depends on 4)

The method according to claim 4, wherein the first pseudo label of the first unlabeled image is used to indicate a first target object area of the first unlabeled image and a first predicted category to which the first target object area belongs, the second pseudo label of the first unlabeled image is used to indicate a second target object area of the first unlabeled image and a second predicted category to which the second target object area belongs;
wherein determining the loss weight of the first unlabeled image according to the first pseudo label and a second pseudo label comprises:
determining an intersection ratio between the first target object area and the second target object area, and comparing the first predicted category with the second predicted category and determining a comparison result; and
determining the loss weight of the first unlabeled image according to the intersection ratio and the comparison result.

### Claim 6 (depends on 5)

The method according to claim 5, wherein determining the loss weight of the first unlabeled image according to the intersection ratio and the comparison result comprises:
in response that the intersection ratio is less than or equal to a preset ratio, or in response that the comparison result indicates that the first predicted category is different from the second predicted category, determining the loss weight of the first unlabeled image as a first preset weight;
in response that the intersection ratio is greater than the preset ratio, and in response that the comparison result indicates that the first predicted category is the same as the second predicted category, determining the loss weight of the first unlabeled image as a second preset weight, wherein the second preset weight is greater than the first preset weight.

### Claim 7 (depends on 3)

The method according to claim 3, wherein the first classification reference information of the first unlabeled image and the second classification reference information of the first unlabeled image both comprise a probability that the first unlabeled image is identified as belonging to each of a plurality of the preset categories;
wherein generating the first pseudo label of the first unlabeled image according to the second classification reference information of the first unlabeled image comprises:
determining a preset category corresponding to a maximum probability from the plurality of preset categories according to the second classification reference information of the first unlabeled image; and
generating the first pseudo label of the first unlabeled image according to the preset category corresponding to the maximum probability in response that the maximum probability is greater than a preset probability threshold.

### Claim 8 (depends on 1)

The method according to claim 1, wherein the target sub-model comprises a first sub-model and a second sub-model,
wherein tuning the model parameter of the model according to the classification loss comprises:
summing a first classification loss of the first sub-model and a second classification loss of the second sub-model by using a weighted summation and determining the classification loss of the model; and
tuning the model parameter of the model according to the first classification loss and the second classification loss by using a back propagation algorithm.

### Claim 9

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 an image set used for training a model, the image set comprises a labeled image, an unlabeled image and a category label of the labeled image;
discriminate the labeled image and the unlabeled image by a target sub-model of the model, and determine first classification reference information of the labeled image and first classification reference information of the unlabeled image;
discriminate the unlabeled image by a non-target sub-model of the model, and determine second classification reference information of the unlabeled image;
determine a classification loss of the target sub-model based on the first classification reference information of the labeled image, the category label of the labeled image, and the second classification reference information of the unlabeled image; and
tune a model parameter of the model according to the classification loss.

### Claim 10 (depends on 9)

The electronic device according to claim 9, wherein the at least one processor is further caused to:
obtain an initial unlabeled image; and
augment the initial unlabeled image via different augmentation strategies and determine the unlabeled images, wherein the number of the unlabeled images is more than one, and each of the unlabeled images corresponding to one of the different augmentation strategies.

### Claim 11 (depends on 10)

The electronic device according to claim 10, wherein the unlabeled images comprise a first unlabeled image and a second unlabeled image, and an augmentation strategy of the first unlabeled image is lighter than an augmentation strategy of the second unlabeled image;
wherein the at least one processor determines the classification loss of the target sub-model based on the first classification reference information of the labeled image, the category label of the labeled image, and the second classification reference information of the unlabeled image, by:
generating a first pseudo label of the first unlabeled image according to the second classification reference information of the first unlabeled image;
determining a first unsupervised loss of the target sub-model according to the first classification reference information of the second unlabeled image and the first pseudo label;
determining a supervised loss of the target sub-model according to the first classification reference information of the labeled image and the category label of the labeled image; and
determining the classification loss of the target sub-model according to the first unsupervised loss of the target sub-model and the supervised loss of the target sub-model.

### Claim 12 (depends on 11)

The electronic device according to claim 11, wherein before determining the first unsupervised loss of the target sub-model according to the first classification reference information of the second unlabeled image and the first pseudo label, the at least one processor is further caused to:
determine a loss weight of the first unlabeled image according to the first pseudo label and a second pseudo label, wherein the second pseudo label is generated according to the first classification reference information of the first unlabeled image;
wherein the at least one processor determines the supervised loss of the target sub-model according to the first classification reference information of the labeled image and the category label of the labeled image, by:
determining a second unsupervised loss of the first unlabeled image according to the first classification reference information of the second unlabeled image and the first pseudo label; and
determining the first unsupervised loss of the target sub-model according to the loss weight and the second unsupervised loss.

### Claim 13 (depends on 12)

The electronic device according to claim 12, wherein the first pseudo label of the first unlabeled image is used to indicate a first target object area of the first unlabeled image and a first predicted category to which the first target object area belongs, the second pseudo label of the first unlabeled image is used to indicate a second target object area of the first unlabeled image and a second predicted category to which the second target object area belongs;
wherein the at least one processor determines the loss weight of the first unlabeled image according to the first pseudo label and a second pseudo label, by:
determining an intersection ratio between the first target object area and the second target object area, and comparing the first predicted category with the second predicted category and determining a comparison result; and
determining the loss weight of the first unlabeled image according to the intersection ratio and the comparison result.

### Claim 14 (depends on 11)

The electronic device according to claim 11, wherein the at least one processor determines the loss weight of the first unlabeled image according to the intersection ratio and the comparison result, by:
determining the loss weight of the first unlabeled image as a first preset weight, in response that the intersection ratio is less than or equal to a preset ratio, or in response that the comparison result indicates that the first predicted category is different from the second predicted category; and
determining the loss weight of the first unlabeled image as a second preset weight, in response that the intersection ratio is greater than the preset ratio, and in response that the comparison result indicates that the first predicted category is the same as the second predicted category, wherein the second preset weight is greater than the first preset weight.

### Claim 15 (depends on 11)

The electronic device according to claim 11, wherein the first classification reference information of the first unlabeled image and the second classification reference information of the first unlabeled image both comprise a probability that the first unlabeled image is identified as belonging to each of a plurality of the preset categories;
wherein the at least one processor generates the first pseudo label of the first unlabeled image according to the second classification reference information of the first unlabeled image, by:
determining a preset category corresponding to a maximum probability from the plurality of preset categories according to the second classification reference information of the first unlabeled image; and
generating the first pseudo label of the first unlabeled image according to the preset category corresponding to the maximum probability in response that the maximum probability is greater than a preset probability threshold.

### Claim 16 (depends on 9)

The electronic device according to claim 9, wherein the target sub-model comprises a first sub-model and a second sub-model,
wherein the at least one processor tunes the model parameter of the model according to the classification loss, by:
summing a first classification loss of the first sub-model and a second classification loss of the second sub-model by using a weighted summation and determining the classification loss of the model; and
tuning the model parameter of the model according to the first classification loss and the second classification loss by using a back propagation algorithm.

### 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 caused to perform a method for training a model, wherein the method comprises:
obtaining an image set used for training a model, the image set comprises a labeled image, an unlabeled image and a category label of the labeled image;
discriminating the labeled image and the unlabeled image by a target sub-model of the model, and determining first classification reference information of the labeled image and first classification reference information of the unlabeled image;
discriminating the unlabeled image by a non-target sub-model of the model, and determining second classification reference information of the unlabeled image;
determining a classification loss of the target sub-model based on the first classification reference information of the labeled image, the category label of the labeled image, and the second classification reference information of the unlabeled image; and
tuning a model parameter of the model according to the classification loss.

### Claim 18 (depends on 17)

The non-transitory storage medium according to claim 17, wherein the method further comprises:
obtaining an initial unlabeled image; and
augmenting the initial unlabeled image via different augmentation strategies and determining the unlabeled images, wherein the number of the unlabeled images is more than one, and each of the unlabeled images corresponding to one of the different augmentation strategies.

### Claim 19 (depends on 18)

The non-transitory storage medium according to claim 18, wherein the unlabeled images comprise a first unlabeled image and a second unlabeled image, and an augmentation strategy of the first unlabeled image is lighter than an augmentation strategy of the second unlabeled image;
wherein determining the classification loss of the target sub-model based on the first classification reference information of the labeled image, the category label of the labeled image, and the second classification reference information of the unlabeled image comprises:
generating a first pseudo label of the first unlabeled image according to the second classification reference information of the first unlabeled image;
determining a first unsupervised loss of the target sub-model according to the first classification reference information of the second unlabeled image and the first pseudo label;
determining a supervised loss of the target sub-model according to the first classification reference information of the labeled image and the category label of the labeled image; and
determining the classification loss of the target sub-model according to the first unsupervised loss of the target sub-model and the supervised loss of the target sub-model.

### Claim 20 (depends on 19)

The non-transitory storage medium according to claim 19, wherein before determining the first unsupervised loss of the target sub-model according to the first classification reference information of the second unlabeled image and the first pseudo label, the method further comprises:
determining a loss weight of the first unlabeled image according to the first pseudo label and a second pseudo label, wherein the second pseudo label is generated according to the first classification reference information of the first unlabeled image;
wherein determining the supervised loss of the target sub-model according to the first classification reference information of the labeled image and the category label of the labeled image comprises:
determining a second unsupervised loss of the first unlabeled image according to the first classification reference information of the second unlabeled image and the first pseudo label; and
determining the first unsupervised loss of the target sub-model according to the loss weight and the second unsupervised loss.
