Elamur Research

Few-Shot Image Recognition by Predicting Parameters from Activations

Paper · 2018 · Siyuan Qiao, Chenxi Liu, Wei Shen et al.

Summary

An image classifier can learn to distinguish familiar categories from abundant labeled examples, yet struggle when a new category arrives with almost no data. Rebuilding the classifier is expensive, and learning new parameters from scarce examples can produce unreliable decisions. This paper studies few-shot learning under a demanding condition: unfamiliar categories must join a much larger collection of familiar ones, and every prediction must consider both groups. The aim is to recognize new categories quickly while preserving useful performance on categories learned earlier.

The authors propose learning a shared function that converts an image category’s internal representation into the weights needed to recognize that category. A pretrained convolutional network first turns an image into an activation vector: a numerical description produced near the end of the network. A separate parameter predictor then transforms that description into a classifier weight vector. For an unfamiliar category, its few labeled images supply the activations from which the new weights are generated. Adaptation therefore requires forward computation through an already learned mapping, without running an additional optimization procedure on the new category.

The idea rests on a relationship between representations and decision rules. In the final classification layer, an image receives a large score for a category when its activation vector has a large inner product with that category’s weight vector. The authors observe related arrangements among category-average activations and existing classifier weights, including recognizable semantic groupings. They use this observation to motivate a mapping shared across categories. Crucially, they train that mapping through classification performance rather than asking it simply to reproduce the original weights. They also expose it to both individual examples and category averages, so that it encounters the difference between sparse evidence and a more stable category description during training.

The experiments cover MiniImageNet and full ImageNet. On full ImageNet, the authors train the feature extractor using 900 categories and introduce 100 additional categories with 1, 2, or 3 examples each. Evaluation considers all 1000 categories as possible answers. They report stronger recognition of the unfamiliar categories than their comparison methods, with relatively modest damage to familiar-category recognition. On MiniImageNet, they report improvements in 5-way recognition using either 1 or 5 reference images per category. The classification tables do not furnish numerical accuracy entries, so the size of those improvements cannot be stated precisely. The efficiency evidence is numerical: generating parameters for 100 unfamiliar categories with one example each takes 0.683s on one GPU, and the resulting classifier runs at about 6.83ms per image under the reported batching conditions. The central contribution is a reusable route from a few examples to an ordinary classification layer, together with evidence that this route can support both familiar and unfamiliar categories.

Interesting ideas

Predict the decision rule. A useful alternative to fitting fresh parameters is to learn how parameters should depend on the available evidence. Here, the evidence is an activation vector and the output is a category’s classifier weights. The expensive learning happens beforehand, across categories with abundant supervision. This separation is worth considering wherever new labels arrive repeatedly but each arrives with little data. The transferable principle is to make adaptation itself a learned computation, while keeping clear that its success depends on the quality and relevance of the earlier training experience.

Train for the evidence available later. A mapping trained exclusively on reliable category averages may behave poorly when asked to work from an individual example. The authors address this by mixing averages and individual activations during predictor training. This is a general design lesson about matching training inputs to deployment conditions. When a system will sometimes receive a rich summary and sometimes a fragment, its learning procedure should expose it to both. The paper’s controlled comparison shows why this matters: training on averages alone favors familiar categories more strongly.

Share the adaptation mechanism across labels. The parameter predictor does not contain a separate learned transformation for every category. It applies the same transformation to whichever category description it receives. This makes adding a label structurally straightforward: supply its evidence, predict its parameters, and include its score among the candidates. The broader opportunity is in tasks where labels change more frequently than the underlying representation. A shared adaptation function can reduce the amount of category-specific machinery, although shared structure does not guarantee that unfamiliar categories will be represented well.

Evaluate the old task alongside the new one. Good performance on recently introduced categories can conceal a serious loss elsewhere. The paper treats familiar-category accuracy, unfamiliar-category accuracy, and computational cost as distinct requirements. This is useful for any expanding classification system, especially when new labels must compete directly with established ones. Testing only within a small selection of unfamiliar labels answers a narrower question. The full ImageNet experiment instead asks whether the new labels remain recognizable in the presence of the existing category inventory.

Use algebra to move work out of inference. With a linear parameter predictor, the expected category statistic can be computed in advance and then transformed into weights. The resulting classifier avoids repeatedly evaluating many possible statistic selections. This illustrates an engineering principle that applies beyond image recognition: identify which quantities remain fixed across queries, then use the structure of the computation to cache them. The paper also shows the boundary of the argument. Once the predictor becomes nonlinear, moving an expectation through it is an approximation rather than an exact rearrangement.

Inspect what the learned mapping changes. The authors examine how strongly activation channels influence the predicted parameters and compare that pattern with the original classifier. This makes the improvement over an unweighted similarity rule more understandable. Instead of treating the predictor as an unexplained source of better scores, they ask whether it learns a useful allocation of influence across the representation. The same habit is valuable elsewhere: compare a learned transformation with a simple reference, then inspect the dimensions or connections through which their behavior differs.

Deep dive: Few-Shot Image Recognition by Predicting Parameters from Activations

How predicting classifier weights from image activations enables fast few-shot recognition, with the method, tests, and limits explained. · about 33 minutes to read

How Mova uses it

For Mova, the small transparent language system written in Rust, this paper offers a possible design pattern for adding categories from limited evidence. It does not establish an implemented Mova component. The experiments concern image recognition, and they provide no measurements for language processing or for Mova itself. The useful connection is therefore architectural: a stable representation could feed a shared function that constructs the decision rule for a newly introduced label.

A possible application would be a language classification component whose category inventory changes over time. Suppose Mova had an established way to turn an input into an inspectable feature vector. A few labeled examples of a new category could supply the evidence used to generate that category’s weights. The category would then participate in the same scoring procedure as existing categories. This would follow the paper’s separation between learning a general parameter-producing function and using that function to add a particular category. It would still require a language-specific experiment before any claim of effectiveness.

The distinction between feature construction and category adaptation is especially useful for a transparent system. The paper keeps the pretrained feature extractor fixed during parameter-predictor training and adaptation. An analogous Mova design could keep its input representation stable while exposing the category statistics, predicted weights, and resulting scores for inspection. That would make the adaptation path relatively concrete: evidence produces a statistic, the statistic produces weights, and those weights determine how features contribute to a category score.

A linear predictor would be a natural candidate for such an investigation because its computation can be examined directly. The image paper interprets its linear version as learning a similarity relationship that can weight channels differently and connect different dimensions. In a language system with intelligible features, inspecting those connections could help explain which aspects of the examples influence the new decision rule. This is a proposed use of the paper’s analysis, not evidence that a corresponding language representation would preserve the same useful geometry.

The training procedure also suggests how to avoid an overly easy development task. A Mova experiment should not train a parameter predictor only on well-supported category summaries and then evaluate it exclusively on sparse examples. The paper’s average-versus-individual comparison shows that those inputs can favor different behavior. A language adaptation experiment could likewise compare richer category descriptions with individual labeled instances, while retaining separate measurements for established and newly introduced labels.

The most important borrowing may be the evaluation discipline. A new language category should be tested while existing categories remain eligible answers. Otherwise, successful recognition could reflect an artificially restricted candidate set. Mova could also record the cost of adding a category separately from the cost of processing later inputs, following the distinction made in the image experiments. These are concrete experimental possibilities. The paper does not show that generated classifier weights are preferable to other approaches for Mova, and it does not support a claim that its image-recognition results transfer automatically to language.

The problem and its context

Learning new categories without starting over

The paper begins from an imbalance in supervised image recognition. Large datasets make it possible to train strong visual classifiers, but many practical additions to a category inventory arrive with very little labeled evidence. A system may have abundant examples of familiar objects and only a few examples of something newly introduced. The difficulty is not merely recognizing that new thing in isolation. It must be recognized while familiar categories remain possible answers.

The authors distinguish a large training collection from a few-shot collection. Their category sets do not overlap. The large collection supplies enough examples to learn a useful visual representation; the few-shot collection supplies only limited evidence for categories unavailable during that earlier learning. The central question is how to use knowledge acquired from the large collection to support these unfamiliar categories.

This arrangement creates competing demands. A method can favor established categories so strongly that new examples rarely win a prediction. It can also make new examples competitive by changing the representation or decision boundaries in ways that damage familiar-category recognition. Reporting performance on only one group would miss this tension. The authors therefore define success through recognition of the unfamiliar categories, retention of familiar-category performance, and efficient adaptation and inference.

Their motivation includes the contrast between data-intensive visual learning and the ease with which people can sometimes acquire new visual concepts after accumulating earlier experience. That comparison motivates the task; it is not a claim that the proposed computation explains human learning. The method remains an engineered image-recognition procedure built on supervised pretraining.

Why ordinary adaptation is difficult

A pretrained classifier already contains useful information about images, so a natural response is to extend its output layer and continue training. The problem is that a newly added category may supply too little evidence to estimate a good decision rule. The imbalance between extensive familiar-category data and scarce unfamiliar-category data makes the combined learning problem difficult.

The paper considers both broad fine-tuning and more restricted updates. Broad fine-tuning can change the network after categories are added. A restricted approach can preserve the representation and existing category parameters while learning only the new category weights. Either way, the newly learned quantities must be estimated from very limited examples.

Nearest-neighbor methods avoid fitting a fresh decision rule in the same way. They represent a query image and compare it with stored examples. A newly labeled image can immediately become a reference. This makes category addition easy, but the quality of the representation and similarity rule becomes decisive. A distance that behaves well for familiar examples may not separate the relevant unfamiliar categories reliably.

There is also an inference cost. If recognition requires comparisons with a large reference collection, every query may involve extensive search or similarity computation. The authors’ alternative tries to preserve the ease of incorporating examples while turning their information into classifier parameters that can be reused efficiently.

The earlier approaches described by the authors

The paper places its proposal after several lines of few-shot research. Early work used a variational Bayesian treatment of visual categories. Work on character recognition explored a hierarchical Bayesian program-based approach, while siamese convolutional networks learned representations through comparisons between examples. These approaches differ in how they bring prior experience to bear on scarce new evidence.

Matching Network framed recognition through retrieval from a reference set, using attention and memory mechanisms. Subsequent approaches described in the paper learned an optimizer through an LSTM-based meta-learner or learned an initialization suited to later adaptation. The authors acknowledge these as strong methods for their evaluated few-shot tasks.

Their criticism concerns flexibility in the particular formulations they discuss. They argue that the earlier setups couple testing to a fixed task structure, including the number of candidate categories and reference examples. Their proposed predictor instead operates on category descriptions independently, allowing the resulting classifier to contain whichever collection of categories is required. This is the paper’s stated comparison with those implementations, rather than a general claim about every possible version of those research directions.

For combined familiar and unfamiliar recognition, the paper also discusses metric learning followed by nearest-neighbor classification. Such a system can incorporate novel examples, but the authors question whether it uses extensive familiar-category supervision as effectively as a classifier trained directly for recognition. Their experiments compare these alternatives using a common pretrained visual foundation.

Learning like a Child is another relevant predecessor. As the authors describe it, that work seeks rapid acquisition of new visual concepts while maintaining previous performance, but uses hundreds of examples per category. The present paper concentrates on much scarcer evidence. Its contribution is therefore tied both to a stricter data regime and to a different mechanism for producing the new category parameters.

From stored evidence to generated weights

The proposal connects the two ends of a standard classifier. Near the output, the network produces an activation vector for an image. The final classification layer contains a weight vector for each category. Recognition depends on the interaction between these vectors.

If examples of a category occupy a related region of activation space, their average provides a possible description of that category. A useful classifier weight should respond strongly to that region. This suggests that the average activation and the corresponding weight vector may share structure.

The authors inspect this possibility through visualizations of category averages and classifier parameters. They report similar neighborhood arrangements and semantic groupings. This observation motivates learning a category-independent mapping between the spaces. The mapping is the central hypothesis: relationships acquired from familiar categories may help construct decision rules for categories absent from pretraining.

The method, step by step

Follow the information through the system

The method begins with ordinary supervised training on familiar categories. Once a useful feature extractor is available, the authors learn an additional function that takes category evidence and returns classifier weights. Training this function requires examples from familiar categories only. At deployment, evidence from unfamiliar categories passes through the same function.

Turning category examples into classifier weights

The steps in order.

Turning category examples into classifier weightsStep 1: Train features on familiar categories1. Train features on familiar categoriesStep 2: Extract image activations2. Extract image activationsStep 3: Sample category summaries and examples3. Sample category summaries and examplesStep 4: Predict category weight vectors4. Predict category weight vectorsStep 5: Train the predictor through classification5. Train the predictor through classificationStep 6: Generate weights for unfamiliar categories6. Generate weights for unfamiliar categoriesStep 7: Score familiar and unfamiliar categories together7. Score familiar and unfamiliar categories together

The separation between these stages matters. The parameter predictor does not have to discover visual features from the few new images. It works in an activation space learned earlier from extensive supervision. Its task is to turn a description within that space into an effective recognition rule.

Likewise, adaptation is separate from predictor training. The predictor itself is learned through optimization. Only after that learning is complete can a new category be incorporated without additional optimization. The phrase “zero training” in the paper refers to this later adaptation stage, not to the construction of the entire system.

Define the representation and the category evidence

Let an image be denoted by x. The pretrained network maps it to a vector a(x), taken from the activations immediately before the final fully connected classification layer. For full ImageNet, these activations come from global average pooling in a ResNet with 50 layers.

a(x) ∈ ℝⁿ

Here, a is the feature-extraction function, x is an image, ℝ denotes real-valued coordinates, and n is the activation vector’s dimensionality. The vector describes the image in the representation learned during pretraining.

Each category y has a collection of activations from its labeled examples.

Aᵧ = {a(x) | x ∈ D_large ∪ D_few, Y(x) = y}

Aᵧ is the activation collection for category y. D_large contains the extensively supervised examples, D_few contains the few-shot examples, and ∪ joins those collections. Y(x) gives the known category of image x. The vertical bar means that the set includes activations satisfying the stated conditions.

The average activation of category y is written āᵧ. It summarizes the available examples by their mean in activation space. For a category represented by an individual image, that average is just the image’s activation. With more evidence, the average can describe a broader collection, although averaging can also conceal differences among examples.

A conventional final layer has a weight vector wᵧ for category y. Its compatibility with an image depends on the inner product between wᵧ and a(x). The authors’ intuition is that a useful wᵧ should respond strongly to activations from that category. Similarity between category evidence and category weights therefore provides the starting point for the predictor.

Learn a shared mapping

The predictor is written φ. It converts a category statistic into a classifier weight vector.

φ: āᵧ ↦ wᵧ

The symbol φ denotes the learned mapping, āᵧ is the category-average activation, wᵧ is the generated classifier weight, and ↦ indicates the transformation. This initial formulation uses the average, although the full training procedure also uses individual activations.

Every category uses the same φ. The predictor receives category evidence instead of a separate category-specific transformation. The intended generalization is across categories: a mapping learned from familiar-category representations should remain useful when the input describes an unfamiliar category.

The authors do not train φ by requiring exact agreement with the pretrained classifier’s existing weights. Instead, they place the generated weights into a classification computation and evaluate the resulting predictions. This makes the training signal correspond directly to the task the predictor must ultimately support.

The initial objective uses category means.

L(φ) = Σ_(y,x)∈D_large [−φ(āᵧ) · a(x) + log Σ_y′∈C_large exp(φ(āᵧ′) · a(x))] + λ‖φ‖

L is the training loss. The outer sum runs over labeled familiar-category images, with y denoting the correct category of x. C_large is the familiar-category set. The generated weight φ(āᵧ) is compared with a(x) through the inner product, written ·. The negative term rewards a high score for the correct category.

The logarithmic term includes the scores of all familiar categories, indexed by y′. The function exp converts a score into an exponential quantity, and log takes the logarithm of their sum. Together, the score terms express the usual softmax classification loss. The final term regularizes the predictor: λ controls its strength, and ‖φ‖ denotes the regularizer used in the objective.

This loss can learn a predictor that performs well with stable category means. It does not on its own ensure that the predictor will handle the less reliable evidence available for unfamiliar categories.

Make training resemble sparse adaptation

To address this mismatch, the authors allow a category to be represented either by its mean activation or by an individual activation. The selected representation is called sᵧ.

sᵧ ∈ Aᵧ ∪ {āᵧ}

The statistic sᵧ belongs either to the collection Aᵧ of individual activations or to the set containing its mean āᵧ. The notation describes the possible inputs to the shared predictor.

For each category, the procedure chooses the mean with probability p_mean. Otherwise, it samples an individual activation uniformly from that category’s collection. The statistic set S_large contains a selected statistic for every familiar category.

The resulting training objective averages over possible statistic selections.

L(φ) = Σ_(y,x)∈D_large E_S_large [−φ(sᵧ) · a(x) + log Σ_y′∈C_large exp(φ(sᵧ′) · a(x))] + λ‖φ‖

E_S_large denotes an expectation over sampled familiar-category statistic sets. The remaining symbols retain their earlier meanings. The difference is that predicted weights now depend on sampled statistics sᵧ rather than invariably depending on full category averages.

This makes the predictor learn from both concentrated and sparse evidence. It must produce useful weights when the input is a stable mean and when the input reflects the particular appearance of an individual example. The task remains classification across familiar categories, but the evidence used to construct the classifier changes from batch to batch.

The parameter p_mean controls this mixture. It is set to 0.9 in the full ImageNet implementation. The paper compares this mixed procedure with an otherwise similar predictor trained only from means, making the choice part of the experimental analysis rather than merely an implementation detail.

Train through the generated classification layer

A training batch contains a statistic set and a separate set of activations to classify. Each set has an entry for every familiar category. Statistics are passed through φ to generate the weights of a temporary classification layer. The training activations then pass through that layer, and their known labels determine the loss.

Gradients travel back through the classification computation into the parameter predictor. Updating φ changes how future category evidence will be converted into weights. The visual feature extractor is fixed during this stage; the learned component is the mapping from its activations to classifier parameters.

For full ImageNet, a batch uses 900 statistics and 900 training activations. Stochastic gradient descent with a learning rate of 0 is used to train the predictor.001, weight decay of 0.0005, and momentum of 0.9. Training lasts 300 epochs, with 250 batches in each epoch.

The authors precompute individual activations and category means for efficiency. As a result, predictor training can operate on these stored vectors rather than repeatedly running the visual network on every sampled image. This is an important part of the actual procedure: the predictor’s learning stage is built on a representation that has already been trained and extracted.

Define recognition over both category groups

At inference, familiar and unfamiliar categories share a candidate set C.

C = C_large ∪ C_few

C_large denotes familiar categories, C_few denotes unfamiliar categories, and their union C is the complete set of possible predictions.

A statistic set S now contains a selected statistic for every category in C. Different choices of statistics produce different generated classifiers. The paper initially defines a probability using the expected score across those choices.

P(y | x) = exp(E_S[φ(sᵧ) · a(x)]) / Σ_y′∈C exp(E_S[φ(sᵧ′) · a(x)])

P(y | x) is the probability assigned to category y for image x. E_S averages over possible statistic sets. The numerator exponentiates the expected score of the requested category, while the denominator sums the corresponding quantities for all candidate categories y′.

The order of operations matters. This expression averages scores before applying the softmax normalization. It does not define an average of separately normalized classifier probabilities. Keeping this distinction clear helps explain the later efficiency argument.

Directly considering the full space of statistic selections is expensive. The authors therefore examine a linear predictor, for which the expectation can be moved through the mapping exactly.

Understand the linear case

When φ is linear, its learned transformation can be represented by a matrix Φ.

ŵᵧ = Φ · sᵧ

The vector ŵᵧ is the predicted weight for category y. Φ is the learned matrix, and sᵧ is the category statistic supplied to it. Matrix multiplication converts the statistic into the weight vector.

The resulting category score is an inner product with the query activation.

h(sᵧ, a(x)) = ŵᵧ · a(x) = (Φ · sᵧ) · a(x)

The function h is the score before softmax normalization. It depends on the category statistic sᵧ, the image activation a(x), and the learned matrix Φ.

This formulation reveals a connection to similarity-based recognition. If the query activation and category statistic are normalized, setting Φ to the identity matrix makes the score their cosine similarity. Learning Φ permits a richer interaction: activation channels can receive unequal influence, and information from different coordinates can be combined.

The parameter-prediction view and the learned-similarity view therefore describe related computations in the linear case. The former emphasizes constructing a reusable classifier; the latter explains what changes relative to a simple cosine comparison.

Linearity also permits efficient inference.

P(y | x) = exp(a(x) · φ(E_S[sᵧ])) / Σ_y′∈C exp(a(x) · φ(E_S[sᵧ′]))

The expectation E_S[sᵧ] is the expected statistic for category y. Because φ is linear in this case, applying φ after the expectation gives the same score as averaging the transformed statistics. The category-dependent quantity can be prepared before classifying a query image.

Writing the same expression with the matrix makes the cached computation explicit.

P(y | x) = exp(a(x) · Φ · E_S[sᵧ]) / Σ_y′∈C exp(a(x) · Φ · E_S[sᵧ′])

Φ again denotes the linear predictor. The expression places the query activation against category weights derived from precomputed expected statistics. Adding a category requires constructing its corresponding statistic and weights rather than retraining the visual network.

Add nonlinearity and handle scarce examples

The authors also investigate a nonlinear predictor. For full ImageNet, its fully connected layers each map 2048-dimensional vectors to 2048-dimensional vectors. A ReLU follows the first layer, and the final outputs are normalized to unit length. The authors report slightly better accuracy with this nonlinear alternative.

The exact expectation argument no longer holds automatically. A nonlinear transformation applied to an expected input generally differs from the expected transformed output. To preserve efficiency, the authors nonetheless use the computation that moves the expectation inside the predictor. For the nonlinear case, this is explicitly an approximation.

The final inference procedure also treats familiar and unfamiliar categories differently. Familiar categories use their expected statistics. For an unfamiliar category, the predictor produces weights from its individual reference examples. The query image is scored against these generated weights, and the highest response becomes that category’s input to softmax.

This maximum-response rule avoids requiring a scarce-example average to capture the whole unfamiliar category. It retains several example-derived responses and lets the most compatible one determine the category score. It also means the deployed few-shot procedure is more specific than simply averaging all available support activations and predicting a single weight vector.

Configure the MiniImageNet version

For MiniImageNet, the authors retain the same overall division between feature extraction and parameter prediction. They test a simple convolutional architecture matching the feature architecture used in Matching Network, as well as a wider residual alternative.

The wider extractor is WRN-28-10. Although MiniImageNet images have size 84 × 84, the authors resize them to 80 × 80 for this network. They use 3 downsampling stages, where the referenced CIFAR configuration uses 2. Activations again come from global average pooling.

The predictor follows the nonlinear full ImageNet configuration, with dimensions adjusted to the chosen extractor’s output. Comparing the simple and wider feature architectures helps distinguish the parameter-prediction mechanism from the benefits of a more capable representation.

Experiments and results

The full ImageNet evaluation

The principal experiment uses ILSVRC 2015. The dataset contains 1000 categories, with about 1300 training images and 50 validation images for each category. The authors allocate 900 categories to the extensively supervised collection and reserve 100 categories for few-shot adaptation.

The feature extractor is trained only on the 900 familiar categories. The experiment then supplies 1, 2, or 3 labeled training examples for each unfamiliar category. Validation images from both groups are classified with all 1000 categories available as answers.

This candidate set is essential to interpreting the experiment. An unfamiliar-category image can be confused with another unfamiliar category or with any familiar category. Similarly, familiar-category images can be diverted toward the newly introduced labels. The setup tests competition within a combined classifier, not recognition within an isolated few-shot subset.

The reported measures are classification accuracies for the familiar and unfamiliar groups. The paper discusses the highest-ranked predictions under this 1000-way setup. Its main accuracy table also varies how much familiar-category data is used, allowing the authors to examine the tradeoff between support for the established inventory and support for newly added categories.

The numerical entries of that table are not available as accuracy values in the paper’s text. As a consequence, the reported ordering and qualitative comparisons can be explained, but exact accuracy gaps cannot be supplied. This limits how precisely a reader can assess the strength of the headline improvement.

What the comparison methods do

The fine-tuned ResNet comparison begins from the familiar-category network, expands the output layer, and continues training with the added category examples. It tests whether ordinary adaptation can exploit the pretrained representation sufficiently well despite limited new supervision.

The Learning like a Child comparison freezes the earlier representation and extends the final layer. It updates the parameters associated with unfamiliar categories while retaining existing category parameters. Because familiar-category data remains accessible in this experiment, the authors do not use that method’s Baseline Probability Fixation procedure.

Nearest-neighbor recognition uses the pretrained convolutional features with cosine distance. It requires no fitting of new category weights. Its category decisions instead depend on comparisons between the query activation and stored reference activations.

The Siamese-Triplet comparison uses shared ResNet feature extractors initialized from the familiar-category classifier. The authors choose the triplet variant because it works better in their experiments than their direct siamese alternative. Training uses relative relationships between positive and negative examples; inference uses cosine-distance nearest neighbors.

These comparisons test different uses of the same initial visual experience. They include changing classifier parameters, retaining a fixed representation with restricted updates, directly comparing stored examples, and adapting features to a chosen distance rule. The proposed predictor occupies another position: it retains the pretrained representation but learns a general procedure for constructing category weights.

The reported recognition findings

The authors report that fine-tuning and Learning like a Child preserve strong familiar-category recognition but struggle with the scant evidence for unfamiliar categories. Their interpretation is that these methods still need to learn new parameters from examples that are too few to support reliable training.

The triplet approach offers better unfamiliar-category performance than those training-based comparisons when little familiar-category data is retained. That benefit comes with substantial damage to familiar-category recognition. The authors also observe that, with full category supervision, features trained directly for classification work better than the triplet-trained alternative.

They suggest that the triplet objective provides less useful supervision for this combined task because it trains through prescribed distance preferences. That explanation is an interpretation of the comparison, not a separately isolated causal finding.

The parameter-prediction method is reported to achieve the strongest unfamiliar-category recognition while retaining comparatively strong familiar-category performance. The mean-only nonlinear predictor favors familiar categories more strongly than the mixed-statistic predictor. Even that mean-only version is reported to exceed the other comparison methods on unfamiliar categories, but the mixed training procedure gives a more favorable balance.

The paper therefore supports a qualitative conclusion about the combined objective: predicting weights from category evidence can improve sparse-category recognition without accepting the familiar-category losses seen in its metric-learning comparison. The accuracy table’s missing numerical entries prevent a precise statement about how large that improvement is.

What the oracle comparisons establish

The authors also examine what happens when all training images of the unfamiliar categories are available. With the pretrained feature extractor fixed, they compare a learned linear classifier and nearest-neighbor recognition across the complete category inventory.

These experiments ask whether the representation already contains useful information about categories excluded from its training. The authors report that it does: both approaches achieve reasonable recognition of those categories when extensive training evidence is supplied.

This is an important context for interpreting the few-shot results. Parameter prediction is not being asked to create a useful representation from nothing. The representation already has some transfer capacity, and the proposed method tries to use it effectively with much less category-specific evidence.

The oracle experiments are empirical references under their stated conditions. They are not mathematical ceilings for every possible classifier using the representation. Their numerical accuracies are not specified in the textual results, so they cannot be used to calculate the remaining gap between few-shot and fully supplied recognition.

Adaptation time and inference time

The efficiency evaluation uses NVIDIA Tesla K40M GPUs. Adaptation with the proposed method consists of predicting category parameters and inserting them into the classifier. For 100 unfamiliar categories with an individual example each, the authors report 0.683s on one GPU.

Fine-tuned ResNet and Learning like a Child instead require additional training. The authors report about 1.8 hours for an epoch on 4 GPUs. This is a cost for an epoch of their training procedure; it should not be interpreted as a complete adaptation time without knowing how much training is performed.

Nearest-neighbor and Siamese-Triplet recognition require no comparable category-parameter generation step. Their reference examples can be used directly. The computational difficulty appears later, when query images must be compared with the stored collection.

Without optimization, the authors report 2.3 hours to classify an image when the entire familiar training collection is involved. They accelerate the comparisons by precomputing features and performing cosine calculations through a deep-learning framework. That optimized procedure uses 45GB of memory and reaches 37.867ms per image.

Full ImageNet image inference time under the reported GPU setup

Parameter prediction produces a classifier with the same reported inference time as the training-based classifiers.

Full ImageNet image inference time under the reported GPU setupOptimized nearest neighbor: 37.867Optimized nearest neighbor37.867Optimized Siamese-Triplet: 37.867Optimized Siamese-Triplet37.867Fine-tuned ResNet: 6.83Fine-tuned ResNet6.83Learning like a Child: 6.83Learning like a Child6.83Parameter prediction (this paper): 6.83Parameter prediction (this paper)6.83
The numbers
System or settingms per image
Optimized nearest neighbor37.867
Optimized Siamese-Triplet37.867
Fine-tuned ResNet6.83
Learning like a Child6.83
Parameter prediction (this paper)6.83

The ordinary classification networks are measured at about 6.83ms per image on one GPU with a batch size of 32. Once the proposed weights are prepared, the method can use a standard network computation for recognition. The comparison therefore supports a practical advantage over exhaustive reference comparisons under the reported implementation conditions.

The timings also clarify the kind of efficiency being claimed. The method does not eliminate pretraining, predictor training, or feature preparation. It reduces the extra work needed to incorporate categories after those stages, while preserving a fast classifier for subsequent queries.

The MiniImageNet evaluation

MiniImageNet contains 80 familiar categories and 20 unfamiliar categories, with 600 images per category. Its images have size 84 × 84. Unlike the full ImageNet experiment, evaluation concerns unfamiliar categories only.

For a task, the authors sample 5 unfamiliar categories. They select either 1 or 5 reference images per selected category and use the remaining images of those categories for testing. They average accuracy across the selected categories, repeat with different selections, and report mean accuracy with a 95% confidence interval.

The simple feature extractor matches the architecture used by Matching Network. The wider alternative uses WRN-28-10. The authors report that both versions exceed the earlier comparison methods on the reference settings, with improvements for the simple extractor as well as the wider residual extractor.

That architectural comparison matters because an improvement found only with a stronger extractor would leave the contribution of parameter prediction less clear. The simple version supplies a closer comparison of the adaptation mechanism. Nevertheless, the exact accuracies and confidence intervals are not numerically stated in the textual table material, so their magnitudes cannot be reproduced.

The MiniImageNet result answers a narrower recognition question than the full ImageNet result. It demonstrates performance within selected unfamiliar categories. It does not test simultaneous preservation of the familiar inventory, which is why the larger combined experiment remains central to the paper’s argument.

What the ablations show

Mixing means with individual examples changes the balance

The clearest controlled comparison concerns the statistics used to train the predictor. The authors compare nonlinear predictors with the same architecture but different objectives. The mixed-statistic version can receive either a category mean or an individual activation; the mean-only version always receives the category average.

The mean-only version exhibits a stronger preference for familiar categories. Its training inputs describe categories using abundant data, while unfamiliar categories at evaluation have sparse evidence. The mixed version explicitly encounters less stable, example-specific descriptions during training, making it better suited to the later adaptation condition.

This comparison supports the value of matching the predictor’s learning inputs to the kind of evidence available at deployment. It also shows that preserving familiar-category accuracy and improving unfamiliar-category accuracy are not perfectly aligned goals. Changing the statistic distribution alters their balance.

The evidence should be read at the level of the tested contrast. It establishes a difference between mixed-statistic and mean-only training under this setup. It does not establish an optimal mixing probability across datasets, and it does not show that the same choice would suit a different representation or category distribution.

Nonlinearity brings a reported improvement

The paper compares a linear predictor, φ¹, with a nonlinear predictor, φ². The latter adds another fully connected transformation and a ReLU, while normalizing its output. The authors report modest accuracy improvements for both familiar and unfamiliar categories.

This suggests that a single learned matrix does not capture every useful relationship between category statistics and classifier weights. A nonlinear mapping can transform the evidence in a more flexible way. The paper does not provide numerical accuracy entries from which to measure that benefit precisely.

There is also a computational qualification. The linear predictor permits an exact rearrangement of the expected score. The nonlinear predictor retains the efficient computation by approximation. Its reported practical improvement therefore comes with a distinction between the original expectation-based expression and the computation actually used for efficiency.

The learned matrix does more than reproduce cosine similarity

The linear predictor is particularly useful for analysis because an identity matrix gives a simple reference. With normalized inputs, that reference produces cosine similarity. The learned matrix can therefore be inspected to see how it departs from equal treatment of activation channels.

The authors visualize an upper-left 256 × 256 portion of the matrix and find that diagonal entries dominate. This suggests that much of the transformation preserves channel identity while adjusting influence. The diagonal values have a maximum of 0.976 and a minimum of 0.744, showing that the learned transformation does not leave every channel equally weighted.

The authors suggest that channels differ in their magnitudes and relevance to recognition. A directly trained classifier can accommodate those differences through its final-layer parameters. A plain cosine rule instead gives channels the same formal role after normalization.

The matrix visualization supports a concrete departure from the identity reference. It does not, on its own, prove why each channel receives its particular weight. The proposed explanations about channel distributions and task relevance remain interpretations that the following impact analysis helps investigate.

To compare channel influence, the authors define an impact statistic by adding the absolute values of weights connected to an input channel.

Iⱼ(φ) = Σᵢ |φᵢⱼ|

Iⱼ is the impact assigned to activation channel j. The entries φᵢⱼ connect that input channel to output coordinates indexed by i. Absolute values prevent positive and negative connections from canceling in the sum.

The same construction is applied to the pretrained classifier’s final weight matrix, written W_large^pt. For the identity mapping, every channel has the same impact.

Iⱼ(Id) = 1

Id denotes the identity mapping, and the statement applies to every channel j. It supplies the equal-influence reference against which the learned predictor is compared.

After normalizing the pretrained classifier’s impact vector to unit length, the authors report a channel-wise mean of 2.13e-2 and a standard deviation of 5.83e-3. These values show that the original classifier also allocates influence unevenly across channels.

They then compare which channels are ranked most influential.

OS(φ, W_large^pt, k) = card(top-k(I(φ)) ∩ top-k(I(W_large^pt))) / k

OS is the overlap score. The function top-k returns the indices of the k largest impacts, ∩ selects indices shared by the two sets, and card counts those shared indices. Dividing by k expresses the overlap relative to the selected set size. W_large^pt denotes the pretrained familiar-category classifier weights.

The authors report closer agreement between the learned predictor and the pretrained classifier than between the identity reference and that classifier. This supports the interpretation that parameter prediction recovers some useful pattern of channel influence learned from extensive supervision.

It remains an explanatory analysis rather than a full causal decomposition. Similar rankings help make the result intelligible, but they do not establish that ranking agreement alone accounts for the recognition improvement.

Limitations

Limits acknowledged in the method

The authors explicitly identify the unreliability of category statistics formed from scarce evidence. A few examples may not give a dependable estimate of the category’s expected activation. Their maximum-response strategy for unfamiliar categories addresses this issue by retaining example-specific generated weights, but it does not remove the underlying shortage of information.

They also acknowledge a tradeoff between familiar and unfamiliar recognition. Training with category means favors the familiar group more strongly, while the mixed objective improves the balance for sparse categories. The paper therefore does not establish adaptation with no cost whatsoever to earlier recognition.

Another stated qualification concerns nonlinear inference. The efficient expectation rearrangement is exact for a linear predictor. Once nonlinearity is introduced, the authors retain that arrangement as an approximation. The nonlinear results should be understood as evidence for a practical implementation rather than verification that the original expectation is calculated exactly.

The efficiency measurements likewise concern a particular implementation and hardware setup. They demonstrate fast category incorporation and inference in that setting. They do not imply that every stage of constructing the system is cheap, since the feature extractor and parameter predictor both require substantial prior learning.

Limits visible in the experimental design

A careful reader should separate the strength of the adaptation mechanism from the strength of the pretrained representation. The method depends on unfamiliar images being meaningfully represented in a feature space learned from familiar categories. The oracle comparisons indicate useful transfer within the evaluated collection, but they do not establish equivalent behavior when new categories require visual distinctions that pretraining failed to preserve.

The familiar and unfamiliar categories come from divisions of ImageNet or MiniImageNet. Category non-overlap prevents direct training on the held-out labels, but it does not amount to a test across arbitrary changes in visual domain. The paper therefore supports claims about the reported category-transfer setup rather than unrestricted transfer to any source of images.

The geometric motivation is also suggestive rather than conclusive. Similar neighborhood patterns in visualizations of averages and classifier weights make a shared mapping plausible. A visualization does not prove that a mapping will generalize across all categories or characterize precisely when it will fail.

The numerical reporting available in the text places another boundary on interpretation. The authors describe stronger accuracies and their comparative trends, but the accuracy tables lack numerical entries. Exact gains, uncertainty intervals, and gaps to the oracle references cannot be reconstructed. Timing values and channel-analysis statistics are explicit; recognition improvements remain qualitative at that level of reporting.

Questions the comparisons do not settle

The evaluation does not establish that parameter prediction is superior to every possible reference-search procedure. The nearest-neighbor timing concerns the authors’ exhaustive comparison implementation and its optimizations. Other search designs are not measured, so the inference comparison should remain attached to the tested systems.

Likewise, the claim of flexible category counts concerns the predictor’s architecture and the earlier task formulations discussed by the authors. It does not demonstrate favorable accuracy at every possible inventory size. Being able to construct a classifier for a new category set and maintaining accurate recognition over that set are related but separate properties.

The maximum-response rule also introduces behavior that is not fully isolated by the reported analyses. It lets an unfamiliar category win through whichever reference-derived weight responds most strongly. The paper explains the rule as a response to unreliable few-shot means, but does not provide a detailed controlled comparison separating its contribution from the predictor and the mixed training procedure.

Normalization, predictor depth, and the choice of feature extractor are additional ingredients. The paper compares important alternatives, especially linear versus nonlinear prediction and mean-only versus mixed training. It does not provide an exhaustive analysis of how every implementation choice contributes independently.

What remains outside the demonstrated scope

The paper motivates its goal partly through lifelong learning, but its reported experiments do not establish the behavior of a system undergoing an extended sequence of category additions. They show adaptation to held-out category groups and recognition over the combined inventory. They do not characterize how repeated additions would affect calibration, memory use, or competition among categories over a long deployment.

The method also assumes labeled reference examples for each new category. The experiments do not establish robustness to incorrect labels or systematically unrepresentative examples. Those conditions matter especially when an individual example can generate a decision rule, but they are not measured here.

The softmax computation produces probabilities across the available categories, yet the paper’s evidence concerns classification accuracy and computational cost. It does not establish that those probabilities are well calibrated, or that the classifier can reliably reject an image belonging to no included category.

Finally, the results are about visual recognition. They offer an architectural idea that can be considered for language classification or other structured tasks, but no such transfer is demonstrated. Any application to Mova would need its own representation, learning setup, comparisons, and evaluation of established as well as newly introduced categories.

What came after

Boosting Few-Shot Visual Learning With Self-Supervision is a later work from 2019 that cites this paper. Its title places it in the continuing effort to improve few-shot visual learning and identifies self-supervision as its additional direction.

The available citation information does not describe how that work uses activation-to-parameter prediction. It therefore supports a citation relationship, but not a more specific claim that the later method adopts this predictor, changes its training objective, or improves its reported results. Those would require technical details about the later work’s method and experiments.

The research connection that can be stated confidently is the shared concern with making earlier learning useful when category-specific supervision is scarce. In the present paper, that concern leads to a learned mapping from category evidence to classifier weights. The later title signals attention to self-supervision within the same broad few-shot visual-learning problem, without establishing the precise relationship between their mechanisms.

The lasting question raised by parameter prediction is broader than any particular architecture: how much of adapting to a new category can be learned in advance? The paper answers through a concrete construction. Learn a representation from well-supported categories, learn how evidence in that representation should become classifier weights, and use that shared transformation when unfamiliar labels arrive. Its experiments make that construction credible for the reported image-recognition settings, while leaving its reliability under wider domain changes and repeated deployment updates open.

Cite

Cite as Siyuan Qiao, Chenxi Liu, Wei Shen and Alan Yuille. 2018. Few-Shot Image Recognition by Predicting Parameters from Activations. IEEE Computer Society Conference on Computer Vision and Pattern Recognition/Proceedings - IEEE Computer Society Conference on Computer Vision and Pattern Recognition/Proceedings.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.1109/cvpr.2018.00755 · arXiv 1706.03466

@inproceedings{qiao2018few,
  title = {{Few-Shot Image Recognition by Predicting Parameters from Activations}},
  author = {Siyuan Qiao, Chenxi Liu, Wei Shen and Alan Yuille},
  booktitle = {IEEE Computer Society Conference on Computer Vision and Pattern Recognition/Proceedings - IEEE Computer Society Conference on Computer Vision and Pattern Recognition/Proceedings},
  year = {2018},
  doi = {10.1109/cvpr.2018.00755},
  eprint = {1706.03466},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.1109/cvpr.2018.00755}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/qiao-2018-few-shot-image-recognition-predicting/

References

31 references, from the paper's own bibliography.

  1. C. G. Atkeson, A. W. Moore, and S. Schaal. Locally weighted learning for control. In Lazy learning, pages 75–113. Springer, 1997. OpenAlex ↗ · Scholar ↗
  2. P. Bloom. How children learn the meanings of words, volume 377. Citeseer, 2000. OpenAlex ↗ · Scholar ↗
  3. Z. Chen and B. Liu. Mining topics in documents: standing on the shoulders of big data. In The 20th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD '14, New York, NY, USA - August 24 - 27, 2014, pages 1116–1125, 2014. OpenAlex ↗ · Scholar ↗
  4. Z. Chen and B. Liu. Topic modeling using topics from many domains, lifelong learning and big data. In Proceedings of the 31th International Conference on Machine Learning, ICML 2014, Beijing, China, 21-26 June 2014, pages 703–711, 2014. OpenAlex ↗ · Scholar ↗
  5. J. Donahue, Y. Jia, O. Vinyals, J. Hoffman, N. Zhang, E. Tzeng, and T. Darrell. Decaf: A deep convolutional activation feature for generic visual recognition. In Proceedings of the 31th International Conference on Machine Learning, ICML 2014, Beijing, China, 21-26 June 2014, pages 647–655, 2014. our card
  6. M. Everingham, L. Van Gool, C. K. I. Williams, J. Winn, and A. Zisserman. The PASCAL Visual Object Classes Challenge 2007 (VOC2007) Results. http://www.pascal-network.org/challenges/VOC/voc2007/workshop/index.html. OpenAlex ↗ · Scholar ↗
  7. L. Fei-Fei, R. Fergus, and P. Perona. One-shot learning of object categories. IEEE transactions on pattern analysis and machine intelligence, 28(4):594–611, 2006. OpenAlex ↗ · Scholar ↗
  8. C. Finn, P. Abbeel, and S. Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In D. Precup and Y. W. Teh, editors, Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 1126–1135, International Convention Centre, Sydney, Australia, 06–11 Aug 2017. PMLR. our card
  9. G. Griffin, A. Holub, and P. Perona. Caltech-256 object category dataset. In Technical Report 7694, California Institute of Technology, 2007. OpenAlex ↗ · Scholar ↗
  10. K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2016, Las Vegas, NV, USA, June 27-30, 2016, pages 770–778, 2016. our card
  11. G. Huang, Z. Liu, and K. Q. Weinberger. Densely connected convolutional networks. CoRR, abs/1608.06993, 2016. OpenAlex ↗ · Scholar ↗
  12. M. Huh, P. Agrawal, and A. A. Efros. What makes imagenet good for transfer learning? CoRR, abs/1608.08614, 2016. our card
  13. G. Koch, R. Zemel, and R. Salakhutdinov. Siamese neural networks for one-shot image recognition. In ICML Deep Learning workshop, 2015. OpenAlex ↗ · Scholar ↗
  14. A. Krizhevsky. Learning multiple layers of features from tiny images. In Master’s thesis, Department of Computer Science, University of Toronto, 2009. OpenAlex ↗ · Scholar ↗
  15. A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In F. Pereira, C. J. C. Burges, L. Bottou, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems 25, pages 1097–1105. Curran Associates, Inc., 2012. our card
  16. B. M. Lake, R. Salakhutdinov, J. Gross, and J. B. Tenenbaum. One shot learning of simple visual concepts. In Proceedings of the 33th Annual Meeting of the Cognitive Science Society, CogSci 2011, Boston, Massachusetts, USA, July 20-23, 2011, 2011. OpenAlex ↗ · Scholar ↗
  17. B. M. Lake, R. Salakhutdinov, and J. B. Tenenbaum. Human-level concept learning through probabilistic program induction. Science, 350(6266):1332–1338, 2015. OpenAlex ↗ · Scholar ↗
  18. B. M. Lake, R. R. Salakhutdinov, and J. Tenenbaum. One-shot learning by inverting a compositional causal process. In C. J. C. Burges, L. Bottou, M. Welling, Z. Ghahramani, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems 26, pages 2526–2534. Curran Associates, Inc., 2013. OpenAlex ↗ · Scholar ↗
  19. Y. LeCun, Y. Bengio, and G. Hinton. Deep learning. Nature, 521(7553):436–444, 2015. OpenAlex ↗ · Scholar ↗
  20. T. Lin, M. Maire, S. J. Belongie, L. D. Bourdev, R. B. Girshick, J. Hays, P. Perona, D. Ramanan, P. Dollár, and C. L. Zitnick. Microsoft COCO: common objects in context. CoRR, abs/1405.0312, 2014. our card
  21. X. Lin, H. Wang, Z. Li, Y. Zhang, A. Yuille, and T. S. Lee. Transfer of view-manifold learning to similarity perception of novel objects. In 5th International Conference on Learning Representations (ICLR), 2017. OpenAlex ↗ · Scholar ↗
  22. L. v. d. Maaten and G. Hinton. Visualizing data using t-sne. Journal of Machine Learning Research, 9(Nov):2579–2605, 2008. OpenAlex ↗ · Scholar ↗
  23. J. Mao, X. Wei, Y. Yang, J. Wang, Z. Huang, and A. L. Yuille. Learning like a child: Fast novel visual concept learning from sentence descriptions of images. In Proceedings of the IEEE International Conference on Computer Vision, pages 2533–2541, 2015. OpenAlex ↗ · Scholar ↗
  24. V. Nair and G. E. Hinton. Rectified linear units improve restricted boltzmann machines. In Proceedings of the 27th International Conference on Machine Learning (ICML-10), June 21-24, 2010, Haifa, Israel, pages 807–814, 2010. OpenAlex ↗ · Scholar ↗
  25. S. Ravi and H. Larochelle. Optimization as a model for few-shot learning. In 5th International Conference on Learning Representations (ICLR), 2017. OpenAlex ↗ · Scholar ↗
  26. O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, M. Bernstein, A. C. Berg, and L. Fei-Fei. ImageNet Large Scale Visual Recognition Challenge. International Journal of Computer Vision (IJCV), 115(3):211–252, 2015. our card
  27. K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. CoRR, abs/1409.1556, 2014. our card
  28. O. Vinyals, C. Blundell, T. Lillicrap, K. Kavukcuoglu, and D. Wierstra. Matching networks for one shot learning. In Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pages 3630–3638, 2016. our card
  29. X. Wang and A. Gupta. Unsupervised learning of visual representations using videos. In 2015 IEEE International Conference on Computer Vision, ICCV 2015, Santiago, Chile, December 7-13, 2015, pages 2794–2802, 2015. OpenAlex ↗ · Scholar ↗
  30. Y. Wang, L. Xie, C. Liu, Y. Zhang, W. Zhang, and A. Yuille. Sort: Second-order response transform for visual recognition. CoRR, abs/1703.06993, 2017. OpenAlex ↗ · Scholar ↗
  31. S. Zagoruyko and N. Komodakis. Wide residual networks. In BMVC, 2016. OpenAlex ↗ · Scholar ↗