Source-linked AI summary
Inverting Visual Representations with Convolutional Networks
Alexey Dosovitskiy, Thomas Brox
TL;DR
Feature representations are difficult to interpret because they may discard image information relevant to understanding what they encode. The paper trains up-convolutional networks to invert shallow and deep representations, finding that reconstructions reveal substantial preserved content, including color and rough object location in higher AlexNet layers and FC8 probabilities.
Problem
Feature representations are difficult to analyze because they are expected to retain task-relevant properties while discarding other image information.
Method
The paper trains up-convolutional networks to predict expected image pre-images from HOG, SIFT, LBP, and AlexNet feature representations.
Results
Higher AlexNet layers, including FC8, preserve precise colors and rough object positions; shallow-feature reconstructions are also effective, with HOG best, SIFT slightly worse, and LBP slightly worse.
Takeaways & Limitations
Inversion provides a way to inspect preserved information and feature-space structure across representations, without requiring representation gradients.
Takeaways & Limitations
Random feature sampling relies on the strong, explicitly wrong independence assumption and produced low-contrast images.
Abstract
from arXiv · showhide
Feature representations, both hand-designed and learned ones, are often hard to analyze and interpret, even when they are extracted from visual data. We propose a new approach to study image representations by inverting them with an up-convolutional neural network. We apply the method to shallow representations (HOG, SIFT, LBP), as well as to deep networks. For shallow representations our approach provides significantly better reconstructions than existing methods, revealing that there is surprisingly rich information contained in these features. Inverting a deep network trained on ImageNet provides several insights into the properties of the feature representation learned by the network. Most strikingly, the colors and the rough contours of an image can be reconstructed from activations in higher network layers and even from the predicted class probabilities.
1. Introduction
The paper introduces inversion networks to reveal which image information feature representations preserve or discard. Applied to shallow descriptors and AlexNet, the approach exposes preserved visual content and supports analysis of feature-space structure.
- Motivation: Feature representations aim to retain task-relevant image properties while discarding irrelevant information, such as brightness or precise spatial detail.HOG and SIFT explicitly remove or reduce several image properties through gradients, spatial binning, and normalization.
- Approach: The proposed method trains a network to predict the expected natural-image pre-image of a feature vector.The predicted image shows properties that can be confidently inferred from the representation, while blur reflects its invariance.
- Feature-space analysis: Perturbations, interpolations, and random feature vectors are used to probe the structure of the learned feature space.These analyses extend reconstruction beyond ordinary feature vectors.
- Scope: The method is applied to HOG, SIFT, LBP, and ImageNet-trained AlexNet representations, including challenging sparse, nondifferentiable, and deep features.LBP cannot be inverted by gradient-based methods, while sparse SIFT requires combining keypoints into a smooth image.
- Relation to prior work: Inversion networks complement prior approaches based on backpropagation, sampling, or representation-specific inversion methods.Unlike several earlier methods, the proposed approach is intended for arbitrary feature representations and does not depend on representation gradients.
2. Method
The method estimates expected image pre-images from feature vectors using trained up-convolutional networks. Separate architectures handle shallow descriptors and AlexNet layers, with reconstruction quality evaluated on ImageNet images.
- Objective: The paper models natural images and feature vectors jointly, then uses a point estimate f(φ) minimizing mean squared reconstruction error.The loss minimizer is the conditional expectation, or expected pre-image.
- Objective: An up-convolutional network is trained on image-feature pairs to approximate the expected pre-image from each feature vector.Training the network to predict images from features directly estimates this conditional expectation.
- Feature representations: The shallow-feature experiments invert HOG, SIFT, and LBP, covering standard, sparse keypoint-based, and nondifferentiable representations.SIFT keypoints must be arranged on a grid, while LBP cannot be handled by gradient-based inversion.
- Network architectures: The AlexNet inversion networks use separate convolutional- and fully connected-layer architectures built from convolutional and up-convolutional components.The fully connected architecture includes three fully connected layers and five up-convolutional layers.
- Network architectures: Up-convolutional layers combine upsampling with convolution to expand feature maps toward image reconstructions.The described upsampling replaces each value with a 2 × 2 block containing the original value in the top-left position.
- Evaluation: Performance is measured by average normalized reconstruction error on a subset of the ImageNet validation set.The normalization coefficient is the average Euclidean distance between test-set images.
3. Experiments: shallow representations
The inversion networks reconstruct substantial visual information from shallow features, including colors and brightness that the representations nominally discard. Sparse SIFT descriptors also yield natural-looking images, while the method outperforms existing reconstruction approaches on HOG.
- HOG: Our method significantly outperforms existing approaches on normalized reconstruction error for HOG.The comparison is reported in Table 2.
- Colorization: Colors of sky, sea, grass, and trees are often predicted correctly from grayscale-derived features that contain no color information.The network uses image content and a learned natural-image prior, though some colors, such as those of people, are not predicted correctly.
- SIFT: Reconstructions from roughly 3000 sparse SIFT keypoints look natural but slightly blurry.The network must rotate and scale descriptors and stitch them into a smooth image; qualitative comparison with prior work is possible because keypoint counts are roughly similar, despite different detectors.
4. Experiments: AlexNet
Inverting AlexNet features reveals that higher layers preserve color and coarse object location, while perturbation and reconstruction experiments expose how information is distributed across features.
- Reconstructions from different layers: Reconstructions remain similar to inputs through AlexNet’s higher layers, although fine details diminish and FC7/FC8 outputs become blurry.Color and approximate object location remain well preserved even in fully connected layers.
- Reconstructions from different layers: FC6 reconstruction error is roughly twice as large as CONV5, while FC8 error remains fairly low because color and coarse object placement are recovered.The fixed-weight method also outperforms the compared method quantitatively in lower layers despite producing less sharp images.
- Autoencoder training: Autoencoder training produces substantially better reconstructions, indicating that AlexNet’s classification objective discards image information relative to reconstruction-oriented training.The gap is especially large in higher layers; even CONV5 can be reconstructed almost perfectly with an autoencoder.
- Case study: Colored apple: FC8 reconstructions retain precise color even when only class probabilities are available, and the five largest activations are not very important.Small probabilities assigned to non-top classes carry more reconstruction information than the top predictions themselves.
- Robustness of the feature representation: In higher layers, binarization barely changes reconstruction quality, whereas random dropout causes larger degradation, especially in FC6 and FC7.These results indicate that activation patterns encode image information, while precise feature magnitudes estimate feature importance.
- Interpolation and random feature vectors: Interpolating CONV5 features produces simple image overlays, whereas FC6 interpolation behaves differently; random top-layer vectors can generate somewhat realistic images.The reconstruction networks implicitly learn a natural-image prior, although independent feature sampling is a strong assumption and initially yields low-contrast images.
5. Conclusions
The paper introduces up-convolutional inversion networks to analyze information preserved by visual representations. Across shallow features and AlexNet, reconstructions show that representations retain more image information—including color and coarse structure—than expected.
- Conclusions: Up-convolutional networks invert visual representations and reveal which image properties are preserved or discarded through reconstruction quality and blur.The method applies to HOG, SIFT, LBP, and AlexNet representations.
- Conclusions: AlexNet features at every layer, including FC8, preserve precise colors and rough object locations.The conclusion extends this finding to the final class-probability representation.
- Conclusions: Higher-layer image information is concentrated mainly in the pattern of non-zero activations rather than their precise values.This conclusion is supported by perturbation experiments involving binarization and dropout.
- Conclusions: In FC8, small probabilities for classes outside the top five contain most of the information used for reconstruction.The largest class activations are comparatively less important for recovering the image.
Supplementary material
The supplementary material documents network architectures and additional reconstructions, perturbation studies, interpolations, and random-feature samples for shallow representations and AlexNet.
- Shallow representations: Shallow-feature experiments compare HOG, SIFT, and LBP inversions, with HOG yielding the best reconstruction, followed by SIFT and then LBP.Colors are often reconstructed correctly, though some examples contain errors and the networks generally agree on estimated colors.
- AlexNet reconstructions: Additional AlexNet figures show reconstructions across layers, class-focused FC8 analyses, and qualitative comparisons with prior reconstructions and autoencoders.Single-neuron FC8 reconstructions correspond to individual classes and can resemble class averages.
- Interpolation: Supplementary interpolation figures compare fixed AlexNet weights with autoencoder training and provide further fixed-weight interpolation examples.These figures extend the analysis of feature-space transitions between two images.
- Random feature vectors: Random-feature figures compare truncated-Gaussian and histogram-based sampling for fixed AlexNet networks and AlexNet-based autoencoders.Images generated by autoencoders look less realistic than those generated with fixed AlexNet weights.