{"id":13570120,"url":"https://github.com/deel-ai/xplique","last_synced_at":"2025-05-16T00:16:39.330Z","repository":{"id":37275345,"uuid":"253266653","full_name":"deel-ai/xplique","owner":"deel-ai","description":"👋 Xplique is a Neural Networks Explainability Toolbox","archived":false,"fork":false,"pushed_at":"2024-10-08T15:52:49.000Z","size":34990,"stargazers_count":688,"open_issues_count":10,"forks_count":58,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-05-13T17:14:54.605Z","etag":null,"topics":["explainable-ai","explainable-ml","interpretability","xai"],"latest_commit_sha":null,"homepage":"https://deel-ai.github.io/xplique","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deel-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":"GOVERNANCE.md","roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-05T15:25:54.000Z","updated_at":"2025-05-05T08:22:56.000Z","dependencies_parsed_at":"2023-09-23T04:24:24.817Z","dependency_job_id":"aab28aa8-b973-4da1-9e38-18748666bfe4","html_url":"https://github.com/deel-ai/xplique","commit_stats":{"total_commits":357,"total_committers":14,"mean_commits":25.5,"dds":0.4901960784313726,"last_synced_commit":"0ec53410e2ebb079adde2157c85c1cea50d47fd0"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deel-ai%2Fxplique","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deel-ai%2Fxplique/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deel-ai%2Fxplique/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deel-ai%2Fxplique/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deel-ai","download_url":"https://codeload.github.com/deel-ai/xplique/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254442819,"owners_count":22071878,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["explainable-ai","explainable-ml","interpretability","xai"],"created_at":"2024-08-01T14:00:48.530Z","updated_at":"2025-05-16T00:16:34.289Z","avatar_url":"https://github.com/deel-ai.png","language":"Python","funding_links":[],"categories":["Uncategorized","Tools","Python","Technical Resources","Python Libraries(sort in alphabeta order)"],"sub_categories":["Uncategorized","Interpretability/Explicability","Open Source/Access Responsible AI Software Packages","Evaluation methods"],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"docs/assets/banner.png\" width=\"75%\" alt=\"Xplique\" align=\"center\" /\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"#\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Python-3.7, 3.8, 3.9, 3.10-efefef\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"#\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Tensorflow-2.5, ..., 2.15-00008b\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/deel-ai/xplique/actions/workflows/python-lints.yml\"\u003e\n        \u003cimg alt=\"PyLint\" src=\"https://github.com/deel-ai/xplique/actions/workflows/python-lints.yml/badge.svg\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/deel-ai/xplique/actions/workflows/python-tests.yml\"\u003e\n        \u003cimg alt=\"Tox\" src=\"https://github.com/deel-ai/xplique/actions/workflows/python-tests.yml/badge.svg\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/deel-ai/xplique/actions/workflows/python-publish.yml\"\u003e\n        \u003cimg alt=\"Pypi\" src=\"https://github.com/deel-ai/xplique/actions/workflows/python-publish.yml/badge.svg\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://pepy.tech/project/xplique\"\u003e\n        \u003cimg alt=\"Pepy\" src=\"https://static.pepy.tech/badge/xplique\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"#\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/License-MIT-efefef\"\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\n\u003cp align=\"center\"\u003e\n    🦊 \u003cb\u003eXplique\u003c/b\u003e (pronounced \u003ci\u003e\\ɛks.plik\\\u003c/i\u003e) is a Python toolkit dedicated to explainability. The goal of this library is to gather the state of the art of Explainable AI to help you understand your complex neural network models. Originally built for Tensorflow's model it also works for PyTorch models partially.\n\n  \u003cbr\u003e\n  \u003ca href=\"https://deel-ai.github.io/xplique/\"\u003e📘 \u003cstrong\u003eExplore Xplique docs\u003c/strong\u003e\u003c/a\u003e\n    |  \n  \u003ca href=\"https://deel-ai.github.io/xplique/latest/tutorials/\"\u003e\u003cstrong\u003eExplore Xplique tutorials\u003c/strong\u003e 🔥\u003c/a\u003e\n  \u003cbr\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://deel-ai.github.io/xplique/latest/api/attributions/api_attributions/\"\u003eAttributions\u003c/a\u003e\n  ·\n  \u003ca href=\"https://deel-ai.github.io/xplique/latest/api/concepts/cav/\"\u003eConcept\u003c/a\u003e\n  ·\n  \u003ca href=\"https://deel-ai.github.io/xplique/latest/api/feature_viz/feature_viz/\"\u003eFeature Visualization\u003c/a\u003e\n  ·\n  \u003ca href=\"https://deel-ai.github.io/xplique/latest/api/attributions/metrics/api_metrics/\"\u003eMetrics\u003c/a\u003e\n  .\n  \u003ca href=\"api/example_based/api_example_based/\"\u003eExample-based\u003c/a\u003e\n\u003c/p\u003e\n\n\u003e [!IMPORTANT]  \n\u003e With the release of Keras 3.X since TensorFlow 2.16, some methods may not function as expected. We are actively working on a fix. In the meantime, we recommend using TensorFlow 2.15 or earlier versions for optimal compatibility.\n\nThe library is composed of several modules, the _Attributions Methods_ module implements various methods (e.g Saliency, Grad-CAM, Integrated-Gradients...), with explanations, examples and links to official papers.\nThe _Feature Visualization_ module allows to see how neural networks build their understanding of images by finding inputs that maximize neurons, channels, layers or compositions of these elements.\nThe _Concepts_ module allows you to extract human concepts from a model and to test their usefulness with respect to a class.\nFinally, the _Metrics_ module covers the current metrics used in explainability. Used in conjunction with the _Attribution Methods_ module, it allows you to test the different methods or evaluate the explanations of a model.\n\n\u003cp align=\"center\" width=\"100%\"\u003e\n    \u003cimg width=\"95%\" src=\"./docs/assets/modules.png\"\u003e\n\u003c/p\u003e\n\n\u003cbr\u003e\n\n\u003e [!NOTE]  \n\u003e We are proud to announce the release of the _Example-based_ module! This module is dedicated to methods that explain a model by retrieving relevant examples from a dataset. It includes methods that belong to different families: similar examples, contrastive (counter-factuals and semi-factuals) examples, and prototypes (as concepts based methods have a dedicated sections).\n\n## 🔥 Tutorials\n\n\u003cdetails\u003e\n\u003csummary\u003eWe propose some Hands-on tutorials to get familiar with the library and its api:\u003c/summary\u003e\n\n- [**Attribution Methods**: Getting started](https://colab.research.google.com/drive/1XproaVxXjO9nrBSyyy7BuKJ1vy21iHs2) \u003csub\u003e [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1XproaVxXjO9nrBSyyy7BuKJ1vy21iHs2) \u003c/sub\u003e\n\n\u003cp align=\"center\" width=\"100%\"\u003e\n    \u003ca href=\"https://colab.research.google.com/drive/1XproaVxXjO9nrBSyyy7BuKJ1vy21iHs2\"\u003e\n        \u003cimg width=\"95%\" src=\"./docs/assets/attributions.jpeg\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n- [**Attribution Methods**: Sanity checks paper](https://colab.research.google.com/drive/1uJOmAg6RjlOIJj6SWN9sYRamBdHAuyaS) \u003csub\u003e [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1uJOmAg6RjlOIJj6SWN9sYRamBdHAuyaS) \u003c/sub\u003e\n- [**Attribution Methods**: Tabular data and Regression](https://colab.research.google.com/drive/1pjDJmAa9oeSquYtbYh6tksU6eTmObIcq) \u003csub\u003e [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1pjDJmAa9oeSquYtbYh6tksU6eTmObIcq) \u003c/sub\u003e\n- [**Attribution Methods**: Object Detection](https://colab.research.google.com/drive/1X3Yq7BduMKqTA0XEheoVIpOo3IvOrzWL) \u003csub\u003e [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1X3Yq7BduMKqTA0XEheoVIpOo3IvOrzWL) \u003c/sub\u003e\n- [**Attribution Methods**: Semantic Segmentation](https://colab.research.google.com/drive/1AHg7KO1fCOX5nZLGZfxkZ2-DLPPdSfbX) \u003csub\u003e [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1AHg7KO1fCOX5nZLGZfxkZ2-DLPPdSfbX) \u003c/sub\u003e\n- [**FORGRad**: Gradient strikes back with FORGrad](https://colab.research.google.com/drive/1ibLzn7r9QQIEmZxApObowzx8n9ukinYB) \u003csub\u003e [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1ibLzn7r9QQIEmZxApObowzx8n9ukinYB) \u003c/sub\u003e\n- [**Attribution Methods**: Metrics](https://colab.research.google.com/drive/1WEpVpFSq-oL1Ejugr8Ojb3tcbqXIOPBg) \u003csub\u003e [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1WEpVpFSq-oL1Ejugr8Ojb3tcbqXIOPBg) \u003c/sub\u003e\n\n\u003cp align=\"center\" width=\"100%\"\u003e\n    \u003ca href=\"https://colab.research.google.com/drive/1WEpVpFSq-oL1Ejugr8Ojb3tcbqXIOPBg\"\u003e \n        \u003cimg width=\"95%\" src=\"./docs/assets/metrics.jpeg\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n- [**PyTorch models**: Getting started](https://colab.research.google.com/drive/1bMlO29_0K3YnTQBbbyKQyRfo8YjvDbhe)\u003csub\u003e [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1bMlO29_0K3YnTQBbbyKQyRfo8YjvDbhe) \u003c/sub\u003e\n \n- [**Concepts Methods**: Testing with Concept Activation Vectors](https://colab.research.google.com/drive/1iuEz46ZjgG97vTBH8p-vod3y14UETvVE) \u003csub\u003e [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1iuEz46ZjgG97vTBH8p-vod3y14UETvVE) \u003c/sub\u003e\n\n\u003cp align=\"center\" width=\"100%\"\u003e\n    \u003ca href=\"https://colab.research.google.com/drive/1iuEz46ZjgG97vTBH8p-vod3y14UETvVE\"\u003e\n        \u003cimg width=\"95%\" src=\"./docs/assets/concepts.jpeg\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n- [**Concepts Methods**: CRAFT: Getting started on Tensorflow](https://colab.research.google.com/drive/1jmyhb89Bdz7H4G2KfK8uEVbSC-C_aht_)\n\u003csub\u003e [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1jmyhb89Bdz7H4G2KfK8uEVbSC-C_aht_) \u003c/sub\u003e\n- [**Concepts Methods**: CRAFT: Getting started on Pytorch](https://colab.research.google.com/drive/16Jn2pQy4gi2qQYZFnuW6ZNtVAYiNyJHO)\n\u003csub\u003e [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/16Jn2pQy4gi2qQYZFnuW6ZNtVAYiNyJHO) \u003c/sub\u003e\n\n\u003cp align=\"center\" width=\"100%\"\u003e\n    \u003ca href=\"https://colab.research.google.com/drive/1jmyhb89Bdz7H4G2KfK8uEVbSC-C_aht_\"\u003e\n        \u003cimg width=\"95%\" src=\"./docs/assets/craft.jpeg\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n- [**Feature Visualization**: Getting started](https://colab.research.google.com/drive/1st43K9AH-UL4eZM1S4QdyrOi7Epa5K8v) \u003csub\u003e [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1st43K9AH-UL4eZM1S4QdyrOi7Epa5K8v) \u003c/sub\u003e\n- [**Modern Feature Visualization with MaCo**: Getting started](https://colab.research.google.com/drive/1l0kag1o-qMY4NCbWuAwnuzkzd9sf92ic) \u003csub\u003e [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1l0kag1o-qMY4NCbWuAwnuzkzd9sf92ic) \u003c/sub\u003e\n\n\u003cp align=\"center\" width=\"100%\"\u003e\n    \u003ca href=\"https://colab.research.google.com/drive/1st43K9AH-UL4eZM1S4QdyrOi7Epa5K8v\"\u003e \n        \u003cimg width=\"95%\" src=\"./docs/assets/feature_viz.jpeg\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n- [**Example-based Methods**: Getting started](https://colab.research.google.com/drive/1gA7mhWhWzdKholZWkTvAg4FzFnzS8NHF) \u003csub\u003e [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1gA7mhWhWzdKholZWkTvAg4FzFnzS8NHF) \u003c/sub\u003e\n\nYou can find a certain number of [**other practical tutorials just here**](https://github.com/deel-ai/xplique/blob/master/TUTORIALS.md). This section is actively developed and more contents will be\nincluded. We will try to cover all the possible usage of the library, feel free to contact us if you have any suggestions or recommendations towards tutorials you would like to see.\n\n\u003c/details\u003e\n\n## 🚀 Quick Start\n\nXplique requires a version of python higher than 3.7 and several libraries including Tensorflow and Numpy. Installation can be done using Pypi:\n\n```python\npip install xplique\n```\n\nNow that Xplique is installed, here are basic examples of what you can do with the available modules.\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eAttributions Methods\u003c/b\u003e\u003c/summary\u003e\nLet's start with a simple example, by computing Grad-CAM for several images (or a complete dataset) on a trained model.\n\n```python\nfrom xplique.attributions import GradCAM\n\n# load images, labels and model\n# ...\n\nexplainer = GradCAM(model)\nexplanations = explainer.explain(images, labels)\n# or just `explainer(images, labels)`\n```\n\nAll attributions methods share a common API described [in the attributions API documentation](https://deel-ai.github.io/xplique/latest/api/attributions/api_attributions/).\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eAttributions Metrics\u003c/b\u003e\u003c/summary\u003e\n\nIn order to measure if the explanations provided by our method are faithful (it reflects well the functioning of the model) we can use a fidelity metric such as Deletion\n\n```python\nfrom xplique.attributions import GradCAM\nfrom xplique.metrics import Deletion\n\n# load images, labels and model\n# ...\n\nexplainer = GradCAM(model)\nexplanations = explainer(inputs, labels)\nmetric = Deletion(model, inputs, labels)\n\nscore_grad_cam = metric(explanations)\n```\n\nAll attributions metrics share a common API. You can find out more about it [here](https://deel-ai.github.io/xplique/latest/api/attributions/metrics/api_metrics/).\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eConcepts Extraction\u003c/b\u003e\u003c/summary\u003e\n\n### CAV\n\nConcerning the concept-based methods, we can for example extract a concept vector from a layer of a model. In order to do this, we use two datasets, one containing inputs containing the concept: `positive_samples`, the other containing other entries which do not contain the concept: `negative_samples`.\n\n```python\nfrom xplique.concepts import Cav\n\n# load a model, samples that contain a concept\n# (positive) and samples who don't (negative)\n# ...\n\nextractor = Cav(model, 'mixed3')\nconcept_vector = extractor(positive_samples,\n                           negative_samples)\n```\n\nMore information on CAV [here](https://deel-ai.github.io/xplique/latest/api/concepts/cav/) and on TCAV [here](https://deel-ai.github.io/xplique/latest/api/concepts/tcav/).\n\n### CRAFT\n\nUse Craft to investigate a single class.\n\n```python\nfrom xplique.concepts import CraftTf as Craft\n\n# Cut the model in two parts: g and h\n# Create a Craft concept extractor from these 2 models\ncraft = Craft(input_to_latent_model = g,\n              latent_to_logit_model = h)\n\n# Use Craft to compute the concepts for a specific class\ncraft.fit(images_preprocessed, class_id=rabbit_class_id)\n\n# Compute Sobol indices to understand which concept matters\nimportances = craft.estimate_importance()\n\n# Display those concepts by showing the 10 best crops for each concept\ncraft.plot_concepts_crops(nb_crops=10)\n\n```\n\nMore information in the [CRAFT documentation](https://deel-ai.github.io/xplique/latest/api/concepts/craft/).\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eFeature Visualization\u003c/b\u003e\u003c/summary\u003e\n\nFinally, in order to find an image that maximizes a neuron and at the same time a layer, we build two objectives that we combine together. We then call the optimizer which returns our images\n\n```python\nfrom xplique.features_visualizations import Objective\nfrom xplique.features_visualizations import optimize\n\n# load a model...\n\nneuron_obj = Objective.neuron(model, \"logits\", 200)\nchannel_obj = Objective.layer(model, \"mixed3\", 10)\n\nobj = neuron_obj + 2.0 * channel_obj\nimages, obj_names = optimize(obj)\n```\n\nWant to know more ? Check the Feature Viz [documentation](https://deel-ai.github.io/xplique/latest/api/feature_viz/feature_viz/)\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003ePyTorch with Xplique\u003c/b\u003e\u003c/summary\u003e\n\nEven though the library was mainly designed to be a Tensorflow toolbox we have been working on a very practical wrapper to facilitate the integration of your PyTorch models into Xplique's framework!\n\n```python\nimport torch\n\nfrom xplique.wrappers import TorchWrapper\nfrom xplique.attributions import Saliency\nfrom xplique.metrics import Deletion\n\n# load images, targets and model\n# ...\n\ndevice = 'cuda' if torch.cuda.is_available() else 'cpu'\nwrapped_model = TorchWrapper(torch_model, device)\n\nexplainer = Saliency(wrapped_model)\nexplanations = explainer(inputs, targets)\n\nmetric = Deletion(wrapped_model, inputs, targets)\nscore_saliency = metric(explanations)\n```\n\nWant to know more ? Check the [PyTorch documentation](https://deel-ai.github.io/xplique/latest/api/attributions/pytorch/)\n\n\u003c/details\u003e\n\n## 📦 What's Included\n\nThere are 4 modules in Xplique, [Attribution methods](https://deel-ai.github.io/xplique/latest/api/attributions/api_attributions/), [Attribution metrics](https://deel-ai.github.io/xplique/latest/api/attributions/metrics/api_metrics/), [Concepts](https://deel-ai.github.io/xplique/latest/api/concepts/cav/), and [Feature visualization](https://deel-ai.github.io/xplique/latest/api/feature_viz/feature_viz/). In particular, the attribution methods module supports a huge diversity of tasks:[Classification](https://deel-ai.github.io/xplique/latest/api/attributions/classification/), [Regression](https://deel-ai.github.io/xplique/latest/api/attributions/regression/), [Object Detection](https://deel-ai.github.io/xplique/latest/api/attributions/object_detection/), and [Semantic Segmentation](https://deel-ai.github.io/xplique/latest/api/attributions/semantic_segmentation/). For diverse data types: [Images, Time Series, and Tabular data](https://deel-ai.github.io/xplique/latest/api/attributions/api_attributions/). The methods compatible with such task are highlighted in the following table:\n\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eTable of attributions available\u003c/b\u003e\u003c/summary\u003e\n\n| **Attribution Method** | Type of Model            | Source                                    | Images         | Time Series and Tabular Data | Tutorial  |\n| :--------------------- | :----------------------- | :---------------------------------------- | :------------: | :--------------------------: | :-------: |\n| Deconvolution          | TF                       | [Paper](https://arxiv.org/abs/1311.2901)  | C✔️ OD❌ SS❌ | C✔️ R✔️ | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/19eB3uwAtCKZgkoWtMzrF0LTJ-htF_KE7) |\n| Grad-CAM               | TF                       | [Paper](https://arxiv.org/abs/1610.02391) | C✔️ OD❌ SS❌ | ❌      | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1nsB7xdQbU0zeYQ1-aB_D-M67-RAnvt4X) |\n| Grad-CAM++             | TF                       | [Paper](https://arxiv.org/abs/1710.11063) | C✔️ OD❌ SS❌ | ❌      | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1nsB7xdQbU0zeYQ1-aB_D-M67-RAnvt4X) |\n| Gradient Input         | TF, PyTorch**            | [Paper](https://arxiv.org/abs/1704.02685) | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/19eB3uwAtCKZgkoWtMzrF0LTJ-htF_KE7) |\n| Guided Backprop        | TF                       | [Paper](https://arxiv.org/abs/1412.6806)  | C✔️ OD❌ SS❌ | C✔️ R✔️ | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/19eB3uwAtCKZgkoWtMzrF0LTJ-htF_KE7) |\n| Integrated Gradients   | TF, PyTorch**            | [Paper](https://arxiv.org/abs/1703.01365) | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1UXJYVebDVIrkTOaOl-Zk6pHG3LWkPcLo) |\n| Kernel SHAP            | TF, PyTorch**, Callable* | [Paper](https://arxiv.org/abs/1705.07874) | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1frholXRE4XQQ3W5yZuPQ2-xqc-LTczfT) |\n| Lime                   | TF, PyTorch**, Callable* | [Paper](https://arxiv.org/abs/1602.04938) | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1frholXRE4XQQ3W5yZuPQ2-xqc-LTczfT) |\n| Occlusion              | TF, PyTorch**, Callable* | [Paper](https://arxiv.org/abs/1311.2901)  | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/15xmmlxQkNqNuXgHO51eKogXvLgs-sG4q) |\n| Rise                   | TF, PyTorch**, Callable* | [Paper](https://arxiv.org/abs/1806.07421) | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1icu2b1JGfpTRa-ic8tBSXnqqfuCGW2mO) |\n| Saliency               | TF, PyTorch**            | [Paper](https://arxiv.org/abs/1312.6034)  | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/19eB3uwAtCKZgkoWtMzrF0LTJ-htF_KE7) |\n| SmoothGrad             | TF, PyTorch**            | [Paper](https://arxiv.org/abs/1706.03825) | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/12-tlM_TdZ12oc5lNL2S2g-hcMJV8tZUD) |\n| SquareGrad             | TF, PyTorch**            | [Paper](https://arxiv.org/abs/1806.10758) | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/12-tlM_TdZ12oc5lNL2S2g-hcMJV8tZUD) |\n| VarGrad                | TF, PyTorch**            | [Paper](https://arxiv.org/abs/1810.03292) | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/12-tlM_TdZ12oc5lNL2S2g-hcMJV8tZUD) |\n| Sobol Attribution      | TF, PyTorch**            | [Paper](https://arxiv.org/abs/2111.04138) | C✔️ OD✔️ SS✔️ | 🔵      | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1XproaVxXjO9nrBSyyy7BuKJ1vy21iHs2) |\n| Hsic Attribution       | TF, PyTorch**            | [Paper](https://arxiv.org/abs/2206.06219) | C✔️ OD✔️ SS✔️ | 🔵      | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1XproaVxXjO9nrBSyyy7BuKJ1vy21iHs2) |\n| FORGrad enhancement    | TF, PyTorch**            | [Paper](https://arxiv.org/abs/2307.09591) | C✔️ OD✔️ SS✔️ | ❌      | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1ibLzn7r9QQIEmZxApObowzx8n9ukinYB) |\n\nTF : Tensorflow compatible\n\nC : [Classification](https://deel-ai.github.io/xplique/latest/api/attributions/classification/) | R : [Regression](https://deel-ai.github.io/xplique/latest/api/attributions/regression/) |\nOD : [Object Detection](https://deel-ai.github.io/xplique/latest/api/attributions/object_detection/) | SS :  [Semantic Segmentation (SS)](https://deel-ai.github.io/xplique/latest/api/attributions/semantic_segmentation/)\n\n\\* : See the [Callable documentation](https://deel-ai.github.io/xplique/latest/api/attributions/callable/)\n\n** : See the [Xplique for PyTorch documentation](https://deel-ai.github.io/xplique/latest/api/attributions/pytorch/), and the [**PyTorch models**: Getting started](https://colab.research.google.com/drive/1bMlO29_0K3YnTQBbbyKQyRfo8YjvDbhe) notebook.\n\n✔️ : Supported by Xplique | ❌ : Not applicable | 🔵 : Work in Progress\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eTable of attribution's metric available\u003c/b\u003e\u003c/summary\u003e\n\n| **Attribution Metrics** | Type of Model | Property         | Source                                    |\n| :---------------------- | :------------ | :--------------- | :---------------------------------------- |\n| MuFidelity              | TF, PyTorch** | Fidelity         | [Paper](https://arxiv.org/abs/2005.00631) |\n| Deletion                | TF, PyTorch** | Fidelity         | [Paper](https://arxiv.org/abs/1806.07421) |\n| Insertion               | TF, PyTorch** | Fidelity         | [Paper](https://arxiv.org/abs/1806.07421) |\n| Average Stability       | TF, PyTorch** | Stability        | [Paper](https://arxiv.org/abs/2005.00631) |\n| MeGe                    | TF, PyTorch** | Representativity | [Paper](https://arxiv.org/abs/2009.04521) |\n| ReCo                    | TF, PyTorch** | Consistency      | [Paper](https://arxiv.org/abs/2009.04521) |\n| (WIP) e-robustness      |\n\nTF : Tensorflow compatible\n\n** : See the [Xplique for PyTorch documentation](https://deel-ai.github.io/xplique/latest/api/attributions/pytorch/), and the [**PyTorch models**: Getting started](https://colab.research.google.com/drive/1bMlO29_0K3YnTQBbbyKQyRfo8YjvDbhe) notebook.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eTable of concept methods available\u003c/b\u003e\u003c/summary\u003e\n\n| **Concepts method**             | Type of Model | Source                                        | Tutorial       |\n| :------------------------------ | :------------ | :-------------------------------------------- | :------------  |\n| Concept Activation Vector (CAV) | TF            | [Paper](https://arxiv.org/pdf/1711.11279.pdf) | |\n| Testing CAV (TCAV)              | TF            | [Paper](https://arxiv.org/pdf/1711.11279.pdf) | |\n| CRAFT Tensorflow | TF | [Paper](https://arxiv.org/pdf/2211.10154.pdf) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1jmyhb89Bdz7H4G2KfK8uEVbSC-C_aht_) |\n| CRAFT PyTorch  | PyTorch** | [Paper](https://arxiv.org/pdf/2211.10154.pdf) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/16Jn2pQy4gi2qQYZFnuW6ZNtVAYiNyJHO) |\n| (WIP) Robust TCAV               |               | | |\n| (WIP) Automatic Concept Extraction (ACE)        | | |\n\nTF : Tensorflow compatible\n\n** : See the [Xplique for Pytorch documentation](https://deel-ai.github.io/xplique/latest/pytorch/), and the [**PyTorch's model**: Getting started](https://colab.research.google.com/drive/1bMlO29_0K3YnTQBbbyKQyRfo8YjvDbhe)\u003csub\u003e [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1bMlO29_0K3YnTQBbbyKQyRfo8YjvDbhe) \u003c/sub\u003e notebook\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eTable of Feature Visualization methods available\u003c/b\u003e\u003c/summary\u003e\n\n| **Feature Visualization** [(Paper)](https://distill.pub/2017/feature-visualization/) | Type of Model | Details                                                                                                            |\n| :----------------------------------------------------------------------------------- | :------------ | :----------------------------------------------------------------------------------------------------------------- |\n| Neurons                                                                              | TF            | Optimizes for specific neurons                                                                              |\n| Layer                                                                                | TF            | Optimizes for specific layers                                                                               |\n| Channel                                                                              | TF            | Optimizes for specific channels                                                                             |\n| Direction                                                                            | TF            | Optimizes for specific vector                                                                               |\n| Fourrier Preconditioning                                                             | TF            | Optimize in Fourier basis (see [preconditioning](https://distill.pub/2017/feature-visualization/#preconditioning)) |\n| Objective combination                                                                | TF            | Allows to combine objectives                                                                                       |\n| MaCo                                                                                 | TF            | Fixed Magnitude optimisation, see [Paper](https://arxiv.org/pdf/2306.06805.pdf)                                                                                       |\n\n\nTF : Tensorflow compatible\n\n\u003c/details\u003e\n\nEven though we are only at the early stages, we have also recently added an [Example-based methods](api/example_based/api_example_based/) module. Do not hesitate to give us feedback! Currently, the methods available are summarized in the following table:\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eTable of example-based methods available\u003c/b\u003e\u003c/summary\u003e\n\n| Method | Family | Documentation | Tutorial |\n| --- | --- | --- | --- |\n| `SimilarExamples` | Similar Examples | [SimilarExamples](../similar_examples/similar_examples/) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1gA7mhWhWzdKholZWkTvAg4FzFnzS8NHF) |\n| `Cole` | Similar Examples | [Cole](../similar_examples/cole/) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1gA7mhWhWzdKholZWkTvAg4FzFnzS8NHF) |\n|  |  |  |\n| `NaiveCounterFactuals` | Counter Factuals | [NaiveCounterFactuals](../counterfactuals/naive_counter_factuals/) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1gA7mhWhWzdKholZWkTvAg4FzFnzS8NHF) |\n| `LabelAwareCounterFactuals` | Counter Factuals | [LabelAwareCounterFactuals](../counterfactuals/label_aware_counter_factuals/) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1gA7mhWhWzdKholZWkTvAg4FzFnzS8NHF) |\n||||\n| `KLEORSimMiss` | Semi Factuals | [KLEOR](../semifactuals/kleor/) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1gA7mhWhWzdKholZWkTvAg4FzFnzS8NHF) |\n| `KLEORGlobalSim` | Semi Factuals | [KLEOR](../semifactuals/kleor/) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1gA7mhWhWzdKholZWkTvAg4FzFnzS8NHF) |\n||||\n| `ProtoGreedy` | Prototypes | [ProtoGreedy](../prototypes/proto_greedy/) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1OI3oa884GwGbXlzn3Y9NH-1j4cSaQb0w) |\n| `ProtoDash` | Prototypes | [ProtoDash](../prototypes/proto_dash/) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1OI3oa884GwGbXlzn3Y9NH-1j4cSaQb0w) |\n| `MMDCritic` | Prototypes | [MMDCritic](../prototypes/mmd_critic/) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1OI3oa884GwGbXlzn3Y9NH-1j4cSaQb0w) |\n\n\u003c/details\u003e\n\n## 👍 Contributing\n\nFeel free to propose your ideas or come and contribute with us on the Xplique toolbox! We have a specific document where we describe in a simple way how to make your first pull request: [just here](https://github.com/deel-ai/xplique/blob/master/CONTRIBUTING.md).\n\n## 👀 See Also\n\nThis library is one approach of many to explain your model. We don't expect it to be the perfect\n solution, we create it to explore one point in the space of possibilities.\n\n\u003cdetails\u003e\n\u003csummary\u003e Other interesting tools to explain your model: \u003c/summary\u003e\n\n- [Lucid](https://github.com/tensorflow/lucid) the wonderful library specialized in feature visualization from OpenAI.\n- [Captum](https://captum.ai/) the PyTorch library for Interpretability research\n- [Tf-explain](https://github.com/sicara/tf-explain) that implement multiples attribution methods and propose callbacks API for tensorflow.\n- [Alibi Explain](https://github.com/SeldonIO/alibi) for model inspection and interpretation\n- [SHAP](https://github.com/slundberg/shap) a very popular library to compute local explanations using the classic Shapley values from game theory and their related extensions\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eTo learn more about Explainable AI in general: \u003c/summary\u003e\n\n- [Interpretable Machine Learning](https://christophm.github.io/interpretable-ml-book/) by Christophe Molnar.\n- [Interpretability Beyond Feature Attribution](https://www.youtube.com/watch?v=Ff-Dx79QEEY) by Been Kim.\n- [Explaining ML Predictions: State-of-the-art, Challenges, and Opportunities](https://www.youtube.com/watch?v=7dpOSmQ89L8) by Himabindu Lakkaraju, Julius Adebayo and Sameer Singh.\n- [A Roadmap for the Rigorous Science of Interpretability](https://www.youtube.com/watch?v=MMxZlr_L6YE) by Finale Doshi-Velez.\n- [DEEL White paper](https://arxiv.org/abs/2103.10529) a summary of the DEEL team on the challenges of certifiable AI and the role of explainability for this purpose\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e More from the DEEL project: \u003c/summary\u003e\n\n- [deel-lip](https://github.com/deel-ai/deel-lip) a Python library for training k-Lipschitz neural networks on TF.\n- [deel-torchlip](https://github.com/deel-ai/deel-torchlip) a Python library for training k-Lipschitz neural networks on PyTorch.\n- [Influenciae](https://github.com/deel-ai/influenciae) Python toolkit dedicated to computing influence values for the discovery of potentially problematic samples in a dataset.\n- [LARD](https://github.com/deel-ai/LARD) Landing Approach Runway Detection (LARD) is a dataset of aerial front view images of runways designed for aircraft landing phase\n- [PUNCC](https://github.com/deel-ai/puncc) Puncc (Predictive uncertainty calibration and conformalization) is an open-source Python library that integrates a collection of state-of-the-art conformal prediction algorithms and related techniques for regression and classification problems\n- [OODEEL](https://github.com/deel-ai/oodeel) OODeel is a library that performs post-hoc deep OOD detection on already trained neural network image classifiers. The philosophy of the library is to favor quality over quantity and to foster easy adoption\n- [DEEL White paper](https://arxiv.org/abs/2103.10529) a summary of the DEEL team on the challenges of certifiable AI and the role of data quality, representativity and explainability for this purpose.\n\n\u003c/details\u003e\n\n## 🙏 Acknowledgments\n\n\u003cdiv align=\"right\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"docs/assets/deel_dark.png\"  width=\"25%\" align=\"right\"\u003e\n    \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"docs/assets/deel_light.png\"  width=\"25%\" align=\"right\"\u003e\n    \u003cimg alt=\"DEEL Logo\" src=\"docs/assets/deel_dark.png\" width=\"25%\" align=\"right\"\u003e\n  \u003c/picture\u003e\n\u003c/div\u003e\nThis project received funding from the French ”Investing for the Future – PIA3” program within the Artificial and Natural Intelligence Toulouse Institute (ANITI). The authors gratefully acknowledge the support of the \u003ca href=\"https://www.deel.ai/\"\u003e DEEL \u003c/a\u003e project.\n\n## 👨‍🎓 Creators\n\nThis library was started as a side-project by [Thomas FEL](http://thomasfel.fr) who is\ncurrently a graduate student at the Artificial and Natural Intelligence Toulouse Institute under\nthe direction of [Thomas SERRE](https://serre-lab.clps.brown.edu). His thesis work focuses on\nexplainability for deep neural networks.\n\nHe then received help from some members of the \u003ca href=\"https://www.deel.ai/\"\u003e DEEL \u003c/a\u003e team\nto enhance the library namely from [Lucas Hervier](https://github.com/lucashervier) and [Antonin Poché](https://github.com/AntoninPoche).\n\n\n## 🗞️ Citation\n\nIf you use Xplique as part of your workflow in a scientific publication, please consider citing the 🗞️ [Xplique official paper](https://arxiv.org/abs/2206.04394):\n\n```\n@article{fel2022xplique,\n  title={Xplique: A Deep Learning Explainability Toolbox},\n  author={Fel, Thomas and Hervier, Lucas and Vigouroux, David and Poche, Antonin and Plakoo, Justin and Cadene, Remi and Chalvidal, Mathieu and Colin, Julien and Boissin, Thibaut and Bethune, Louis and Picard, Agustin and Nicodeme, Claire \n          and Gardes, Laurent and Flandin, Gregory and Serre, Thomas},\n  journal={Workshop on Explainable Artificial Intelligence for Computer Vision (CVPR)},\n  year={2022}\n}\n```\n\n## 📝 License\n\nThe package is released under \u003ca href=\"https://choosealicense.com/licenses/mit\"\u003e MIT license\u003c/a\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeel-ai%2Fxplique","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeel-ai%2Fxplique","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeel-ai%2Fxplique/lists"}