# Explainable Artificial Intelligence: Advancements and Limitations
## 4 Visual Explanations
### Pixel Attribution
#### 4.2.3 Perturbation-Based Methodologies
Based on the distances and the corresponding predictions, LIME constructs a new, simpler linear model that approximates the behaviour of the original complex model in the local region around the investigated sample. Finally, the most important superpixels--those that have the greatest impact on the prediction--are highlighted as pixel attribution maps for the model's decision. By doing so, LIME helps identify which parts of the image were most influential for the model's decision. To illustrate how LIME works, we present Figure 4a for a binary classification task. As shown, a complex pattern, highlighted in brown colour, is captured by the original trained model. The big red star is the instance to be explained, and other red stars represent the perturbed samples from the same class while the blue octagrams are the samples from the opposite class. The larger the instance, the closer it is to the data point being queried. Using the predicted classes from the original complex model for the perturbed instances, along with the calculated distances, the linear model (represented by the blue line) is optimised to approximate and explain the class prediction of the red star in its local vicinity. Although this new model does not reflect the global behaviour of the complex model, it is locally faithful, meaning that it reflects the behaviour of the complex model in the local area of the given instance. The weights of this linear line show the importance of each image patch in the input image [77]. One major issue that LIME and other linear approximation approaches face is to determine the neighbourhood in which the given explanations are valid. There is no specified way to decide which data points these explanations are applicable to. This is a vital issue as the coverage of explanations is not clear. In other words, explanations would be tricky and unstable when trying to predict unseen examples by relying on the weights of the newly fitted model. An attempt to mitigate this limitation was performed by the same authors in [78], where a novel method called Anchors, high-precision model-agnostic explanations, is presented. The difference between Anchors and LIME can be seen in Figure 4b. Anchors aim to fix a local area where all the instances are from the same class to achieve consistent \"anchored\" explanations. In this way, explanations help users predict unseen data points with high precision and less effort. This approach is presented in the form of a rule-based system, and an example explanation may be the following:  
* **if** you are _[younger than 50]_ and _[female]_, **then** you are very unlikely to have cancer,  
where _[age: under 50]_ and _[gender: female]_ are referred to as anchors. As long as these anchors are present in new input, it is highly likely to be predicted as belonging to the same class as samples sharing these feature values. These features are assumed to cause the classification and provided that they are held; changes in the rest of the features do not affect the prediction. Similarly, for an image classification task, the anchors may be the following:  
* **if** the given image includes _[stripes]_, **then** it is almost guaranteed that the model will classify it correctly as a zebra,  
and hence the super-pixels involving _[stripes]_ are called anchors. Anchors aim to meet two main requirements: precision and coverage. The former is about how precise the explanations are, while the latter defines the local area where these explanations are applicable. For a zebra classification task, precision is the percentage of perturbed examples from the same class as the input image that also contains _[stripes]_, whereas coverage is defined as the fraction of the number of samples that hold the given anchor _[stripes]_ to all perturbed instances [78]. Shapley Additive Explanations (SHAP) by [PERSON] et al. is another powerful and widely used model-agnostic XAI approach [40].