Skip to content

Commit d81e47b

Browse files
committedSep 30, 2024
Update documentation
1 parent b28d731 commit d81e47b

File tree

5 files changed

+318
-60
lines changed

5 files changed

+318
-60
lines changed
 

‎releases/1.1.0/_sources/user-guide.md.txt

+39-3
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@ Content:
2424
- [XAI insertion (white-box usage)](#xai-insertion-white-box-usage)
2525
- [XAI methods](#xai-methods)
2626
- [Overview](#overview)
27+
- [Methods performance-accuracy comparison](#methods-performance-accuracy-comparison)
2728
- [White-box methods](#white-box-methods)
2829
- [Black-box methods](#black-box-methods)
2930
- [Plot saliency maps](#plot-saliency-maps)
3031
- [Saving saliency maps](#saving-saliency-maps)
32+
- [Measure quality metrics of saliency maps](#measure-quality-metrics-of-saliency-maps)
3133
- [Example scripts](#example-scripts)
3234

3335

@@ -372,7 +374,7 @@ result_image = overlay(saliency_map, image)[0] # HxWx3
372374
At the moment, the following XAI methods are supported:
373375

374376
| Method | Using model internals | Per-target support | Single-shot | #Model inferences |
375-
|------------------------|-----------------------|--------------------|-------------|-------------------|
377+
|:-----------------------|:---------------------:|:------------------:|:-----------:|:-----------------:|
376378
| White-Box | | | | |
377379
| Activation Map | Yes | No | Yes | 1 |
378380
| Recipro-CAM | Yes | Yes (class) | Yes* | 1* |
@@ -392,6 +394,27 @@ Target layer is the part of the model graph where XAI branch will be inserted (a
392394

393395
All supported methods are gradient-free, which suits deployment framework settings (e.g. OpenVINO™), where the model is in optimized or compiled representation.
394396

397+
## Methods performance-accuracy comparison
398+
399+
The table below compares accuracy and performace of different models and explain methods (learn more about [Quality Metrics](#measure-quality-metrics-of-saliency-maps)).
400+
401+
Metrics were measured on a 10% random subset of the [ILSVRC 2012](https://www.image-net.org/challenges/LSVRC/index.php) validation dataset (5000 images, seed 42).
402+
403+
| Model | Explain mode | Explain method | Explain time<br>#Model inferences | | Pointing game | | Insertion | Deletion | | ADCC | Coherency | Complexity | Average Drop |
404+
|:---------------------------:|:------------:|:--------------:|:---------------------------------:|---|:-------------:|---|:---------:|:--------:|---|:--------:|:---------:|:----------:|:------------:|
405+
| deit - tiny (transformer) | White box | VIT ReciproCAM | 1* | | **89.9** | | 22.4 | **4.5** | | 70.4 | 88.9 | **38.1** | 34.3 |
406+
| | | Activation map | 1 | | 56.6 | | 7.8 | 7.0 | | 46.9 | 74.0 | 53.7 | 65.4 |
407+
| | Black Box | AISE | 60 | | 73.9 | | 15.9 | 8.9 | | 66.6 | 73.9 | 44.3 | 26.0 |
408+
| | | RISE | 2000 | | 85.5 | | **23.2** | 5.8 | | **74.8** | **92.5** | 42.3 | **16.6** |
409+
| | | | | | | | | | | | | | |
410+
| resnet18 | White box | ReciproCAM | 1* | | **89.5** | | 33.9 | **5.9** | | **77.3** | 91.1 | 30.2 | 25.9 |
411+
| | | Activation map | 1 | | 87.0 | | **36.3** | 10.5 | | 74.4 | **97.9** | **25.2** | 40.2 |
412+
| | Black Box | AISE | 60 | | 72.0 | | 22.5 | 12.4 | | 67.4 | 69.3 | 44.5 | 16.9 |
413+
| | | RISE | 2000 | | 87.0 | | 34.6 | 7.1 | | 77.1 | 93.0 | 42.0 | **8.3** |
414+
415+
\* Recipro-CAM re-infers part of the graph (usually neck + head or last transformer block) H*W times, where HxW is the feature map size of the target layer.
416+
417+
395418
### White-Box methods
396419

397420
When to use?
@@ -662,7 +685,7 @@ explanation.save(
662685
) # image_name_aeroplane_conf_0.85.jpg
663686
```
664687

665-
## Measure quiality metrics of saliency maps
688+
## Measure quality metrics of saliency maps
666689

667690
To compare different saliency maps, you can use the implemented quality metrics: Pointing Game, Insertion-Deletion AUC, and ADCC.
668691

@@ -671,10 +694,23 @@ To compare different saliency maps, you can use the implemented quality metrics:
671694
- **Coherence** - The coherency between the saliency map on the input image and saliency map on the explanation map (image masked with the saliency map). Requires generating an extra explanation (can be time-consuming for black box methods).
672695
- **Complexity** - Measures the L1 norm of the saliency map (average value per pixel). Fewer important pixels -> less complexity -> better saliency map.
673696

674-
- **Insertion-Deletion AUC** ([paper](https://arxiv.org/abs/1806.07421)) - Measures the AUC of the curve of model confidence when important pixels are sequentially inserted or deleted. Time-consuming, requires 60 model inferences: 30 steps of the insertion and deletion process.
697+
- **Insertion-Deletion AUC** ([paper](https://arxiv.org/abs/1806.07421)) - Measures the AUC of the curve of model confidence when important pixels are sequentially inserted or deleted. Time-consuming, requires 60 model inferences: 30 steps for insertion and 30 steps for deletion (number of steps is configurable).
675698

676699
- **Pointing Game** ([paper](https://arxiv.org/abs/1608.00507)/[impl](https://github.com/understandable-machine-intelligence-lab/Quantus/blob/main/quantus/metrics/localisation/pointing_game.py)) - Returns True if the most important saliency map pixel falls into the object ground truth bounding box. Requires ground truth annotation, so it is convenient to use on public datasets (COCO, VOC, ILSVRC) rather than individual images (check [accuracy_tests](../../tests/perf/test_accuracy.py) for examples).
677700

701+
Here is a comparison of the performance time (measured in model inferences) for different accuracy methods. The explain time (also in model inferences) is added along for the better picture.
702+
703+
| Explain mode | Explain method | Explain time** | Pointing Game | Insertion/Deletion AUC | ADCC |
704+
|:------------:|:--------------:|:----------------------------------:|:-------------:|:---------------------------------------------------------------------------------------------------------:|:--------------------------:|
705+
| White Box | Activation map | 1 | 0 | 30 insertion + 30 deletion + 1 to define predicted class and check difference in its score | 2 + 1 explain (1*) |
706+
| | ReciproCAM | 1* | 0 | 30 insertion + 30 deletion | 2 + 1 explain (1*) |
707+
| | ViT ReciproCAM | 1* | 0 | 30 insertion + 30 deletion | 2 + 1 explain (1*) |
708+
| Black Box | AISE-classification | 120-500 | 0 | 30 insertion + 30 deletion | 2 + 1 explain (120-150) |
709+
| | RISE | 1000-10000 | 0 | 30 insertion + 30 deletion | 2 + 1 explain (1000-10000) |
710+
711+
\* Recipro-CAM re-infers part of the graph (usually neck + head or last transformer block) H*W times, where HxW is the feature map size of the target layer.
712+
713+
\*\* All time measurements are in number of model inferences.
678714

679715
```python
680716
import cv2

‎releases/1.1.0/index.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,10 @@ <h1>Welcome to OpenVINO™ Explainable AI Toolkit’s documentation!<a class="he
393393
<li class="toctree-l2"><a class="reference internal" href="user-guide.html#black-box-mode">Black-Box mode</a></li>
394394
<li class="toctree-l2"><a class="reference internal" href="user-guide.html#xai-insertion-white-box-usage">XAI insertion (white-box usage)</a></li>
395395
<li class="toctree-l2"><a class="reference internal" href="user-guide.html#xai-methods">XAI methods</a></li>
396+
<li class="toctree-l2"><a class="reference internal" href="user-guide.html#methods-performance-accuracy-comparison">Methods performance-accuracy comparison</a></li>
396397
<li class="toctree-l2"><a class="reference internal" href="user-guide.html#plot-saliency-maps">Plot saliency maps</a></li>
397398
<li class="toctree-l2"><a class="reference internal" href="user-guide.html#saving-saliency-maps">Saving saliency maps</a></li>
398-
<li class="toctree-l2"><a class="reference internal" href="user-guide.html#measure-quiality-metrics-of-saliency-maps">Measure quiality metrics of saliency maps</a></li>
399+
<li class="toctree-l2"><a class="reference internal" href="user-guide.html#measure-quality-metrics-of-saliency-maps">Measure quality metrics of saliency maps</a></li>
399400
<li class="toctree-l2"><a class="reference internal" href="user-guide.html#example-scripts">Example scripts</a></li>
400401
</ul>
401402
</li>

‎releases/1.1.0/objects.inv

35 Bytes
Binary file not shown.

‎releases/1.1.0/searchindex.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)