The increasing complexity of state-of-the-art machine learning models has made their behavior progressively harder to interpret, spurring rapid advancements in the field of eXplainable Artificial Intelligence (XAI). Among many methods proposed, perturbation-based approaches play a major role. By systematically altering (perturbing) input features, these approaches measure the impact on the model's predictions. For image data, traditional perturbation techniques, often involve replacing pixel values e.g., with a pre-defined color. However, such approaches, but also more refined deterministic techniques, generate unrealistic out-of-distribution samples and often leave visible artifacts, which can mislead the model and compromise explanation quality. In this work, we adjust LIME, a widely used perturbation-based method, to demonstrate how generative inpainting can improve perturbation-based explanations for images. We achieve photorealistic perturbed samples that align better with the original data distribution and enhance explanation quality.
Figures & tables
Figure 1: Perturbed samples and explanations for band-aid from different methods: The first row shows the segmented original image with an example of a perturbation mask (left image), as well as the perturbed samples as given by LIME , LIME-G and LILI . The second row shows the model’s gradients with respect to the input, as well as the explanations given by different methods (here, the top ten superpixels by absolute weight are visualized: darker green indicates a stronger positive contribution). Note that the gradient w.r.t. the input reveals that the band-aid superpixel seems to influence the prediction. However, only LILI identifies the band-aid as most important.
Figure 2: Explanations using 8 deterministic occlusion methods: Applied to an image of class band-aid where default LIME fails to identify the most important superpixel(s). The top ten superpixels by absolute weight are visualized (darker green for a stronger positive contribution). From left to right, we can see the occlusion methods 1-8 as described in Section 2.2 .
Figure 3: Motivation for perturbation mask expansion: The top-left image ( original ) shows three hips and a perturbation mask (black outline). The inpainted sample closely resembles the original, but the mask does not fully cover the hips. The expanded mask hides remaining artifacts, encouraging background replacement (see inpainted expanded ). The right part shows perturbation effects on classification confidence (probabilities below). The image column displays the original and masked region ( i.e. , yellow outline). LIME default and LILI with 0 pixel expansion leave the instance visible with high confidence, while LILI with 8 pixel expansion removes it, causing a significant confidence drop.
Figure 4: Examples of perturbed samples and explantions by methods: For each explained image, we can see the original with it’s segmentation and a perturbation mask on the left, and the gradients with respect to the input on the right (first row). Following rows show one perturbed sample, and the explanation as given by the corresponding methods.
Occlusion method
FID
LIME
superpixel mean color
30.532
LIME-G
inpainting with DeepFill
56.524
LILI
inpainting with LaMa
6.727
Table 1: Fréchet inception distance (FID) of perturbed samples: As generated by LIME, LILI and LIME-G. Lower values indicate a higher perceptual image quality.
mean
Q1
median
Q3
IQR
MAD
Method
Mask expansion
LILI
0
-1.766
-2.410
-1.981
-1.159
1.251
0.574
3
-1.816
-2.427
-2.011
-1.357
1.070
0.544
5
-1.733
-2.451
-1.917
-1.245
1.206
0.619
8
-1.692
-2.427
-1.875
-1.189
1.238
0.632
LIME-G
0
-1.637
-2.387
-1.774
-1.013
1.374
0.691
Table 2: Statistics of the saliency metric scores: For each method and mask expansion is presented: mean, first quartile (Q1), median, third quartile (Q3), interquartile range (IQR) and median absolute deviation (MAD). Lower values indicate better explanations. The best result (minimum aggregated saliency score) for mean, Q1, median and Q3 is underlined.
Figure 5: Boxplot of the agreement of rankings: As computed using Kendall’s W (coefficient of concordance) for the top 10 superpixels (by absolute mean weight) for each of the 100 sample images.
LIME
LILI
LIME-G
mean
0.889
0.852
0.723
std
0.080
0.109
0.184
Table 3: Agreement of rankings: As computed using Kendall’s W (coefficient of concordance) for the top 10 superpixels (by absolute mean weight) for each of the 100 sample images. The table shows the aggregated results as mean and standard deviation (std) across all samples.
mean
std
Method
Mask expansion
LIME
0
4.431
0.099
LIME-G
0
8.708
0.037
3
8.915
0.044
5
9.008
0.046
8
9.154
0.055
Table 4: Execution times of explanations: The table shows the mean and the standard deviation (std) of the execution times in seconds of the generation of explanations.
Microwaves and Radar Institute, German Aerospace Center (DLR), Weßling, 82234, Germany · Chair of Remote Sensing Technology, Department of Aerospace and Geodesy, Technical University of Munich, Munich, 80333, Germany