[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-deel-ai--xplique":3,"tool-deel-ai--xplique":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",155373,2,"2026-04-14T11:34:08",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":67,"readme_en":68,"readme_zh":69,"quickstart_zh":70,"use_case_zh":71,"hero_image_url":72,"owner_login":73,"owner_name":74,"owner_avatar_url":75,"owner_bio":76,"owner_company":77,"owner_location":77,"owner_email":77,"owner_twitter":77,"owner_website":78,"owner_url":79,"languages":80,"stars":89,"forks":90,"last_commit_at":91,"license":92,"difficulty_score":32,"env_os":93,"env_gpu":94,"env_ram":94,"env_deps":95,"category_tags":101,"github_topics":103,"view_count":32,"oss_zip_url":77,"oss_zip_packed_at":77,"status":17,"created_at":108,"updated_at":109,"faqs":110,"releases":145},7465,"deel-ai\u002Fxplique","xplique","👋 Xplique is a Neural Networks Explainability Toolbox","Xplique 是一款专为神经网络可解释性打造的 Python 工具箱，旨在帮助用户深入理解复杂深度学习模型的决策逻辑。它解决了人工智能领域长期存在的“黑盒”难题，让模型如何得出结论变得透明、可信且易于分析。\n\n这款工具非常适合 AI 研究人员、数据科学家以及需要调试或优化模型的开发者使用。无论是基于 TensorFlow 构建的模型，还是部分 PyTorch 模型，Xplique 都能提供强大的支持。其核心亮点在于模块化设计：内置的“归因方法”模块集成了 Saliency、Grad-CAM、Integrated-Gradients 等前沿算法，并附带论文链接与实例；“特征可视化”模块能展示神经元如何识别图像特征；“概念”模块支持提取并验证人类可理解的概念；而独特的“基于示例”模块则能通过检索相似或对比样本来解释模型行为。此外，Xplique 还提供了完善的评估指标，帮助用户量化和比较不同解释方法的效果。\n\n作为连接理论与实践的桥梁，Xplique 不仅汇总了可解释性人工智能（XAI）领域的最新成果，还通过丰富的教程和文档降低了使用门槛。如果你希望让模型决策过程不再神秘，Xplique","Xplique 是一款专为神经网络可解释性打造的 Python 工具箱，旨在帮助用户深入理解复杂深度学习模型的决策逻辑。它解决了人工智能领域长期存在的“黑盒”难题，让模型如何得出结论变得透明、可信且易于分析。\n\n这款工具非常适合 AI 研究人员、数据科学家以及需要调试或优化模型的开发者使用。无论是基于 TensorFlow 构建的模型，还是部分 PyTorch 模型，Xplique 都能提供强大的支持。其核心亮点在于模块化设计：内置的“归因方法”模块集成了 Saliency、Grad-CAM、Integrated-Gradients 等前沿算法，并附带论文链接与实例；“特征可视化”模块能展示神经元如何识别图像特征；“概念”模块支持提取并验证人类可理解的概念；而独特的“基于示例”模块则能通过检索相似或对比样本来解释模型行为。此外，Xplique 还提供了完善的评估指标，帮助用户量化和比较不同解释方法的效果。\n\n作为连接理论与实践的桥梁，Xplique 不仅汇总了可解释性人工智能（XAI）领域的最新成果，还通过丰富的教程和文档降低了使用门槛。如果你希望让模型决策过程不再神秘，Xplique 将是你值得信赖的得力助手。","\u003Cdiv align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdeel-ai_xplique_readme_8fd949ecb387.png\" width=\"75%\" alt=\"Xplique\" align=\"center\" \u002F>\n\u003C\u002Fdiv>\n\u003Cbr>\n\n\u003Cdiv align=\"center\">\n    \u003Ca href=\"#\">\n        \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPython-3.10, 3.11, 3.12, 3.13, 3.14-efefef\">\n    \u003C\u002Fa>\n    \u003Ca href=\"#\">\n        \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FTensorflow-2.5, ..., 2.15-00008b\">\n    \u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Fxplique\u002Factions\u002Fworkflows\u002Fpython-lints.yml\">\n        \u003Cimg alt=\"PyLint\" src=\"https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Fxplique\u002Factions\u002Fworkflows\u002Fpython-lints.yml\u002Fbadge.svg\">\n    \u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Fxplique\u002Factions\u002Fworkflows\u002Fpython-tests.yml\">\n        \u003Cimg alt=\"Tests\" src=\"https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Fxplique\u002Factions\u002Fworkflows\u002Fpython-tests.yml\u002Fbadge.svg\">\n    \u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Fxplique\u002Factions\u002Fworkflows\u002Fpython-publish.yml\">\n        \u003Cimg alt=\"Pypi\" src=\"https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Fxplique\u002Factions\u002Fworkflows\u002Fpython-publish.yml\u002Fbadge.svg\">\n    \u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fpepy.tech\u002Fproject\u002Fxplique\">\n        \u003Cimg alt=\"Pepy\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdeel-ai_xplique_readme_dc959cc4f4f5.png\">\n    \u003C\u002Fa>\n    \u003Ca href=\"#\">\n        \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-efefef\">\n    \u003C\u002Fa>\n\u003C\u002Fdiv>\n\u003Cbr>\n\n\u003Cp align=\"center\">\n    🦊 \u003Cb>Xplique\u003C\u002Fb> (pronounced \u003Ci>\\ɛks.plik\\\u003C\u002Fi>) 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>\n  \u003Ca href=\"https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002F\">📘 \u003Cstrong>Explore Xplique docs\u003C\u002Fstrong>\u003C\u002Fa>\n    |  \n  \u003Ca href=\"https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Ftutorials\u002F\">\u003Cstrong>Explore Xplique tutorials\u003C\u002Fstrong> 🔥\u003C\u002Fa>\n  \u003Cbr>\n  \u003Cbr>\n  \u003Ca href=\"https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fapi_attributions\u002F\">Attributions\u003C\u002Fa>\n  ·\n  \u003Ca href=\"https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fconcepts\u002Fcav\u002F\">Concept\u003C\u002Fa>\n  ·\n  \u003Ca href=\"https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Ffeature_viz\u002Ffeature_viz\u002F\">Feature Visualization\u003C\u002Fa>\n  ·\n  \u003Ca href=\"https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fmetrics\u002Fapi_metrics\u002F\">Metrics\u003C\u002Fa>\n  .\n  \u003Ca href=\"api\u002Fexample_based\u002Fapi_example_based\u002F\">Example-based\u003C\u002Fa>\n\u003C\u002Fp>\n\n> [!IMPORTANT]  \n> 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, FEM, 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%\">\n    \u003Cimg width=\"95%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdeel-ai_xplique_readme_d89e2e6cf8a6.png\">\n\u003C\u002Fp>\n\n\u003Cbr>\n\n> [!NOTE]  \n> 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>\n\u003Csummary>We propose some Hands-on tutorials to get familiar with the library and its api:\u003C\u002Fsummary>\n\n- [**Attribution Methods**: Getting started](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1XproaVxXjO9nrBSyyy7BuKJ1vy21iHs2) \u003Csub> [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1XproaVxXjO9nrBSyyy7BuKJ1vy21iHs2) \u003C\u002Fsub>\n\n\u003Cp align=\"center\" width=\"100%\">\n    \u003Ca href=\"https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1XproaVxXjO9nrBSyyy7BuKJ1vy21iHs2\">\n        \u003Cimg width=\"95%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdeel-ai_xplique_readme_75d3c2503a98.jpeg\">\n    \u003C\u002Fa>\n\u003C\u002Fp>\n\n- [**Attribution Methods**: Sanity checks paper](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1uJOmAg6RjlOIJj6SWN9sYRamBdHAuyaS) \u003Csub> [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1uJOmAg6RjlOIJj6SWN9sYRamBdHAuyaS) \u003C\u002Fsub>\n- [**Attribution Methods**: Tabular data and Regression](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1pjDJmAa9oeSquYtbYh6tksU6eTmObIcq) \u003Csub> [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1pjDJmAa9oeSquYtbYh6tksU6eTmObIcq) \u003C\u002Fsub>\n- [**Attribution Methods**: Object Detection](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1X3Yq7BduMKqTA0XEheoVIpOo3IvOrzWL) \u003Csub> [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1X3Yq7BduMKqTA0XEheoVIpOo3IvOrzWL) \u003C\u002Fsub>\n- [**Attribution Methods**: Semantic Segmentation](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1AHg7KO1fCOX5nZLGZfxkZ2-DLPPdSfbX) \u003Csub> [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1AHg7KO1fCOX5nZLGZfxkZ2-DLPPdSfbX) \u003C\u002Fsub>\n- [**FORGRad**: Gradient strikes back with FORGrad](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1ibLzn7r9QQIEmZxApObowzx8n9ukinYB) \u003Csub> [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1ibLzn7r9QQIEmZxApObowzx8n9ukinYB) \u003C\u002Fsub>\n- [**Attribution Methods**: Metrics](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1WEpVpFSq-oL1Ejugr8Ojb3tcbqXIOPBg) \u003Csub> [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1WEpVpFSq-oL1Ejugr8Ojb3tcbqXIOPBg) \u003C\u002Fsub>\n- [**Attribution Methods**: Complexity Metrics](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F13boAsXGVKS0LaNzslOdjSkYIrpBJdh7K) \u003Csub> [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F13boAsXGVKS0LaNzslOdjSkYIrpBJdh7K) \u003C\u002Fsub>\n- [**Attribution Methods**: Randomization Metrics](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F13lNkZqKajRJ63XllkQddgrPOYF1Xv9-Y) \u003Csub> [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F13lNkZqKajRJ63XllkQddgrPOYF1Xv9-Y) \u003C\u002Fsub>\n- [**Attribution Methods**: Average Drop\u002FIncrease\u002FGain Fidelity Metrics](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1nGP13qiQrsJMBx8TXgA69D-5ALoP3l9p) \u003Csub> [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1nGP13qiQrsJMBx8TXgA69D-5ALoP3l9p) \u003C\u002Fsub>\n\n\u003Cp align=\"center\" width=\"100%\">\n    \u003Ca href=\"https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1WEpVpFSq-oL1Ejugr8Ojb3tcbqXIOPBg\"> \n        \u003Cimg width=\"95%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdeel-ai_xplique_readme_4f5f43c1780a.jpeg\">\n    \u003C\u002Fa>\n\u003C\u002Fp>\n\n- [**PyTorch models**: Getting started](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1bMlO29_0K3YnTQBbbyKQyRfo8YjvDbhe)\u003Csub> [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1bMlO29_0K3YnTQBbbyKQyRfo8YjvDbhe) \u003C\u002Fsub>\n \n- [**Concepts Methods**: Testing with Concept Activation Vectors](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1iuEz46ZjgG97vTBH8p-vod3y14UETvVE) \u003Csub> [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1iuEz46ZjgG97vTBH8p-vod3y14UETvVE) \u003C\u002Fsub>\n\n\u003Cp align=\"center\" width=\"100%\">\n    \u003Ca href=\"https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1iuEz46ZjgG97vTBH8p-vod3y14UETvVE\">\n        \u003Cimg width=\"95%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdeel-ai_xplique_readme_6271b8dd8b59.jpeg\">\n    \u003C\u002Fa>\n\u003C\u002Fp>\n\n- [**Concepts Methods**: CRAFT: Getting started on Tensorflow](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1jmyhb89Bdz7H4G2KfK8uEVbSC-C_aht_)\n\u003Csub> [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1jmyhb89Bdz7H4G2KfK8uEVbSC-C_aht_) \u003C\u002Fsub>\n- [**Concepts Methods**: CRAFT: Getting started on Pytorch](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F16Jn2pQy4gi2qQYZFnuW6ZNtVAYiNyJHO)\n\u003Csub> [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F16Jn2pQy4gi2qQYZFnuW6ZNtVAYiNyJHO) \u003C\u002Fsub>\n\n\u003Cp align=\"center\" width=\"100%\">\n    \u003Ca href=\"https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1jmyhb89Bdz7H4G2KfK8uEVbSC-C_aht_\">\n        \u003Cimg width=\"95%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdeel-ai_xplique_readme_cbec1890a9d9.jpeg\">\n    \u003C\u002Fa>\n\u003C\u002Fp>\n\n- [**Feature Visualization**: Getting started](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1st43K9AH-UL4eZM1S4QdyrOi7Epa5K8v) \u003Csub> [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1st43K9AH-UL4eZM1S4QdyrOi7Epa5K8v) \u003C\u002Fsub>\n- [**Modern Feature Visualization with MaCo**: Getting started](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1l0kag1o-qMY4NCbWuAwnuzkzd9sf92ic) \u003Csub> [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1l0kag1o-qMY4NCbWuAwnuzkzd9sf92ic) \u003C\u002Fsub>\n\n\u003Cp align=\"center\" width=\"100%\">\n    \u003Ca href=\"https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1st43K9AH-UL4eZM1S4QdyrOi7Epa5K8v\"> \n        \u003Cimg width=\"95%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdeel-ai_xplique_readme_b2c42859d3ef.jpeg\">\n    \u003C\u002Fa>\n\u003C\u002Fp>\n\n- [**Example-based Methods**: Getting started](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1gA7mhWhWzdKholZWkTvAg4FzFnzS8NHF) \u003Csub> [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1gA7mhWhWzdKholZWkTvAg4FzFnzS8NHF) \u003C\u002Fsub>\n\nYou can find a certain number of [**other practical tutorials just here**](https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Fxplique\u002Fblob\u002Fmaster\u002FTUTORIALS.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\u002Fdetails>\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>\n\u003Csummary>\u003Cb>Attributions Methods\u003C\u002Fb>\u003C\u002Fsummary>\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:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fapi_attributions\u002F).\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Attributions Metrics\u003C\u002Fb>\u003C\u002Fsummary>\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:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fmetrics\u002Fapi_metrics\u002F).\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Concepts Extraction\u003C\u002Fb>\u003C\u002Fsummary>\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:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fconcepts\u002Fcav\u002F) and on TCAV [here](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fconcepts\u002Ftcav\u002F).\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:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fconcepts\u002Fcraft\u002F).\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Feature Visualization\u003C\u002Fb>\u003C\u002Fsummary>\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:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Ffeature_viz\u002Ffeature_viz\u002F)\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>PyTorch with Xplique\u003C\u002Fb>\u003C\u002Fsummary>\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:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fpytorch\u002F)\n\n\u003C\u002Fdetails>\n\n## 📦 What's Included\n\nThere are 4 modules in Xplique, [Attribution methods](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fapi_attributions\u002F), [Attribution metrics](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fmetrics\u002Fapi_metrics\u002F), [Concepts](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fconcepts\u002Fcav\u002F), and [Feature visualization](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Ffeature_viz\u002Ffeature_viz\u002F). In particular, the attribution methods module supports a huge diversity of tasks:[Classification](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fclassification\u002F), [Regression](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fregression\u002F), [Object Detection](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fobject_detection\u002F), and [Semantic Segmentation](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fsemantic_segmentation\u002F). For diverse data types: [Images, Time Series, and Tabular data](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fapi_attributions\u002F). The methods compatible with such task are highlighted in the following table:\n\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Table of attributions available\u003C\u002Fb>\u003C\u002Fsummary>\n\n| **Attribution Method** | Type of Model            | Source                                    | Images         | Time Series and Tabular Data | Tutorial  |\n| :--------------------- | :----------------------- | :---------------------------------------- | :------------: | :--------------------------: | :-------: |\n| Deconvolution          | TF                       | [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1311.2901)  | C✔️ OD❌ SS❌ | C✔️ R✔️ | [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F19eB3uwAtCKZgkoWtMzrF0LTJ-htF_KE7) |\n| FEM                    | TF                       | [Paper](https:\u002F\u002Fhal.science\u002Fhal-02963298\u002Fdocument) | C✔️ OD❌ SS❌ | ❌      | [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1fghFJylXtM18VCxoqYbOhvkXLUPHalBf\u002Fview?usp=sharing) |\n| Grad-CAM               | TF                       | [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1610.02391) | C✔️ OD❌ SS❌ | ❌      | [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1nsB7xdQbU0zeYQ1-aB_D-M67-RAnvt4X) |\n| Grad-CAM++             | TF                       | [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1710.11063) | C✔️ OD❌ SS❌ | ❌      | [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1nsB7xdQbU0zeYQ1-aB_D-M67-RAnvt4X) |\n| Gradient Input         | TF, PyTorch**            | [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1704.02685) | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F19eB3uwAtCKZgkoWtMzrF0LTJ-htF_KE7) |\n| Guided Backprop        | TF                       | [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1412.6806)  | C✔️ OD❌ SS❌ | C✔️ R✔️ | [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F19eB3uwAtCKZgkoWtMzrF0LTJ-htF_KE7) |\n| Integrated Gradients   | TF, PyTorch**            | [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1703.01365) | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1UXJYVebDVIrkTOaOl-Zk6pHG3LWkPcLo) |\n| Kernel SHAP            | TF, PyTorch**, Callable* | [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1705.07874) | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1frholXRE4XQQ3W5yZuPQ2-xqc-LTczfT) |\n| Lime                   | TF, PyTorch**, Callable* | [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1602.04938) | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1frholXRE4XQQ3W5yZuPQ2-xqc-LTczfT) |\n| Occlusion              | TF, PyTorch**, Callable* | [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1311.2901)  | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F15xmmlxQkNqNuXgHO51eKogXvLgs-sG4q) |\n| Rise                   | TF, PyTorch**, Callable* | [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1806.07421) | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1icu2b1JGfpTRa-ic8tBSXnqqfuCGW2mO) |\n| Saliency               | TF, PyTorch**            | [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1312.6034)  | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F19eB3uwAtCKZgkoWtMzrF0LTJ-htF_KE7) |\n| SmoothGrad             | TF, PyTorch**            | [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1706.03825) | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F12-tlM_TdZ12oc5lNL2S2g-hcMJV8tZUD) |\n| SquareGrad             | TF, PyTorch**            | [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1806.10758) | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F12-tlM_TdZ12oc5lNL2S2g-hcMJV8tZUD) |\n| VarGrad                | TF, PyTorch**            | [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1810.03292) | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F12-tlM_TdZ12oc5lNL2S2g-hcMJV8tZUD) |\n| Sobol Attribution      | TF, PyTorch**            | [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2111.04138) | C✔️ OD✔️ SS✔️ | 🔵      | [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1XproaVxXjO9nrBSyyy7BuKJ1vy21iHs2) |\n| Hsic Attribution       | TF, PyTorch**            | [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2206.06219) | C✔️ OD✔️ SS✔️ | 🔵      | [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1XproaVxXjO9nrBSyyy7BuKJ1vy21iHs2) |\n| FORGrad enhancement    | TF, PyTorch**            | [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2307.09591) | C✔️ OD✔️ SS✔️ | ❌      | [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1ibLzn7r9QQIEmZxApObowzx8n9ukinYB) |\n\nTF : Tensorflow compatible\n\nC : [Classification](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fclassification\u002F) | R : [Regression](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fregression\u002F) |\nOD : [Object Detection](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fobject_detection\u002F) | SS :  [Semantic Segmentation (SS)](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fsemantic_segmentation\u002F)\n\n\\* : See the [Callable documentation](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fcallable\u002F)\n\n** : See the [Xplique for PyTorch documentation](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fpytorch\u002F), and the [**PyTorch models**: Getting started](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1bMlO29_0K3YnTQBbbyKQyRfo8YjvDbhe) notebook.\n\n✔️ : Supported by Xplique | ❌ : Not applicable | 🔵 : Work in Progress\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Table of attribution's metric available\u003C\u002Fb>\u003C\u002Fsummary>\n\n| **Attribution Metrics** | Type of Model | Property         | Source                                    |\n| :---------------------- | :------------ | :--------------- | :---------------------------------------- |\n| MuFidelity              | TF, PyTorch** | Fidelity         | [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2005.00631) |\n| Deletion                | TF, PyTorch** | Fidelity         | [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1806.07421) |\n| Insertion               | TF, PyTorch** | Fidelity         | [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1806.07421) |\n| AverageDropMetric       | TF, PyTorch** | Fidelity         | [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1710.11063) |\n| AverageIncreaseMetric   | TF, PyTorch** | Fidelity         | [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1710.11063) |\n| AverageGainMetric       | TF, PyTorch** | Fidelity         | [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2301.07002) |\n| Average Stability       | TF, PyTorch** | Stability        | [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2005.00631) |\n| MeGe                    | TF, PyTorch** | Representativity | [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2009.04521) |\n| ReCo                    | TF, PyTorch** | Consistency      | [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2009.04521) |\n| Complexity              | TF, PyTorch** | Complexity       | [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2005.00631) |\n| Sparseness              | TF, PyTorch** | Complexity       | [Paper](https:\u002F\u002Fproceedings.mlr.press\u002Fv119\u002Fchalasani20a.html) |\n| RandomLogitMetric       | TF, PyTorch** | Randomization    | [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1810.03292) |\n| ModelRandomizationMetric| TF, PyTorch** | Randomization    | [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1810.03292) |\n| (WIP) e-robustness      |\n\nTF : Tensorflow compatible\n\n** : See the [Xplique for PyTorch documentation](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fpytorch\u002F), and the [**PyTorch models**: Getting started](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1bMlO29_0K3YnTQBbbyKQyRfo8YjvDbhe) notebook.\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Table of concept methods available\u003C\u002Fb>\u003C\u002Fsummary>\n\n| **Concepts method**             | Type of Model | Source                                        | Tutorial       |\n| :------------------------------ | :------------ | :-------------------------------------------- | :------------  |\n| Concept Activation Vector (CAV) | TF            | [Paper](https:\u002F\u002Farxiv.org\u002Fpdf\u002F1711.11279.pdf) | |\n| Testing CAV (TCAV)              | TF            | [Paper](https:\u002F\u002Farxiv.org\u002Fpdf\u002F1711.11279.pdf) | |\n| CRAFT Tensorflow | TF | [Paper](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2211.10154.pdf) | [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1jmyhb89Bdz7H4G2KfK8uEVbSC-C_aht_) |\n| CRAFT PyTorch  | PyTorch** | [Paper](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2211.10154.pdf) | [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F16Jn2pQy4gi2qQYZFnuW6ZNtVAYiNyJHO) |\n| (WIP) Robust TCAV               |               | | |\n| (WIP) Automatic Concept Extraction (ACE)        | | |\n\nTF : Tensorflow compatible\n\n** : See the [Xplique for Pytorch documentation](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fpytorch\u002F), and the [**PyTorch's model**: Getting started](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1bMlO29_0K3YnTQBbbyKQyRfo8YjvDbhe)\u003Csub> [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1bMlO29_0K3YnTQBbbyKQyRfo8YjvDbhe) \u003C\u002Fsub> notebook\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Table of Feature Visualization methods available\u003C\u002Fb>\u003C\u002Fsummary>\n\n| **Feature Visualization** [(Paper)](https:\u002F\u002Fdistill.pub\u002F2017\u002Ffeature-visualization\u002F) | 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:\u002F\u002Fdistill.pub\u002F2017\u002Ffeature-visualization\u002F#preconditioning)) |\n| Objective combination                                                                | TF            | Allows to combine objectives                                                                                       |\n| MaCo                                                                                 | TF            | Fixed Magnitude optimisation, see [Paper](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2306.06805.pdf)                                                                                       |\n\n\nTF : Tensorflow compatible\n\n\u003C\u002Fdetails>\n\nEven though we are only at the early stages, we have also recently added an [Example-based methods](api\u002Fexample_based\u002Fapi_example_based\u002F) module. Do not hesitate to give us feedback! Currently, the methods available are summarized in the following table:\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Table of example-based methods available\u003C\u002Fb>\u003C\u002Fsummary>\n\n| Method | Family | Documentation | Tutorial |\n| --- | --- | --- | --- |\n| `SimilarExamples` | Similar Examples | [SimilarExamples](..\u002Fsimilar_examples\u002Fsimilar_examples\u002F) | [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1gA7mhWhWzdKholZWkTvAg4FzFnzS8NHF) |\n| `Cole` | Similar Examples | [Cole](..\u002Fsimilar_examples\u002Fcole\u002F) | [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1gA7mhWhWzdKholZWkTvAg4FzFnzS8NHF) |\n|  |  |  |\n| `NaiveCounterFactuals` | Counter Factuals | [NaiveCounterFactuals](..\u002Fcounterfactuals\u002Fnaive_counter_factuals\u002F) | [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1gA7mhWhWzdKholZWkTvAg4FzFnzS8NHF) |\n| `LabelAwareCounterFactuals` | Counter Factuals | [LabelAwareCounterFactuals](..\u002Fcounterfactuals\u002Flabel_aware_counter_factuals\u002F) | [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1gA7mhWhWzdKholZWkTvAg4FzFnzS8NHF) |\n||||\n| `KLEORSimMiss` | Semi Factuals | [KLEOR](..\u002Fsemifactuals\u002Fkleor\u002F) | [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1gA7mhWhWzdKholZWkTvAg4FzFnzS8NHF) |\n| `KLEORGlobalSim` | Semi Factuals | [KLEOR](..\u002Fsemifactuals\u002Fkleor\u002F) | [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1gA7mhWhWzdKholZWkTvAg4FzFnzS8NHF) |\n||||\n| `ProtoGreedy` | Prototypes | [ProtoGreedy](..\u002Fprototypes\u002Fproto_greedy\u002F) | [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1OI3oa884GwGbXlzn3Y9NH-1j4cSaQb0w) |\n| `ProtoDash` | Prototypes | [ProtoDash](..\u002Fprototypes\u002Fproto_dash\u002F) | [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1OI3oa884GwGbXlzn3Y9NH-1j4cSaQb0w) |\n| `MMDCritic` | Prototypes | [MMDCritic](..\u002Fprototypes\u002Fmmd_critic\u002F) | [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1OI3oa884GwGbXlzn3Y9NH-1j4cSaQb0w) |\n\n\u003C\u002Fdetails>\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:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Fxplique\u002Fblob\u002Fmaster\u002FCONTRIBUTING.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>\n\u003Csummary> Other interesting tools to explain your model: \u003C\u002Fsummary>\n\n- [Lucid](https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Flucid) the wonderful library specialized in feature visualization from OpenAI.\n- [Captum](https:\u002F\u002Fcaptum.ai\u002F) the PyTorch library for Interpretability research\n- [Tf-explain](https:\u002F\u002Fgithub.com\u002Fsicara\u002Ftf-explain) that implement multiples attribution methods and propose callbacks API for tensorflow.\n- [Alibi Explain](https:\u002F\u002Fgithub.com\u002FSeldonIO\u002Falibi) for model inspection and interpretation\n- [SHAP](https:\u002F\u002Fgithub.com\u002Fslundberg\u002Fshap) a very popular library to compute local explanations using the classic Shapley values from game theory and their related extensions\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>To learn more about Explainable AI in general: \u003C\u002Fsummary>\n\n- [Interpretable Machine Learning](https:\u002F\u002Fchristophm.github.io\u002Finterpretable-ml-book\u002F) by Christophe Molnar.\n- [Interpretability Beyond Feature Attribution](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=Ff-Dx79QEEY) by Been Kim.\n- [Explaining ML Predictions: State-of-the-art, Challenges, and Opportunities](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=7dpOSmQ89L8) by Himabindu Lakkaraju, Julius Adebayo and Sameer Singh.\n- [A Roadmap for the Rigorous Science of Interpretability](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=MMxZlr_L6YE) by Finale Doshi-Velez.\n- [DEEL White paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2103.10529) a summary of the DEEL team on the challenges of certifiable AI and the role of explainability for this purpose\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary> More from the DEEL project: \u003C\u002Fsummary>\n\n- [deel-lip](https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Fdeel-lip) a Python library for training k-Lipschitz neural networks on TF.\n- [deel-torchlip](https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Fdeel-torchlip) a Python library for training k-Lipschitz neural networks on PyTorch.\n- [Influenciae](https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Finfluenciae) Python toolkit dedicated to computing influence values for the discovery of potentially problematic samples in a dataset.\n- [LARD](https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002FLARD) Landing Approach Runway Detection (LARD) is a dataset of aerial front view images of runways designed for aircraft landing phase\n- [PUNCC](https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Fpuncc) 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:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Foodeel) 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:\u002F\u002Farxiv.org\u002Fabs\u002F2103.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\u002Fdetails>\n\n## 🙏 Acknowledgments\n\n\u003Cdiv align=\"right\">\n  \u003Cpicture>\n    \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdeel-ai_xplique_readme_38700e9fe14e.png\"  width=\"25%\" align=\"right\">\n    \u003Csource media=\"(prefers-color-scheme: light)\" srcset=\"docs\u002Fassets\u002Fdeel_light.png\"  width=\"25%\" align=\"right\">\n    \u003Cimg alt=\"DEEL Logo\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdeel-ai_xplique_readme_38700e9fe14e.png\" width=\"25%\" align=\"right\">\n  \u003C\u002Fpicture>\n\u003C\u002Fdiv>\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:\u002F\u002Fwww.deel.ai\u002F\"> DEEL \u003C\u002Fa> project.\n\n## 👨‍🎓 Creators\n\nThis library was started as a side-project by [Thomas FEL](http:\u002F\u002Fthomasfel.fr) who is\ncurrently a graduate student at the Artificial and Natural Intelligence Toulouse Institute under\nthe direction of [Thomas SERRE](https:\u002F\u002Fserre-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:\u002F\u002Fwww.deel.ai\u002F\"> DEEL \u003C\u002Fa> team\nto enhance the library namely from [Lucas Hervier](https:\u002F\u002Fgithub.com\u002Flucashervier) and [Antonin Poché](https:\u002F\u002Fgithub.com\u002FAntoninPoche).\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:\u002F\u002Farxiv.org\u002Fabs\u002F2206.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:\u002F\u002Fchoosealicense.com\u002Flicenses\u002Fmit\"> MIT license\u003C\u002Fa>.\n","\u003Cdiv align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdeel-ai_xplique_readme_8fd949ecb387.png\" width=\"75%\" alt=\"Xplique\" align=\"center\" \u002F>\n\u003C\u002Fdiv>\n\u003Cbr>\n\n\u003Cdiv align=\"center\">\n    \u003Ca href=\"#\">\n        \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPython-3.10, 3.11, 3.12, 3.13, 3.14-efefef\">\n    \u003C\u002Fa>\n    \u003Ca href=\"#\">\n        \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FTensorflow-2.5, ..., 2.15-00008b\">\n    \u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Fxplique\u002Factions\u002Fworkflows\u002Fpython-lints.yml\">\n        \u003Cimg alt=\"PyLint\" src=\"https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Fxplique\u002Factions\u002Fworkflows\u002Fpython-lints.yml\u002Fbadge.svg\">\n    \u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Fxplique\u002Factions\u002Fworkflows\u002Fpython-tests.yml\">\n        \u003Cimg alt=\"Tests\" src=\"https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Fxplique\u002Factions\u002Fworkflows\u002Fpython-tests.yml\u002Fbadge.svg\">\n    \u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Fxplique\u002Factions\u002Fworkflows\u002Fpython-publish.yml\">\n        \u003Cimg alt=\"Pypi\" src=\"https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Fxplique\u002Factions\u002Fworkflows\u002Fpython-publish.yml\u002Fbadge.svg\">\n    \u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fpepy.tech\u002Fproject\u002Fxplique\">\n        \u003Cimg alt=\"Pepy\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdeel-ai_xplique_readme_dc959cc4f4f5.png\">\n    \u003C\u002Fa>\n    \u003Ca href=\"#\">\n        \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-efefef\">\n    \u003C\u002Fa>\n\u003C\u002Fdiv>\n\u003Cbr>\n\n\u003Cp align=\"center\">\n    🦊 \u003Cb>Xplique\u003C\u002Fb>（发音为\u003Ci>\\ɛks.plik\\\u003C\u002Fi>) 是一个专注于可解释性的 Python 工具包。该库旨在汇集可解释人工智能领域的最新成果，帮助您理解复杂的神经网络模型。它最初是为 TensorFlow 模型设计的，目前也部分支持 PyTorch 模型。\n\n  \u003Cbr>\n  \u003Ca href=\"https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002F\">📘 \u003Cstrong>探索 Xplique 文档\u003C\u002Fstrong>\u003C\u002Fa>\n  ·  \n  \u003Ca href=\"https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Ftutorials\u002F\">\u003Cstrong>探索 Xplique 教程\u003C\u002Fstrong> 🔥\u003C\u002Fa>\n  \u003Cbr>\n  \u003Cbr>\n  \u003Ca href=\"https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fapi_attributions\u002F\">归因方法\u003C\u002Fa>\n  ·\n  \u003Ca href=\"https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fconcepts\u002Fcav\u002F\">概念提取\u003C\u002Fa>\n  ·\n  \u003Ca href=\"https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Ffeature_viz\u002Ffeature_viz\u002F\">特征可视化\u003C\u002Fa>\n  ·\n  \u003Ca href=\"https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fmetrics\u002Fapi_metrics\u002F\">评估指标\u003C\u002Fa>\n  .\n  \u003Ca href=\"api\u002Fexample_based\u002Fapi_example_based\u002F\">基于示例的方法\u003C\u002Fa>\n\u003C\u002Fp>\n\n> [!IMPORTANT]  \n> 自 TensorFlow 2.16 引入 Keras 3.X 以来，部分方法可能无法按预期工作。我们正在积极修复此问题。在此期间，建议使用 TensorFlow 2.15 或更早版本以获得最佳兼容性。\n\n该库由多个模块组成：_归因方法_模块实现了多种方法（如显著图、Grad-CAM、FEM、积分梯度等），并提供详细说明、示例以及官方论文链接。_特征可视化_模块允许通过寻找使神经元、通道、层或这些元素组合激活程度最大的输入，来观察神经网络如何构建对图像的理解。_概念提取_模块则可以从模型中提取人类可理解的概念，并测试其与特定类别的相关性。最后，_评估指标_模块涵盖了当前可解释性领域常用的各类指标。结合 _归因方法_ 模块使用，可以对不同方法进行测试，或评估模型生成的解释质量。\n\n\u003Cp align=\"center\" width=\"100%\">\n    \u003Cimg width=\"95%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdeel-ai_xplique_readme_d89e2e6cf8a6.png\">\n\u003C\u002Fp>\n\n\u003Cbr>\n\n> [!NOTE]  \n> 我们很荣幸地宣布推出 _基于示例的方法_ 模块！该模块专注于通过从数据集中检索相关示例来解释模型的方法。它包括来自不同类别的方法：相似示例、对比示例（反事实和半事实示例）以及原型示例（关于基于概念的方法的内容已单独列出）。\n\n## 🔥 教程\n\n\u003Cdetails>\n\u003Csummary>我们提供了一些动手实践教程，帮助您熟悉该库及其 API：\u003C\u002Fsummary>\n\n- [**归因方法**：入门](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1XproaVxXjO9nrBSyyy7BuKJ1vy21iHs2) \u003Csub> [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1XproaVxXjO9nrBSyyy7BuKJ1vy21iHs2) \u003C\u002Fsub>\n\n\u003Cp align=\"center\" width=\"100%\">\n    \u003Ca href=\"https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1XproaVxXjO9nrBSyyy7BuKJ1vy21iHs2\">\n        \u003Cimg width=\"95%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdeel-ai_xplique_readme_75d3c2503a98.jpeg\">\n    \u003C\u002Fa>\n\u003C\u002Fp>\n\n- [**归因方法**：论文中的合理性检查](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1uJOmAg6RjlOIJj6SWN9sYRamBdHAuyaS) \u003Csub> [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1uJOmAg6RjlOIJj6SWN9sYRamBdHAuyaS) \u003C\u002Fsub>\n- [**归因方法**：表格数据与回归](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1pjDJmAa9oeSquYtbYh6tksU6eTmObIcq) \u003Csub> [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1pjDJmAa9oeSquYtbYh6tksU6eTmObIcq) \u003C\u002Fsub>\n- [**归因方法**：目标检测](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1X3Yq7BduMKqTA0XEheoVIpOo3IvOrzWL) \u003Csub> [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1X3Yq7BduMKqTA0XEheoVIpOo3IvOrzWL) \u003C\u002Fsub>\n- [**归因方法**：语义分割](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1AHg7KO1fCOX5nZLGZfxkZ2-DLPPdSfbX) \u003Csub> [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1AHg7KO1fCOX5nZLGZfxkZ2-DLPPdSfbX) \u003C\u002Fsub>\n- [**FORGRad**：梯度借助 FORGrad 逆袭](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1ibLzn7r9QQIEmZxApObowzx8n9ukinYB) \u003Csub> [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1ibLzn7r9QQIEmZxApObowzx8n9ukinYB) \u003C\u002Fsub>\n- [**归因方法**：指标](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1WEpVpFSq-oL1Ejugr8Ojb3tcbqXIOPBg) \u003Csub> [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1WEpVpFSq-oL1Ejugr8Ojb3tcbqXIOPBg) \u003C\u002Fsub>\n- [**归因方法**：复杂度指标](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F13boAsXGVKS0LaNzslOdjSkYIrpBJdh7K) \u003Csub> [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F13boAsXGVKS0LaNzslOdjSkYIrpBJdh7K) \u003C\u002Fsub>\n- [**归因方法**：随机化指标](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F13lNkZqKajRJ63XllkQddgrPOYF1Xv9-Y) \u003Csub> [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F13lNkZqKajRJ63XllkQddgrPOYF1Xv9-Y) \u003C\u002Fsub>\n- [**归因方法**：平均下降\u002F上升\u002F增益保真度指标](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1nGP13qiQrsJMBx8TXgA69D-5ALoP3l9p) \u003Csub> [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1nGP13qiQrsJMBx8TXgA69D-5ALoP3l9p) \u003C\u002Fsub>\n\n\u003Cp align=\"center\" width=\"100%\">\n    \u003Ca href=\"https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1WEpVpFSq-oL1Ejugr8Ojb3tcbqXIOPBg\"> \n        \u003Cimg width=\"95%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdeel-ai_xplique_readme_4f5f43c1780a.jpeg\">\n    \u003C\u002Fa>\n\u003C\u002Fp>\n\n- [**PyTorch 模型**：入门](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1bMlO29_0K3YnTQBbbyKQyRfo8YjvDbhe)\u003Csub> [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1bMlO29_0K3YnTQBbbyKQyRfo8YjvDbhe) \u003C\u002Fsub>\n \n- [**概念方法**：使用概念激活向量进行测试](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1iuEz46ZjgG97vTBH8p-vod3y14UETvVE) \u003Csub> [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1iuEz46ZjgG97vTBH8p-vod3y14UETvVE) \u003C\u002Fsub>\n\n\u003Cp align=\"center\" width=\"100%\">\n    \u003Ca href=\"https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1iuEz46ZjgG97vTBH8p-vod3y14UETvVE\">\n        \u003Cimg width=\"95%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdeel-ai_xplique_readme_6271b8dd8b59.jpeg\">\n    \u003C\u002Fa>\n\u003C\u002Fp>\n\n- [**概念方法**：CRAFT：TensorFlow 入门](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1jmyhb89Bdz7H4G2KfK8uEVbSC-C_aht_)\n\u003Csub> [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1jmyhb89Bdz7H4G2KfK8uEVbSC-C_aht_) \u003C\u002Fsub>\n- [**概念方法**：CRAFT：PyTorch 入门](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F16Jn2pQy4gi2qQYZFnuW6ZNtVAYiNyJHO)\n\u003Csub> [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F16Jn2pQy4gi2qQYZFnuW6ZNtVAYiNyJHO) \u003C\u002Fsub>\n\n\u003Cp align=\"center\" width=\"100%\">\n    \u003Ca href=\"https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1jmyhb89Bdz7H4G2KfK8uEVbSC-C_aht_\">\n        \u003Cimg width=\"95%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdeel-ai_xplique_readme_cbec1890a9d9.jpeg\">\n    \u003C\u002Fa>\n\u003C\u002Fp>\n\n- [**特征可视化**：入门](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1st43K9AH-UL4eZM1S4QdyrOi7Epa5K8v) \u003Csub> [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1st43K9AH-UL4eZM1S4QdyrOi7Epa5K8v) \u003C\u002Fsub>\n- [**使用 MaCo 的现代特征可视化**：入门](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1l0kag1o-qMY4NCbWuAwnuzkzd9sf92ic) \u003Csub> [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1l0kag1o-qMY4NCbWuAwnuzkzd9sf92ic) \u003C\u002Fsub>\n\n\u003Cp align=\"center\" width=\"100%\">\n    \u003Ca href=\"https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1st43K9AH-UL4eZM1S4QdyrOi7Epa5K8v\"> \n        \u003Cimg width=\"95%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdeel-ai_xplique_readme_b2c42859d3ef.jpeg\">\n    \u003C\u002Fa>\n\u003C\u002Fp>\n\n- [**基于示例的方法**：入门](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1gA7mhWhWzdKholZWkTvAg4FzFnzS8NHF) \u003Csub> [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1gA7mhWhWzdKholZWkTvAg4FzFnzS8NHF) \u003C\u002Fsub>\n\n您还可以在此处找到一些[其他实用教程](https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Fxplique\u002Fblob\u002Fmaster\u002FTUTORIALS.md)。本部分正在积极开发中，未来还将添加更多内容。我们将努力覆盖该库的所有可能用法，如果您有任何建议或希望看到的教程，请随时与我们联系。\n\n\u003C\u002Fdetails>\n\n## 🚀 快速入门\n\nXplique 需要 Python 3.7 或更高版本，以及 TensorFlow 和 NumPy 等多个库。可以通过 PyPI 安装：\n\n```python\npip install xplique\n```\n\n现在 Xplique 已安装完毕，以下是一些使用可用模块的基本示例。\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>归因方法\u003C\u002Fb>\u003C\u002Fsummary>\n我们从一个简单的例子开始，为训练好的模型对多张图像（或整个数据集）计算 Grad-CAM。\n\n```python\nfrom xplique.attributions import GradCAM\n\n# 加载图像、标签和模型\n# ...\n\nexplainer = GradCAM(model)\nexplanations = explainer.explain(images, labels)\n# 或者直接使用 `explainer(images, labels)`\n```\n\n所有归因方法都共享一个通用的 API，详见 [归因 API 文档](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fapi_attributions\u002F)。\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>归因指标\u003C\u002Fb>\u003C\u002Fsummary>\n\n为了衡量我们的方法所提供的解释是否忠实（即是否准确反映了模型的行为），我们可以使用诸如 Deletion 之类的忠实度指标。\n\n```python\nfrom xplique.attributions import GradCAM\nfrom xplique.metrics import Deletion\n\n# 加载图像、标签和模型\n# ...\n\nexplainer = GradCAM(model)\nexplanations = explainer(inputs, labels)\nmetric = Deletion(model, inputs, labels)\n\nscore_grad_cam = metric(explanations)\n```\n\n所有归因指标也共享一个通用的 API。更多信息请参见 [这里](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fmetrics\u002Fapi_metrics\u002F)。\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>概念提取\u003C\u002Fb>\u003C\u002Fsummary>\n\n### CAV\n\n在基于概念的方法中，例如可以从模型的某一层提取一个概念向量。为此，我们需要两个数据集：一个包含具有该概念的输入样本 `positive_samples`，另一个包含不具有该概念的样本 `negative_samples`。\n\n```python\nfrom xplique.concepts import Cav\n\n# 加载模型、包含概念的样本（正样本）和不包含概念的样本（负样本）\n# ...\n\nextractor = Cav(model, 'mixed3')\nconcept_vector = extractor(positive_samples,\n                           negative_samples)\n```\n\n关于 CAV 的更多信息请参见 [这里](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fconcepts\u002Fcav\u002F)，关于 TCAV 的更多信息请参见 [这里](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fconcepts\u002Ftcav\u002F)。\n\n### CRAFT\n\n使用 CRAFT 来研究单个类别。\n\n```python\nfrom xplique.concepts import CraftTf as Craft\n\n# 将模型分为两部分：g 和 h\n# 使用这两个模型创建一个 CRAFT 概念提取器\ncraft = Craft(input_to_latent_model = g,\n              latent_to_logit_model = h)\n\n# 使用 CRAFT 计算特定类别的概念\ncraft.fit(images_preprocessed, class_id=rabbit_class_id)\n\n# 计算 Sobol 指数以了解哪些概念更重要\nimportances = craft.estimate_importance()\n\n# 显示这些概念，展示每个概念的最佳 10 张图像\ncraft.plot_concepts_crops(nb_crops=10)\n```\n\n更多信息请参见 [CRAFT 文档](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fconcepts\u002Fcraft\u002F)。\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>特征可视化\u003C\u002Fb>\u003C\u002Fsummary>\n\n最后，为了找到一张既能最大化某个神经元激活又能最大化某一层激活的图像，我们可以构建两个目标并将其结合在一起。然后调用优化器来生成这些图像。\n\n```python\nfrom xplique.features_visualizations import Objective\nfrom xplique.features_visualizations import optimize\n\n# 加载模型...\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\n想了解更多？请查看 [特征可视化文档](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Ffeature_viz\u002Ffeature_viz\u002F)。\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Xplique 与 PyTorch\u003C\u002Fb>\u003C\u002Fsummary>\n\n尽管该库主要是为 TensorFlow 设计的工具箱，但我们开发了一个非常实用的封装器，可以方便地将你的 PyTorch 模型集成到 Xplique 的框架中！\n\n```python\nimport torch\n\nfrom xplique.wrappers import TorchWrapper\nfrom xplique.attributions import Saliency\nfrom xplique.metrics import Deletion\n\n# 加载图像、目标和模型\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\n想了解更多？请查看 [PyTorch 文档](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fpytorch\u002F)。\n\n\u003C\u002Fdetails>\n\n## 📦 包含内容\n\nXplique 包含 4 个模块：[归因方法](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fapi_attributions\u002F)、[归因指标](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fmetrics\u002Fapi_metrics\u002F)、[概念](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fconcepts\u002Fcav\u002F) 和 [特征可视化](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Ffeature_viz\u002Ffeature_viz\u002F)。特别是，归因方法模块支持多种任务：[分类](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fclassification\u002F)、[回归](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fregression\u002F)、[目标检测](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fobject_detection\u002F) 和 [语义分割](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fsemantic_segmentation\u002F)。适用于多种数据类型：[图像、时间序列和表格数据](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fapi_attributions\u002F)。与这些任务兼容的方法在下表中突出显示：\n\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>可用归因方法表\u003C\u002Fb>\u003C\u002Fsummary>\n\n| **归因方法** | 模型类型            | 来源                                    | 图像         | 时间序列与表格数据 | 教程  |\n| :--------------------- | :----------------------- | :---------------------------------------- | :------------: | :--------------------------: | :-------: |\n| 反卷积               | TF                       | [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1311.2901)  | C✔️ OD❌ SS❌ | C✔️ R✔️ | [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F19eB3uwAtCKZgkoWtMzrF0LTJ-htF_KE7) |\n| 有限元法             | TF                       | [论文](https:\u002F\u002Fhal.science\u002Fhal-02963298\u002Fdocument) | C✔️ OD❌ SS❌ | ❌      | [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1fghFJylXtM18VCxoqYbOhvkXLUPHalBf\u002Fview?usp=sharing) |\n| Grad-CAM               | TF                       | [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1610.02391) | C✔️ OD❌ SS❌ | ❌      | [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1nsB7xdQbU0zeYQ1-aB_D-M67-RAnvt4X) |\n| Grad-CAM++             | TF                       | [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1710.11063) | C✔️ OD❌ SS❌ | ❌      | [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1nsB7xdQbU0zeYQ1-aB_D-M67-RAnvt4X) |\n| 梯度输入               | TF、PyTorch**            | [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1704.02685) | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F19eB3uwAtCKZgkoWtMzrF0LTJ-htF_KE7) |\n| 引导反向传播           | TF                       | [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1412.6806)  | C✔️ OD❌ SS❌ | C✔️ R✔️ | [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F19eB3uwAtCKZgkoWtMzrF0LTJ-htF_KE7) |\n| 集成梯度               | TF、PyTorch**            | [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1703.01365) | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1UXJYVebDVIrkTOaOl-Zk6pHG3LWkPcLo) |\n| 核 SHAP                | TF、PyTorch**、可调用*   | [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1705.07874) | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1frholXRE4XQQ3W5yZuPQ2-xqc-LTczfT) |\n| LIME                   | TF、PyTorch**、可调用*   | [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1602.04938) | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1frholXRE4XQQ3W5yZuPQ2-xqc-LTczfT) |\n| 屏蔽                   | TF、PyTorch**、可调用*   | [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1311.2901)  | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F15xmmlxQkNqNuXgHO51eKogXvLgs-sG4q) |\n| RISE                   | TF、PyTorch**、可调用*   | [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1806.07421) | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1icu2b1JGfpTRa-ic8tBSXnqqfuCGW2mO) |\n| 显著性图               | TF、PyTorch**            | [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1312.6034)  | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F19eB3uwAtCKZgkoWtMzrF0LTJ-htF_KE7) |\n| 平滑梯度               | TF、PyTorch**            | [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1706.03825) | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F12-tlM_TdZ12oc5lNL2S2g-hcMJV8tZUD) |\n| 平方梯度               | TF、PyTorch**            | [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1806.10758) | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F12-tlM_TdZ12oc5lNL2S2g-hcMJV8tZUD) |\n| 方差梯度               | TF、PyTorch**            | [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1810.03292) | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F12-tlM_TdZ12oc5lNL2S2g-hcMJV8tZUD) |\n| Sobol 归因             | TF、PyTorch**            | [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F2111.04138) | C✔️ OD✔️ SS✔️ | 🔵      | [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1XproaVxXjO9nrBSyyy7BuKJ1vy21iHs2) |\n| HSIC 归因              | TF、PyTorch**            | [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F2206.06219) | C✔️ OD✔️ SS✔️ | 🔵      | [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1XproaVxXjO9nrBSyyy7BuKJ1vy21iHs2) |\n| FORGrad 增强           | TF、PyTorch**            | [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F2307.09591) | C✔️ OD✔️ SS✔️ | ❌      | [![在 Colab 中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1ibLzn7r9QQIEmZxApObowzx8n9ukinYB) |\n\nTF : 兼容 Tensorflow\n\nC : [分类](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fclassification\u002F) | R : [回归](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fregression\u002F) |\nOD : [目标检测](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fobject_detection\u002F) | SS : [语义分割 (SS)](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fsemantic_segmentation\u002F)\n\n\\* : 参见 [可调用文档](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fcallable\u002F)\n\n** : 参见 [Xplique for PyTorch 文档](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fpytorch\u002F)，以及 [**PyTorch 模型**：入门](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1bMlO29_0K3YnTQBbbyKQyRfo8YjvDbhe) 笔记本。\n\n✔️ : Xplique 支持 | ❌ : 不适用 | 🔵 : 正在开发中\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>归因指标可用表\u003C\u002Fb>\u003C\u002Fsummary>\n\n| **归因指标** | 模型类型 | 属性         | 来源                                    |\n| :---------------------- | :------------ | :--------------- | :---------------------------------------- |\n| MuFidelity              | TF, PyTorch** | 忠实度         | [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F2005.00631) |\n| 删除法                | TF, PyTorch** | 忠实度         | [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1806.07421) |\n| 插入法                | TF, PyTorch** | 忠实度         | [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1806.07421) |\n| 平均下降指标          | TF, PyTorch** | 忠实度         | [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1710.11063) |\n| 平均上升指标          | TF, PyTorch** | 忠实度         | [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1710.11063) |\n| 平均增益指标          | TF, PyTorch** | 忠实度         | [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F2301.07002) |\n| 平均稳定性            | TF, PyTorch** | 稳定性        | [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F2005.00631) |\n| MeGe                    | TF, PyTorch** | 表征性         | [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F2009.04521) |\n| ReCo                    | TF, PyTorch** | 一致性      | [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F2009.04521) |\n| 复杂度                | TF, PyTorch** | 复杂度       | [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F2005.00631) |\n| 稀疏性                | TF, PyTorch** | 复杂度       | [论文](https:\u002F\u002Fproceedings.mlr.press\u002Fv119\u002Fchalasani20a.html) |\n| 随机Logit指标         | TF, PyTorch** | 随机化    | [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1810.03292) |\n| 模型随机化指标        | TF, PyTorch** | 随机化    | [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1810.03292) |\n| (进行中) e-鲁棒性      |\n\nTF : 兼容TensorFlow\n\n** : 参见[Xplique for PyTorch文档](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fpytorch\u002F)，以及[**PyTorch模型**：入门](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1bMlO29_0K3YnTQBbbyKQyRfo8YjvDbhe)笔记本。\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>可用概念方法表\u003C\u002Fb>\u003C\u002Fsummary>\n\n| **概念方法**             | 模型类型 | 来源                                        | 教程       |\n| :------------------------------ | :------------ | :-------------------------------------------- | :------------  |\n| 概念激活向量 (CAV) | TF            | [论文](https:\u002F\u002Farxiv.org\u002Fpdf\u002F1711.11279.pdf) | |\n| CAV测试 (TCAV)              | TF            | [论文](https:\u002F\u002Farxiv.org\u002Fpdf\u002F1711.11279.pdf) | |\n| CRAFT TensorFlow | TF | [论文](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2211.10154.pdf) | [![在Colab中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1jmyhb89Bdz7H4G2KfK8uEVbSC-C_aht_) |\n| CRAFT PyTorch  | PyTorch** | [论文](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2211.10154.pdf) | [![在Colab中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F16Jn2pQy4gi2qQYZFnuW6ZNtVAYiNyJHO) |\n| (进行中) 鲁棒TCAV               |               | | |\n| (进行中) 自动概念提取 (ACE)        | | |\n\nTF : 兼容TensorFlow\n\n** : 参见[Xplique for Pytorch文档](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fpytorch\u002F)，以及[**PyTorch的模型**：入门](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1bMlO29_0K3YnTQBbbyKQyRfo8YjvDbhe)\u003Csub> [![在Colab中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1bMlO29_0K3YnTQBbbyKQyRfo8YjvDbhe) \u003C\u002Fsub>笔记本\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>可用特征可视化方法表\u003C\u002Fb>\u003C\u002Fsummary>\n\n| **特征可视化** [(论文)](https:\u002F\u002Fdistill.pub\u002F2017\u002Ffeature-visualization\u002F) | 模型类型 | 详情                                                                                                            |\n| :----------------------------------------------------------------------------------- | :------------ | :----------------------------------------------------------------------------------------------------------------- |\n| 神经元                                                                              | TF            | 针对特定神经元进行优化                                                                              |\n| 层                                                                                | TF            | 针对特定层进行优化                                                                               |\n| 通道                                                                              | TF            | 针对特定通道进行优化                                                                             |\n| 方向                                                                            | TF            | 针对特定向量进行优化                                                                               |\n| 傅里叶预处理                                                             | TF            | 在傅里叶基下优化（参见[预处理](https:\u002F\u002Fdistill.pub\u002F2017\u002Ffeature-visualization\u002F#preconditioning)) |\n| 目标组合                                                                | TF            | 允许组合多个目标                                                                                       |\n| MaCo                                                                                 | TF            | 固定幅度优化，参见[论文](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2306.06805.pdf)                                                                                       |\n\n\nTF : 兼容TensorFlow\n\n\u003C\u002Fdetails>\n\n尽管我们仍处于早期阶段，但最近也新增了一个[基于示例的方法](api\u002Fexample_based\u002Fapi_example_based\u002F)模块。欢迎随时向我们提供反馈！目前可用的方法汇总于下表：\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>可用基于示例的方法表\u003C\u002Fb>\u003C\u002Fsummary>\n\n| 方法 | 家族 | 文档 | 教程 |\n| --- | --- | --- | --- |\n| `SimilarExamples` | 相似示例 | [SimilarExamples](..\u002Fsimilar_examples\u002Fsimilar_examples\u002F) | [![在Colab中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1gA7mhWhWzdKholZWkTvAg4FzFnzS8NHF) |\n| `Cole` | 相似示例 | [Cole](..\u002Fsimilar_examples\u002Fcole\u002F) | [![在Colab中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1gA7mhWhWzdKholZWkTvAg4FzFnzS8NHF) |\n|  |  |  |\n| `NaiveCounterFactuals` | 对照反事实 | [NaiveCounterFactuals](..\u002Fcounterfactuals\u002Fnaive_counter_factuals\u002F) | [![在Colab中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1gA7mhWhWzdKholZWkTvAg4FzFnzS8NHF) |\n| `LabelAwareCounterFactuals` | 对照反事实 | [LabelAwareCounterFactuals](..\u002Fcounterfactuals\u002Flabel_aware_counter_factuals\u002F) | [![在Colab中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1gA7mhWhWzdKholZWkTvAg4FzFnzS8NHF) |\n||||\n| `KLEORSimMiss` | 半事实 | [KLEOR](..\u002Fsemifactuals\u002Fkleor\u002F) | [![在Colab中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1gA7mhWhWzdKholZWkTvAg4FzFnzS8NHF) |\n| `KLEORGlobalSim` | 半事实 | [KLEOR](..\u002Fsemifactuals\u002Fkleor\u002F) | [![在Colab中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1gA7mhWhWzdKholZWkTvAg4FzFnzS8NHF) |\n||||\n| `ProtoGreedy` | 原型 | [ProtoGreedy](..\u002Fprototypes\u002Fproto_greedy\u002F) | [![在Colab中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1OI3oa884GwGbXlzn3Y9NH-1j4cSaQb0w) |\n| `ProtoDash` | 原型 | [ProtoDash](..\u002Fprototypes\u002Fproto_dash\u002F) | [![在Colab中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1OI3oa884GwGbXlzn3Y9NH-1j4cSaQb0w) |\n| `MMDCritic` | 原型 | [MMDCritic](..\u002Fprototypes\u002Fmmd_critic\u002F) | [![在Colab中打开](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1OI3oa884GwGbXlzn3Y9NH-1j4cSaQb0w) |\n\n\u003C\u002Fdetails>\n\n\n\n## 👍 贡献方式\n\n欢迎提出您的想法，或加入我们，共同为Xplique工具箱贡献力量！我们有一份专门的文档，以简单易懂的方式介绍了如何提交您的首次拉取请求：[请在此处查看](https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Fxplique\u002Fblob\u002Fmaster\u002FCONTRIBUTING.md)。\n\n## 👀 更多相关信息\n\n本库只是解释您模型的众多方法之一。我们并不认为它是完美的解决方案，而是为了探索可能性空间中的一个方向而创建的。\n\n\u003Cdetails>\n\u003Csummary> 其他有趣的模型解释工具： \u003C\u002Fsummary>\n\n- [Lucid](https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Flucid)，由OpenAI开发的专注于特征可视化的优秀库。\n- [Captum](https:\u002F\u002Fcaptum.ai\u002F)，PyTorch框架下的可解释性研究专用库。\n- [Tf-explain](https:\u002F\u002Fgithub.com\u002Fsicara\u002Ftf-explain)，实现了多种归因方法，并为TensorFlow提供了回调API。\n- [Alibi Explain](https:\u002F\u002Fgithub.com\u002FSeldonIO\u002Falibi)，用于模型检查与解释的工具。\n- [SHAP](https:\u002F\u002Fgithub.com\u002Fslundberg\u002Fshap)，一种非常流行的库，使用经典博弈论中的Shapley值及其相关扩展来计算局部解释。\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary> 想要了解更多关于可解释人工智能的一般知识： \u003C\u002Fsummary>\n\n- [可解释机器学习](https:\u002F\u002Fchristophm.github.io\u002Finterpretable-ml-book\u002F)，克里斯托夫·莫尔纳著。\n- [超越特征归因的可解释性](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=Ff-Dx79QEEY)，作者：Been Kim。\n- [解释机器学习预测：现状、挑战与机遇](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=7dpOSmQ89L8)，作者：Himabindu Lakkaraju、Julius Adebayo和Sameer Singh。\n- [可解释性严谨科学研究路线图](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=MMxZlr_L6YE)，作者：Finale Doshi-Velez。\n- [DEEL白皮书](https:\u002F\u002Farxiv.org\u002Fabs\u002F2103.10529)，DEEL团队关于可认证AI挑战以及可解释性在此过程中作用的总结。\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary> DEEL项目的更多内容： \u003C\u002Fsummary>\n\n- [deel-lip](https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Fdeel-lip)，用于在TensorFlow上训练k-Lipschitz神经网络的Python库。\n- [deel-torchlip](https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Fdeel-torchlip)，用于在PyTorch上训练k-Lipschitz神经网络的Python库。\n- [Influenciae](https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Finfluenciae)，一款专门用于计算影响值的Python工具，旨在发现数据集中可能存在问题的样本。\n- [LARD](https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002FLARD)，跑道着陆引导检测（LARD）是一个包含飞机正面航拍图像的数据集，专为飞机着陆阶段设计。\n- [PUNCC](https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Fpuncc)，Puncc（预测不确定性校准与置信度调整）是一个开源Python库，整合了回归和分类问题中一系列最先进的置信度预测算法及相关技术。\n- [OODEEL](https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Foodeel)，OODEEL是一款对已训练好的神经网络图像分类器进行事后深度OOD检测的库。该库的理念是注重质量而非数量，并促进易于采用。\n- [DEEL白皮书](https:\u002F\u002Farxiv.org\u002Fabs\u002F2103.10529)，DEEL团队关于可认证AI挑战以及数据质量、代表性与可解释性在此过程中的作用的总结。\n\n\u003C\u002Fdetails>\n\n## 🙏 致谢\n\n\u003Cdiv align=\"right\">\n  \u003Cpicture>\n    \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdeel-ai_xplique_readme_38700e9fe14e.png\"  width=\"25%\" align=\"right\">\n    \u003Csource media=\"(prefers-color-scheme: light)\" srcset=\"docs\u002Fassets\u002Fdeel_light.png\"  width=\"25%\" align=\"right\">\n    \u003Cimg alt=\"DEEL Logo\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdeel-ai_xplique_readme_38700e9fe14e.png\" width=\"25%\" align=\"right\">\n  \u003C\u002Fpicture>\n\u003C\u002Fdiv>\n本项目获得了法国“面向未来的投资计划——PIA3”项目在图卢兹人工与自然智能研究所（ANITI）框架下的资助。作者谨此感谢\u003Ca href=\"https:\u002F\u002Fwww.deel.ai\u002F\"> DEEL \u003C\u002Fa>项目的支持。\n\n## 👨‍🎓 创建者\n\n本库最初是由[Thomas FEL](http:\u002F\u002Fthomasfel.fr)作为副业项目启动的，他目前是图卢兹人工与自然智能研究所的一名研究生，在[Thomas SERRE](https:\u002F\u002Fserre-lab.clps.brown.edu)的指导下进行研究。他的论文工作主要集中在深度神经网络的可解释性方面。\n\n随后，他得到了来自\u003Ca href=\"https:\u002F\u002Fwww.deel.ai\u002F\"> DEEL \u003C\u002Fa>团队部分成员的帮助，进一步完善了该库，尤其是来自[Lucas Hervier](https:\u002F\u002Fgithub.com\u002Flucashervier)和[Antonin Poché](https:\u002F\u002Fgithub.com\u002FAntoninPoche)的支持。\n\n## 🗞️ 引用\n\n如果您在科学出版物的工作流中使用 Xplique，请考虑引用 🗞️ [Xplique 官方论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F2206.04394)：\n\n```\n@article{fel2022xplique,\n  title={Xplique: 一种深度学习可解释性工具箱},\n  author={Fel, Thomas 和 Hervier, Lucas 和 Vigouroux, David 和 Poche, Antonin 和 Plakoo, Justin 和 Cadene, Remi 和 Chalvidal, Mathieu 和 Colin, Julien 和 Boissin, Thibaut 和 Bethune, Louis 和 Picard, Agustin 和 Nicodeme, Claire \n          和 Gardes, Laurent 和 Flandin, Gregory 和 Serre, Thomas},\n  journal={计算机视觉可解释人工智能研讨会（CVPR）},\n  year={2022}\n}\n```\n\n## 📝 许可证\n\n该软件包采用 \u003Ca href=\"https:\u002F\u002Fchoosealicense.com\u002Flicenses\u002Fmit\"> MIT 许可证\u003C\u002Fa>发布。","# Xplique 快速上手指南\n\nXplique 是一个专注于可解释性人工智能（Explainable AI）的 Python 工具包，旨在帮助开发者理解复杂的神经网络模型。它最初为 TensorFlow 构建，同时也部分支持 PyTorch 模型。\n\n## 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n*   **操作系统**：Linux, macOS 或 Windows\n*   **Python 版本**：3.10, 3.11, 3.12, 3.13 或 3.14\n*   **核心依赖**：\n    *   **TensorFlow**：推荐版本 **2.15 或更早版本**。\n        > ⚠️ **重要提示**：由于 TensorFlow 2.16+ 引入了 Keras 3.X，部分方法可能无法按预期工作。官方正在修复中，目前为了获得最佳兼容性，建议使用 TensorFlow 2.15 及以下版本。\n    *   **NumPy**\n    *   **PyTorch**（可选，如需使用 PyTorch 模型）\n\n## 安装步骤\n\n您可以直接通过 PyPI 安装 Xplique：\n\n```bash\npip install xplique\n```\n\n如果您在中国大陆地区，建议使用国内镜像源以加速下载：\n\n```bash\npip install xplique -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n## 基本使用\n\n安装完成后，您可以立即开始使用 Xplique 的各个模块。以下是两个最常用的核心功能示例。\n\n### 1. 生成归因图 (Attribution Methods)\n\n使用 `Grad-CAM` 等方法生成热力图，以可视化模型关注的图像区域。\n\n```python\nfrom xplique.attributions import GradCAM\n\n# 加载图片、标签和训练好的模型\n# images, labels, model = ...\n\n# 初始化解释器\nexplainer = GradCAM(model)\n\n# 生成解释结果\nexplanations = explainer.explain(images, labels)\n\n# 或者简写为：\n# explanations = explainer(images, labels)\n```\n\n### 2. 评估解释质量 (Attribution Metrics)\n\n使用指标（如 `Deletion`）来衡量生成的解释是否忠实反映了模型的行为。\n\n```python\nfrom xplique.attributions import GradCAM\nfrom xplique.metrics import Deletion\n\n# 加载图片、标签和模型\n# inputs, labels, model = ...\n\n# 生成解释\nexplainer = GradCAM(model)\nexplanations = explainer(inputs, labels)\n\n# 初始化评估指标\nmetric = Deletion(model, inputs, labels)\n\n# 计算得分\nscore_grad_cam = metric(explanations)\n```\n\n更多高级功能（如概念提取、特征可视化、基于示例的方法等）及详细教程，请访问 [Xplique 官方文档](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002F) 或查看其提供的 Colab 实战教程。","某医疗影像初创团队的算法工程师正在开发一款基于深度学习的肺结节检测模型，急需向医院合作方证明模型决策的可靠性以满足合规审查。\n\n### 没有 xplique 时\n- **决策过程如“黑盒”**：医生质疑模型为何将良性阴影误判为恶性，团队无法提供直观的视觉证据来解释模型关注了图像的哪些区域。\n- **归因方法实现繁琐**：试图手动复现 Grad-CAM 或 Integrated-Gradients 等前沿算法，需耗费数周编写底层代码且容易出错，难以快速对比不同方法的效果。\n- **缺乏量化评估标准**：仅凭肉眼观察热力图觉得“合理”，却无法用客观指标（如忠实度、稳定性）证明解释结果的可信度，导致验收报告缺乏说服力。\n- **概念验证困难**：想要验证模型是否真的学到了“毛刺”、“分叶”等医学特征概念，却找不到有效工具从神经网络中提取并测试这些人类可理解的概念。\n\n### 使用 xplique 后\n- **可视化决策依据**：利用 Attribution Methods 模块一键生成高质量热力图，清晰展示模型聚焦于结节边缘的毛刺特征，让医生直观理解判罚逻辑。\n- **高效集成多种算法**：直接调用内置的 Saliency、FEM 等多种 State-of-the-Art 算法，几天内即可完成多方法对比实验，大幅缩短研发周期。\n- **科学量化解释质量**：通过 Metrics 模块计算解释的忠实度分数，用数据证明模型关注区域与病灶高度重合，为合规审查提供坚实的量化支撑。\n- **提取人类医学概念**：借助 Concepts 模块成功提取并验证了模型对特定病理特征的敏感度，证明了模型学习到了符合医学常识的特征表示。\n\nxplique 将晦涩的神经网络内部机制转化为可视、可测、可信的证据链，成为连接高精度算法与人类信任的关键桥梁。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdeel-ai_xplique_8fd949ec.png","deel-ai","DEEL","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fdeel-ai_4d5af5b6.png","Dependable, Certifiable & Explainable Artificial Intelligence for Critical Systems",null,"https:\u002F\u002Fwww.deel.ai","https:\u002F\u002Fgithub.com\u002Fdeel-ai",[81,85],{"name":82,"color":83,"percentage":84},"Python","#3572A5",99.9,{"name":86,"color":87,"percentage":88},"Makefile","#427819",0.1,741,61,"2026-03-31T14:34:14","NOASSERTION","","未说明",{"notes":96,"python":97,"dependencies":98},"该工具主要为 TensorFlow 模型构建，部分支持 PyTorch 模型。重要提示：由于 TensorFlow 2.16 引入了 Keras 3.X，部分方法可能无法按预期工作，建议暂时使用 TensorFlow 2.15 或更早版本以获得最佳兼容性。","3.10, 3.11, 3.12, 3.13, 3.14",[99,100],"tensorflow>=2.5, \u003C=2.15","numpy",[14,102],"其他",[104,105,106,107],"xai","explainable-ai","explainable-ml","interpretability","2026-03-27T02:49:30.150509","2026-04-15T03:24:59.810324",[111,116,121,126,130,135,140],{"id":112,"question_zh":113,"answer_zh":114,"source_url":115},33493,"CRAFT PyTorch 方法是否适用于时间序列数据（如 12 通道 ECG）的概念可视化？","虽然 CRAFT 最初是为计算机视觉设计的，但其原理可以借鉴。维护者指出，图像数据通常经过大量的增强（如裁剪、缩放），因此调整大小后的补丁可以被视为符合模型训练时的分布。对于时间序列数据，关键在于确保输入数据的预处理方式（如分段、缩放）与模型训练时看到的分布一致或接近。如果满足这一条件，理论上可以尝试应用，但需注意该方法主要针对图像领域设计。","https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Fxplique\u002Fissues\u002F158",{"id":117,"question_zh":118,"answer_zh":119,"source_url":120},33494,"如何为 Lime 和 KernelShap 方法自定义分割函数（map_to_interpret_space），特别是当需要针对每张图像动态调整参数时？","目前的 API 不支持在解释方法函数内部动态计算带有特定参数（如 watershed 算法的 markers）的图像映射。建议的解决方案是：预先计算好每张图像的分割映射（image maps），然后将其作为参数传递给解释方法，而不是让方法每次重新计算。此外，需注意 Lime 和 KernelShap 是黑盒方法，无法利用模型的卷积层信息进行分割，否则将变为白盒方法。用户可以参考官方提供的 Colab 教程来了解当前 `map_to_interpret_space` 的使用方式。","https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Fxplique\u002Fissues\u002F92",{"id":122,"question_zh":123,"answer_zh":124,"source_url":125},33495,"为什么在相同数据和条件下重新训练模型后，使用 XAI 方法（如 Saliency）得到的可解释性结果完全不同且不稳定？","即使模型在相同样本和条件下训练出的预测准确率几乎相同，神经网络内部的权重参数初始化具有随机性，这会导致不同训练轮次得到的模型权重存在差异。由于可解释性方法（如 Saliency）直接依赖于模型的梯度和权重结构，微小的权重变化可能导致解释结果的显著不同。若要复现结果，必须在训练完成后完整保存模型参数，并在后续分析中重新加载该特定版本的模型，而不是重新训练。","https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Fxplique\u002Fissues\u002F116",{"id":127,"question_zh":128,"answer_zh":129,"source_url":125},33496,"运行 Getting Started 笔记本时报错 `plot_attributions` 无法处理 3 维或 4 维的解释数据（如包含通道维度），如何解决？","这是一个已知问题，`plot_attributions` 方法原本仅设计用于处理无通道维度的 2D 图像。对于返回 4 维解释（形状为 `(batch, height, width, channels)`）的方法（如 GradientInput, IntegratedGradients 等），会引发 `ValueError: too many values to unpack` 错误。维护者已提交修复补丁（PR #117），新版本库已支持处理多通道图像的可视化。如果遇到此问题，请升级 Xplique 到最新版本即可解决。",{"id":131,"question_zh":132,"answer_zh":133,"source_url":134},33497,"Xplique 是否支持表格数据（Tabular Data）模型的保真度（Fidelity）指标评估？","早期版本不直接支持表格数据的保真度指标，但社区贡献者已通过 PR #88 添加了相关支持。该更新引入了针对表格数据的因果度量（causal metrics）。如果您需要使用此功能，请确保安装包含该更新的版本（通常在 develop 分支合并后发布的新版本中可用）。","https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Fxplique\u002Fissues\u002F72",{"id":136,"question_zh":137,"answer_zh":138,"source_url":139},33498,"目前是否有针对单通道图像进行特征可视化（Feature Visualization）时的维度错误解决方案？","在使用 `xplique.features_visualizations.optimize` 处理单通道图像模型时，可能会因代码硬编码通道数为 3 而报错。具体原因是 `transformations.py` 第 43 行使用了 `tf.tile(kernel, [1, 1, 3, 1])`。解决方法是修改该行代码，将硬编码的 `3` 替换为实际的通道数变量（例如 `number_of_channels`），即改为 `tf.tile(kernel, [1, 1, number_of_channels, 1])`，以适配单通道或多通道输入。","https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Fxplique\u002Fissues\u002F148",{"id":141,"question_zh":142,"answer_zh":143,"source_url":144},33499,"Xplique 计划何时支持时间序列解释的可视化功能？","时间序列解释的可视化功能已在规划中。维护者表示已有用于内部项目（Confiance.AI）的草稿函数，但尚未整理为干净的公共 API 版本。该功能的正式加入取决于首个标记版本（Tagged Version）的发布时间表以及开发人员的可用性。用户可以关注相关 PR（如 PR #84）的进展，未来可能会先提供一个最小可用的可视化函数，随后再逐步完善功能。","https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Fxplique\u002Fissues\u002F73",[146,151,156,161,166,171,176,181,186,191,196,201,206,210,214],{"id":147,"version":148,"summary_zh":149,"released_at":150},255661,"v1.5.2","将 `FEM`（特征解释方法）添加到库中，并附上相应的测试、文档和教程。\n\n该方法与 `GradCAM` 有些相似。","2026-02-24T10:24:51",{"id":152,"version":153,"summary_zh":154,"released_at":155},255662,"v1.5.1","# 修复文档站点\r\n\r\n本次发布修复了文档站点，现已包含 v1.5.0 中的所有新内容。","2026-02-13T16:51:55",{"id":157,"version":158,"summary_zh":159,"released_at":160},255663,"v1.5.0","# v1.5.0 版本发布：引入复杂度、随机化及新的 fidelity 指标\n\n这些是用于归因方法的新指标，旨在帮助评估解释的质量。具体包括：\n- 在 [Bhatt 等人，“评估与聚合基于特征的模型解释”（2020）](https:\u002F\u002Farxiv.org\u002Fabs\u002F2005.00631) 中提出的复杂度指标。\n- 在 [Chalasani 等人，“利用对抗训练获得神经网络的简洁解释”（ICML 2020）](https:\u002F\u002Fproceedings.mlr.press\u002Fv119\u002Fchalasani20a.html) 中定义的稀疏性指标。\n- 在 [Adebayo, J., Gilmer, J., Muelly, M., Goodfellow, I., Hardt, M., & Kim, B.（2018），“显著性图的合理性检验”] 中介绍的两种随机化合理性检验：Logit 随机化和模型层随机化。\n- 在 [Chattopadhay, A., Sarkar, A., Howlader, P., & Balasubramanian, V. N.（2018年3月），“Grad-CAM++：面向深度卷积神经网络的广义梯度可视化解释”] 中提出的平均下降和平均上升指标。\n- 在 [Zhang, H., Torres, F., Sicre, R., Avrithis, Y., & Ayache, S.（2024），“Opti-CAM：为可解释性优化显著性图”] 中引入的平均增益指标。\n\n## API 接口\n\nAPI 的设计与其他归因方法指标保持高度一致。\n\n```python\n# 创建解释器并生成解释\nexplainer = Explainer(model, kwargs)\nexplanations = explainer.explain(inputs, predictions)\n\n# 创建指标\ncomplexity_metric = Complexity()\naverage_gain_metric = AverageGainMetric(model, inputs, predictions, activation)\nrandom_logit_metric = RandomLogitMetric(model, inputs, predictions)\n\n# 计算得分\ncomplexity_score = complexity_metric.evaluate(explanations)\naverage_gain_score = average_gain_metric.evaluate(explanations)\nrandom_logit_score = random_logit_metric.evaluate(explainer)  # 随机化指标直接应用于解释器\n```\n\n如需更多信息，请参阅教程或文档。\n\n## 其他改进\n\n- 本次版本包含了对 LIME 归因方法的修复，以及基于全局敏感性分析的归因方法的优化。这些更改已在标记为 `v1.4.2` 的版本中合并到 `master` 分支。\n- Xplique 目前仍限制在 `tensorflow \u003C 2.16` 和 `python \u003C 3.12` 的范围内。","2026-02-10T10:55:56",{"id":162,"version":163,"summary_zh":164,"released_at":165},255664,"v1.4.0","# 发布 v1.4.0 引入基于示例的模块\n\n该模块介绍了来自四大类方法的基于示例的方法。具体包括：\n- 相似示例\n- 半事实假设\n- 反事实假设\n- 原型示例\n\n\n\n## API 接口\n\n这四类方法共用一个 API，其流程分为三个步骤：\n1. 使用模型构建投影函数。\n2. 通过数据集、投影函数及其他参数初始化方法。\n3. 对给定样本进行局部解释。\n\n```python\nprojection = ProjectionMethod(model)\n\nexplainer = ExampleMethod(\n    cases_dataset=cases_dataset, \n    k=k,\n    projection=projection,\n    case_returns=case_returns,\n    distance=distance,\n)\n\nexamples = explainer.explain(inputs, targets)\n```\n\n该 API 无需额外代码即可同时支持 TensorFlow 和 PyTorch。如需更多信息，请参阅 [文档](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fexample_based\u002Fapi_example_based\u002F) 或 [教程](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1gA7mhWhWzdKholZWkTvAg4FzFnzS8NHF)。\n\n\n\n## 其他修改\n\n- Xplique 目前仅支持 TensorFlow \u003C 2.16，因为该版本引入了大量改动。\n- 特征可视化模块现已支持灰度图像。","2024-10-08T12:36:34",{"id":167,"version":168,"summary_zh":169,"released_at":170},255665,"v1.3.3","修复问题：\n- #150 [Bug]：`steps=-1` 时因果一致性指标存在问题\n- #151 [Bug]：MuFidelity 对于表格数据和时间序列无法正常工作\n\n现在，用于归因方法的 `CausalFidelity` 指标支持在 `Insertion` 和 `Deletion` 中使用 `steps=-1`，以逐特征进行操作。\n\n现在，`MuFidelity` 已按预期适用于表格数据和时间序列。","2023-12-13T15:45:35",{"id":172,"version":173,"summary_zh":174,"released_at":175},255666,"v1.3.2","# 补丁\n修复问题 #143：在导入 Xplique 时，会一次性分配所有显存，现在已不再如此。","2023-12-13T14:46:56",{"id":177,"version":178,"summary_zh":179,"released_at":180},255667,"v1.3.1","# 发布说明 v1.3.1\n\n## 数据类型覆盖范围\n\n本次发布的第一部分涉及 Xplique 数据类型覆盖范围的扩展。首先对一些方法进行了修改，以扩大其支持的数据类型范围。\n\n\n\n### 非正方形图像\n\n`SobolAttributionMethod` 和 `HsicAttributionImage` 现在支持非正方形图像。\n\n\n\n### 图像解释形状统一化\n\n对于图像解释，根据不同的方法，其形状可能是 $(n, h, w)$、$(n, h, w, 1)$ 或 $(n, h, w, 3)$。经过讨论，决定将其统一为 $(n, h, w, 1)$。\n\n#### 基于梯度的方法的降维器\n\n对于图像数据，大多数基于梯度的方法会为每个通道提供一个值。然而，为了保持一致性，决定将图像解释的形状统一为 $(n, h, w, 1)$。因此，基于梯度的方法需要对其图像解释的通道维度进行降维处理，而 `reducer` 参数则用于指定降维的方式，可选值包括 {`\"mean\"`、`\"min\"`、`\"max\"`、`\"sum\"`、`None`}。当设置为 `None` 时，不会对通道维度进行降维。默认情况下，除 `Saliency` 方法使用 `\"max\"` 以符合论文要求外，其他方法均采用 `\"mean\"`；而 `GradCAM` 和 `GradCAMPP` 则不受此影响。\n\n\n\n### 时间序列\n\nXplique 最初是为图像设计的，但它也支持针对表格数据和现在的时间序列数据的归因方法。\n\nXplique 对数据的维度划分如下：\n- 4 维数据被视为图像。\n- 3 维数据被视为时间序列。\n- 2 维数据被视为表格数据。\n\n#### 教程\n\n为了展示如何在时间序列上使用 Xplique，我们设计了一个新的教程：[归因：时间序列与回归](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1h0lThbcP5d2VKtRxwLG8z7KC8PExcVIA)。\n\n#### 可视化函数\n\n函数 `xplique.plots.plot_timeseries_attributions` 已被修改，以与 `xplique.plots.plot_attributions` 的 API 保持一致。以下是该教程中的一个示例，基于过去 48 小时的气象数据，对未来 24 小时的气温进行预测：\n\n\u003Cimg width=\"521\" alt=\"image\" src=\"https:\u002F\u002Fgithub.com\u002Fdeel-ai\u002Fxplique\u002Fassets\u002F90199266\u002Ff4ad2060-378a-4138-8609-33ce95078215\">\n\n\n\n#### 方法支持\n\n`Rise`、`Lime` 和 `Kernelshap` 现在原生支持时间序列数据。\n\n\n\n#### 已覆盖数据类型及任务概览\n\n| **归因方法**         | 模型类型            | 图像         | 时间序列与表格数据 |\n| :------------------- | :------------------ | :----------: | :------------------: |\n| 反卷积               | TensorFlow          | C✔️ OD❌ SS❌ | C✔️ R✔️ | \n| Grad-CAM             | TensorFlow          | C✔️ OD❌ SS❌ | ❌      |\n| Grad-CAM++           | TensorFlow          | C✔️ OD❌ SS❌ | ❌      |\n| 梯度输入             | TensorFlow、PyTorch** | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | \n| 引导反向传播         | TensorFlow          | C✔️ OD❌ SS❌ | C✔️ R✔️ | \n| 积分梯度             | TensorFlow、PyTorch** | C✔️ OD✔️ SS✔️ | C✔️ R✔️ | \n| 核 SHAP              | TensorFlow、PyTorch**、可调用对象* | C✔️ OD✔️ SS✔️ | C✔️ R✔️ |\n| Lime                 ","2023-11-09T11:18:14",{"id":182,"version":183,"summary_zh":184,"released_at":185},255668,"v1.3.0","# 发布说明 v1.3.0\n\n## 新特性\n\n### CRAFT：用于可解释性的概念递归激活因子分解\n\n在 PyTorch 和 TensorFlow 两个框架中引入了 CRAFT 方法（详见 [论文](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2211.10154)）。CRAFT 是一种从深度网络中自动提取人类可理解概念的方法。\n\n```python\nfrom xplique.concepts import CraftTf as Craft\n\n# 按照论文中的方法将模型分为两部分\n# 第一部分是 g(.)，即我们的 'input_to_latent' 模型，它返回正向激活；\n# 第二部分是 h(.)，即我们的 'latent_to_logit' 模型。\n\ng = tf.keras.Model(model.input, model.layers[-3].output)\nh = tf.keras.Model(model.layers[-2].input, model.layers[-1].output)\n\n# 使用这两个模型创建一个 CRAFT 概念提取器\ncraft = Craft(input_to_latent_model = g,\n              latent_to_logit_model = h,\n              number_of_concepts = 10,\n              patch_size = 80,\n              batch_size = 64)\n\n# 使用 CRAFT 获取裁剪区域（crops）、这些区域的嵌入表示（crops_u）以及概念库（w）\ncrops, crops_u, w = craft.fit(images_preprocessed, class_id=rabbit_class_id)\n\n# 计算 Sobol 指数以了解哪些概念最为重要\nimportances = craft.estimate_importance()\n\n# 通过展示每个概念对应的前 10 个最佳裁剪区域来可视化这些概念\ncraft.plot_concepts_crops(nb_crops=10)\n```\n\n相关文档请参阅 [此处](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fconcepts\u002Fcraft)，TensorFlow 教程请见 [此链接](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1jmyhb89Bdz7H4G2KfK8uEVbSC-C_aht_)，PyTorch 教程请见 [此链接](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F16Jn2pQy4gi2qQYZFnuW6ZNtVAYiNyJHO)。","2023-10-19T13:22:19",{"id":187,"version":188,"summary_zh":189,"released_at":190},255669,"v1.2.1","# 发布说明 v1.2.1\n\n## 小修复\n\n### 死链\n\n在 88165b3d996b139cbdbf054079b1de1aff104473 提交中，修改了多个死链。\n\n\n### 更新方法表格中的数据类型覆盖范围\n\n目前 Lime 尚不支持语义分割任务，因此表格中的内容由“由 xplique 支持”更新为“正在进行中”。提交号：c307bb55dd1524ec246d2c3fbd59260a242f19e3。\n\n\n### 添加特征可视化教程链接\n\n此前特征可视化的教程链接未显示，因此在 0547dbb62d1fb8ac3937d9019247fb6769111756 提交中，在多个位置添加了相关链接。\n\n\n### 修改 `setup.cfg`\n\n在执行 `bump2version` 时，`setup.cfg` 中会创建一个标签。然而，该标签是基于当前分支而非 master 分支创建的，无法正常使用。因此，在 113974095120e48410d36e579e6fd6a0d0ee7ade 提交中，移除了这一行为。","2023-10-18T12:08:28",{"id":192,"version":193,"summary_zh":194,"released_at":195},255670,"v1.2.0","# 发布说明 v1.2.0\n\n## 新特性\n\n### 语义分割\n\n相关文档请参见：[语义分割](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fsemantic_segmentation\u002F) 和 [教程](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1AHg7KO1fCOX5nZLGZfxkZ2-DLPPdSfbX)。\n\n```python\nexplainer = Method(model, operator=xplique.Tasks.SEMANTIC_SEGMENTATION)\n```\n\n为语义分割任务设计了一个新的算子，并提供了相应的文档和教程。其使用方式与分类和回归任务类似，如上例所示。不过，`model` 的定义以及 `targets` 参数的设置有所不同（用户可以使用 `xplique.utils_functions.segmentation` 中的一组函数来完成这些设置）。\n\n### 目标检测\n\n相关文档请参见：[目标检测](https:\u002F\u002Fdeel-ai.github.io\u002Fxplique\u002Flatest\u002Fapi\u002Fattributions\u002Fobject_detection\u002F) 和 [教程](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1X3Yq7BduMKqTA0XEheoVIpOo3IvOrzWL)。\n\n```python\nexplainer = Method(model, operator=xplique.Tasks.OBJECT_DETECTION)\n```\n\n目标检测 API 已经适配到算子 API，因此设计了一个专门用于目标检测的白盒方法算子。同时，还新增了相关的文档和教程。同样地，这里的 `targets` 和 `model` 的定义也与分类任务有所不同。\n\n因此，`BoundingBoxExplainer` 现已弃用。\n\n## 文档更新\n\n### 合并模型、算子和 API 描述页面\n\n正如 @fel-thomas 在 #132 中指出的那样，之前的文档过于分散，且各页面之间存在大量重复信息，相互依赖性较强。为此，我们决定将模型、算子和 API 描述页面合并为一个统一的页面。我们相信这一调整将使库的使用更加简便。\n\n### 创建任务相关页面\n\n如前所述，文档中新增了两个任务（目标检测和语义分割），由于其复杂性，需要单独的文档页面。然而，仅为这两个任务提供文档页面并不一致。因此，我们将分类和回归的相关信息从通用 API 页面中提取出来，分别创建了两个新的任务专用页面。最终，文档中新增了四个任务专用页面。\n\n## 错误修复\n\n### 回归\n\n在上一版本中，为了支持多输出回归的解释，回归算子被设置为 MAE 函数。然而，MAE 函数在零点不可导，导致基于梯度的方法无法正常工作。\n\n因此，我们将其行为恢复为之前的默认设置（即对目标输出求和）。尽管如此，该算子仅适用于单输出解释；对于多输出回归问题，仍需对每个输出单独进行解释。","2023-10-05T10:17:44",{"id":197,"version":198,"summary_zh":199,"released_at":200},255671,"v1.1.0","# Release note v1.1.0\r\n\r\n## New Features\r\n\r\n### MaCO\r\n\r\nIntroduction of a recent method for scaling up feature visualization on state-of-the-art deep models: **MaCo**.  This method is described in the following arXiv paper: [https:\u002F\u002Farxiv.org\u002Fpdf\u002F2306.06805.pdf](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2306.06805.pdf). It involves fixing the amplitude in the Fourier spectrum and only optimizing the phase during the optimization of a neuron\u002Fchannel\u002Flayer.\r\n\r\nIt comes with the associated documentation, tests and notebook\r\n\r\n### FORGrad\r\n\r\nIntroduction of FORGrad (paper here: [https:\u002F\u002Farxiv.org\u002Fpdf\u002F2307.09591.pdf](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2307.09591.pdf)). All in all, this method consists in filtering the noise in the explanations to make them more interpretable.\r\n\r\nIt comes with the associated documentation, tests and notebook\r\n\r\n### PyTorch Wrapper\r\n\r\nProvide within Xplique a convenient wrapper for Pytorch's model that works for most attribution methods and is compatible with metrics.\r\n\r\nIt comes with the associated documentation, tests and notebook. It also introduce its own pipeline for CI challenging the cross-version between TF and PyTorch.\r\n\r\n### Introduce a Tasks Enum\r\n\r\nAdd the `Tasks` enum which includes the operators for classification and regression tasks. The possibility to choose from the existing `operator` by their name was added.\r\n\r\n### Add an activation parameter for metrics\r\n\r\nWhile we recommend using the logits to generate explanations, it might be more relevant to look at the probability (after a softmax or sigmoid layer) of a prediction when computing metrics for instance if it measures 'a drop in probability for the classification of an input occluded in the more relevant part'. Thus, we introduce this option when you build a metric. `activation` can be either None, 'softmax' or 'sigmoid'.\r\n\r\n## Bug fixes\r\n\r\n### `regression_operator`\r\nThe operator was a sum instead of a mean (for MAE). It has been fixed.\r\n\r\n### HSIC attribution\r\n- doc of **call** of HSICEstimator\r\n- Add @tf.function\r\n## Documentation\r\n- Enhance overall the documentation\r\n- Add documetation for the `operator`\r\n- Add explanation concerning the model, the API\r\n- Add a pipeline for CI of the documentation","2023-09-07T07:55:21",{"id":202,"version":203,"summary_zh":204,"released_at":205},255672,"v1.0.0","This release introduces operators for attribution methods. It allows one to apply attribution methods to a larger variety of use-cases. For more detail, one can refer to PRs #124 and #125 \r\n\r\n# What changes in the use of Xplique?\r\n\r\nFor regular users, this release should be transparent. However, if you want to apply attribution methods to non-classification tasks, il will now be easier.\r\n\r\n# What is an operator?\r\n\r\nThe idea is as follows: to define an attribution method, we need any function that takes in the model (`f`), a series of inputs (`x`), and labels (`y`) and returns a scalar in `R`.\r\n\r\n**`g(f, x, y) -> R`**\r\n\r\nThis function called an operator, can be defined by the user (or by us) and then provides a common interface for all attribution methods that will call it (or calculate its gradient). As you can see, the goal is for attribution methods to have this function as an attribute (in more detail, this will give `self.inference_function = operator` at some point).\r\n\r\n# Some Examples of Operators\r\n\r\n1) The most trivial operator is perhaps the **classification** one, it consists of taking a particular logit to explain a class. In the case where the model `f: R^n -> R^c` with `c` being the number of classes and `y` being one-hot vectors, then our operator simply boils down to:\r\n\r\n```python\r\ndef g(f, x, y):\r\n    return tf.reduce_sum(f(x) * y, -1)\r\n```\r\n\r\n2) Regarding **regression**, with a model `f: R^n -> R^m` with `m` and `targets` being the initial prediction of the model, the operator will be:\r\n\r\n```python\r\ndef g(f, x, y):\r\n    return tf.reduce_sum(tf.abs(model(inputs) - targets), axis=-1)\r\n```\r\n\r\n3) Regarding **bounding-box**, an operator has already been defined in the literature with the D-RISE article. It consists of using the three IOU, objectness, and box classification scores to form... *a scalar*!\r\n\r\n4) To explain **concepts**, for example with a model `f = c ⚬ g(x)`, with `a = g(x)` and a factorizer  that allows interpreting `a` in a reduced dimension space `u = factorizer(a)`, we can very well define the following operator:\r\n\r\n```python\r\ndef g(c, u, y):\r\n    a = factorizer.inverse(u)\r\n    y_pred = c(a)\r\n    return tf.reduce_sum(y_pred * y, -1)\r\n```\r\n\r\nAs you can see, many cases can be handled in this manner!\r\n\r\n# Implementation\r\n\r\nRegarding implementation, there is a series of operators available in the file in `commons\u002Foperators` and the most important part -- the operator plug -- is located in the `attributions\u002Fbase.py` file. As discussed with @fel-thomas, @AntoninPoche, and @lucashervier, the PyTorch implementation is not far and would be located here!\r\n\r\nOnce this is done, we simply added the argument to all the attribution methods defined in the library, some related metrics naturally inherited the parameter.\r\n\r\nFinally, the two metrics InsertionTS and DeletionTS, were deleted as they are now redundant. Indeed, with the new implementation, metrics are not limited to classification.","2023-05-29T15:47:28",{"id":207,"version":208,"summary_zh":77,"released_at":209},255673,"v0.4.3","2022-12-19T14:09:32",{"id":211,"version":212,"summary_zh":77,"released_at":213},255674,"v0.2-alpha","2021-10-01T12:33:03",{"id":215,"version":216,"summary_zh":77,"released_at":217},255675,"v0.1-alpha","2021-06-21T15:34:08"]