{
  "id": 99270,
  "title": "How to really understand your model's feature detections",
  "url": "/competitions/aptos2019-blindness-detection/discussion/99270",
  "author_name": "",
  "post_date": "2019-07-10T03:41:22.050328700Z",
  "votes": 16,
  "comment_count": 3,
  "views": 0,
  "content": "<p>Grad-CAM is an important approach to let us understand what is going on in our model's brain.\nSometimes even when the model is able to predict the class correctly, it may actually miss the important features (and in contrast, remember spurious features -- see the 2nd picture below). By understanding spurious features, it may be possible to design new augmentation schemes to eliminate those features.</p>\n\n<p>I just finished this kernel as an introduction to Keras Grad-CAM applying to this competition data, if you feel interested, please <a href=\"https://www.kaggle.com/ratthachat/aptos-spotting-blindness-real-or-spurious/\">take a look here</a> </p>\n\n<p><img src=\"https://i.ibb.co/6FM6VCC/gradcam-resized.png\" alt=\"heatmap\"></p>\n\n<p>Hope it is helpful!</p>\n\n<p>Credit: I apply the base model from <a href=\"https://www.kaggle.com/xhlulu/aptos-2019-densenet-keras-starter\"></a><a href=\"/xhlulu\">@xhlulu</a> kernel :) </p>",
  "messages": [
    {
      "id": "571734",
      "postDate": "07/10/2019 03:41:22",
      "content": "<p>Grad-CAM is an important approach to let us understand what is going on in our model's brain.\nSometimes even when the model is able to predict the class correctly, it may actually miss the important features (and in contrast, remember spurious features -- see the 2nd picture below). By understanding spurious features, it may be possible to design new augmentation schemes to eliminate those features.</p>\n\n<p>I just finished this kernel as an introduction to Keras Grad-CAM applying to this competition data, if you feel interested, please <a href=\"https://www.kaggle.com/ratthachat/aptos-spotting-blindness-real-or-spurious/\">take a look here</a> </p>\n\n<p><img src=\"https://i.ibb.co/6FM6VCC/gradcam-resized.png\" alt=\"heatmap\"></p>\n\n<p>Hope it is helpful!</p>\n\n<p>Credit: I apply the base model from <a href=\"https://www.kaggle.com/xhlulu/aptos-2019-densenet-keras-starter\"></a><a href=\"/xhlulu\">@xhlulu</a> kernel :) </p>",
      "rawMarkdown": "Grad-CAM is an important approach to let us understand what is going on in our model's brain.\nSometimes even when the model is able to predict the class correctly, it may actually miss the important features (and in contrast, remember spurious features -- see the 2nd picture below). By understanding spurious features, it may be possible to design new augmentation schemes to eliminate those features.\n\nI just finished this kernel as an introduction to Keras Grad-CAM applying to this competition data, if you feel interested, please [take a look here](https://www.kaggle.com/ratthachat/aptos-spotting-blindness-real-or-spurious/) \n\n![heatmap](https://i.ibb.co/6FM6VCC/gradcam-resized.png)\n\nHope it is helpful!\n\nCredit: I apply the base model from [@xhlulu kernel](https://www.kaggle.com/xhlulu/aptos-2019-densenet-keras-starter) :)",
      "votes": null
    },
    {
      "id": "571783",
      "postDate": "07/10/2019 05:04:24",
      "content": "<p>Great kernel! I was actually going to do something very similar with my models as <code>fastai</code> has GradCAM code already included, but you beat me to it ;)</p>",
      "rawMarkdown": "Great kernel! I was actually going to do something very similar with my models as `fastai` has GradCAM code already included, but you beat me to it ;)",
      "votes": null
    },
    {
      "id": "571793",
      "postDate": "07/10/2019 05:14:40",
      "content": "<p>Thanks <a href=\"/tanlikesmath\">@tanlikesmath</a> !  Since I am writing in Keras, the fast.ai visualization will be useful to  to many users too.</p>",
      "rawMarkdown": "Thanks @tanlikesmath !  Since I am writing in Keras, the fast.ai visualization will be useful to  to many users too.",
      "votes": null
    },
    {
      "id": "573381",
      "postDate": "07/12/2019 07:35:26",
      "content": "<p>I update the kernel to also incorporate the great albumentation ! Hope it is helpful.</p>\n\n<p><img src=\"https://i.ibb.co/H4MJWVz/gradcam-album.png\" alt=\"Albumentation meets Grad-CAM\"></p>",
      "rawMarkdown": "I update the kernel to also incorporate the great albumentation ! Hope it is helpful.\n\n![Albumentation meets Grad-CAM](https://i.ibb.co/H4MJWVz/gradcam-album.png)",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 571783,
      "author_name": "tanlikesmath",
      "author_url": "",
      "post_date": "07/10/2019 05:04:24",
      "content": "<p>Great kernel! I was actually going to do something very similar with my models as <code>fastai</code> has GradCAM code already included, but you beat me to it ;)</p>",
      "votes": null,
      "replies": [
        {
          "id": 571793,
          "author_name": "ratthachat",
          "author_url": "",
          "post_date": "07/10/2019 05:14:40",
          "content": "<p>Thanks <a href=\"/tanlikesmath\">@tanlikesmath</a> !  Since I am writing in Keras, the fast.ai visualization will be useful to  to many users too.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 573381,
      "author_name": "ratthachat",
      "author_url": "",
      "post_date": "07/12/2019 07:35:26",
      "content": "<p>I update the kernel to also incorporate the great albumentation ! Hope it is helpful.</p>\n\n<p><img src=\"https://i.ibb.co/H4MJWVz/gradcam-album.png\" alt=\"Albumentation meets Grad-CAM\"></p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "571734": "Grad-CAM is an important approach to let us understand what is going on in our model's brain.\nSometimes even when the model is able to predict the class correctly, it may actually miss the important features (and in contrast, remember spurious features -- see the 2nd picture below). By understanding spurious features, it may be possible to design new augmentation schemes to eliminate those features.\n\nI just finished this kernel as an introduction to Keras Grad-CAM applying to this competition data, if you feel interested, please [take a look here](https://www.kaggle.com/ratthachat/aptos-spotting-blindness-real-or-spurious/) \n\n![heatmap](https://i.ibb.co/6FM6VCC/gradcam-resized.png)\n\nHope it is helpful!\n\nCredit: I apply the base model from [@xhlulu kernel](https://www.kaggle.com/xhlulu/aptos-2019-densenet-keras-starter) :)",
    "571783": "Great kernel! I was actually going to do something very similar with my models as `fastai` has GradCAM code already included, but you beat me to it ;)",
    "571793": "Thanks @tanlikesmath !  Since I am writing in Keras, the fast.ai visualization will be useful to  to many users too.",
    "573381": "I update the kernel to also incorporate the great albumentation ! Hope it is helpful.\n\n![Albumentation meets Grad-CAM](https://i.ibb.co/H4MJWVz/gradcam-album.png)"
  },
  "source": "meta"
}