Reducing Texture Bias of Deep Neural Networks via Edge Enhancing Diffusion

Edgar Heinert, Matthias Rottmann, Kira Maag, Karsten Kahl · DOI

Introduction

Deep Convolutional Neural Networks (CNNs) have achieved remarkable success in computer vision tasks, yet they remain fundamentally different from human perception in one critical aspect: texture bias. While humans prioritize global shapes and silhouettes for object recognition, CNNs often rely on local textures and patterns. This reliance makes models brittle to domain shifts, such as changes in lighting, weather, or the transition from synthetic to real-world environments. This paper explores a novel pre-processing framework using Edge Enhancing Diffusion (EED) to mitigate this bias, specifically within the demanding context of semantic segmentation.

Methodology: Edge Enhancing Diffusion

The core of the proposed approach is the application of EED, an anisotropic diffusion method based on Partial Differential Equations (PDEs). Unlike standard Gaussian blurring, which smooths images uniformly and degrades boundaries, EED calculates the local image gradient to control the flow of color information. It allows diffusion to occur along edges but inhibits it across them, effectively "painting over" internal textures while maintaining sharp object boundaries.

Comparison between an original Cityscapes image (top) and its EED-processed version (bottom), demonstrating the removal of internal textures while preserving structural edges.

A key technical innovation in this work is the introduction of stabilizing orientation smoothing. Standard EED can produce mathematical singularities or artifacts during the diffusion process. By smoothing the orientation field, the authors ensure the resulting images are clean and suitable for training deep learning architectures like DeepLabv3+ (CNN) and Segformer (Vision Transformer).

A comparison of the diffusion process on a complex street scene. The middle panel illustrates the potential for artifacts (singularities) in standard diffusion, which are resolved by the authors' orientation smoothing in the final EED output (right).

Experimental Evaluation

The researchers evaluated the impact of texture removal on two primary datasets: Cityscapes (real-world German urban scenes) and CARLA (high-fidelity autonomous driving simulations). Models were trained from scratch on these "diffused" datasets to force the networks to prioritize shape-based features over textural cues.

Key Findings

  • CNN Vulnerability: A standard CNN trained on original Cityscapes data achieves approximately 74% mIoU. However, when tested on texture-less EED images, performance drops to 8.5%, confirming a near-total reliance on texture for segmentation.
  • Transformer Resilience: Vision Transformers (ViTs) proved significantly more robust. Their self-attention mechanisms allow them to maintain a higher degree of shape awareness compared to the local receptive fields of CNNs.
  • Texture-Ignorant Training: Models trained on EED-processed data become "texture-ignorant." When these models are evaluated on original, textured images, their performance remains stable, indicating they have successfully learned to ignore textural noise in favor of structural geometry.

Robustness and Adversarial Defense

Beyond domain generalization, EED serves as an effective defensive layer against adversarial attacks. In tests using the Fast Gradient Sign Method (FGSM), applying EED as a pre-processing filter significantly restored model accuracy. This is particularly effective in "gray-box" scenarios where the attacker is unaware of the specific pre-processing steps being utilized.

However, the method faces a "small object problem." Because EED aggressively smooths internal regions, very thin or distant objects—such as utility poles or traffic lights—can occasionally be "over-diffused" and rendered invisible to the model. This represents a primary trade-off between texture robustness and fine-grained detail preservation.

Conclusion

By integrating Edge Enhancing Diffusion into the training pipeline, this research demonstrates that it is possible to reduce the inherent texture bias of deep neural networks. While Vision Transformers are naturally more shape-aware, CNNs can be hardened against texture shifts through EED pre-processing. Future work will focus on adaptive diffusion parameters to better preserve small, semantically critical objects while maintaining the benefits of texture-ignorance.

Summary updated

BibTeX
@inproceedings{heinert2024reducing,
  author = {Edgar Heinert and Matthias Rottmann and Kira Maag and Karsten Kahl},
  title = {{Reducing Texture Bias of Deep Neural Networks via Edge Enhancing Diffusion}},
  booktitle = {ECAI},
  year = {2024},
  url = {https://openreview.net/forum?id=rse53j6a9O},
}
Figure