Unsupervised Learning on Neural Network Outputs: With Application in Zero-Shot Learning

Yao Lu

Abstract

The outputs of a trained neural network contain much richer information than just a one-hot classifier. For example, a neural network might give an image of a dog the probability of one in a million of being a cat, but this is still significantly larger than the probability of it being a car. To reveal the hidden structure in these outputs, we apply two unsupervised learning algorithms, PCA and ICA, to the outputs of a deep Convolutional Neural Network (CNN) trained on ImageNet. The resulting embeddings reveal visual similarities between object classes, which can be interpreted as common visual features. We propose a new zero-shot learning (ZSL) method using these features, achieving state-of-the-art results on the ImageNet dataset of over 20,000 classes.

Introduction

When a CNN is trained to classify images, the primary focus is typically the "top-1" prediction. However, the full probability distribution—the softmax output—contains "dark knowledge" about the relationships between classes. A model might correctly identify a "dog," but its secondary predictions (e.g., "cat" vs. "car") indicate its internal understanding of visual similarity.

The challenge lies in the fact that raw outputs are often "squashed" by the softmax function, making these subtle relationships difficult to extract. Furthermore, while semantic hierarchies like WordNet exist, we lack a structured way to extract latent visual attributes (like "has fur" or "is metallic") directly from a model without manual labeling. This paper aims to extract these features and use them for Zero-Shot Learning (ZSL), classifying objects the model has never seen during training.

Methodology

Normalized Logits

To prevent the softmax function from suppressing useful information, we introduce a normalization technique. This technique magnifies the tiny values in the logits (the inputs to the softmax) while maintaining a valid probability distribution. This "un-squashing" effect allows the model to reveal the structured relationships between the primary class and other visually similar classes.

Comparison of standard Softmax outputs versus the proposed Normalized Logits, showing how the latter reveals a denser distribution of class relationships.

Factor Analysis: PCA and ICA

We apply Principal Component Analysis (PCA) and Independent Component Analysis (ICA) to these normalized outputs. While PCA assumes Gaussian data, ICA is designed for non-Gaussian, independent signals. A key technical finding of this work is that the neurons in the output layer of a CNN exhibit extremely high kurtosis, meaning they are highly non-Gaussian.

Kurtosis of output neurons for both Softmax and Normalized Logits. The high values (80-100) justify the use of ICA to disentangle independent visual factors.

This high kurtosis justifies the use of ICA, which effectively finds distinct visual "attributes" shared across classes. For ZSL, we use Canonical Correlation Analysis (CCA) to bridge these visual features with semantic features from WordNet, mapping unseen images into a space where they can be compared against thousands of unknown labels.

Key Insights and Results

  • Visual vs. Semantic Gaps: Visual similarity and semantic meaning do not always align. For instance, a "soccer ball" and a "football helmet" are visually similar but semantically distant. Unsupervised features from the CNN capture these visual nuances that text-based models might miss.
  • Unsupervised Attribute Discovery: Traditionally, ZSL required manual attribute labeling (e.g., "has stripes"). Our method shows that PCA and ICA can discover these attributes automatically from the model's own output distribution.
  • Zero-Shot Accuracy: On the ImageNet 20k task, our method achieved a Top-1 accuracy of 1.8% and a Top-20 accuracy of 9.7%. While seemingly small, these results significantly outperformed existing state-of-the-art methods like DeViSE (0.8% Top-1) and conSE (1.4% Top-1) at the time.
  • Qualitative Success: ICA components successfully grouped visually similar categories. One component effectively acted as a "domed architecture" detector, ranking "mosque," "dome," and "palace" highly without explicit supervision.

Conclusion

This work demonstrates that the "wrong" answers of a neural network are not just noise but a structured source of visual information. By applying unsupervised learning to these outputs, we can extract latent visual features that bridge the gap between seen and unseen objects. While ICA provides slightly more consistent features, PCA remains a computationally efficient alternative for large-scale zero-shot learning tasks.

Summary updated

Abstract

The outputs of a trained neural network contain much richer information than just a one-hot classifier. For example, a neural network might give an image of a dog the probability of one in a million of being a cat but it is still much larger than the probability of being a car. To reveal the hidden structure in them, we apply two unsupervised learning algorithms, PCA and ICA, to the outputs of a deep Convolutional Neural Network trained on the ImageNet of 1000 classes. The PCA/ICA embedding of the object classes reveals their visual similarity and the PCA/ICA components can be interpreted as common visual features shared by similar object classes. For an application, we proposed a new zero-shot learning method, in which the visual features learned by PCA/ICA are employed. Our zero-shot learning method achieves the state-of-the-art results on the ImageNet of over 20000 classes.
BibTeX
@inproceedings{lu2016unsupervised,
  author = {Yao Lu},
  title = {{Unsupervised Learning on Neural Network Outputs: With Application in Zero-Shot Learning}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2016},
  url = {https://openreview.net/forum?id=BJb1Brfu-H},
}
Figure