Image recognition models have purportedly reached human performance on benchmarks such as ImageNet, but depend critically onlarge, balanced, labeled training sets with hundreds of examples per class. This requirement is impractical in many realistic scenarios, where concepts may be rare or have very few labeled training examples. Furthermore, acquiring more labeled examples might require expert annotators and thus be too expensive. This problem is exacerbated in applications (e.g., robotics) that require learning new concepts on the fly in deployment, and cannot wait for a costly offline data collection process.
These considerations have prompted research on the problem of “few-shot” learning: recognizing concepts from small labeled sets [14, 18, 37, 40, 43]. This past work builds “learners” that can learn to distinguish between a small number of unseen classes (often fewer than 20) based on an extremely small number of training examples (e.g. 5 per class). However, multiple challenges plague these methods when they are applied to real-world recognition problems.
First, few-shot methods typically assume balanced datasets, and optimize the learner for an exact, often unrealistically small number of training examples per class. In contrast, real-world problems may have highly imbalanced, heavy-tailed class distributions, with orders of magnitude more data in some classes than in others. A practical learner must therefore work equally well for all classes irrespective of the number of training examples. It is unclear how or even if few-shot methods can handle such an imbalance.
Second, few-shot learning methods often assume the number of relevant concepts to be small, and as such highly distinct from each other. In contrast, real world applications often involve thousands of classes with subtle distinctions. These distinctions can be particularly hard to detect when natural images are cluttered or difficult to parse (Figure 1, bottom). Thus, the learner must also be able to make fine-grained class distinctions on cluttered natural images.
We first evaluate prototypical networks , a simple yet state-of-the-art few-shot learning method, on a realistic benchmark based on the heavy-tailed class distribution and subtle class distinctions of the iNaturalist dataset . We show that prototypical networks can struggle on this challenging benchmark, confirming the intuitions above.
We next present ways to address the challenge of heavy-tailed, fine-grained, cluttered recognition. We introduce modifications to prototypical networks that significantly improve accuracy without increasing model complexity.
First, to deal with heavy class imbalance, we propose a new training method based on leave-one-out cross-validation. This approach makes optimization easier and the learner more resilient to wider distributions of class sizes. This technique yields a 4 point gain in accuracy.
Second, we posit that when objects are small or scenes are cluttered, the learner may find it difficult to identify relevant objects from image-level labels alone.
To tackle this problem, we explore new learner architectures that localize each object of interest before classifying it
new learner architectures that localize each object of interest before classifying it. These learners use bounding box annotations for a tiny subset of the labelled images. Localization improves accuracy by 6 points, more so when objects occupy under 40% of the image.
Even after localizing the object, the learner may need to look for subtle distinctions between concepts. Existing few-shot methods rely on the learning process alone to build informative feature representations. We show that straightforward, parameter-free adjustments can significantly improve performance. In particular, we find that the representational power of the learner can be significantly increased by leveraging bilinear pooling [7, 26]. While in its original formulation, bilinear pooling significantly increases the model parameter count, we show that it can be applied to prototypical networks with zero increase. This modification significantly improves accuracy by up to 9 points.
Together, these contributions double the accuracy of prototypical networks and other strong baselines on our challenging heavy-tailed benchmark, with negligible impact on model complexity. Our results suggest that our proposed approach provides significant benefits over prior techniques for realistic recognition problems in the wild.
2 Related Work
The ideas behind our proposed techniques have broad prior support, but appear in mostly disjoint or incompatible problem settings. We adapt these concepts into a unified framework for recognition in real-world scenarios.
Meta-learning: Prior work on few-shot learning has mainly focused on optimizing a learner: a function that takes a small labeled training set and an unlabeled test set as inputs, and outputs predictions on the test set. This learner can be expressed as a parametric function and trained on a dataset of “training” concepts so that it generalizes to new ones. Because these methods train a learner, this class of approaches is often called “meta-learning”. Optimization may focus on the learner’s parameterization [6, 15, 29, 36], its update schedule [28, 34, 35], the generalizability of a built-in feature extractor [12, 37, 40], or a learned distance metric in feature space [13, 21, 38]. An orthogonal approach is to generate additional, synthetic data [18, 46].
In most cases, however, few-shot classifiers [6, 15, 21, 28, 34, 35, 37, 38] are evaluated on one or both of only two datasets: mini-ImageNet  and Omniglot . The former presents only five classes at a time, with one or five training images per class. The latter is a handwritten character dataset, on which accuracy regularly surpasses 98% [12, 28, 29, 38, 40]. Some recent work has expanded the number of classes dramatically [18, 43], but still assumes that novel classes have the same number of examples. These benchmarks are therefore divorced from real-world conditions, which involve difficult problems, natural images, many concepts, and varying amounts of training data [27, 39, 44]. Many prior meta-learning approaches are incompatible with these settings. Notably, Wang et al  design an approach to heavy-tailed problems based on knowledge transfer from common to rare classes. Their approach is orthogonal to our improvements.
Heavy-tailed datasets: Heavy-tailed class distributions are common in the real world. MS-COCO , the SUN database , DeepFashion , MINC , and Places  are all examples where an order of magnitude separates the number of images in the most versus the least common classes. MINC and Places are especially noteworthy because they are explicitly designed to narrow this gap in data availability [5, 49], yet display heavy class imbalance anyway. Despite this trend, standard recognition benchmarks like ImageNet , CIFAR-10, and CIFAR-100  heavily curate their data to ensure that classes remain nicely balanced and easily separable. The mini-ImageNet and Omniglot few-shot benchmarks encode class balance explicitly, as do other proposed few-shot benchmarks [18, 43, 46].
Improving feature space: It is well known that higher-order expansions of feature space can raise the expressive power of hand-designed feature extractors [19, 33]. Recent work has shown that similar techniques [7, 26], learnable generalizations of these techniques [8, 47], and efficient approximations to these techniques [16, 20]
also improve the performance of convolutional networks. The improvement is especially large in fine-grained classification settings, such as facial recognition[4, 9, 26]. However, using the resulting expanded feature space requires parameter-heavy models. We adapt bilinear pooling  to the few-shot setting as a truly parameter-free expansion, which no longer risks overfitting to small datasets.
Localization: A close relationship exists between localization and recognition. Networks trained solely on image-level, classification-based losses nevertheless learn to localize objects of interest [30, 48]. These learned localizations can act as useful data annotation, including for the original recognition task [41, 45, 48]. Very difficult problems, however, may require expensive ground truth annotations to begin bootstrapping. Fortunately, a very small set of annotations can be sufficient to predict the rest . Semi-supervised localization further improves when image-level category labels are provided [17, 23]. Since each can bootstrap from the other, combining recognition and localization may prove a particularly effective remedy for data scarcity.
3 Problem Setup and Benchmark
Our goal is to build learners
, systems that can automatically learn new concepts under challenging real-world conditions, with heavy-tailed distributions of classes and subtle class distinctions. Each learner may have tunable parameters or hyperparameters. As in prior work, these parameters are learned on a “representation set” of concepts (“base classes” in) with many training examples (see Fig. 2).
Once trained, the learner must generalize to a disjoint “evaluation set” of novel categories. The evaluation set is split into a small collection of labeled “reference images” and a larger set of unlabeled “query images”. The learner may use the reference images to define the new set of categories, estimate new parameters for those categories (e.g. a linear classifier) and/or fine-tune its feature representations.
Final accuracy is reported on the unannotated query images. We report top-1 and top-5 accuracy, both as a mean over images and over the categories of the evaluation set. The latter metric penalizes classifiers that focus on large categories while ignoring smaller ones.
Two approaches to the above problem act as illustrative examples. A traditional transfer learning approach is to train a softmax classifier on the representation set. On the evaluation set, the fully-connected layer is replaced by a new version with the appropriate number of categories, and fine-tuned on reference images. Query images form the test set. Meta-learning approaches, such as prototypical networks, train a parametric learner on tiny datasets sampled from the representation set, teaching the learner to adapt to novel tiny datasets. The learner processes the evaluation set in a single pass, with reference images forming the training set and query images forming the test set.
Object location annotations: As discussed in Section 1, a key challenge in real-world recognition problems is finding relevant objects in cluttered scenes. Small sets of image-level class labels may be insufficient. We therefore provide bounding boxes for a small fraction () of the reference images in the evaluation set. Note that with extremal point clicks, these annotations are cheap to acquire in practice . We fully annotate the representation set, as such datasets tend to be heavily curated in the real world (Fig. 2).
3.1 Benchmark Implementation
We now convert this problem setup into a benchmark that accurately evaluates learners on real-world heavy-tailed problems. For this, the evaluation set must satisfy three key properties. First, as in many real-world problems, training sets should be heavily imbalanced, with orders of magnitude difference between rare and common classes. Yet the number of examples per class must be neither unnecessarily small (e.g. fewer than 10), nor unrealistically large (e.g. more than 200). Second, in contrast to past few-shot learning benchmarks that use five classes at a time [24, 40], there should be many (e.g. at least 20) categories in the evaluation set, with coarse- and fine-grained distinctions, as in the real world. Third, images must be realistically challenging, with clutter and small regions of interest.
We implement our benchmark using the iNat2017 dataset , an organically collected, crowdsourced compendium of living organisms, with fine- and coarse-grained species distinctions, a heavy-tailed class size distribution, and bounding box annotations for a significant subset. Of the appropriately-sized categories with bounding boxes, 80% are randomly assigned to the representation set, and the rest to the evaluation set. Within the evaluation set, 20% of images are reference images and the rest are query images, for an overall split of 80/4/16% representation, reference, and query. We propose this “meta-iNat” dataset as a realistic, heavy-tailed, fine-grained benchmark for meta-learning algorithms. Meta-iNat contains 1,135 animal species, the distribution for which can be found in Fig. 3.
While all images in meta-iNat have bounding box annotations, only 10% are allowed during evaluation (see Section 2). We run ten trials on the evaluation set with a different collection of annotated reference images in each trial.
We build upon prototypical networks  (Section 4.1) by introducing three light-weight and parameter-free improvements. Batch folding (Section 4.2) improves gradients during training and helps the learner generalize to large classes. Few-shot localization (Section 4.3) teaches the learner to localize an object before classifying it. Covariance pooling (Section 4.4
) greatly increases the expressive power of prototype vectors without affecting the underlying network architecture. In addition to being parameter-free, these techniques are mutually compatible and mutually beneficial.
4.1 Prototypical Networks
We briefly review prototypical networks . Prototypical networks are a learner architecture designed to learn novel classes using few training examples. The learner uses a feature extractor to embed labeled reference and unlabeled query images in feature space. Reference image embeddings are averaged within each class to generate a “prototype” vector for that class. Predictions are made on query embeddings based on L2 proximity to each class prototype.
Training a prototypical network amounts to setting the parameters of the feature extractor, since classification is non-parametric. The prototypical network is trained on the representation set by sampling small
datasets of reference and query images. These are passed through the network to get class probabilities for the query images. Cross entropy loss on query images is then minimized. Through this training, the network learns a feature extractor that produces good prototypes from limited reference images.
4.2 Batch Folding
Batch folding is motivated by the fact that during training, every image in a batch is either a reference or a query image, but never both. While reference images learn to form good class centroids, conditioned on the other contributors, query images gravitate toward the correct centroid and away from others. Gradients for both are necessary for learning, but every image gets only one, so prototypical weight updates are noisy.
This reference/query distinction also limits the number of reference images a network can handle. For a prototype network to work on common classes as well as rare ones, it must be trained with a larger number of reference images . Increasing the reference images per batch, however, requires either increasing the batch size, which runs into memory constraints, or decreasing the number of queries, producing noisier query gradients. Thus the original prototypical networks are designed for rare classes.
As an alternative, we propose to use leave-one-out cross-validation within each batch, abandoning the hard reference/query split. The entire batch is treated as reference images, and the contribution of each image is subtracted (“folded”) out from its corresponding prototype whenever it acts as a query. Each image thus gets a combined, cleaner gradient, acting as both a reference and a query. Furthermore, the number of query / reference images can be as high as the batch size / one less. The result is stable training with large reference sets without violating memory constraints. We call this approach batch folding.
Procedure: Let be the number of classes and the number of images per class in a batch. Denote by the feature vector of the -th image in the -th category. Let be the centroid of the -th class. To make predictions for the -th image in the -th category, the network uses the following class prototypes:
, and TensorFlow.
Note also that standard prototypical network prediction already involves calculating the L2 distance between every centroid and every query image embedding. This has the same asymptotic cost as calculating (1) for every image, so long as query set size . Generally this is true . The overhead of batch folding also tends to be dominated by earlier convolutional layers.
Image-level labels are less informative when the object of interest is small and the scene cluttered, since it is unclear what part of the image the label refers to. Given many, sufficiently different training images, the machine eventually figures out the region of interest . But with only a few images and image-level labels, distinguishing relevant features from distractors becomes highly difficult.
For these reasons, isolating the region of interest (on both reference and query images) should make classification significantly easier. We consider two possible approaches. In unsupervised localization, the learner internally develops a category-agnostic “foregroundness” model on the representation set. Few-shot localization uses reference image bounding boxes on the evaluation set for such localization.
In both approaches, the localizer is a sub-module that classifies each location in the final feature map as “foreground” or “background”. This prediction is calculated as a softmax over each pixel embedding’s negative L2 proximity to a foreground vector and to a background vector. In unsupervised localization, these vectors are learned parameters optimized on the representation set. In few-shot localization, the localizer gets a few reference images annotated with bounding boxes. We use these boxes as figure/ground masks, and average all the foreground pixel embeddings to produce the foreground vector. The background vector is computed similarly.
The output of the localizer is a soft foreground / background mask. Multiplying the feature map with its mask (and inverse mask) produces foreground and background maps, which are average-pooled then concatenated. This double-length feature vector is used to form prototypes and perform classification. Fig. 4 provides a visual explanation.
Training: Both localization approaches are trainable end-to-end, so we train them within the classification problem. We use no additional supervisory loss; localizers are trained only to be useful for classification. Despite this, the outputs are visually quite good. Examples are given in Fig. 5.
When a few-shot localizer is trained with batch folding, an additional round of folding during localization is required. Each image’s contribution is removed from the foreground and background vectors. Otherwise, each image ‘sees’ its own ground truth bounding box during localization, preventing generalization to unannotated images.
4.4 Covariance Pooling
can be used to expand the feature space and increase expressive power. Unfortunately, a traditional learning framework uses these expanded representations as input to linear classifiers or fully-connected softmax layers[9, 20, 26], dramatically increasing parameters and making the model prone to catastrophic overfitting on small classes.
However, these techniques can be adapted to prototypical networks without any parameter increase. We use bilinear pooling ,111 Similar techniques have been called second-order pooling  and covariance descriptors  in the literature. which improves fine-grained classification performance and generalizes many hand-designed feature descriptors such as VLAD , Fisher vectors , and Bag-of-Visual-Words . This approach takes two feature maps (from e.g. a two-stream convolutional network) and computes the cross-covariance between them, by performing a pixel-wise outer product before average-pooling. In our localization models, the predicted foreground and background maps act as the two streams. Otherwise, we use the outer product of the feature map with itself. Both versions perform signed square-root normalization, as in bilinear pooling, but do not project to the unit sphere, as this heavily constrains the prototype prediction space.
It is worth emphasizing that this expansion adds no parameters. Unlike prior models, all improvement in performance comes from increased feature expressiveness, not from increased network capacity. To emphasize this distinction, we call this version covariance pooling.
We first present overall results on the meta-iNat benchmark (Table 1). We analyze localizer behavior, and then generalization to larger networks, tasks with domain shift, and the original mini-ImageNet. We use 4-layer convolutional learners closely mimicking prototypical networks , plus average-pooling (see supplementary).
|Top-1 Accuracy||Top-5 Accuracy|
Results on the meta-iNat benchmark, with 95% confidence intervals from 4 trials. PN is a prototypical network, BF is batch folding, fsL and usL are few-shot and unsupervised localization, and CP is covariance pooling. *Results are averaged over 10 runs of 4 trials, annotations randomly sampled per-run.
Baseline results: Standard softmax classifiers trained from scratch on the evaluation set’s reference images perform poorly, especially on rare classes. Upweighting rare classes during training improves the per-class accuracy only slightly. Oversampling the rare classes causes catastrophic overfitting. A second baseline is transfer learning: we train the same network on the representation set, but replace and re-train the final linear layer on the evaluation set, using class weights. This approach works significantly better than training from scratch, attaining 17.6% per-class accuracy.
As our third baseline, prototypical networks trained on the meta-iNat representation set easily outperform the models trained from scratch, and are comparable to transfer learning without any need for label reweighting. This suggests that prototypical networks are inherently class-balanced, but provide no additional advantages over transfer learning in this heavy-tailed setting.
A prototypical network trained with batch folding outperforms all baselines by almost a 3-point margin. The per-class accuracy gain as a function of class size is plotted in Fig. 6. We see gains across the board, suggesting that batch folding does provide higher-quality gradients. At the same time, by incorporating more reference images during training, batch folding helps models generalize to larger classes: the positive slope of the best-fit line suggests that large classes benefit more from batch folding, though not at the expense of small ones.
Localization: Incorporating few-shot localization leads to another significant boost in performance, about 6 percentage points. Note that 10% of reference images are annotated, only 1 to 20 images per category. This relatively cheap annotation has an outsized impact on performance.
Interestingly, unsupervised localization provides a larger gain, about 8 percentage points. We posit that few-shot localization underperforms its counterpart because it uses bounding boxes, a very coarse form of segmentation. Bounding boxes may include a significant amount of background, hurting the separation of foreground from background. Indeed, we find that when provided bounding boxes are large (e.g. occupying the full image), the few-shot localizer is unable to localize correctly.
As hypothesized, localization particularly helps when objects are small, and bounding boxes cover less than half the image (Fig. 7). The decrease in gain for tiny objects is not entirely surprising - classification is inherently harder when the relevant object contains only a few pixels.
Covariance pooling: Accuracy improves yet again with covariance pooling, yielding a 4 point gain over unsupervised localization and 9 points over few-shot localization. Notably, covariance pooling causes class balance to break: large categories benefit disproportionately (Fig. 8). We hypothesize that the high dimensionality of covariance space is responsible. Small categories do not have enough reference images to span the space, so centroid quality suffers.
Unsupervised localization does not interact well with covariance pooling, perhaps because covariance space is too high-dimensional for reference images to span during training. Thus the learned foreground and background vectors may overfit to a particular manifold on the representation set. Few-shot localization, which calculates these vectors dynamically, does not have this problem. We conclude that both localization techniques are useful for different settings.
Using all three techniques, top-1 accuracy is doubled from the baseline prototypical network. The best performer uses batch folding, few-shot localization and covariance pooling. An ablation study is provided in supplementary.
5.2 Analyzing Few-Shot Localizer Behavior
|Localizer||% annotation||Mean acc.||Per-Class acc.|
We next evaluate the number of bounding box annotations needed for good classification accuracy. As shown in Table 2, performance saturates at 16% bounding box availability, but even at 1% (amounting to one box per class), performance decreases only slightly. This scarcity can go further: categories in meta-iNat are grouped into nine supercategories, so we also try using one box per supercategory, nine total. Accuracy does drop significantly, but is still better than models that do not localize. Thus localization can lead to real accuracy gains using hardly any annotations at all, to our knowledge a first-of-its-kind finding.
Joint training: Although the few-shot localizer never receives direct training supervision, it must still be learned jointly with the classifier. Table 2
also compares localizers that are not jointly trained. Applying few-shot localization to a network trained without it leads to a drop in performance (“Untrained”). Training the network to use localization, but preventing backpropagation through the localizer itself, also leads to a drop in performance (“No Gradient”). Localization thus provides a useful training signal, but must itself be trained with the classifier for maximum benefit.
We evaluate our models on three new settings. To test generalization over domain shift, we create a second split of meta-iNat based on supercategories. To test generalization to other network architectures, we evaluate our techniques on meta-iNat using more powerful, pretrained ResNet architectures. Finally, these techniques are tested on mini-ImageNet, using evaluation methods from prior literature. With some expected caveats for mini-ImageNet, our results generalize extremely well to all settings.
Supercategory meta-iNat: We wish to evaluate our results in settings where transfer learning is more difficult, and switching from the representation set to the evaluation set involves substantial domain shift. To that end we construct a new version of meta-iNat, which we call Supercategory meta-iNat. Rather than assign categories to the representation and evaluation sets randomly, we instead split by supercategory. Insects and arachnids (354 total) form the evaluation set, and everything else (birds, fish, mammals, reptiles, etc.) is the representation set. Training and evaluation are performed as before, with results in Table 3.
|Top-1 Accuracy||Top-5 Accuracy|
Transfer learning on Supercategory meta-iNat is much harder than in the original setting. Scores are uniformly lower across the board. However, overall trends remain exactly the same. Batch folding outperforms standard prototypical networks and transfer learning baselines by 2 points. Few-shot and unsupervised localization lead to similar, substantial accuracy gains (4 points). Covariance pooling also improves (5 points), but again causes mean accuracy to outstrip per-class accuracy. Unsupervised localization underperforms few-shot localization when using covariance pooling, so we remove it from future tests.
ResNet-50: While batch folding, few-shot localization, and covariance pooling lead to substantial improvement on meta-iNat, accuracy is still low. For more powerful models, these improvements might disappear. To test this, we replace the bottom two prototypical network layers with a frozen ResNet-50 pretrained on ImageNet. Details can be found in supplementary. Results are presented in Table 4.
|Top-1 Accuracy||Top-5 Accuracy|
|Transfer Learn (top)||19.27.17||18.72.20||44.02.30||41.2.36|
|Transfer Learn (full)||22.52.58||18.22.40||48.16.60||40.38.48|
Using the pretrained ResNet-50 model, it is possible to perform transfer learning directly from ImageNet to the meta-iNat evaluation set. Freezing the ResNet, and training just the top two layers on reference images, works poorly given the power of the model. Fine-tuning the entire network on reference images works slightly better, but decreases per-class accuracy. Freezing the ResNet and training the top layers as a prototypical network improves top-1 accuracy by 13 percentage points. Batch folding, few-shot localization, and covariance pooling provide another 16 points. We conclude that these techniques are helpful for large neural architectures as well as small ones.
|Model||5-shot Accuracy||1-shot Accuracy|
Batch folding, few-shot localization, and covariance pooling improve accuracy on large evaluation sets with long-tailed class distributions. To see if these techniques still help with the original, smaller few-shot learning problem, we construct a mock mini-ImageNet dataset with similar statistics but annotated with bounding boxes. Performance of prototypical networks on our dataset is similar to the published figures . Table 5 shows the results.
An immediate departure from prior results is the fact that batch folding hurts performance. Batch folding does indeed result in better training and lower training loss, but overfits because the representation set is smaller (Fig. 9).
Few-shot localization and covariance pooling make modest but real improvements when five reference images are provided (“five shot”). There is little discernible effect on single-reference (“one-shot”) performance, perhaps because with few reference images and a small set of classes, a more expressive feature space is unnecessary. Nevertheless, the small improvements do suggest that few-shot localization and covariance pooling generalize to few-shot learning.
In this paper, we have shown that past work on classical or few-shot balanced benchmarks fails to generalize to realistic heavy-tailed classification problems. We show that parameter-free localization from limited bounding box annotations, and improvements to training and representation, provide large gains beyond those previously observed in data abundant settings. Ours is but a first step in addressing broader questions of class balance and data scarcity.
Acknowledgements This work was partly funded by a grant from Aricent.
-  Broadcasting - numpy v1.15 manual. https://docs.scipy.org/doc/numpy-1.15.0/user/basics.broadcasting.html. Accessed: 2018-11-16.
-  Broadcasting semantics - pytorch master documentation. https://pytorch.org/docs/stable/notes/broadcasting.html. Accessed: 2018-11-16.
-  Broadcasting semantics — xla — tensorflow. https://www.tensorflow.org/xla/broadcasting. Accessed: 2018-11-16.
-  D. Acharya, Z. Huang, D. Pani Paudel, and L. Van Gool. Covariance pooling for facial expression recognition. In , June 2018.
-  S. Bell, P. Upchurch, N. Snavely, and K. Bala. Material recognition in the wild with the materials in context database. In IEEE Conference on Computer Vision and Pattern Recognition, 2015.
-  L. Bertinetto, J. a. F. Henriques, J. Valmadre, P. H. S. Torr, and A. Vedaldi. Learning feed-forward one-shot learners. In Neural Information Processing Systems, 2016.
-  J. Carreira, R. Caseiro, J. Batista, and C. Sminchisescu. Semantic segmentation with second-order pooling. In European Conference on Computer Vision, pages 430–443. Springer, 2012.
-  Y. Cheng, F. X. Yu, R. S. Feris, S. Kumar, A. Choudhary, and S.-F. Chang. An exploration of parameter redundancy in deep networks with circulant projections. In IEEE International Conference on Computer Vision, 2015.
-  A. R. Chowdhury, T. Lin, S. Maji, and E. Learned-Miller. One-to-many face recognition with bilinear cnns. In IEEE Winter Conference on Applications of Computer Vision (WACV), March 2016.
-  G. Csurka, C. R. Dance, L. Fan, J. Willamowski, and C. Bray. Visual categorization with bags of keypoints. In European Conference on Computer Vision, 2004.
-  J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. Imagenet: A large-scale hierarchical image database. In IEEE Conference on Computer Vision and Pattern Recognition, 2009.
-  H. Edwards and A. Storkey. Towards a neural statistician. In International Conference on Learning Representations, 2017.
-  M. Fink. Object classification from a single example utilizing class relevance metrics. In Neural Information Processing Systems, 2004.
-  C. Finn, P. Abbeel, and S. Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In International Conference on Machine Learning, 2017.
-  C. Finn, P. Abbeel, and S. Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In International Conference on Machine Learning, 2017.
-  Y. Gao, O. Beijbom, N. Zhang, and T. Darrell. Compact bilinear pooling. In IEEE Conference on Computer Vision and Pattern Recognition, June 2016.
-  M. Guillaumin, D. Küttel, and V. Ferrari. Imagenet auto-annotation with segmentation propagation. International Journal of Computer Vision, 110(3):328–348, Dec 2014.
-  B. Hariharan and R. Girshick. Low-shot learning by shrinking and hallucinating features. In IEEE International Conference on Computer Vision, 2017.
-  H. Jégou, M. Douze, C. Schmid, and P. Pérez. Aggregating local descriptors into a compact image representation. In IEEE Conference on Computer Vision and Pattern Recognition, June 2010.
-  J. Kim, K. W. On, W. Lim, J. Kim, J. Ha, and B. Zhang. Hadamard product for low-rank bilinear pooling. International Conference on Learning Representations, 2017.
G. Koch, R. Zemel, and R. Salakhutdinov.
Siamese neural networks for one-shot image recognition.2015.
-  A. Krizhevsky. Learning multiple layers of features from tiny images. Master’s thesis, Department of Computer Science, University of Toronto, 2009.
-  D. Kuettel, M. Guillaumin, and V. Ferrari. Segmentation propagation in imagenet. In A. Fitzgibbon, S. Lazebnik, P. Perona, Y. Sato, and C. Schmid, editors, European Conference on Computer Vision, 2012.
-  B. M. Lake, R. Salakhutdinov, and J. B. Tenenbaum. Human-level concept learning through probabilistic program induction. Science, 2015.
-  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. In European Conference on Computer Vision, 2014.
-  T.-Y. Lin, A. RoyChowdhury, and S. Maji. Bilinear cnn models for fine-grained visual recognition. 2017.
-  Z. Liu, P. Luo, S. Qiu, X. Wang, and X. Tang. Deepfashion: Powering robust clothes recognition and retrieval with rich annotations. In IEEE Conference on Computer Vision and Pattern Recognition, 2016.
-  N. Mishra, M. Rohaninejad, X. Chen, and P. Abbeel. A simple neural attentive meta-learner. In International Conference on Learning Representations, 2018.
-  T. Munkhdalai and H. Yu. Meta networks. In International Conference on Machine Learning, 2017.
-  M. Oquab, L. Bottou, I. Laptev, and J. Sivic. In IEEE Conference on Computer Vision and Pattern Recognition, June 2015.
-  N. Otberdout, A. Kacem, M. Daoudi, L. Ballihi, and S. Berretti. Deep covariance descriptors for facial expression recognition. In British Machine Vision Conference, 2018.
-  D. P. Papadopoulos, J. R. R. Uijlings, F. Keller, and V. Ferrari. Extreme clicking for efficient object annotation. 2017.
-  F. Perronnin, J. Sánchez, and T. Mensink. Improving the fisher kernel for large-scale image classification. In European Conference on Computer Vision, 2010.
-  S. Ravi and H. Larochelle. Optimization as a model for few-shot learning. In International Conference on Learning Representations, 2017.
-  A. Santoro, S. Bartunov, M. Botvinick, D. Wierstra, and T. Lillicrap. Meta-learning with memory-augmented neural networks. In International Conference on Machine Learning, 2016.
-  A. Shaban, S. Bansal, Z. Liu, I. Essa, and B. Boots. One-shot learning for semantic segmentation. In British Machine Vision Conference, 2017.
-  J. Snell, K. Swersky, and R. S. Zemel. Prototypical networks for few-shot learning. In Neural Information Processing Systems, 2017.
-  F. Sung, Y. Yang, L. Zhang, T. Xiang, P. H. Torr, and T. M. Hospedales. Learning to compare: Relation network for few-shot learning. In IEEE Conference on Computer Vision and Pattern Recognition, 2018.
-  G. Van Horn, O. Mac Aodha, Y. Song, Y. Cui, C. Sun, A. Shepard, H. Adam, P. Perona, and S. Belongie. The inaturalist species classification and detection dataset. In IEEE Conference on Computer Vision and Pattern Recognition, 2018.
-  O. Vinyals, C. Blundell, T. Lillicrap, k. kavukcuoglu, and D. Wierstra. Matching networks for one shot learning. In Neural Information Processing Systems, 2016.
-  F. Wang, M. Jiang, C. Qian, S. Yang, C. Li, H. Zhang, X. Wang, and X. Tang. Residual attention network for image classification. In IEEE Conference on Computer Vision and Pattern Recognition, July 2017.
-  Y. Wang, D. K. Ramanan, and M. Hebert. Learning to model the tail. In Neural Information Processing Systems, December 2017.
-  Y.-X. Wang and M. Hebert. Learning to learn: Model regression networks for easy small sample learning. In European Conference on Computer Vision, 2016.
J. Xiao, J. Hays, K. A. Ehinger, A. Oliva, and A. Torralba.
Sun database: Large-scale scene recognition from abbey to zoo.In IEEE Conference on Computer Vision and Pattern Recognition, 2010.
T. Xiao, Y. Xu, K. Yang, J. Zhang, Y. Peng, and Z. Zhang.
The application of two-level attention models in deep convolutional neural network for fine-grained image classification.In IEEE Conference on Computer Vision and Pattern Recognition, June 2015.
-  Y. xiong Wang, R. Girshick, M. Herbert, and B. Hariharan. Low-shot learning from imaginary data. In IEEE Conference on Computer Vision and Pattern Recognition, 2018.
-  Z. Yang, M. Moczulski, M. Denil, N. d. Freitas, A. Smola, L. Song, and Z. Wang. Deep fried convnets. In ICCV, 2015.
B. Zhou, A. Khosla, A. Lapedriza, A. Oliva, and A. Torralba.
Learning deep features for discriminative localization.In IEEE Conference on Computer Vision and Pattern Recognition, June 2016.
-  B. Zhou, A. Lapedriza, J. Xiao, A. Torralba, and A. Oliva. Learning deep features for scene recognition using places database. In Z. Ghahramani, M. Welling, C. Cortes, N. D. Lawrence, and K. Q. Weinberger, editors, Neural Information Processing Systems, pages 487–495. Curran Associates, Inc., 2014.
7 Ablation Study
Top-1 and top-5 mean and per-class accuracies are given below. Three-digit model names indicate the presence or absence of batch folding, localization, and covariance pooling, in that order. For example, ‘101’ indicates a model with batch folding and covariance pooling, but no localization. Because two versions of localization exist, we use ‘0’ to indicate no localization, ‘1’ for few-shot localization, and ‘2’ for unsupervised localization. A ‘*’ indicates a model presented in the main paper.
|Top-1 Accuracy||Top-5 Accuracy|
Between any two models with different numbers of features, the one with more always outperforms the one with less, regardless of combination. Thus batch folding, localization, and covariance pooling consistently and independently improve performance on meta-iNat.
8 Network Architectures
Our learner architectures mimic the original prototypical networks. Networks contain four 64-channel
convolutional layers, with Batchnorm, ReLU, andmax-pooling in between. This is followed by Batchnorm and global average-pooling, for a 64-dimensional feature vector. Unlike prototypical networks, which flatten the feature map to a 6400-dimensional vector, we use average pooling to eliminate spatial priors on uncentered, uncropped images. Softmax classifier models use a fully-connected layer on top of the feature vector; prototype classifiers use the feature vector directly. Localization and covariance pooling models replace average-pooling layers with the appropriate algorithm(s).
Models based on ResNet50 use the first two stages of a ResNet50 model, pretrained on ImageNet, to produce feature maps with 512 channels. Learned layers consist of max-pooling, followed by convolution with 128 channels, Batchnorm, ReLU, a second convolution with 64 channels, and Batchnorm. The resulting feature maps are localized, average pooled, or covariance pooled as appropriate. As in the original setting, softmax classifiers use an additional fully-connected layer, while prototype architectures use the pooled embeddings directly.
9 Training and Implementation Details
We train meta-iNat models via SGD with Adam, using an initial learning rate of
and dividing by two every epoch. Each epoch consists of 10 passes over the representation set, with five epochs in total. For mini-ImageNet, we lengthen each epoch to 28 passes, to account for the smaller representation set.
In both settings we unit-normalize input color channels. We use random horizontal flipping but no other data augmentation. Because bounding boxes are downsized to very small resolutions (e.g. ), we use average-pooling before downsampling, as a fast approximation for anti-aliasing.
9.2 Batch Sampling
While mini-ImageNet uses random batch sampling with replacement during training and testing, meta-iNat uses a different sampling procedure for each. During each training iteration, classes are sampled without replacement: so long as classes have sufficient remaining images to create a batch, they are sampled proportionately to the number of available images they contain. This ensures that differently-sized classes occur at constant, representative rates throughout the entire sampling process. Images are then selected from the sampled classes, and those images are subsequently unavailable for further training until the next pass over the dataset.
During testing, we wish to evaluate classification accuracy for relatively large numbers of classes and images. For sufficiently high values, it becomes impossible to process the sampled datasets as single batches in computer memory. Category sizes also vary so widely that it no longer makes sense to use constant sample sizes. Rather than attempt to evaluate a given network on a large number of large and complicated datasets, we instead impose a single reference/query split over the evaluation set.
Evaluation consists of one pass over the reference images followed by one pass over the query images. During the reference pass, each category is split into manageable batches, and the class centroid is computed from a running total of the embedding vectors. The query pass is divided the same way, and the pre-computed centroids are used to make class predictions. When localization is used, we run 10 trials where different 10% subsets of the reference images are randomly selected to receive bounding box annotations.
The above applies to prototype-styled classifiers, which require representation and query sets for a limited selection of classes in every batch. For straightforward softmax classifiers, we instead use random sampling without replacement, and a batch size of 128. Annealing schedule is as above.
Note: the full set of supplementary materials, including additional results, localizer visualizations and behavior, and the exact category assignments in meta-iNat by species, can be found here.