IP Library Granted Patent US 12,380,680
Granted Patent B2
US 12,380,680 · App. 17/986,081 · Granted Aug 5, 2025

Model training method and related device

Inventors: Fuhui Tang (Shenzhen, CN); Xiaopeng Zhang (Shanghai, CN); Minzhe Niu (Shanghai, CN); Zichen Wang (Shanghai, CN); Jianhua Han (Shanghai, CN); Qi Tian (Shenzhen, CN)
Assignee: HUAWEI TECHNOLOGIES CO., LTD.
G06V10/774G06V10/30G06V10/40G06V10/764G06V10/82
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,380,680
App. No.
17/986,081
Granted
Aug 5, 2025
Kind
B2
Abstract

A model training method and a related apparatus are provided and may be used in computer vision to perform image detection. The method includes: extracting feature information from a target image; further separately extracting features of a target object from the feature information by using a Gaussian mask to obtain a first local feature and a second local feature; determining a feature loss by using the first local feature and the second local feature; performing prediction by using the first network and the second network based on a same region proposal set to obtain a first classification predicted value and a second classification predicted value, and obtaining a classification loss based on the first classification predicted value and the second classification predicted value; and training the second network based on the classification loss and the feature loss to obtain a target network.

Claims (151)

1. A model training method, comprising:

extracting first feature information from a target image using a feature extraction layer of a first network;

extracting second feature information from the target image using a feature extraction layer of a second network, wherein both the first network and the second network are classification networks, and a depth of the first network is greater than a depth of the second network;

extracting a feature about a target object from the first feature information using a Gaussian mask to obtain a first local feature;

extracting a feature about a target object from the second feature information using the Gaussian mask to obtain a second local feature;

determining a feature loss using the first local feature and the second local feature; and

training the second network based on the feature loss to obtain a target network.

2. The method according to claim 1 , further comprising:

generating a first classification predicted value of a target region proposal in a region proposal set using a classification layer of the first network;

generating a second classification predicted value of the target region proposal in the region proposal set using a classification layer of the second network;

determining a classification loss based on the first classification predicted value and the second classification predicted value; and

the training the second network based on the feature loss to obtain a target network comprises:

training the second network based on the feature loss and the classification loss to obtain the target network.

3. The method according to claim 2 , wherein both the first network and the second network have the region proposal set by sharing a region proposal network (RPN) between the first network and the second network.

4. The method according to claim 3 , wherein the RPN is shared by the second network with the first network, or is shared by the first network with the second network.

5. The method according to claim 2 , wherein the target region proposal is all region proposals in the region proposal set, or is a positive region proposal that is in the region proposal set and that belongs to the target object.

6. The method according to claim 2 , wherein the classification loss L cls satisfies the following relationship:

L

c

l

s

=

m

=

1

K

L

C

E

(

y

s

m

,

y

m

)

+

β

n

=

1

N

p

L

B

C

E

(

y

s

n

,

y

t

n

)

,

K is a total quantity of region proposals in the region proposal set, N p is a total quantity of positive region proposals that are in the region proposal set and that belong to the target object, y s m is a classification predicted value predicted by the classification layer of the second network for an m th region proposal in the region proposal set, y m is a ground truth label corresponding to the m th region proposal in the region proposal set, y s n is the second classification predicted value predicted by the classification layer of the second network for an n th positive region proposal that is in the region proposal set and that belongs to the target object, y t n is the first classification predicted value predicted by the classification layer of the first network for the n th positive region proposal that is in the region proposal set and that belongs to the target object, L CE (y s m , y m ) represents a cross entropy loss obtained based on y s m and y m , L BCE (y s n , y t n ) represents a binary cross entropy loss obtained based on y s n and y t n , and β is a preset weight balance factor.

7. The method according to claim 2 , further comprising:

determining a regression loss and an RPN loss of the second network based on a ground truth label of a region proposal in the target image and a predicted value predicted by the second network for the region proposal in the target image; and

the training the second network based on the feature loss and the classification loss to obtain the target network comprises:

training the second network based on the feature loss, the classification loss, the regression loss, and the RPN loss to obtain the target network.

8. The method according to claim 1 , wherein the training the second network based on the feature loss to obtain a target network comprises:

training the second network based on the feature loss to obtain a trained second network; and

training the trained second network using a third network to obtain the target network, wherein a depth of the third network is greater than the depth of the first network.

9. The method according to claim 1 , after the training the second network based on the feature loss to obtain a target network, the method further comprises:

sending the target network to a model using device, wherein content in an image is predicted using the target network.

10. An image detection apparatus, comprising at least one processor and a memory storage instructions that, when executed by the at least one processor, cause the image detection apparatus to:

obtain a target network, wherein the target network is obtained after a second network is trained using a first network, a parameter used for training the second network using the first network comprises a feature loss, the feature loss is determined based on a first local feature and a second local feature, the first local feature is extracted from first feature information using a Gaussian mask and is about a target object, the second local feature is extracted from second feature information using the Gaussian mask and is about the target object, the first feature information is extracted from a target image using a feature extraction layer of the first network, the second feature information is extracted from the target image using a feature extraction layer of the second network, both the first network and the second network are classification networks, and a depth of the first network is greater than a depth of the second network; and

recognize content in an image using the target network.

11. The apparatus according to claim 10 , wherein the parameter used for training the second network further comprises a classification loss, the classification loss is determined based on a first classification predicted value and a second classification predicted value, the first classification predicted value is a classification predicted value that is generated using a classification layer of the first network and that is of a target region proposal in a region proposal set, and the second classification predicted value is a classification predicted value that is generated using a classification layer of the second network and that is of the target region proposal in the region proposal set.

12. The apparatus according to claim 11 , wherein both the first network and the second network have the region proposal set by sharing a region proposal network (RPN) between the first network and the second network.

13. The apparatus according to claim 12 , wherein the RPN is shared by the second network with the first network, or is shared by the first network with the second network.

14. The apparatus according to claim 11 , wherein the target region proposal is all region proposals in the region proposal set, or is a positive region proposal that is in the region proposal set and that belongs to the target object.

15. The apparatus according to claim 11 , wherein the classification loss L cls satisfies the following relationship:

L

c

l

s

=

m

=

1

K

L

C

E

(

y

s

m

,

y

m

)

+

β

n

=

1

N

p

L

B

C

E

(

y

s

n

,

y

t

n

)

,

wherein

K is a total quantity of region proposals in the region proposal set, N p is a total quantity of positive region proposals that are in the region proposal set and that belong to the target object, y s m is a classification predicted value predicted by the classification layer of the second network for an m th region proposal in the region proposal set, y m is a ground truth label corresponding to the m th region proposal in the region proposal set, y s n is the second classification predicted value predicted by the classification layer of the second network for an n th positive region proposal that is in the region proposal set and that belongs to the target object, y t n is the first classification predicted value predicted by the classification layer of the first network for the n th positive region proposal that is in the region proposal set and that belongs to the target object, L CE (y s m , y m ) represents a cross entropy loss obtained based on y s m and y m , L BCE (y s n , y t n ) represents a binary cross entropy loss obtained based on y s n and y t n , and β is a preset weight balance factor.

16. The apparatus according to claim 11 , wherein

the parameter used for training the second network further comprises a regression loss and an RPN loss of the second network, and the regression loss and the RPN loss of the second network are determined based on a ground truth label of a region proposal in the target image and a predicted value predicted by the second network for the region proposal in the target image.

17. The apparatus according to claim 10 , wherein the target network is obtained by training the second network using the first network to obtain a trained second network and then training the trained second network using a third network, and a depth of the third network is greater than the depth of the first network.

18. The apparatus according to claim 10 , wherein the instructions, when executed by the at least one processor, further cause the apparatus to:

receive the target network sent by a model training device, wherein the model training device is configured to perform training to obtain the target network.

19. A computer-readable storage medium, configured to store a computer program including instructions that, when executed by at least one processor, cause the at least one processor to perform operations comprising:

extracting first feature information from a target image using a feature extraction layer of a first network;

extracting second feature information from the target image using a feature extraction layer of a second network, wherein both the first network and the second network are classification networks, and a depth of the first network is greater than the depth of the second network;

extracting a feature about a target object from the first feature information using a Gaussain mask to obtain a first local feature;

extracting a feature about the target object from the second feature information using the Gaussain mask to obtain a second local feature;

determining a feature loss using the first local feature and the second local feature; and

training the second network based on the feature loss to obtain a target network.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 14, 2025
From: TANG, FUHUI; ZHANG, XIAOPENG; NIU, MINZHE; WANG, ZICHEN; HAN, JIANHUA; TIAN, QI
To: HUAWEI TECHNOLOGIES CO., LTD.
Reel/Frame 071106/0733 →
Priority Claims (1)
CN 202010412910.6 · May 15, 2020 · national
Continuity (2)
Continuation PCTCN2021088787 · Apr 21, 2021
Related Publication 20230075836A1 · Mar 9, 2023
References Cited (25)
US 11244671B2 · Kim · 2022 [cited by examiner]
US 20180268292A1 · Choi · 2018 [cited by examiner]
US 20180365564A1 · Huang · 2018 [cited by examiner]
US 20200302230A1 · Chang · 2020 [cited by examiner]
US 20210407090A1 · Li · 2021 [cited by examiner]
US 20220156593A1 · Liu · 2022 [cited by examiner]
US 20220180199A1 · Xu · 2022 [cited by examiner]
CN 108921294A · 2018 [cited by applicant]
CN 109871905A · 2019 [cited by applicant]
CN 109961442A · 2019 [cited by applicant]
CN 110163344A · 2019 [cited by applicant]
CN 110472730A · 2019 [cited by applicant]
Zhu, Yousong, et al. “Mask guided knowledge distillation for single shot detector.” 2019 IEEE international conference on multimedia and expo (ICME). IEEE, 2019. (Year: 2019). [cited by examiner]
Hao, Yu, et al. “An end-to-end architecture for class-incremental object detection with knowledge distillation.” 2019 IEEE International Conference on Multimedia and Expo (ICME). IEEE, 2019. (Year: 2019). [cited by examiner]
Chen, Guobin, et al. “Learning efficient object detection models with knowledge distillation.” Advances in neural information processing systems 30 (2017). (Year: 2017). [cited by examiner]
Rui Chen et al., “Learning Lightweight Pedestrian Detector With Hierarchical Knowledge Distillation”, arXiv:1909.09325v1, Sep. 20, 2019, total 5 pages. [cited by applicant]
Ze Yang et al., “Model Compression with Two-stage Multi-teacher Knowledge Distillation for Web Question Answering System”, arXiv:1910.08381v1, Oct. 18, 2019, total 9 pages. [cited by applicant]
Office Action issued in CN202010412910.6, dated Jul. 24, 2024, 9 pages. [cited by applicant]
Tao Wang et al.,“Distilling Object Detectors with Fine-grained Feature Imitation”, Publish Year: 2019, total: 10 pages. [cited by applicant]
Guohin Chen et al., “Learning Efficient Object Detection Models with Knowledge Distillation”, 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA, total: 10 pages. [cited by applicant]
Xuemeng Song et al., “Neural Compatibility Modeling with Attentive Knowledge Distillation”, SIGIR″18, Jul. 8-12, 2018, Ann Arbor, MI, USA, total: 10 pages. [cited by applicant]
Ruichi Yu et al.,“Visual Relationship Detection with Internal and External Linguistic Knowledge Distillation”, Jul. 28, 2017, total: 9 pages. [cited by applicant]
Adriana Romero et al., “FITNETs: Hints for Thin Deep Nets”, Published as a conference paper at ICLR 2015, total: 13 pages. [cited by applicant]
Geoffrey Hinton et al., “Distilling the Knowledge in a Neural Network”, Mar. 9, 2015, total: 9 pages. [cited by applicant]
International Search Report and Written Opinion issued in PCT/CN2021/088787, dated Jun. 24, 2021, 11 pages. [cited by applicant]