Co-occurrence Filter

Roy Josef Jevnisek, Shai Avidan

Abstract

Co-occurrence Filter (CoF) is a boundary preserving filter. It is based on the Bilateral Filter (BF) but instead of using a Gaussian on the range values to preserve edges it relies on a co-occurrence matrix. Pixel values that co-occur frequently in the image (i.e., inside textured regions) will have a high weight in the co-occurrence matrix. This, in turn, means that such pixel pairs will be averaged and hence smoothed, regardless of their intensity differences. On the other hand, pixel values that rarely co-occur (i.e., across texture boundaries) will have a low weight in the co-occurrence matrix. As a result, they will not be averaged and the boundary between them will be preserved. The CoF therefore extends the BF to deal with boundaries, not just edges. It learns co-occurrences directly from the image. We can achieve various filtering results by directing it to learn the co-occurrence matrix from a part of the image, or a different image.

Introduction: Beyond Edge Preservation

In image processing, edge-preserving filters are essential for tasks like denoising and artistic abstraction. However, traditional filters like the Bilateral Filter (BF) rely on a simple assumption: an edge is defined by a sharp change in intensity. This assumption fails in the presence of texture. A high-contrast texture (like a checkerboard) contains many "edges" that should be smoothed, while a boundary between two different textures might have a very small intensity difference and should be preserved.

Roy J. Jevnisek and Shai Avidan introduce the Co-Occurrence Filter (CoF) to address this. By shifting the focus from local intensity differences to global statistical frequency, the CoF distinguishes between repetitive textures and unique boundaries.

Methodology: Learning from Statistics

The CoF adapts the Bilateral Filter framework by replacing the standard intensity-based "range kernel" with a data-driven normalized co-occurrence matrix ($M$).

  1. The Co-occurrence Matrix: This matrix counts how often a pixel value $a$ appears near a pixel value $b$ across the image. Frequent pairs (high weight) are treated as texture and smoothed; rare pairs (low weight) are treated as boundaries and preserved.
  2. Texture vs. Boundary: Unlike the BF, which requires manual tuning of a range parameter ($\sigma_r$), the CoF learns what constitutes a boundary directly from the image statistics. This allows it to smooth high-contrast textures that would normally "trap" a standard Bilateral Filter.
  3. Color Handling: For RGB images, the authors use K-means quantization to reduce the color space to a manageable set of clusters, employing soft assignment to prevent artifacts.
Figure 1: The CoF mechanism. Left: Noisy textured input. Middle: The learned co-occurrence weights highlighting boundaries. Right: The filtered output preserving boundaries while flattening texture.

Key Results and Applications

The CoF excels at "texture flattening"—removing complex patterns while maintaining sharp silhouettes. This is particularly effective when the average intensity of a textured object is similar to its background, a scenario where intensity-based filters often fail.

  • Iterative Performance: Applying the filter multiple times leads to highly effective image simplification, useful for computer vision tasks that require clean object masks.
  • Computational Efficiency: The filter is remarkably fast, processing a 1-megapixel image in roughly 3.2 seconds on a standard CPU (including statistics collection and filtering).
  • Real-World Robustness: In comparisons with $L_0$ smoothing and Rolling Guidance Filters, the CoF is superior at preserving thin structures and low-contrast boundaries that are often mistakenly blurred by other methods.
Figure 6: Real-world texture flattening. Iterative application of the CoF removes the high-contrast leopard spots while maintaining the sharp boundary of the animal against the tree.

Conclusion

The Co-occurrence Filter represents a significant step forward in boundary-preserving smoothing. By treating texture as a global statistical property rather than a local intensity fluctuation, it provides a more context-aware approach to image filtering. While it faces challenges with extremely rare colors ("lone stars") and quantization sensitivity, its ability to learn boundaries directly from data makes it a powerful new primitive for the image processing toolkit.

Summary updated

BibTeX
@inproceedings{jevnisek2017co,
  author = {Roy Josef Jevnisek and Shai Avidan},
  title = {{Co-occurrence Filter}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2017},
  url = {https://openreview.net/forum?id=ryEZCR-OZB},
}
Figure