Laplacian Regularized Few-Shot Learning

Imtiaz Masud Ziko, Jose Dolz, Eric Granger, Ismail Ben Ayed

Introduction

Deep learning models are notoriously data-hungry. Few-shot learning (FSL) attempts to solve this limitation by training models to generalize to novel classes given only a handful of labeled examples (the "support set").

Recently, transductive inference has become a popular approach in FSL. Unlike standard inductive inference—which classifies one unseen query image at a time—transductive inference looks at the entire batch of unlabeled query images at once. By leveraging the underlying structure of the unlabeled data, it can make significantly better predictions.

However, existing transductive FSL methods are computationally brutal. They often require inverting massive matrices (as seen in Label Propagation) or completely re-training the neural network's weights at test time (transductive fine-tuning). Furthermore, the FSL field is currently dominated by highly complex "meta-learning" (episodic training) regimes. This paper asks a critical question: Can we achieve the accuracy boosts of transductive inference without the massive computational overhead or convoluted meta-learning setups?

To answer this, the authors introduce LaplacianShot, a fast, transductive inference method for few-shot learning that bypasses complex meta-learning entirely. By framing query set classification as a Laplacian-regularized graph clustering problem, LaplacianShot achieves state-of-the-art accuracy using simple base-trained features.

Methodology

The authors propose a remarkably simple yet mathematically elegant alternative to standard episodic meta-learning:

  1. Standard Base Training: Instead of complex episodic meta-learning, the model simply trains a standard CNN feature extractor (like ResNet) on the base classes using a standard cross-entropy loss.
  2. Laplacian-Regularized Objective: At test time, they formulate a quadratic binary-assignment function to classify the query images. This function consists of two parts:
  3. A unary term that assigns query samples to the nearest class prototype in the support set.
  4. A pairwise Laplacian term that acts as a regularizer, encouraging query samples that are close to each other in the feature space to be assigned the same label.
  5. Efficient Bound Optimization: Solving this exact assignment problem is NP-hard. The authors' key technical contribution is applying a concave relaxation with a negative-entropy barrier. This allows them to use a Majorize-Minimization (MM) bound optimizer.
Convergence of the objective function across different network architectures.

This specific optimizer yields independent, closed-form updates for every single query sample, meaning the math can be perfectly parallelized. As shown above, it guarantees rapid convergence—usually in under 15 iterations—without ever needing to update the neural network's weights.

Key Insights

  • Meta-learning might be an illusion of progress: The authors demonstrate that standard cross-entropy training, when paired with a smart regularizer at inference time, can vastly outperform complex episodic meta-learning strategies.
  • Transduction as Graph Clustering: Transductive FSL can be elegantly framed as a graph clustering problem on the query set, anchored by the labeled support set. The Laplacian term naturally groups similar unlabeled items together.
  • Speed is a Feature: By avoiding matrix inversions and network fine-tuning, transductive inference can be scaled to large tasks without a prohibitive time penalty.
  • Connections to Attention: The mathematical updates in the Laplacian optimizer closely resemble the attention mechanisms used in famous FSL models like Matching Networks, but they operate non-parametrically during inference rather than being learned during training.

Experimental Results

The authors evaluated LaplacianShot across a diverse set of benchmarks, including generic image classification (miniImageNet, tieredImageNet), fine-grained classification (CUB), cross-domain transfer learning, and highly imbalanced real-world datasets (iNat).

Performance comparison on miniImageNet and tieredImageNet.
  • Massive Accuracy Gains: LaplacianShot consistently beats state-of-the-art methods across all datasets and network architectures (ResNet, WideResNet, DenseNet, MobileNet). On the miniImageNet 1-shot task using a ResNet-18, LaplacianShot achieves 72.11% accuracy. This crushes classic meta-learning models like MAML (49.61%) and beats recent strong baselines like SimpleShot (63.10%).
  • Blazing Fast Inference: Inference takes just 0.012 seconds per 5-shot task. This is three orders of magnitude faster than transductive fine-tuning methods (which take ~20.7 seconds) and is nearly identical to the speed of basic inductive inference (0.009 seconds).
  • Robustness: The method handles the extreme class imbalance of the iNat dataset significantly better than existing baselines.

Limitations and Future Work

While LaplacianShot is highly effective, it does have a few limitations. First, the method requires tuning a hyperparameter ($\lambda$) to balance the unary and Laplacian terms, which relies on having a validation set. Second, like all transductive methods, it assumes access to a "batch" of query samples at test time; it cannot be used in strict real-time, sequential prediction environments where a single image must be classified instantly without seeing others.

For future work, the authors position LaplacianShot as a model-agnostic, highly potent baseline. They suggest the FSL community should consider pivoting away from overly complex meta-learning architectures and instead focus on classical, well-established regularizers (like the Laplacian) that offer outstanding performance with a fraction of the computational headache.

Summary updated

BibTeX
@inproceedings{ziko2020laplacian,
  author = {Imtiaz Masud Ziko and Jose Dolz and Eric Granger and Ismail Ben Ayed},
  title = {{Laplacian Regularized Few-Shot Learning}},
  booktitle = {International Conference on Machine Learning},
  year = {2020},
}
Figure