IP Library Granted Patent US 12,374,087
Granted Patent B2
US 12,374,087 · App. 17/993,507 · Granted Jul 29, 2025

Neural network training method, image classification system, and related device

Inventors: Weiran Huang (Beijing, CN); Zhenguo Li (Hong Kong, CN); Aoxue Li (Beijing, CN); Liwei Wang (Beijing, CN)
Assignee: HUAWEI TECHNOLOGIES CO., LTD.
G06V10/774G06V10/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,374,087
App. No.
17/993,507
Filed
Nov 23, 2022
Granted
Jul 29, 2025
Kind
B2
Art Unit
2674
USPC
382/156
Abstract

A neural network training method, an image classification system, and a related device, which may be applied to the artificial intelligence field. Feature extraction is performed on images in a training set (including a first set and a second set) by using a prototype network, to obtain first feature points, in a feature space, of a plurality of images in the first set and second feature points of a plurality of images in the second set. The first feature points are used for calculating a prototype of a class of an image, and the second feature points are used for updating a network parameter of the prototype network. A semantic similarity between classes of the images in the second set is obtained, to calculate a margin value between the classes of the images. Then, a loss function is adjusted based on the margin value.

Claims (70)

1. A neural network training method, comprising:

obtaining a training set having a first set of a plurality of images and a second set of a plurality of images, wherein classes of the plurality of images in the first set correspond to classes of the plurality of images in the second set;

performing feature extraction on the plurality of images in the first set and the plurality of images in the second set using a prototype network, to obtain a first feature point of the plurality of images in the first set and a second feature point of the plurality of images in the second set in a feature space, wherein

the first feature point is used for calculating a prototype corresponding to a class of an image for indicating a class center of a position of the first feature point;

obtaining a semantic similarity between the classes of the plurality of images in the second set, and obtaining a margin value between the classes of the plurality of images in the second set based on the semantic similarity;

adjusting an objective loss function based on the margin value; and

training the prototype network based on the first feature point and the second feature point using the adjusted objective loss function.

2. The method according to claim 1 , wherein obtaining the semantic similarity between the classes of the plurality of images in the second set comprises:

extracting a plurality of semantic vectors corresponding to the classes of the plurality of images in the second set respectively using a semantic feature extraction module;

calculating a Euclidean distance between a first semantic vector and a second semantic vector in the plurality of semantic vectors; and

determining a semantic similarity between a class of a first image corresponding to the first semantic vector and a class of a second image corresponding to the second semantic vector in the classes of the plurality of images based on the Euclidean distance.

3. The method according to claim 1 , wherein obtaining the semantic similarity between the classes of the plurality of images in the second set comprises:

extracting a plurality of semantic vectors corresponding to the classes of the plurality of images in the second set respectively using a semantic feature extraction module;

performing an inner product operation between a first semantic vector and a second semantic vector in the plurality of semantic vectors, to obtain an inner product operation result; and

determining a semantic similarity between a class of a first image corresponding to the first semantic vector and a class of a second image corresponding to the second semantic vector in the classes of the plurality of images based on the inner product operation result.

4. The method according to claim 1 , wherein obtaining the margin value between the classes of the plurality of images in the second set based on the semantic similarity comprises:

performing a linear operation on the semantic similarity using an objective operation formula, to obtain a margin value between every two of the classes of the images in the second set.

5. The method according to claim 4 , wherein training the prototype network using the adjusted objective loss function comprises:

adjusting a value of at least one parameter variable of the objective operation formula.

6. The method according to claim 1 , wherein obtaining the margin value between the classes of the plurality of images in the second set based on the semantic similarity comprises:

using the semantic similarity as an input of a preset neural network to obtain an output result, wherein the output result comprises a margin value between every two of the classes of the images in the second set.

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

performing joint training on the prototype network and the preset neural network using the adjusted objective loss function.

8. The method according to claim 1 , wherein after training the prototype network based on the first feature point and the second feature point, the method further comprises:

outputting the trained prototype network.

9. The method according to claim 8 , further comprising:

performing feature extraction on a target image by using the trained prototype network, to obtain a target feature point in the feature space; and

outputting a predicted class of the target image corresponding to a prototype closest to the target feature point.

10. A training device, comprising:

a processor and a memory

to store a program instructions, which

when executed by the processor, cause the training device to perform operations, the operations comprising:

obtaining a training set having a first set of a plurality of images and a second set of a plurality of images, wherein classes of the plurality of images in the first set correspond to classes of the plurality of images in the second set;

performing feature extraction on the plurality of images in the first set and the plurality of images in the second set using a prototype network, to obtain a first feature point, of the plurality of images in the first set and a second feature point of the plurality of images in the second set in a feature space, wherein

the first feature point is used for calculating a prototype corresponding to a class of an image, and the prototype is used for indicating a class center of a position, in the feature space, of the first feature point;

obtaining a semantic similarity between the classes of the plurality of images in the second set, and obtaining a margin value between the classes of the plurality of images in the second set based on the semantic similarity;

adjusting an objective loss function based on the margin value; and

training the prototype network based on the first feature point and the second feature point using the adjusted objective loss function.

11. The training device according to claim 10 , wherein obtaining the semantic similarity between the classes of the plurality of images in the second set comprises:

extracting a plurality of semantic vectors corresponding to the classes of the plurality of images in the second set respectively using a semantic feature extraction module;

calculating a Euclidean distance between a first semantic vector and a second semantic vector in the plurality of semantic vectors; and

determining a semantic similarity between a class of a first image corresponding to the first semantic vector and a class of a second image corresponding to the second semantic vector in the classes of the plurality of images based on the Euclidean distance.

12. The training device according to claim 10 , wherein the obtaining the semantic similarity between the classes of the plurality of images in the second set comprises:

extracting a plurality of semantic vectors corresponding to the classes of the plurality of images in the second set respectively using a semantic feature extraction module;

performing an inner product operation between a first semantic vector and a second semantic vector in the plurality of semantic vectors, to obtain an inner product operation result; and

determining a semantic similarity between a class of a first image corresponding to the first semantic vector and a class of a second image corresponding to the second semantic vector in the classes of the plurality of images based on the inner product operation result.

13. The training device according to claim 10 , wherein obtaining the margin value between the classes of the plurality of images in the second set based on the semantic similarity comprises:

performing a linear operation on the semantic similarity using an objective operation formula, to obtain a margin value between every two of the classes of the images in the second set.

14. The training device according to claim 13 , wherein training the prototype network using the adjusted objective loss function comprises:

adjusting a value of at least one parameter variable of the objective operation formula.

15. The training device according to claim 10 , wherein obtaining the margin value between the classes of the plurality of images in the second set based on the semantic similarity comprises:

using the semantic similarity as an input of a preset neural network to obtain an output result, wherein the output result comprises a margin value between every two of the classes of the images in the second set.

16. The training device according to claim 15 , wherein training the prototype network using an adjusted objective loss function comprises:

performing joint training on the prototype network and the preset neural network using the adjusted objective loss function.

17. The training device according to claim 10 , wherein after training the prototype network based on the first feature point and the second feature point, the operations further comprise:

outputting the trained prototype network.

18. The training device according to claim 17 , wherein the operations further comprise:

performing feature extraction on a target image using the trained prototype network, to obtain a target feature point in the feature space; and

outputting a predicted class of the target image corresponding to a prototype closest to the target feature point.

19. A non-transitory computer-readable storage medium having instructions stored therein, which when executed by a computer to perform operations, the operations comprising:

obtaining a training set having a first set of a plurality of images and a second set of a plurality of images, wherein classes of the plurality of images in the first set correspond to classes of the plurality of images in the second set;

performing feature extraction on the plurality of images in the first set and the plurality of images in the second set using a prototype network, to obtain a first feature point, of the plurality of images in the first set and a second feature point of the plurality of images in the second set in a feature space, wherein

the first feature point is used for calculating a prototype corresponding to a class of an image, and the prototype is used for indicating a class center of a position, in the feature space, of the first feature point;

obtaining a semantic similarity between the classes of the plurality of images in the second set, and obtaining a margin value between the classes of the plurality of images in the second set based on the semantic similarity;

adjusting an objective loss function based on the margin value; and

training the prototype network based on the first feature point and the second feature point and using the adjusted objective loss function.

20. The non-transitory computer-readable storage medium according to claim 19 , wherein the obtaining the semantic similarity between the classes of the plurality of images in the second set comprises:

extracting a plurality of semantic vectors corresponding to the classes of the plurality of images in the second set respectively using a semantic feature extraction module;

calculating a Euclidean distance between a first semantic vector and a second semantic vector in the plurality of semantic vectors; and

determining a semantic similarity between a class of a first image corresponding to the first semantic vector and a class of a second image corresponding to the second semantic vector in the classes of the plurality of images based on the Euclidean distance.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 24, 2023
From: HUANG, WEIRAN; LI, ZHENGUO; LI, AOXUE; WANG, LIWEI
To: HUAWEI TECHNOLOGIES CO., LTD.
Reel/Frame 063747/0029 →
Priority Claims (1)
CN 202010454031.X · May 26, 2020 · national
Continuity (2)
Continuation PCTCN2021073688 · Jan 26, 2021
Related Publication 20230087526A1 · Mar 23, 2023
References Cited (43)
US 8340405B2 · Cooper · 2012 [cited by examiner]
US 8886579B2 · De Sousa Webber · 2014 [cited by examiner]
US 9684706B2 · Satzke · 2017 [cited by examiner]
US 10387749B2 · Movshovitz-Attias · 2019 [cited by examiner]
US 10410353B2 · Feng · 2019 [cited by examiner]
US 11568245B2 · Chang · 2023 [cited by examiner]
US 11574198B2 · Son · 2023 [cited by examiner]
US 12217485B2 · Sawada · 2025 [cited by examiner]
US 20120254077A1 · Porikli · 2012 [cited by examiner]
US 20150134577A1 · Yu · 2015 [cited by examiner]
US 20170228641A1 · Sohn · 2017 [cited by examiner]
US 20180165546A1 · Skans · 2018 [cited by examiner]
US 20200097742A1 · Ratnesh Kumar · 2020 [cited by examiner]
US 20200134375A1 · Zhan · 2020 [cited by examiner]
US 20200134382A1 · Zhuravlev · 2020 [cited by examiner]
US 20200210768A1 · Turkelson · 2020 [cited by examiner]
US 20200234196A1 · Nishino · 2020 [cited by examiner]
US 20200257975A1 · Chang · 2020 [cited by examiner]
US 20200312056A1 · Wang · 2020 [cited by examiner]
US 20200320709A1 · Geipel · 2020 [cited by examiner]
US 20200338454A1 · Kim · 2020 [cited by examiner]
US 20200380338A1 · Matsumura · 2020 [cited by examiner]
US 20210003700A1 · Zhai · 2021 [cited by examiner]
US 20210271924A1 · Tarumi · 2021 [cited by examiner]
US 20210319880A1 · Tomii · 2021 [cited by examiner]
US 20210341911A1 · Joshi · 2021 [cited by examiner]
US 20220129697A1 · Jog · 2022 [cited by examiner]
US 20220129791A1 · Nia · 2022 [cited by examiner]
US 20220139069A1 · Toizumi · 2022 [cited by examiner]
US 20220188707A1 · Kingetsu · 2022 [cited by examiner]
US 20220207307A1 · Kingetsu · 2022 [cited by examiner]
US 20220215294A1 · Kingetsu · 2022 [cited by examiner]
US 20220237407A1 · Umeda · 2022 [cited by examiner]
US 20230062289A1 · Amma · 2023 [cited by examiner]
US 20230196726A1 · Deng · 2023 [cited by examiner]
CN 111797893A · 2020 [cited by applicant]
“Zero-Shot Learning on Semantic Class Prototype Graph”; Zhenyong Fu, IEEE Transactions on Pattern Analysis and Machine Intelligence (vol. 40, Issue: 8, 2018, pp. 2009-2022) (Year: 2018). [cited by examiner]
F. Sung, Y. Yang, L. Zhang, T. Xiang, P. H. S. Torr and T. M. Hospedales, “Learning to Compare: Relation Network for Few-Shot Learning,” 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Salt Lake Cit… [cited by applicant]
Aoxue Li et al:“Boosting Few-Shot Learning With Adaptive Margin Loss.” arXiv:2005.13826v1. May 28, 2020. total 9 pages. [cited by applicant]
Y. L. Cacheux, H. L. Borgne and M. Crucianu, “Modeling Inter and Intra-Class Relations in the Triplet Loss for Zero-Shot Learning,” 2019 IEEE/CVF International Conference on Computer Vision (ICCV), Seoul, Korea (South),… [cited by applicant]
H. Wang et al., “CosFace: Large Margin Cosine Loss for Deep Face Recognition,” 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, Jun. 18-23, 2018, pp. 5265-5274, doi: 10.1109/… [cited by applicant]
Deng, J. Guo, N. Xue and S. Zafeiriou, “ArcFace: Additive Angular Margin Loss for Deep Face Recognition,” 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Long Beach, CA, USA, Jun. 15-20, 2019… [cited by applicant]
Jake Snell et al.“Prototypical Networks for Few-shot Learning.” Jun. 19, 2017. arXiv:1703.05175v2, total13 pages. [cited by applicant]