Learning from Few Samples: Transformation-Invariant SVMs with Composition and Locality at Multiple Scales

Tao Liu, Panganamala Kumar, Ruida Zhou, Xi Liu

This NeurIPS 2022 paper bridges the gap between classical Support Vector Machines (SVMs) and modern Convolutional Neural Networks (CNNs) to solve the "small data" problem. By mathematically embedding CNN-like properties—translation invariance, locality, and hierarchical composition—directly into SVM kernels, the authors create a model that significantly outperforms deep learning benchmarks when training data is extremely scarce.

The Problem: Data-Hungry Deep Learning

Deep learning has revolutionized image recognition, but it is notoriously data-hungry. CNNs succeed largely because they are hard-coded with structural "priors" about the visual world: an image of a dog is still a dog if it's shifted ten pixels to the left (translation invariance), and edges are formed by neighboring pixels (locality).

SVMs, while theoretically robust for high-dimensional data, traditionally lack these spatial priors. Previous attempts to make SVMs invariant usually relied on data augmentation—adding shifted or rotated copies of images to the training set. However, the authors argue that data augmentation is mathematically equivalent to an "average-fit" kernel, which blurs features and leads to poor classification margins.

The alternative is a "best-fit" kernel that looks for the maximum similarity over all possible transformations. Historically, this approach was avoided because it wasn't guaranteed to be positive definite, a strict mathematical requirement for SVMs to function correctly.

Methods: Embedding CNN Priors into SVMs

The authors introduce a framework to endow SVMs with three core CNN properties:

  1. Transformation-Invariant "Best-Fit" Kernels: Instead of averaging similarities across augmented data, the kernel calculates the maximum inner product between a sample and all possible transformed versions (e.g., shifts or rotations) of another sample.
  2. Mathematical Proof of Stability: To solve the positive definiteness problem, the authors use Gershgorin’s circle theorem to prove that these "best-fit" kernels are positive definite with high probability—provided the number of training samples is relatively small. This justifies using these kernels in the exact scenario where they are most needed.
  3. Hierarchical Locality (Composition): They develop a multi-layer polynomial kernel structure. Much like a CNN’s layers, the first "layer" looks at local pixel neighborhoods (locality), and subsequent layers compose these local features into more complex, global patterns.

Key Insights and Ideas

  • Max Beats Average: Data augmentation (average-fit) effectively "blurs" the training data. By using a "best-fit" (maximum) approach, the SVM maintains sharp decision boundaries and achieves much larger margins, which is critical for generalization.
  • The "Small Sample" Advantage: The very thing that makes these kernels theoretically risky (potential indefiniteness) isn't an issue when the sample size ($n$) is small. The authors turned a perceived mathematical weakness into a specialized tool for data-scarce environments.
  • SVMs as Shallow CNNs: By carefully structuring the kernel to account for spatial locality and hierarchy, the authors show that you can achieve the architectural benefits of "depth" without the optimization headaches of backpropagation.
Decision boundaries comparing data augmentation (average-fit) vs. best-fit kernels, alongside examples of Translated and Rotated MNIST datasets.

Datasets and Key Results

The researchers evaluated their methods on several benchmarks, focusing on small training sets (100, 200, and 500 samples). Datasets included Original MNIST, EMNIST Letters, and custom "Translated" and "Rotated" MNIST variants designed to test spatial invariance.

The proposed L-TI-RI-SVM (Locality-Translation Invariant-Rotation Invariant SVM) consistently outperformed optimized CNNs and ResNets in the small-sample regime:

  • MNIST (100 samples): The proposed SVM achieved 81.55% accuracy, compared to 68.33% for the best CNN benchmark.
  • EMNIST (100 samples): The SVM reached 44.56% accuracy vs. the CNN’s 33.82%.
  • Robustness to "Uncentered" Data: On the Translated MNIST dataset, where objects aren't perfectly centered, the L-TI-SVM maintained high accuracy while standard SVMs and CNNs (without heavy augmentation) failed significantly.
Accuracy comparison showing the proposed L-TI-RI-SVM outperforming CNN benchmarks on small sample sizes (100, 200, 500).

Limitations and Future Work

While highly effective for few-shot learning, the approach has limitations:

  • Computational Cost: Calculating the maximum over a group of transformations is computationally expensive. While manageable for small datasets, it may not scale well to large-scale problems without further optimization.
  • The Indefiniteness Boundary: The proof for positive definiteness only holds for small $n$. As the number of samples grows, the kernel may eventually become indefinite, limiting the method's use as a general-purpose replacement for CNNs in large-data scenarios.
  • Group Complexity: The current work focuses on translation and rotation. Extending this to more complex transformations (like 3D perspective changes) would require more sophisticated group theory and higher computational overhead.

Summary updated

BibTeX
@inproceedings{liu2022learning,
  author = {Tao Liu and Panganamala Kumar and Ruida Zhou and Xi Liu},
  title = {{Learning from Few Samples: Transformation-Invariant SVMs with Composition and Locality at Multiple Scales}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=SWbdhfz3lBy},
}
Figure