Abstract
Traditional metric-based few-shot learning (FSL) often represents classes as single-point prototypes, which fails to capture class-level variance and sparsity. We present HyperProto, a novel framework that models class prototypes as hyperspheres. By learning a center and a dynamic radius for each category, HyperProto provides a more expressive geometric representation that adapts to class density. Our approach demonstrates significant performance improvements across diverse benchmarks in Natural Language Processing (NLP) and Computer Vision (CV), offering a robust alternative to point-based or complex statistical distribution models.
Introduction
Few-shot learning (FSL) aims to recognize novel categories from a limited number of labeled examples. Metric-based meta-learning has emerged as a dominant paradigm, typically mapping data into an embedding space where each class is represented by a "prototype"—usually the mean vector of support examples.
However, point-based prototypes are inherently limited. They cannot represent the "spread" or "compactness" of a class. While modeling classes as statistical distributions (e.g., using covariance matrices) can address this, such methods often introduce computational complexity and optimization challenges. HyperProto bridges this gap by using hyperspheres: a representation more expressive than a point but simpler and more stable than a full statistical distribution.
Methodology: Hypersphere Modeling
HyperProto defines each class in the embedding space as a hypersphere characterized by two parameters: a center ($z$) and a radius ($\epsilon$).
The Distance Metric
Instead of measuring the distance to a central point, HyperProto calculates the distance from a query point $f_\phi(x)$ to the surface of the hypersphere: $$M(x, B) = ||f_\phi(x) - z||_2 - \epsilon$$ This metric allows the model to naturally handle points within the sphere (negative distance) via the softmax function, creating a more flexible and "forgiving" decision boundary.
Dynamic Optimization
Unlike standard prototypes that are statically re-estimated for each episode, HyperProto initializes the center and radius from the support set and then optimizes them through gradient descent. This allows the radius to act as a learnable "area of influence," expanding for sparse classes and contracting for compact ones.
Experiments and Results
The model was evaluated on a wide range of benchmarks to demonstrate its cross-domain efficacy:
- NLP: FEW-NERD (Named Entity Recognition) and FewRel (Relation Extraction).
- Computer Vision: miniImageNet and cross-domain transfer to CUB.
Performance Gains
HyperProto consistently outperformed vanilla Prototypical Networks (ProtoNet) and numerous competitive baselines. In NLP tasks, it achieved an 8.33% absolute F1 increase on FEW-NERD (INTRA) and a 21.63% increase on FewRel 2.0 domain adaptation. In computer vision, it improved miniImageNet accuracy by 3.45% over the baseline.
Discussion and Insights
The success of HyperProto stems from its geometric approach to class sparsity. By measuring distance to a surface rather than a point, the model explicitly accounts for the "territory" a class occupies. This learnable sparsity forces the feature encoder to produce representations that reside within the learned "safe zone" of the hypersphere.
Limitations
The primary challenge remains the 1-shot scenario, where estimating an initial radius is difficult due to the lack of multiple points. Additionally, the radius parameter is sensitive to learning rates, often requiring a higher rate than the rest of the network to converge effectively.
Conclusion
HyperProto offers a computationally efficient and geometrically intuitive advancement for few-shot classification. By adding only a single scalar parameter (the radius) per class, it achieves state-of-the-art results in high-shot settings and provides a scalable foundation for future research in non-Euclidean or robust representation learning.
Summary updated