-
Notifications
You must be signed in to change notification settings - Fork 443
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge back changes in release 1.1.0 (#1947)
* Bump up version to 1.1.0rc1 * Updated daily workflow (#1905) - remove if statement to allow running on any branch by manually * [FIX] Wrong test temp directory path (#1902) * Fix wrong test temp directory * Update tests/unit/algorithms/action/adapters/mmaction/utils/test_action_config_utils.py * Update test_action_config_utils.py * Update PR template (#1914) * Update . location. * Fix OTX1.1 -> Geti1.4 integration issues (#1910) * Add dill to requirements/api.txt * Return None instead of raising NotImplementedError in IMedia2DEntity.path * Move utils HPO uses into HPO directory (#1912) move utils into hpo dir * [FIX] Add stability to explain detection (#1901) Add stability to explain detection * [Fix] e2e tests FQ references (#1918) Fix FQ references * Move mpa.deploy to otx.algorithms.common (#1903) * Move deploy modules to otx * test: fix mmdeploy api replacement error * Fix pre-commit issues * Update otx/mpa/det/exporter.py * Update otx/mpa/exporter_mixin.py * Update otx/mpa/seg/exporter.py * Update otx/mpa/cls/exporter.py * Update otx/algorithms/common/adapters/mmdeploy/utils/mmdeploy.py * Update otx/algorithms/common/adapters/mmdeploy/utils/operations_domain.py * Add mmcls.VisionTransformer backbone support (#1908) * Add mmcls transformer backbones * Fix VisionTransformeroutput check * Add changes * Disable recording forward hooks in inferrer * Remove unused import * Move semantic-segmentation related codes to otx adapters (#1911) * Added security.md Add the security related notification * Update security.md fix prettier issue * Add custom exception class for CLI (#1919) * Add custom exception class for CLI * Fixed TCs for config_manager * Correct License to Apache * Remove temp hot key values (#1916) * Refactor OTX classification phase 1: move modules from MPA to OTX (#1893) * Revert TrainType typo (#1928) * Fix Conflict * Fix conflict * Fix unit-tests * Fix cli tests * Fix cli tests * Fix type * Move all hooks in MPA into OTX common mmcv adapter (#1922) * Add explanation for XAI & minor doc fixes (#1923) * [CI] Updated daily workflow (#1904) Updated daily workflow - remove if statement to allow running on any branch by manually * [FIX] re-bugfix: ATSS head loss (#1907) re bugfix * Fix typos * Explanation of Explanation * Add images & typo fixes * Fixes from comments * Add accuracy for OD explanation * Tutorial update * Add accuracy for BCCD and WGISD * Fix * Move utils to OTX common & adapter (#1931) * [CI] Updated daily workflow (#1904) Updated daily workflow - remove if statement to allow running on any branch by manually * [FIX] re-bugfix: ATSS head loss (#1907) re bugfix * Added security.md Added the security related notification. * Update security.md fix prettier issue * Move utils * Fix typo * Move classification unit tests to OTX tests (#1932) * [CI] Updated daily workflow (#1904) Updated daily workflow - remove if statement to allow running on any branch by manually * [FIX] re-bugfix: ATSS head loss (#1907) re bugfix * Added security.md Added the security related notification. * Update security.md fix prettier issue * Move classification unit tests * Apply mocker in RandAugment TC * Move otx.mpa.modules.ov -> otx.core.ov (#1929) * First Refactoring * Refactor mpa.modules.ov -> otx.core.ov * Remove otx.mpa.modules.ov * Fix docs & unit test paths * Fix some import * Add TODO comments * Add github icon link in doc head (#1934) * Fix invalid temp_dir inside unit tests (#1937) * Move all model utils and dataloaders/samplers in mpa to otx adapter (#1930) * Move stages to each algorithms (#1938) * Move stages to each algorithms * Change docs for action recognition (#1940) * Change docs for action recognition * Fix typo * Update MoViNet related parts * Add MoViNet performance * Revert table include Complexity and Model size * Fix tox to run tests on non-editable install * Fix packaging errors including cython module build / import issues (#1936) * Avoid cychon compile on Windows * Fix packaging errors * Fix pre-commit * Remove use_develop option from tox tests * Fix pre-commit * Fix tox -e -> -re for clean build * Fix import error * Add missing __init__.py * Fix relative -> absolute import * Revert to editable package in tox tests * Release 1.1.0 (#1933) * Release OTX 1.1.0 * Update known issues in CHANGELOG.md * Fix PR / issue # to links * Fix pre-commit * Bump-up version to 1.2 * Fix pre-commit --------- Signed-off-by: Songki Choi <songki.choi@intel.com> Co-authored-by: Yunchu Lee <yunchu.lee@intel.com> Co-authored-by: Harim Kang <harim.kang@intel.com> Co-authored-by: Eunwoo Shin <eunwoo.shin@intel.com> Co-authored-by: Emily Chun <emily.chun@intel.com> Co-authored-by: emily.chun <chuneuny@ikvensx012> Co-authored-by: Sungman Cho <sungman.cho@intel.com> Co-authored-by: Inhyuk Andy Cho <andy.inhyuk.jo@intel.com> Co-authored-by: Jaeguk Hyun <jaeguk.hyun@intel.com> Co-authored-by: Jihwan Eom <jihwan.eom@intel.com> Co-authored-by: Soobee Lee <soobee.lee@intel.com> Co-authored-by: Galina Zalesskaya <galina.zalesskaya@intel.com>
- Loading branch information
1 parent
fd1e6c3
commit f8e31db
Showing
663 changed files
with
8,301 additions
and
6,731 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ Additional Features | |
models_optimization | ||
hpo | ||
auto_configuration | ||
xai |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
Explainable AI (XAI) | ||
==================== | ||
|
||
**Explainable AI (XAI)** is a field of research that aims to make machine learning models more transparent and interpretable to humans. | ||
The goal is to help users understand how and why AI systems make decisions and provide insight into their inner workings. It allows us to detect, analyze, and prevent common mistakes, for example, when the model uses irrelevant features to make a prediction. | ||
XAI can help to build trust in AI, make sure that the model is safe for development and increase its adoption in various domains. | ||
|
||
Most XAI methods generate **saliency maps** as a result. Saliency map is a visual representation, suitable for human comprehension, that highlights the most important parts of the image from the model point of view. | ||
It looks like a heatmap, where warm-colored areas represent the areas with main focus. | ||
|
||
|
||
.. figure:: ../../../../utils/images/xai_example.jpg | ||
:width: 600 | ||
:alt: this image shows the result of XAI algorithm | ||
|
||
These images are taken from `D-RISE paper <https://arxiv.org/abs/2006.03204>`_. | ||
|
||
|
||
We can generate saliency maps for a certain model that was trained in OpenVINO™ Training Extensions, using ``otx explain`` command line. Learn more about its usage in :doc:`../../tutorials/base/explain` tutorial. | ||
|
||
********************************* | ||
XAI algorithms for classification | ||
********************************* | ||
|
||
.. image:: ../../../../utils/images/xai_cls.jpg | ||
:width: 600 | ||
:align: center | ||
:alt: this image shows the comparison of XAI classification algorithms | ||
|
||
|
||
For classification networks these algorithms are used to generate saliency maps: | ||
|
||
- **Activation Map** - this is the most basic and naive approach. It takes the outputs of the model's feature extractor (backbone) and averages it in channel dimension. The results highly rely on the backbone and ignore neck and head computations. Basically, it gives a relatively good and fast result. | ||
|
||
- `Eigen-Cam <https://arxiv.org/abs/2008.00299>`_ uses Principal Component Analysis (PCA). It returns the first principal component of the feature extractor output, which most of the time corresponds to the dominant object. The results highly rely on the backbone as well and ignore neck and head computations. | ||
|
||
- `Recipro-CAM <https://arxiv.org/pdf/2209.14074>`_ uses Class Activation Mapping (CAM) to weigh the activation map for each class, so it can generate different saliency per class. Recipro-CAM is a fast gradient-free Reciprocal CAM method. The method involves spatially masking the extracted feature maps to exploit the correlation between activation maps and network predictions for target classes. | ||
|
||
|
||
Below we show the comparison of described algorithms. ``Access to the model internal state`` means the necessity to modify the model's outputs and dump inner features. | ||
``Per-class explanation support`` means generation different saliency maps for different classes. | ||
|
||
+-------------------------------------------+----------------+----------------+-------------------------------------------------------------------------+ | ||
| Classification algorithm | Activation Map | Eigen-Cam | Recipro-CAM | | ||
+===========================================+================+================+=========================================================================+ | ||
| Need access to model internal state | Yes | Yes | Yes | | ||
+-------------------------------------------+----------------+----------------+-------------------------------------------------------------------------+ | ||
| Gradient-free | Yes | Yes | Yes | | ||
+-------------------------------------------+----------------+----------------+-------------------------------------------------------------------------+ | ||
| Single-shot | Yes | Yes | No (re-infer neck + head H*W times, where HxW – feature map size) | | ||
+-------------------------------------------+----------------+----------------+-------------------------------------------------------------------------+ | ||
| Per-class explanation support | No | No | Yes | | ||
+-------------------------------------------+----------------+----------------+-------------------------------------------------------------------------+ | ||
| Execution speed | Fast | Fast | Medium | | ||
+-------------------------------------------+----------------+----------------+-------------------------------------------------------------------------+ | ||
|
||
|
||
**************************** | ||
XAI algorithms for detection | ||
**************************** | ||
|
||
For detection networks these algorithms are used to generate saliency maps: | ||
|
||
- **Activation Map** - the same approach as for classification networks, which uses the outputs from feature extractor. This is an algorithm is used to generate saliency maps for two-stage detectors. | ||
|
||
- **DetClassProbabilityMap** - this approach takes the raw classification head output and uses class probability maps to calculate regions of interest for each class. So, it creates different salience maps for each class. This algorithm is implemented for single-stage detectors only. | ||
|
||
.. image:: ../../../../utils/images/xai_det.jpg | ||
:width: 600 | ||
:align: center | ||
:alt: this image shows the detailed description of XAI detection algorithm | ||
|
||
|
||
The main limitation of this method is that, due to training loss design of most single-stage detectors, activation values drift towards the center of the object while propagating through the network. | ||
This prevents from getting clear explanation in the input image space using intermediate activations. | ||
|
||
Below we show the comparison of described algorithms. ``Access to the model internal state`` means the necessity to modify the model's outputs and dump inner features. | ||
``Per-class explanation support`` means generation different saliency maps for different classes. ``Per-box explanation support`` means generation standalone saliency maps for each detected prediction. | ||
|
||
|
||
+-------------------------------------------+----------------------------+--------------------------------------------+ | ||
| Detection algorithm | Activation Map | DetClassProbabilityMap | | ||
+===========================================+============================+============================================+ | ||
| Need access to model internal state | Yes | Yes | | ||
+-------------------------------------------+----------------------------+--------------------------------------------+ | ||
| Gradient-free | Yes | Yes | | ||
+-------------------------------------------+----------------------------+--------------------------------------------+ | ||
| Single-shot | Yes | Yes | | ||
+-------------------------------------------+----------------------------+--------------------------------------------+ | ||
| Per-class explanation support | No | Yes | | ||
+-------------------------------------------+----------------------------+--------------------------------------------+ | ||
| Per-box explanation support | No | No | | ||
+-------------------------------------------+----------------------------+--------------------------------------------+ | ||
| Execution speed | Fast | Fast | | ||
+-------------------------------------------+----------------------------+--------------------------------------------+ |
Oops, something went wrong.