Size Matters.

Mats L. Richter, Johan Byttner, Ulf Krumnack, Ludwdig Schallner, Justin ShenkarXiv 2021

TL;DR

This paper challenges the assumption that fully convolutional neural networks (FCNNs) are inherently size-agnostic. The authors demonstrate that input image size significantly impacts classifier performance, revealing that each network architecture has an optimal input size. They propose that this phenomenon is driven by the size of discriminatory features within the image, influencing how inference is distributed across network layers.

What Problem Does This Paper Address?

While fully convolutional neural networks (FCNNs) are designed to handle arbitrary input sizes through downsampling and pooling, this paper addresses the observation that their performance is not uniform across different input resolutions. The common practice of using fixed input sizes (e.g., 224x224 or 299x299) in early CNN designs, and the trend towards larger resolutions in recent work, suggests that input size might be more critical than previously assumed. The authors aim to understand why input size matters and how it interacts with network architecture to affect performance.

Methods

The authors employ several key techniques to investigate the impact of input size:

  • Probe Classifiers: Logistic regression models are trained on the intermediate layer outputs of the main network. This allows them to assess the "solution quality" at each layer and how it evolves during the forward pass.
  • Saturation Metric: This metric quantifies how much of a layer's output space is "filled" by the data, providing a measure of information utilization.
  • Receptive Field Analysis: The receptive field size of each layer is calculated to understand the spatial extent of information that can influence a single output unit.
  • Spectral Analysis of Layer Activations: While not explicitly detailed as a separate method, the paper mentions using spectral analysis of layer activations.
  • Modified Architectures: To study specific aspects, they modify architectures by making them fully convolutional (e.g., replacing fully connected layers with global average pooling) and by disabling residual connections.

Datasets

The experiments were conducted on a variety of datasets:

  • ImageNet: Used for training and evaluating models with higher resolution images.
  • iNaturalist: Also used for higher resolution experiments.
  • Cifar10: A common dataset for image classification, used for experiments with smaller input sizes and for analyzing the effects of object size.
  • MNIST: A dataset for handwritten digit recognition, used to test the generalizability of findings on simpler tasks.
  • TinyImageNet: A more complex, smaller resolution dataset used to test observations on challenging problems.

Key Insights and Ideas

  • Input Size is Not Arbitrary: Contrary to the expectation for FCNNs, input image size significantly affects classification performance. There isn't a universal "bigger is better" rule; each architecture has a preferred input size.
  • Discriminatory Feature Size Matters: The size of the discriminatory features within an image is a critical factor. The input image size acts as a heuristic for the size of these features, influencing which layers are most active during inference.
  • "Border Layer" Phenomenon: A specific layer, termed the "border layer," is identified. This layer is the first where the receptive field size exceeds the input image size. Layers before this are considered "solving" stages, while layers after are "compressing" stages.
  • Inference Distribution Shifts: Smaller input sizes shift the inference process towards earlier layers, while drastically larger sizes shift it towards later layers, both leading to suboptimal performance. The optimal input size allows for a more even distribution of inference across layers.
  • Residual Connections Mitigate, Don't Eliminate: Residual connections help involve more layers in the inference process and can counteract mismatches between input size and receptive field size, but they don't fully resolve the performance degradation caused by such mismatches.

Key Results

  • Performance Variation: Training the same model on different input sizes (e.g., 32x32 vs. 224x224) can lead to significant performance differences. For instance, on Cifar10, performance dropped from 92.79% to 84.64% when reducing input size from 224x224 to 32x32.
  • Upscaling Recovers Performance: Resizing smaller images back to a larger resolution (without adding new details) partially recovers lost performance, indicating an independent effect of image size beyond just added detail.
  • Optimal Resolution: For ResNet18 on Cifar10, the 224x224 resolution yielded the best performance, with inference distributed most evenly. Drastically smaller (32x32) or larger (1024x1024) resolutions shifted inference and reduced accuracy.
  • Receptive Field and Border Layer: The "border layer" (where receptive field > input size) consistently separates "productive" (solving) and "unproductive" (compressing) stages of the network.
  • Residual Connections Impact: Disabling early residual connections in ResNet18 significantly harmed performance, while disabling later ones had less impact.
  • Cifar10 Optimized ResNets: ResNet variants optimized for Cifar10 (with smaller receptive fields) showed improved performance and more evenly distributed inference compared to ImageNet-optimized versions.

Limitations and Future Work

  • Generalizability to Object Detection: The authors note that their findings, particularly regarding the size of discriminatory features, might not directly generalize to object detection tasks where objects are more localized and varied.
  • Artifacts in Probe Analysis: The paper mentions that anomalies in probe performance can occur due to residual connections.
  • Future Work: The authors suggest that understanding the interaction between dataset properties (like object size) and network architecture is crucial for principled CNN design. Further research could explore how to optimally match receptive field size to input resolution for various tasks and architectures. They also highlight probe classifiers and saturation as valuable tools for this analysis.

Summary updated

BibTeX
@misc{richter2021size,
  author = {Mats L. Richter and Johan Byttner and Ulf Krumnack and Ludwdig Schallner and Justin Shenk},
  title = {{Size Matters.}},
  year = {2021},
  eprint = {2102.01582},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2102.01582},
}
Figure