Abstract
Deep Neural Networks (DNNs) have achieved remarkable success in computer vision, yet their internal decision-making processes remain largely opaque. Feature visualization via gradient ascent is a common technique to interpret these models, but it often yields high-frequency noise that lacks human-understandable structure. This paper presents a Transformation Invariant Optimization method that regularizes the visualization process by enforcing geometric robustness. By requiring generated features to remain recognizable under transformations such as rotation and scaling, the method effectively filters out noise and reveals structural patterns. Our results demonstrate that this approach not only produces clearer visualizations but also exposes significant contextual biases in state-of-the-art architectures.
Introduction
The "black box" nature of Deep Neural Networks (DNNs) presents a significant hurdle for their deployment in safety-critical applications. Feature visualization—generating an image that maximizes the activation of a specific neuron or class—offers a window into the model's internal representations. However, standard gradient ascent often produces "adversarial" noise: patterns that strongly activate the network but are nonsensical to humans. While existing regularization techniques (e.g., Gaussian blur, total variation) can mitigate this, they often require careful tuning and may suppress important details. This study explores a more intuitive regularization strategy based on the principle of transformation invariance.
Methodology
Transformation Invariant Optimization
The core proposal is an iterative optimization loop that incorporates geometric transformations. Instead of optimizing a static image, the process alternates between gradient-based updates and random geometric operations:
- Optimization Phase: Perform gradient ascent on the current image to increase the target class's activation.
- Transformation Phase: Apply a geometric transformation, such as a 10-degree rotation or a scaling factor.
- Iteration: Use the transformed image as the seed for the next optimization step.
This cycle ensures that the resulting features are structurally robust. Features that rely on specific pixel coordinates or high-frequency noise are discarded, while those representing the underlying geometry of the object (e.g., the hexagons of a soccer ball) persist.
Optimal Initialization
The starting point of the optimization significantly impacts the quality of the final visualization. While a mean-gray image is standard, we investigated the effect of different initial grayscale values. Using a "second-order entropy" metric, we determined that an initial grayscale around RGB (60, 60, 60) provides the most effective balance for capturing structural information across various classes.
Results and Discussion
Qualitative Improvements
The Transformation Invariant Optimization method yields visualizations that are significantly more interpretable than those produced by classic gradient ascent. As shown in the comparison below, the "classic" approach results in colorful, high-frequency noise. In contrast, our method reveals distinct structural elements: the hexagonal patches of a soccer ball, the facial features of a Persian cat, and the rectangular form of a laptop.
Architectural Visual Signatures
Our visualizations reveal that different CNN architectures possess unique "visual styles." ResNet50 visualizations often resemble freehand drawings with clear outlines. VGG19 produces images akin to colorful paintings, while InceptionV3 tends toward dash-line strokes. These signatures suggest that the models' internal representations are influenced by their specific architectural constraints.
Identifying Contextual Bias
A critical application of this method is model debugging. Visualizations for InceptionV3's "soccer ball" and "golf ball" classes were dominated by textures resembling grass rather than the objects themselves. Quantitative tests confirmed this bias: InceptionV3 classified images of plain grass as "golf balls" with 43.55% confidence. Furthermore, when the ball was masked in a real photo, InceptionV3 maintained its classification based on the background (49.78% confidence), whereas ResNet50 correctly updated its prediction to "fountain."
Conclusion
Transformation Invariant Optimization provides a robust and intuitive framework for feature visualization. By leveraging geometric transformations as a natural regularizer, we can generate human-interpretable images that reveal both the strengths and the hidden biases of deep learning models. While this is a qualitative tool, it represents a significant step toward making computer vision models more transparent and reliable.
Summary updated