Resolution-Limit-Free Prototype Allocation for Rare Sub-Modes

Many classifiers decide a class by distance to a "prototype," a representative point for that class in a learned feature space. A single prototype per class breaks when a class has several distinct forms, such as a bird species photographed in flight and perched. So recent methods give each class several prototypes. How many, and where to put them, is still settled by a fixed number per class or by a global clustering objective. Graph clustering has a well-known flaw here, called the resolution limit: an objective scored over the whole graph cannot see small, tight groups once the graph is large. It merges them into their bigger neighbors. We argue the same flaw hits multi-prototype classifiers. A rare form of a class, one that makes up a small share of that class's training examples, gets absorbed into the prototype of the dominant form, and test examples of that rare form are then misclassified.

The proposal is to build each class's prototypes from its own nearest-neighbor graph, using a community criterion whose score for a group does not depend on how big the whole graph is. Each resulting community becomes one prototype. The number of prototypes per class is then an output, not a setting. The claim is specific and can be falsified. With a global criterion, the smallest sub-mode that can be recovered should grow with class size. With a size-independent criterion it should stay flat. Accuracy gains should concentrate on rare sub-modes rather than on the average test example.

Core Claim

Three roles are distinct here. Prototype-based classification is the setting. Multi-prototype representation is the object being fixed. The resolution limit is the diagnosis and the source of the remedy.

The diagnosis comes from graph theory. Newman–Girvan modularity scores a partition by comparing edges inside each group to a random baseline that shrinks as the graph grows. Past a point, two small dense groups joined by even one edge look "surprisingly connected" and get merged. Yang and Xu's divide-and-conquer graph clustering work states the rule of thumb: communities smaller than roughly $\sqrt{N}$ are swamped. Shen et al. read modularity maximization as a global dimension reduction that collapses multiscale structure to one scale. Lewis et al. show the practical cost: small, functionally specific protein complexes get lumped into coarse groups. These papers motivate the proposal.

The remedy is borrowed. CEIL scores a community as the product of internal density and external isolation, a quantity with no dependence on total graph size. On the circle-of-cliques test, modularity merged 30 cliques into 15, while CEIL recovered all 30. Permanence scores each vertex against the strongest single competing community rather than against all outside edges. LEMON grows small communities from seeds using short random walks and a sparse local spectral subspace, avoiding global objectives entirely. All three operate on fixed graphs and have never been used to decide how many prototypes a deep classifier needs or where to put them.

The multi-prototype side supplies the object to be fixed:

  • SoftTriple gives every class $K$ learnable centers and prunes redundant ones with one $L_{2,1}$ penalty shared across all classes.
  • The Multi-Proxy Wasserstein Classifier fixes $M=4$ proxies per class and matches local features to them with optimal transport.
  • attMPTI picks a fixed number of prototypes by farthest-point sampling, then spreads labels over a $k$-nearest-neighbor graph.
  • PMAL mines a fixed number $T$ of real exemplars as prototypes.

None of them ties the number of prototypes to local structure. The shared SoftTriple penalty has a further problem we hypothesize matters: a center serving a rare sub-mode receives few gradient updates, so a penalty uniform across centers is most likely to prune exactly that center.

Our contribution has two parts. The first is a measurement showing that existing allocation schemes lose rare sub-modes in a class-size-dependent way. The second is an allocation rule that does not.

On a careful point about scope: the $\sqrt{N}$ result is proven for modularity. For $k$-means with fixed $K$ and for shared pruning penalties, we treat the analogous failure as an empirical hypothesis to be measured, not an established fact.

Research Program

The method alternates standard training with periodic prototype re-allocation.

Every few epochs, for each class $k$ with $N_k$ training examples, we do the following:

  1. Embed the examples with the current encoder.
  2. Build a symmetric $k$-nearest-neighbor graph among them.
  3. Partition the graph by greedily maximizing a CEIL-style score. For a candidate community $S$, the score is $$\text{score}(S) = \frac{e_{\text{in}}(S)}{\binom{|S|}{2}} \cdot \frac{e_{\text{in}}(S)}{e_{\text{in}}(S) + e_{\text{out}}(S)},$$ where $e_{\text{in}}(S)$ counts edges inside $S$ and $e_{\text{out}}(S)$ counts edges leaving $S$ for the rest of the class graph. Neither factor depends on $N_k$, which is the property we need.

  4. Keep every community above a small minimum size.

  5. Set that class's prototypes to the community means.

Communities of consecutive re-allocations are matched by overlap, so prototypes are carried forward rather than re-initialized.

Between re-allocations, the encoder and the prototypes are trained with a SoftTriple-style smoothed-maximum loss over each class's current prototype set, but without the $L_{2,1}$ penalty. Pruning now happens only through the graph step. At test time an input is assigned to the class of its nearest prototype, using squared Euclidean distance as in Prototypical Networks.

A permanence-based variant replaces the community score with a check on each member of a proposed community. The member's pull toward its own community must exceed its pull toward the strongest single rival community. This check is intended to protect rare sub-modes that sit next to a dominant one.

Two analyses accompany the method.

The first is a scaling study. We fix a rare sub-mode at size $m$ and grow the dominant sub-mode. We record the dominant size at which each allocation rule stops giving the rare sub-mode its own prototype. The prediction is that this threshold grows roughly like $\sqrt{N_k}$ for the modularity-based rule, following the null-model argument above, and stays flat for the CEIL-style rule.

The second is a noise study. It checks that a size-independent criterion does not simply split classes into spurious fragments, which is its obvious failure mode.

Baselines

The naive reference is nearest-class-mean with a single prototype per class, on the same encoder trained with cross-entropy. Meta-Baseline showed this recipe is surprisingly competitive, and it tells us whether any sub-mode structure is worth modeling at all.

The strongest existing multi-prototype competitors are SoftTriple and the Multi-Proxy Wasserstein Classifier. For SoftTriple, the reported figures are 60.1% Recall@1 on CUB-200-2011 with 64-dimensional embeddings, 65.4% with 512 dimensions, and 78.6% Recall@1 on Cars196 (SoftTriple Loss). For the Multi-Proxy Wasserstein Classifier, the reported figure is 75.27% top-1 on CIFAR-100 with ResNet-110, up from 73.25% (Multi-Proxy Wasserstein Classifier). For the open-set evaluation, the reference is PMAL's reported 83.1% AUROC on TinyImageNet (PMAL).

All of these are re-run under our conditions:

  • Shared setup: the same backbone, the same augmentation, and the same number of epochs.
  • Tuning: an equal hyperparameter search budget, measured in trials, for each method. SoftTriple's $K$ and penalty weight, the Wasserstein classifier's $M$, and our neighbor count and minimum community size are each tuned within that budget.
  • Costs reported: wall-clock time, including our periodic graph step.

The Wasserstein classifier's published overhead is about 17.7% extra wall-clock time. We treat this as the comparison point for acceptable cost.

What counts as beating these baselines. Mean accuracy or Recall@1 must match within noise over three seeds. In addition, accuracy on rare sub-modes must be significantly higher, with confidence intervals that do not overlap.

Ablation of scale-independence. This is the key ablation. It keeps our full pipeline but replaces the CEIL-style score with modularity maximization via Louvain, once at the default resolution and once with the resolution parameter tuned on validation data. If the tuned-modularity variant matches ours, size-independence is not the active ingredient.

Ablation of count versus placement. A second ablation separates how many prototypes each class gets from where they go. It gives each class exactly the number our method finds, but places the prototypes by $k$-means.

Upper reference. We include a $k$-nearest-neighbor classifier over all training embeddings. It resolves every sub-mode at the cost of storing everything.

Why not just…?

Why not just choose $K$ per class with a standard model-selection rule, such as the silhouette score or an information criterion over $k$-means? This is the most serious threat, because it is also adaptive and cheap. Our concern is that $k$-means-based selection scores the whole class's partition at once, so a small sub-mode barely moves the global score. That is the same dilution mechanism as the resolution limit. The literature in the file contains no evidence either way. We therefore include silhouette-selected $k$-means as a baseline and run it through the scaling study. If its recovery threshold stays flat as $N_k$ grows, the graph machinery is unnecessary, and we would report the result that way.

Why not just run Louvain with a tuned resolution parameter? The resolution parameter shifts the scale at which modularity sees communities, but it is a single scale per run. Classes differ in size by orders of magnitude on long-tailed data, so one setting cannot suit every class. Tuning it per class requires sub-mode labels we do not have. The CEIL circle-of-cliques result (CEIL) shows the default fails. The tuned-resolution ablation above tests whether tuning rescues it on real feature graphs.

Why not just over-provision prototypes, say ten per class, and let SoftTriple's penalty prune? The Multi-Proxy Wasserstein Classifier reports that extra proxies can collapse onto the same representation. SoftTriple needed its penalty to control redundancy. We hypothesize that a penalty shared across all centers preferentially removes rarely updated centers. We test this directly by logging which ground-truth sub-mode each surviving SoftTriple center serves.

Why not just use a $k$-nearest-neighbor classifier over all training examples? It has no allocation problem and may match us on rare sub-modes. If it does, our method's value reduces to compactness. We report accuracy against the number of stored vectors, so the trade-off is explicit rather than hidden.

Proposed Experiments

The primary testbed has known ground-truth sub-modes. We train on CIFAR-100's 20 coarse superclasses, each the union of 5 fine classes. The hidden fine classes are the sub-modes. We subsample so that in each superclass one fine class is rare, at 2 to 10% of the superclass. We then measure:

  • coarse accuracy;
  • coarse accuracy restricted to test images of the rare fine class;
  • normalized mutual information between prototype assignments and fine labels.

I found no reported result on Lacuna for this sub-mode recovery setting, so all numbers here will be new. The scaling study runs on this testbed, sweeping dominant sub-mode size at a fixed rare size.

Transfer to standard benchmarks uses CUB-200-2011, Cars196 and Stanford Online Products for retrieval-style evaluation, compared against SoftTriple's reported figures. We add full CIFAR-100 and ImageNet with ResNet-18 against the Wasserstein classifier. We use TinyImageNet and ImageNet-LT open-set recognition against PMAL; the long-tailed setting is where rare sub-modes should matter most. We also run 5-way 5-shot miniImageNet, where Prototypical Networks report 68.20%. In that last setting we expect little gain, since five examples rarely contain a rare sub-mode. It serves as a check that the method does no harm when there is nothing to find.

Decisive check. The proposal stands or falls on the scaling curve. The CEIL-style rule must keep recovering a fixed-size rare sub-mode as the dominant sub-mode grows, while modularity-based and $k$-means-based rules stop recovering it at a size that grows with $N_k$. That recovery must also translate into higher accuracy on rare-sub-mode test examples. If the curves coincide, the resolution-limit story does not apply to feature graphs, and we would say so.