TL;DR
This paper introduces weight imprinting, a simple yet powerful technique to instantly add new categories to a pre-trained ConvNet by directly setting the final layer weights using the embeddings of just a few training examples. By bridging the gap between softmax classifiers and metric learning, it provides immediate recognition capabilities and serves as a superior initialization for subsequent fine-tuning.
What Problem Does This Paper Address?
Standard deep learning models are "data-hungry" and struggle with low-shot learning—the ability to learn new concepts from only one or a few examples, a feat humans perform effortlessly.
Typically, adding new classes to a trained ConvNet requires extensive fine-tuning with stochastic gradient descent (SGD), which is computationally expensive and risks "forgetting" old classes. Alternatively, metric learning (embedding) methods allow for adding new classes via nearest-neighbor search, but these require storing all training embeddings and can be slow during inference. The authors seek a middle ground: a method that retains the efficient parametric form of a standard classifier while gaining the rapid learning flexibility of embedding methods.
Methods
The core innovation is a two-step process called imprinting, built on a specific architectural modification.
- Architecture Modification: The authors add an $L_2$ normalization layer at the end of the embedding extractor (the penultimate layer). They also normalize the weights of the final fully-connected (FC) layer to unit length and remove the bias term. This ensures that the inner product between an input embedding and a class weight vector is equivalent to cosine similarity. To aid convergence, a trainable scaling factor $s$ is applied before the softmax.
- Weight Imprinting: When a new category is introduced with a single example $x_+$, the model computes its embedding $\phi(x_+)$ and directly sets this vector as the new column in the weight matrix for that class ($w_+ = \phi(x_+)$).
- Averaging for Multi-Shot: If multiple examples are available, the weights are set to the average of their normalized embeddings and then re-normalized.
This process exploits the symmetry between normalized inputs and weights, effectively "remembering" the new class's location in the embedding space as a template.
Datasets
The authors evaluated their approach on the CUB-200-2011 dataset, a challenging benchmark for fine-grained bird classification containing 200 categories. They split the data into 100 "base" classes (with abundant data) and 100 "novel" classes (with only $n=1, 2, 5, 10, 20$ examples).
Key Insights and Ideas
- Symmetry is Key: By normalizing both embeddings and weights, the authors turn the final layer into a template matcher. This allows them to treat activations and weights interchangeably.
- Averaging as a Denoising Filter: Surprisingly, averaging embeddings for a new class performs better than storing all individual instances for a nearest-neighbor search. The authors conjecture that averaging reduces noise in the embedding dimensions, focusing on features consistent for that category.
- Superior Initialization: Imprinted weights provide a much better starting point for SGD than random initialization. It bypasses the initial "random walk" phase of training, leading to faster convergence and higher final accuracy, especially in extremely low-data regimes (1-5 shots).
- Unified Framework: The method allows a single model to perform well on both old (base) and new (novel) classes simultaneously without needing to cycle through all old data extensively.
Key Results
- Instant Recognition: On CUB-200-2011, a 1-shot imprinted model achieved 21.26% accuracy on novel classes instantly, compared to near-zero for random initialization.
- Fine-tuning Boost: When fine-tuned, the imprinted model reached higher accuracies much faster. For example, with 5 shots, imprinting + fine-tuning reached ~46% accuracy on novel classes, significantly outperforming random initialization + fine-tuning (~35%).
- Qualitative Success: The model successfully generalized from single exemplars to recognize birds in different poses and backgrounds, particularly for categories with distinctive colors or textures.
Limitations and Future Work
- Unimodal Assumption: The averaging strategy assumes that a class's distribution in the embedding space is unimodal (has one "cluster"). This might fail for categories with high intra-class variance (e.g., a class containing both male and female birds that look very different).
- Embedding Quality: The method's success relies heavily on the quality of the pre-trained embedding space. If the base classes don't share features with the novel classes, imprinting will be less effective.
- Future Directions: The authors suggest exploring whether imprinting can be applied to lower layers of the network to learn novel low-level features more rapidly.
Summary updated