Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Oct 2, 2024
1 parent 9b7d015 commit dbeb898
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
]

TEST_MODELS = IMAGENET_MODELS + VOC_MODELS + TRANSFORMER_MODELS
IMAGENET_LABELS = get_imagenet_labels()
EXPLAIN_METHODS = [Method.RECIPROCAM, Method.AISE, Method.RISE, Method.ACTIVATIONMAP]


Expand Down Expand Up @@ -100,8 +99,9 @@ def setup_model(self, data_dir, model_name):
return model, None

elif model_name in IMAGENET_MODELS + TRANSFORMER_MODELS:
self.dataset_label_list = IMAGENET_LABELS
_, model_cfg = convert_timm_to_ir(model_name, data_dir, self.supported_num_classes)
version = "1k" if model_cfg["num_classes"] == 1000 else "21k"
self.dataset_label_list = get_imagenet_labels(version)
ir_path = data_dir / "timm_models" / "converted_models" / model_name / "model_fp32.xml"
model = ov.Core().read_model(ir_path)
return model, model_cfg
Expand Down Expand Up @@ -157,7 +157,7 @@ def setup_explainer(self, model, explain_method):
def setup(self, fxt_data_root, fxt_output_root, fxt_dataset_parameters):
self.data_dir = fxt_data_root
self.output_dir = fxt_output_root
self.supported_num_classes = {1000: 1000}
self.supported_num_classes = {1000: 1000, 21841: 21841, 21843: 21843}

self.setup_dataset(fxt_dataset_parameters)
self.dataset_name = self.dataset_type.value
Expand Down
8 changes: 5 additions & 3 deletions releases/1.1.0/_sources/user-guide.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ Target layer is the part of the model graph where XAI branch will be inserted (a

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

## Methods performance-accuracy comparison
### Methods performance-accuracy comparison

The table below compares accuracy and performace of different models and explain methods (learn more about [Quality Metrics](#measure-quality-metrics-of-saliency-maps)).

Expand All @@ -404,16 +404,18 @@ Metrics were measured on a 10% random subset of the [ILSVRC 2012](https://www.im
|:---------------------------:|:------------:|:--------------:|:---------------------------------:|---|:-------------:|---|:---------:|:--------:|---|:--------:|:---------:|:----------:|:------------:|
| deit - tiny (transformer) | White box | VIT ReciproCAM | 1* | | **89.9** | | 22.4 | **4.5** | | 70.4 | 88.9 | **38.1** | 34.3 |
| | | Activation map | 1 | | 56.6 | | 7.8 | 7.0 | | 46.9 | 74.0 | 53.7 | 65.4 |
| | Black Box | AISE | 60 | | 73.9 | | 15.9 | 8.9 | | 66.6 | 73.9 | 44.3 | 26.0 |
| | Black Box** | AISE | 60 | | 73.9 | | 15.9 | 8.9 | | 66.6 | 73.9 | 44.3 | 26.0 |
| | | RISE | 2000 | | 85.5 | | **23.2** | 5.8 | | **74.8** | **92.5** | 42.3 | **16.6** |
| | | | | | | | | | | | | | |
| resnet18 | White box | ReciproCAM | 1* | | **89.5** | | 33.9 | **5.9** | | **77.3** | 91.1 | 30.2 | 25.9 |
| | | Activation map | 1 | | 87.0 | | **36.3** | 10.5 | | 74.4 | **97.9** | **25.2** | 40.2 |
| | Black Box | AISE | 60 | | 72.0 | | 22.5 | 12.4 | | 67.4 | 69.3 | 44.5 | 16.9 |
| | Black Box** | AISE | 60 | | 72.0 | | 22.5 | 12.4 | | 67.4 | 69.3 | 44.5 | 16.9 |
| | | RISE | 2000 | | 87.0 | | 34.6 | 7.1 | | 77.1 | 93.0 | 42.0 | **8.3** |

\* 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.

\*\* For Black Box Methods preset = `SPEED`


### White-Box methods

Expand Down
1 change: 0 additions & 1 deletion releases/1.1.0/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,6 @@ <h1>Welcome to OpenVINO™ Explainable AI Toolkit’s documentation!<a class="he
<li class="toctree-l2"><a class="reference internal" href="user-guide.html#black-box-mode">Black-Box mode</a></li>
<li class="toctree-l2"><a class="reference internal" href="user-guide.html#xai-insertion-white-box-usage">XAI insertion (white-box usage)</a></li>
<li class="toctree-l2"><a class="reference internal" href="user-guide.html#xai-methods">XAI methods</a></li>
<li class="toctree-l2"><a class="reference internal" href="user-guide.html#methods-performance-accuracy-comparison">Methods performance-accuracy comparison</a></li>
<li class="toctree-l2"><a class="reference internal" href="user-guide.html#plot-saliency-maps">Plot saliency maps</a></li>
<li class="toctree-l2"><a class="reference internal" href="user-guide.html#saving-saliency-maps">Saving saliency maps</a></li>
<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>
Expand Down
2 changes: 1 addition & 1 deletion releases/1.1.0/searchindex.js

Large diffs are not rendered by default.

14 changes: 6 additions & 8 deletions releases/1.1.0/user-guide.html
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,6 @@ <h3><a href="index.html">Table of Contents</a></h3>
<li class="toctree-l2"><a class="reference internal" href="#black-box-mode">Black-Box mode</a></li>
<li class="toctree-l2"><a class="reference internal" href="#xai-insertion-white-box-usage">XAI insertion (white-box usage)</a></li>
<li class="toctree-l2"><a class="reference internal" href="#xai-methods">XAI methods</a></li>
<li class="toctree-l2"><a class="reference internal" href="#methods-performance-accuracy-comparison">Methods performance-accuracy comparison</a></li>
<li class="toctree-l2"><a class="reference internal" href="#plot-saliency-maps">Plot saliency maps</a></li>
<li class="toctree-l2"><a class="reference internal" href="#saving-saliency-maps">Saving saliency maps</a></li>
<li class="toctree-l2"><a class="reference internal" href="#measure-quality-metrics-of-saliency-maps">Measure quality metrics of saliency maps</a></li>
Expand Down Expand Up @@ -844,9 +843,8 @@ <h3>Overview<a class="headerlink" href="#overview" title="Link to this heading">
<p>Target layer is the part of the model graph where XAI branch will be inserted (applicable for white-box methods).</p>
<p>All supported methods are gradient-free, which suits deployment framework settings (e.g. OpenVINO™), where the model is in optimized or compiled representation.</p>
</section>
</section>
<section id="methods-performance-accuracy-comparison">
<h2>Methods performance-accuracy comparison<a class="headerlink" href="#methods-performance-accuracy-comparison" title="Link to this heading">#</a></h2>
<h3>Methods performance-accuracy comparison<a class="headerlink" href="#methods-performance-accuracy-comparison" title="Link to this heading">#</a></h3>
<p>The table below compares accuracy and performace of different models and explain methods (learn more about <a class="reference internal" href="#measure-quality-metrics-of-saliency-maps"><span class="xref myst">Quality Metrics</span></a>).</p>
<p>Metrics were measured on a 10% random subset of the <a class="reference external" href="https://www.image-net.org/challenges/LSVRC/index.php">ILSVRC 2012</a> validation dataset (5000 images, seed 42).</p>
<div class="pst-scrollable-table-container"><table class="table">
Expand Down Expand Up @@ -899,7 +897,7 @@ <h2>Methods performance-accuracy comparison<a class="headerlink" href="#methods-
<td class="text-center"><p>65.4</p></td>
</tr>
<tr class="row-even"><td class="text-center"><p></p></td>
<td class="text-center"><p>Black Box</p></td>
<td class="text-center"><p>Black Box**</p></td>
<td class="text-center"><p>AISE</p></td>
<td class="text-center"><p>60</p></td>
<td><p></p></td>
Expand Down Expand Up @@ -974,7 +972,7 @@ <h2>Methods performance-accuracy comparison<a class="headerlink" href="#methods-
<td class="text-center"><p>40.2</p></td>
</tr>
<tr class="row-odd"><td class="text-center"><p></p></td>
<td class="text-center"><p>Black Box</p></td>
<td class="text-center"><p>Black Box**</p></td>
<td class="text-center"><p>AISE</p></td>
<td class="text-center"><p>60</p></td>
<td><p></p></td>
Expand Down Expand Up @@ -1007,6 +1005,8 @@ <h2>Methods performance-accuracy comparison<a class="headerlink" href="#methods-
</table>
</div>
<p>* 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.</p>
<p>** For Black Box Methods preset = <code class="docutils literal notranslate"><span class="pre">SPEED</span></code></p>
</section>
<section id="white-box-methods">
<h3>White-Box methods<a class="headerlink" href="#white-box-methods" title="Link to this heading">#</a></h3>
<p>When to use?</p>
Expand Down Expand Up @@ -1459,9 +1459,7 @@ <h2>Example scripts<a class="headerlink" href="#example-scripts" title="Link to
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#xai-insertion-white-box-usage">XAI insertion (white-box usage)</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#xai-methods">XAI methods</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#overview">Overview</a></li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#methods-performance-accuracy-comparison">Methods performance-accuracy comparison</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#methods-performance-accuracy-comparison">Methods performance-accuracy comparison</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#white-box-methods">White-Box methods</a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#activation-map">Activation Map</a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#recipro-cam-vit-recipro-cam-for-vit-models">Recipro-CAM (ViT Recipro-CAM for ViT models)</a></li>
Expand Down

0 comments on commit dbeb898

Please sign in to comment.