Inferensys

Glossary

Occlusion Sensitivity

A perturbation-based attribution method that systematically occludes different regions of an input with a gray square and measures the resulting change in the model's prediction probability.
Developer building agentic RAG system, retrieval pipeline diagram on laptop, technical workspace with notes.
PERTURBATION-BASED ATTRIBUTION

What is Occlusion Sensitivity?

A foundational feature attribution method that systematically occludes regions of an input to measure their impact on a model's prediction probability.

Occlusion Sensitivity is a perturbation-based attribution method that quantifies feature importance by systematically sliding a gray square across an input image, replacing the underlying pixels, and measuring the resulting change in the model's prediction probability for the target class. The core principle is that occluding a critical region will cause a significant drop in the classifier's confidence score, producing a two-dimensional heatmap where low probability values directly correspond to high-importance spatial locations.

As a model-agnostic technique, occlusion sensitivity requires no access to internal model weights or gradients, making it applicable to any black-box classifier. However, its computational cost scales with the stride and window size, and the choice of the occluding patch—typically a constant gray value—introduces an out-of-distribution artifact. This method is conceptually related to RISE and the Deletion Metric, which formalize the perturbation-and-measure paradigm for evaluating attribution faithfulness.

PERTURBATION-BASED ATTRIBUTION

Key Characteristics of Occlusion Sensitivity

Occlusion sensitivity is a foundational, model-agnostic method for interpreting black-box models by systematically blocking regions of an input and measuring the resulting change in prediction confidence.

01

Sliding Window Perturbation

The core mechanism involves iteratively sliding a gray square (or a baseline patch) across the input image. At each position, the patch replaces the underlying pixels, and the model's output probability for the target class is recorded. The resulting drop in confidence forms a heatmap, where darker regions indicate higher importance. The size of the occluding patch, or kernel size, is a critical hyperparameter that determines the granularity of the explanation.

Model-Agnostic
Applicability
02

Probability Delta Heatmap

The raw output is a 2D map of probability deltas. For each patch position (x, y), the method computes P(class|original_image) - P(class|occluded_image). A large positive delta signifies that the occluded region was critical for the prediction. This direct measurement of prediction sensitivity avoids the need for backpropagation or access to internal model weights, making it suitable for any model that outputs a probability score.

Black-Box
Access Level
03

Kernel Size Trade-offs

The choice of the occluding patch size presents a fundamental trade-off between spatial resolution and computational cost:

  • Small Kernels (e.g., 4x4): Provide high-resolution, fine-grained heatmaps but require many forward passes, increasing latency.
  • Large Kernels (e.g., 32x32): Are computationally cheap but produce coarse, blocky explanations that may miss small, critical features.
  • Adaptive Kernels: Advanced implementations can vary patch size based on local image entropy.
04

Occlusion Value Selection

The pixel value used to fill the occluding patch significantly impacts the explanation's fidelity. Common strategies include:

  • Zero Padding: Replacing pixels with black (0).
  • Mean Pixel Value: Using the dataset's average pixel intensity.
  • Blurring: Applying a Gaussian blur to the patch region instead of a solid color.
  • Learned Baseline: Using a generative model to inpaint a realistic, neutral background. A poor baseline can introduce out-of-distribution artifacts, causing the model to react to the patch itself rather than the missing information.
05

Computational Complexity

Occlusion sensitivity is computationally expensive. For an image of size H x W and a stride S, the number of forward passes is approximately (H/S) * (W/S). This linear scaling with input resolution makes it impractical for real-time applications. However, the process is embarrassingly parallel, as each patch perturbation is an independent inference call that can be batched and distributed across multiple GPUs to reduce wall-clock time.

O(n²)
Time Complexity
06

Comparison to RISE

Occlusion sensitivity is the deterministic precursor to Randomized Input Sampling for Explanation (RISE). While occlusion uses a systematic grid of square masks, RISE uses thousands of random, soft-edged binary masks. RISE produces smoother, more visually appealing heatmaps by averaging over many random perturbations, but occlusion sensitivity offers a more direct, exhaustive measurement of local importance without the stochastic noise inherent in random sampling.

PERTURBATION-BASED ATTRIBUTION COMPARISON

Occlusion Sensitivity vs. Related Attribution Methods

A feature-level comparison of Occlusion Sensitivity against other perturbation-based and gradient-based attribution methods for auditing model predictions.

FeatureOcclusion SensitivityRISEKernelSHAPIntegrated Gradients

Method Category

Perturbation-based

Perturbation-based

Perturbation-based

Gradient-based

Model Agnostic

Requires Baseline Input

Satisfies Completeness Axiom

Computational Cost

High

Medium

High

Low

Spatial Resolution

Coarse (patch size dependent)

Fine (pixel-level)

Coarse (coalition dependent)

Fine (pixel-level)

Stochastic Output

Typical Use Case

Debugging CNN focus

Saliency map generation

Model-agnostic SHAP estimation

Axiomatic feature attribution

OCCLUSION SENSITIVITY

Frequently Asked Questions

Answers to common questions about occlusion sensitivity, a perturbation-based feature attribution method used to interpret model predictions by systematically blocking input regions.

Occlusion sensitivity is a perturbation-based feature attribution method that systematically occludes different regions of an input with a gray square and measures the resulting change in the model's prediction probability. The technique operates by sliding an occluding patch—typically a gray box—across the input image in a grid pattern, recording the model's output probability for the target class at each position. When the patch covers a region critical to the prediction, the probability drops significantly, producing a heatmap where low-intensity areas correspond to important features. Unlike gradient-based methods such as Saliency Maps or Integrated Gradients, occlusion sensitivity is completely model-agnostic and requires no access to internal model parameters, making it applicable to any black-box classifier. The resolution of the resulting attribution map is determined by the stride and size of the occluding patch, creating a trade-off between computational cost and spatial precision.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.