Prototype Network Adaptive Margins for Few-Shot Image Classification

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current machine learning algorithms for image classification face challenges in few-shot scenarios due to overfitting and difficulty in distinguishing between classes with similar feature points, leading to inaccurate classification results.

Innovation Solution

Introduce an adaptive margin value into the loss function of a prototype network to differentiate between similar and less similar classes based on semantic similarity, adjusting the margin values to enhance classification accuracy.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If a metric-based meta-learning method with prototype network is used to reduce overfitting, then generalization ability is improved, but classification accuracy deteriorates when feature points of similar classes are close or difficult to distinguish

Engineering Contradiction:
Improvegeneralization abilityVSAvoidclassification accuracy
Core Design Contradiction:
ReliabilityVSMeasurement precision

Solution Approach 1:

The patent applies local quality by introducing different margin values for different class pairs based on their semantic similarity. Instead of using a uniform margin, the system dynamically adjusts the margin size locally for each pair of classes, with larger margins for semantically similar classes and smaller margins for dissimilar classes. This resolves the contradiction by maintaining good generalization while improving local classification accuracy for difficult-to-distinguish classes.

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The patent changes the margin parameter dynamically based on semantic similarity between classes. The margin value is not fixed but is adjusted according to the semantic relationship between class pairs, allowing the system to adaptively handle both well-separated and closely-separated classes. This parameter change strategy improves classification accuracy without sacrificing the generalization ability provided by the prototype network approach.

Inventive Principle:
Principle #35Parameter changes

2Device complexity

If a fixed margin value is used in the loss function, then the loss function is simple, but classification accuracy deteriorates when classes have different semantic similarities

Engineering Contradiction:
Improveloss function complexityVSAvoidclassification accuracy
Core Design Contradiction:
Device complexityVSMeasurement precision

Solution Approach 1:

The patent transforms the static, fixed margin value into a dynamic parameter that changes based on the semantic similarity between class pairs. The margin is no longer a constant but is computed adaptively for each pair of classes during training and inference. This dynamic approach significantly improves classification accuracy for classes with varying semantic relationships while adding only moderate complexity through the integration of semantic similarity computation.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent introduces parameter changes by making the margin value dependent on semantic similarity. Different margin parameters are applied to different class pairs based on their semantic characteristics, allowing the loss function to adapt to the specific needs of each class relationship. This resolves the contradiction between simplicity and accuracy by adding intelligence to the margin parameter without overly complicating the overall loss function structure.

Inventive Principle:
Principle #35Parameter changes

3Measurement precision

If abundant training data is collected for all classes, then classification accuracy is improved, but data collection feasibility deteriorates for rare classes

Engineering Contradiction:
Improveclassification accuracyVSAvoiddata collection feasibility
Core Design Contradiction:
Measurement precisionVSEase of manufacture

Solution Approach 1:

The patent applies preliminary action by pre-computing and storing semantic similarity information between classes before the actual classification task. This semantic knowledge is prepared in advance and used to guide the margin adjustment during training, allowing the system to handle rare classes effectively without requiring extensive labeled data for each rare class. The preliminary preparation of semantic relationships enables the system to generalize better with limited data.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces semantic similarity as an intermediary that bridges the gap between limited training data and accurate classification. Instead of relying solely on abundant labeled data for each class, the system uses semantic relationships as a mediator to transfer knowledge from common classes to rare classes. This intermediary mechanism enables accurate classification of rare classes with minimal training samples, resolving the contradiction between data availability and classification accuracy.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS12374087B2Neural network training method, image classification system, and related device
Publication Date: 2025.07.29 HUAWEI TECH CO LTD
  • US12374087B2 patent drawing
  • US12374087B2 patent drawing
  • US12374087B2 patent drawing

AI summary

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.