Do We Need Fully Connected Output Layers in Convolutional Networks?

Zhongchao Qian, Tyler L. Hayes, Kushal Kafle, Christopher KananarXiv 2020

Introduction

Standard Convolutional Neural Networks (CNNs) typically follow a two-part design: a convolutional feature extractor followed by a classifier composed of one or more fully connected (FC) layers. While this paradigm has driven state-of-the-art performance, it introduces a significant "classifier tax." As the number of categories increases, the final FC layer expands linearly, often becoming the primary memory bottleneck in efficient architectures.

The Parameter Bottleneck

In large models like ResNet-50, the final classifier represents a negligible fraction of the total parameter count. However, for models optimized for edge devices, the story is different.

Distribution of parameters between the feature extractor and classifier across different CNN architectures.

As shown in the figure above, the classifier accounts for 37% of parameters in MobileNet-v2 and a staggering 75% in ShuffleNet-v2 x0.5. This research investigates whether this learned layer is truly necessary or if the feature extractor can perform classification directly.

Methods: Fixed and Identity Classifiers

The authors propose replacing the learned FC layer with fixed, non-trainable matrices. They evaluate three variants:

  1. Fixed Orthogonal Classifier: Uses a random orthogonal matrix to project features.
  2. Fixed Hadamard Classifier: Utilizes a structured Hadamard matrix with mutually orthogonal rows.
  3. Fixed Identity Classifier: The most radical approach, where the FC layer is removed entirely. The output of the Global Average Pooling (GAP) layer serves directly as the classification logits.

In the Identity approach, the network is forced to learn feature maps where each channel corresponds directly to a specific class score. This effectively merges the roles of feature extraction and classification into the final convolutional layers.

Interpretability by Design

A significant advantage of the "no-FC" approach is inherent interpretability. Because each channel in the final layer represents a class, the network becomes transparent.

Comparison between a standard FC classifier and the proposed modified classifier, highlighting the inherent interpretability of the latter.

As illustrated, the modified classifier allows for the direct generation of class activation maps during the forward pass. One can visualize exactly which image regions contribute to a specific class prediction (e.g., an ostrich) without the need for complex post-hoc analysis like Grad-CAM.

Experimental Results

The proposed method was validated across ImageNet-1K, CIFAR-100, and specialized datasets like Stanford Cars-196.

Parameter Efficiency

The most dramatic results were seen in efficient models. By removing the FC layer on ImageNet-1K:

  • MobileNet-v2 parameters were reduced by 37%.
  • ShuffleNet-v2 x0.5 parameters were slashed by 75%, reducing the model from 1.3M to just 0.3M parameters.

Accuracy Maintenance

Despite the massive reduction in parameters, accuracy remained remarkably stable. On CIFAR-100 using DenseNet-BC, the Fixed Identity approach achieved 76.90% accuracy, representing a negligible 0.71% drop from the standard learned baseline. In transfer learning tasks, such as fine-tuning on Flowers-102, ResNet-50 with a fixed identity classifier achieved 94.64% accuracy, nearly matching the 95.06% of the standard model while being more memory-efficient.

Limitations and Conclusion

The primary constraint of the Identity method is the "Channel-Class" dependency: the number of output channels in the final convolutional layer must match the number of target classes. While this is manageable for datasets like ImageNet-1K (using architectures with 1024+ channels), it may pose challenges for datasets with tens of thousands of classes.

In conclusion, this work demonstrates that the final FC layer in CNNs is often redundant. By adopting a "no-layer" approach, researchers can design significantly leaner models that are easier to deploy on resource-constrained hardware while gaining "free" interpretability.

Summary updated

BibTeX
@misc{qian2020do,
  author = {Zhongchao Qian and Tyler L. Hayes and Kushal Kafle and Christopher Kanan},
  title = {{Do We Need Fully Connected Output Layers in Convolutional Networks?}},
  year = {2020},
  eprint = {2004.13587},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2004.13587},
}
Figure