Skip to main content
QUICK REVIEW

[Paper Review] Visual Recognition with Deep Nearest Centroids

Wenguan Wang, Han Cheng|arXiv (Cornell University)|Sep 15, 2022
Remote-Sensing Image ClassificationEngineering45 citations
TL;DR

This paper introduces Deep Nearest Centroids (DNC), a nonparametric, case-based classifier that uses class sub-centroids for visual recognition and segmentation, improving transparency and transferability over traditional parametric softmax classifiers.

ABSTRACT

We devise deep nearest centroids (DNC), a conceptually elegant yet surprisingly effective network for large-scale visual recognition, by revisiting Nearest Centroids, one of the most classic and simple classifiers. Current deep models learn the classifier in a fully parametric manner, ignoring the latent data structure and lacking simplicity and explainability. DNC instead conducts nonparametric, case-based reasoning; it utilizes sub-centroids of training samples to describe class distributions and clearly explains the classification as the proximity of test data and the class sub-centroids in the feature space. Due to the distance-based nature, the network output dimensionality is flexible, and all the learnable parameters are only for data embedding. That means all the knowledge learnt for ImageNet classification can be completely transferred for pixel recognition learning, under the "pre-training and fine-tuning" paradigm. Apart from its nested simplicity and intuitive decision-making mechanism, DNC can even possess ad-hoc explainability when the sub-centroids are selected as actual training images that humans can view and inspect. Compared with parametric counterparts, DNC performs better on image classification (CIFAR-10, ImageNet) and greatly boots pixel recognition (ADE20K, Cityscapes), with improved transparency and fewer learnable parameters, using various network architectures (ResNet, Swin) and segmentation models (FCN, DeepLabV3, Swin). We feel this work brings fundamental insights into related fields.

Motivation & Objective

  • Motivate a simple, interpretable alternative to parametric softmax classifiers in deep visual recognition.
  • Capture latent data structure within each class via sub-centroid representation.
  • Enable direct supervision of representation learning through distance-based, nonparametric classification.
  • Improve transferability by decoupling representation learning from fixed class-specific parameters.
  • Demonstrate explainability by linking predictions to human-viewable sub-centroids (training exemplars).

Proposed method

  • Define a DNC classifier that assigns a sample to the nearest sub-centroid across all classes using a distance-based rule.
  • Represent each class by K sub-centroids learned via deterministic clustering within the class in the feature space.
  • Relax the clustering problem to a transportation polytope and solve with a fast Sinkhorn-based algorithm.
  • Train by alternating between class-wise clustering to discover sub-centroids and supervised learning using the nearest sub-centroids for prediction.
  • Formulate training loss that uses the nearest sub-centroids to compute class probabilities, enabling nonparametric classification.
  • Demonstrate compatibility with various backbones (e.g., ResNet, Swin) and segmentation models (FCN, DeepLabV3, Swin-UNet).

Experimental results

Research questions

  • RQ1Can a nonparametric, centroid-based classifier match or exceed parametric softmax performance in large-scale visual recognition?
  • RQ2Do class sub-centroids better capture intra-class variation and provide improved transferability across tasks?
  • RQ3Does learning representation through distance to sub-centroids improve segmentation performance and interpretability?
  • RQ4Can efficient Sinkhorn-based clustering enable scalable sub-centroid estimation during training?
  • RQ5Does constraining sub-centroids to training exemplars provide ad-hoc explainability without sacrificing accuracy?

Key findings

  • DNC outperforms parametric counterparts on image classification with scratch training, achieving 0.23-0.24% top-1 gains on CIFAR-10 and 0.24-0.32% on ImageNet in §4.1.
  • DNC with ImageNet-pretrained backbones substantially improves pixel-wise segmentation on ADE20K and Cityscapes (1.6-2.5% mIoU and 1.1-1.9% mIoU, respectively) in §4.2.
  • Constraining sub-centroids to actual training images yields ad-hoc explainability with only 0.12% top-1 accuracy sacrifice (0.17% better than parametric), in §4.3.
  • DNC enables complete transfer of learned knowledge from source tasks (e.g., ImageNet) to target tasks (e.g., Cityscapes) due to representation-focused learning.
  • The method combines unsupervised within-class clustering with supervised representation learning in a synergistic, distance-based framework.
  • DNC training incurs only a modest slowdown (~5%) on ImageNet due to efficient clustering and online centroid estimation.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.