NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Histogram Layers for Texture Analysis

Joshua Peeples, Weihuang Xu, Alina Zare · DOI

Abstract

An essential aspect of texture analysis is the extraction of features that describe the distribution of values in local, spatial regions. We present a localized histogram layer for artificial neural networks. Instead of computing global histograms as done previously, the proposed histogram layer directly computes the local, spatial distribution of features for texture analysis and parameters for the layer are estimated during backpropagation. We compare our method with state-of-the-art texture encoding methods on three material/texture datasets: the Describable Texture Dataset, an extension of the ground terrain in outdoor scenes (GTOS-mobile), and a subset of the Materials in Context dataset. Results indicate that the inclusion of the proposed histogram layer improves performance.

Introduction

Standard convolutional neural networks (CNNs) are highly effective at identifying structural patterns such as edges and shapes. However, they often struggle with statistical textures—patterns where the distribution of values is more informative than their exact spatial arrangement, such as the difference between grass and sand.

Traditional pooling operations like Max or Average Pooling discard significant portions of the underlying distribution information. While classical computer vision utilized handcrafted histogram-based features (e.g., LBP or HOG), these are difficult to integrate into modern deep learning because standard histogram operations are non-differentiable. This paper bridges the gap by introducing a learnable, localized histogram layer that maintains spatial context within a differentiable framework.

Methodology: The Localized Histogram Layer

The core innovation is a layer that directly models the statistical distribution of features in local spatial regions using several key mechanisms:

  • Soft Binning with RBFs: To make the histogram operation differentiable, the authors use Radial Basis Functions (RBFs). A feature value's contribution to a bin is determined by its distance from the bin center ($\mu$) and the bin's width ($\gamma$), allowing for smooth gradient flow during backpropagation.
  • Learnable Parameters: Unlike fixed histogram methods, both bin centers and widths are parameters optimized during training. This allows the network to learn which feature ranges are most discriminative for a specific task.
  • Localization: Instead of a single global histogram, the layer uses a sliding window to compute histograms over local regions. This preserves the spatial relationships crucial for complex texture analysis.
Local histograms capture varying feature distributions across different spatial patches of an image.

Experimental Evaluation

The researchers evaluated the "HistRes" (ResNet + Histogram Layer) architecture across four datasets:

  1. Synthetic Texture Dataset: Designed to test structural vs. statistical texture discrimination.
  2. Describable Texture Dataset (DTD): 47 classes of real-world textures.
  3. Materials in Context (MINC-2500): 23 material categories.
  4. GTOS-mobile: 31 classes of ground terrain images captured in outdoor scenes.

Key Insights and Results

A primary finding was that standard CNNs using Global Average Pooling (GAP) are biased toward structure, performing poorly on statistical textures (~41% accuracy) compared to histogram-augmented models (~90%).

Furthermore, the experiments demonstrated that spatial context is critical. Global histograms often fail to distinguish between different spatial arrangements of the same intensity values. By tracking where certain distributions occur, the localized histogram layer provides a more robust representation.

Comparison of global vs. local histograms: Global counts lose spatial arrangement (both images have 8 black/8 white squares), while local histograms preserve spatial context.

On the challenging GTOS-mobile dataset, the histogram-integrated model achieved 79.75% accuracy, a significant improvement over the baseline ResNet's 70.82%. The use of RBFs also provided increased robustness to outliers and noise compared to "hard" histogram assignments.

Conclusion

The localized histogram layer offers a powerful, interpretable, and flexible addition to standard CNN architectures. By allowing the network to learn local statistical distributions end-to-end, it significantly improves performance on material and terrain classification. Future work may explore different kernel functions, such as the t-distribution, to better handle heavy-tailed data and investigate the layer's utility in non-visual domains like signal processing.

Summary updated

BibTeX
@article{peeples2020histogram,
  author = {Joshua Peeples and Weihuang Xu and Alina Zare},
  title = {{Histogram Layers for Texture Analysis}},
  journal = {IEEE Trans. Artif. Intell.},
  year = {2020},
  doi = {10.1109/tai.2021.3135804},
}
Figure