YH Hsu
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    2
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # [Explainable AI] XAI文獻搜尋筆記: XAI for Vision Transformer ###### tags: `Literature Reading` `XAI` `Visualization` `Interpretability` `Transformer` 筆記一些在Vision Transfonmer領域的可解釋性方法,目前相關文章還不是很多,以下依引用術或重要性排序 ### [Transformer Interpretability Beyond Attention Visualization](https://arxiv.org/abs/2012.09838) #### [官方code](https://github.com/hila-chefer/Transformer-Explainability) #### [Transformer Interpretability Beyond Attention Visualization詳細筆記](https://hackmd.io/@YungHuiHsu/rk8ZHeqys) ## 核心概念 ![](https://hackmd.io/_uploads/ryGf4TFCq.png =500x) ![](https://hackmd.io/_uploads/BJ7dN6tRq.png =500x) --- ### [Visualizer!简化你的Vision Transformer可视化](https://zhuanlan.zhihu.com/p/398408338) ##### [官方code](https://github.com/luo3300612/Visualizer) 自刻的一個小套件,簡單易用,引用的人還不少 > 如果要使用hooks其中的问题就是 嵌套太深,模块名不清晰,我们根本不知道我们要取的attention map怎么以model.bla.bla.bla这样一直点出来! 一般来说,Transformer中attention map每层都有一个,一个个注册实在太麻烦了 所以我就思考并查找能否通过更简洁的方法来得到Attention Map(尤其是Transformer的),而visualizer就是其中的一种,它具有以下特点: > - 精准直接,你可以取出任何变量名的模型中间结果 > - 快捷方便,同时取出Transformer类模型中的所有attention map > - 非侵入式,你无须修改函数内的任何一行代码 > 训练-测试一致,可视化完成后,你无须在训练时再将代码改回来 ![](https://hackmd.io/_uploads/ByANuGOGq.png =400x) --- ### [Dodrio: Exploring Transformer Models with Interactive Visualization](https://arxiv.org/abs/2103.14625) ##### [官方code](https://github.com/poloclub/dodrio) ##### [互動式探索](https://poloclub.github.io/dodrio/) 提供互動式探索網站,但還看不懂在幹嘛,可能是偏NLP領域 ![](https://hackmd.io/_uploads/ryu49GdM9.png =600x) ![](https://hackmd.io/_uploads/rkv1cGOM5.png =400x) --- ### [Better Explanations through Conservative Propagation](https://arxiv.org/abs/2202.07304?fbclid=IwAR265K4zPxnEQfBPYyBxGKGrjJIGwwv-kk7fIRoxjfO6vHpMaLDAZQDxBNQ) ##### [官方code](https://github.com/ameenali/xai_transformers) 滿新的一篇,不確定能否可用 ![](https://hackmd.io/_uploads/rJ6zPMOf5.png =300x) ![](https://hackmd.io/_uploads/HyDJDMdf9.png =300x) --- 其他,不是可解釋性工具,但值得一看 ### [Visualization of Self-Attention Maps in Vision](https://epfml.github.io/attention-cnn/) ### [Are Convolutional Neural Networks or Transformers more like human vision?](https://arxiv.org/abs/2105.07197) #### 中文介紹 - [正面刚CNN,Transformer居然连犯错都像人类](https://zhuanlan.zhihu.com/p/393204542?fbclid=IwAR0HdXlORgVsvTirkDn0Mc2jzjzkZRvsnVyA3z6sk9og0XqecKfbpGmg-No) > 最近普林斯顿的一项研究认为,Transformer的运作方式更接近人类,连犯错的方式都和人类一样。 研究团队在图像分类的准确率之外,增加了对错误类型的分析。 结果发现,与CNN相比,ViT更擅长判断形状。 此前在ICLR2019上发表的一篇论文提出,用ImageNet训练的CNN模型更倾向于通过纹理分类图像。 如下图中混合了大象皮肤纹理的猫被判断成了大象。 ![](https://i.imgur.com/NhSeWLQ.png) > ViT模型,使用相同数据集训练,就倾向于通过形状分类图像,并且表现比CNN更好。 > 在普林斯顿大学对比CNN和ViT的这篇论文中,还建立了错误一致性这个指标来对各个模型进行评判。 > 从WordNet中选取了16个概念(如飞机、熊、键盘等)来衡量CNN和ViT犯错的类型。 > 从结果可以看出,ViT和人类一样,更倾向于通过形状判断物体。 ![](https://hackmd.io/_uploads/HJsk3GuMq.png =400x)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully