当前位置: 首页 > article >正文

李宏毅机器学习2022-HW9--Explainable AI

Task

CNN explanation

11种食物图片分类,与HW3使用同一个dataset

  • Bread, Diary product, Dessert, Egg, Fried food, Meat, Noodles/Pasta, Rice, Seafood, Soup, and Vegetables/Fruit
  • 在这里插入图片描述

训练一个CNN model用于classification,并做一些explanations

Lime package

Lime

在这里插入图片描述

Saliency map

What is Saliency map ?

Saliency: 顯著性

The heatmaps that highlight pixels of the input image that contribute the most in the classification task.

Ref: https://medium.com/datadriveninvestor/visualizing-neural-networks-using-saliency-maps-in-pytorch-289d8e244ab4

We put an image into the model, forward then calculate the loss referring to the label. Therefore, the loss is related to:

  • image
  • model parameters
  • label

Generally speaking, we change model parameters to fit “image” and “label”. When backward, we calculate the partial differential value of loss to model parameters. 一般来说,我们改变模型参数来拟合“图像”和“标签”。当反向时,我们计算损失对模型参数的偏微分值。

Now, we have another look. When we change the image’s pixel value, the partial differential value of loss to image shows the change in the loss. We can say that it means the importance of the pixel. We can visualize it to demonstrate which part of the image contribute the most to the model’s judgment. 现在,我们再看一遍。当我们改变图像的像素值时,损耗对图像的偏微分值表示损耗的变化。我们可以说这意味着像素的重要性。我们可以将其可视化,以演示图像的哪一部分对模型的判断贡献最大。

在这里插入图片描述

Smooth Grad

Smooth grad 的方法是,在圖片中隨機地加入 noise,然後得到不同的 heatmap,把這些 heatmap 平均起來就得到一個比較能抵抗 noisy gradient 的結果。

The method of Smooth grad is to randomly add noise to the image and get different heatmaps. The average of the heatmaps would be more robust to noisy gradient.

ref: https://arxiv.org/pdf/1706.03825.pdf

在这里插入图片描述

Filter Visualization

https://reurl.cc/mGZNbA

在这里插入图片描述

Integrated Gradients

https://arxiv.org/pdf/1703.01365.pdf

在这里插入图片描述

BERT Explanation

  • Attention Visualization
  • Embedding Visualization
  • Embedding analysis

##Attention Visualization

https://exbert.net/exBERT.html

##Embedding Visualization

Embedding 二维化

在这里插入图片描述

##Embedding analysis

用Euclidean distance 和 Cosine similarity 两种方法比较output embedding

下图是"果"

在这里插入图片描述

#Code Link
详细代码和问题解答见Github


http://www.kler.cn/news/322870.html

相关文章:

  • 鸿蒙面试题库收集(一):ArkTSArkUI-基础理论
  • MySQL知识点复习 - 常用的日志类型
  • 浅谈Java之多线程锁处理
  • kali linux crunch工具使用 -- 生成字典
  • 【常见框架漏洞】ThinkPHP、struts2、Spring、Shiro
  • 【数据结构】堆(Heap)详解
  • 前端框架的选择与考量:一场技术的盛宴
  • [Doc][ROS2]订阅发布、服务客户端区别
  • django drf 自动注册路由
  • Leetcode尊享面试100题-252.会议室
  • 产品推介——SOP4 随机相位可控硅光耦KLM305X
  • Docker Init 实战详解:从入门到精通
  • 前端练习总结(1)
  • 选择、冒泡、插入排序
  • 【Redis 源码】2项目结构说明
  • c语言中的杨氏矩阵的介绍以及元素查找的方法
  • Spring Boot 中实现任务后台处理的几种常见方式
  • 【笔记】自动驾驶预测与决策规划_Part4_时空联合规划
  • 数据结构及基本算法
  • LeetCode 2266. 统计打字方案数
  • UE4_Niagara基础实例—使用自定义模块二
  • DataLight(V1.4.5) 版本更新,新增 Ranger、Solr
  • Sony IMX334LQR-C 1/1.8寸 8.42 M像素
  • 机器学习笔记 - week6 -(十一、机器学习系统的设计)
  • 鼎阳加油-IOC关键技术问题的解决记
  • 信息安全工程师(24)网络安全体系建设原则与安全策略
  • MacOS开发环境配置与应用开发
  • 【JAVA 笔记】06 车辆属性抽象类
  • 【libp2p——NAT】
  • 优化|基于深度学习的不动点算子优化的热启动方法