{
  "id": 116058,
  "title": "Creating Masks With Magic!!",
  "url": "/competitions/understanding_cloud_organization/discussion/116058",
  "author_name": "Chris Deotte",
  "post_date": "2019-11-06T20:55:01.647000",
  "votes": 113,
  "comment_count": 43,
  "views": 0,
  "content": "<p>It's amazing that a classifier can generate segmentation masks without ever seeing the annotators' provided training masks. If you just train a classifier to identify which images are <code>Fish</code>, <code>Flower</code>, <code>Gravel</code>, and <code>Sugar</code>. The classifier will learn segmentation masks on its own unsupervised!!</p>\n\n<p>Below are some examples. In the right images, the yellow masks are true mask and the blue masks are generated. The heat map on the left is why the classifier made it's decision. This classifier never saw any training masks!! For more examples and source code, see my notebook <a href=\"https://www.kaggle.com/cdeotte/unsupervised-masks-cv-0-60\">here</a></p>\n\n<h1>Examples</h1>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1723677%2Fd458f55214032302dc1cb645771ed448%2Fsug-grav.png?generation=1573071239901517&amp;alt=media\" alt=\"\">\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1723677%2Ff30867959fb8874af0df7f2f13b22487%2Fflow.png?generation=1573071438393907&amp;alt=media\" alt=\"\">\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1723677%2Fff350e450ecec4d51dd8cd870804a956%2Ffish.png?generation=1573084162484500&amp;alt=media\" alt=\"\"></p>\n\n<h1>Why This Works</h1>\n\n<p>To understand why this works, we first look at a typical ImageNet pretrained backbone. Notice how we input an image of size <code>32W by 32H</code> and after 5 downsamples (halvings), we have many maps of size <code>W by H</code>. These small maps are little segmentation masks that specialize in finding certain patterns.</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1723677%2F57d22309cd6b728d672e396a96c4c261%2Fmaps.jpg?generation=1573073279072376&amp;alt=media\" alt=\"\"></p>\n\n<h1>Small Maps Examples</h1>\n\n<p>Let's imagine that we input an image of a car. This might activate maps 1, 2, 3, 4, 5, 6 which specialize in locating Red patterns, Orange patterns, Rectangle patterns, Circle patterns, Small patterns, and Large patterns respectively. If you train the classifier to find Back Bumpers, then it will learn to associate Back Bumpers with activation maps 2, 4, 5 which find Orange, Circle, and Small respectively.</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1723677%2Fe22d58519d432169cc7d18d4f903a1f3%2Fcar2.jpg?generation=1573073253975085&amp;alt=media\" alt=\"\"></p>\n\n<h1>Generate Segmentation Map</h1>\n\n<p>We generate a segmentation mask for a Back Bumper by inspecting which activation maps the network used to make its decision that the image was a Back Bumper. In this case, we see that it used maps 2, 4, 5. Therefore if we add these maps together we get a segmentation map for Back Bumper.</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1723677%2F66e3814e110e25b107d2a55a7598b1dd%2Fadd.jpg?generation=1573072220466711&amp;alt=media\" alt=\"\"></p>\n\n<h1>Evaluation</h1>\n\n<p>Using this technique, one can obtain (at least) an impressive CV 0.606 using our cloud images and generating <code>Fish</code>, <code>Flower</code>, <code>Gravel</code>, and <code>Sugar</code> masks. That's pretty good for never seeing any annotators' masks. It may be that these unsupervised segmentation masks are more accurate (more consistently matching similar cloud formations) than the annotators' masks! I published a notebook illustrating this <a href=\"https://www.kaggle.com/cdeotte/unsupervised-masks-cv-0-60\">here</a>.</p>",
  "messages": [
    {
      "id": 667120,
      "postDate": "2019-11-06T20:55:01.647Z",
      "content": "<p>It's amazing that a classifier can generate segmentation masks without ever seeing the annotators' provided training masks. If you just train a classifier to identify which images are <code>Fish</code>, <code>Flower</code>, <code>Gravel</code>, and <code>Sugar</code>. The classifier will learn segmentation masks on its own unsupervised!!</p>\n\n<p>Below are some examples. In the right images, the yellow masks are true mask and the blue masks are generated. The heat map on the left is why the classifier made it's decision. This classifier never saw any training masks!! For more examples and source code, see my notebook <a href=\"https://www.kaggle.com/cdeotte/unsupervised-masks-cv-0-60\">here</a></p>\n\n<h1>Examples</h1>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1723677%2Fd458f55214032302dc1cb645771ed448%2Fsug-grav.png?generation=1573071239901517&amp;alt=media\" alt=\"\">\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1723677%2Ff30867959fb8874af0df7f2f13b22487%2Fflow.png?generation=1573071438393907&amp;alt=media\" alt=\"\">\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1723677%2Fff350e450ecec4d51dd8cd870804a956%2Ffish.png?generation=1573084162484500&amp;alt=media\" alt=\"\"></p>\n\n<h1>Why This Works</h1>\n\n<p>To understand why this works, we first look at a typical ImageNet pretrained backbone. Notice how we input an image of size <code>32W by 32H</code> and after 5 downsamples (halvings), we have many maps of size <code>W by H</code>. These small maps are little segmentation masks that specialize in finding certain patterns.</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1723677%2F57d22309cd6b728d672e396a96c4c261%2Fmaps.jpg?generation=1573073279072376&amp;alt=media\" alt=\"\"></p>\n\n<h1>Small Maps Examples</h1>\n\n<p>Let's imagine that we input an image of a car. This might activate maps 1, 2, 3, 4, 5, 6 which specialize in locating Red patterns, Orange patterns, Rectangle patterns, Circle patterns, Small patterns, and Large patterns respectively. If you train the classifier to find Back Bumpers, then it will learn to associate Back Bumpers with activation maps 2, 4, 5 which find Orange, Circle, and Small respectively.</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1723677%2Fe22d58519d432169cc7d18d4f903a1f3%2Fcar2.jpg?generation=1573073253975085&amp;alt=media\" alt=\"\"></p>\n\n<h1>Generate Segmentation Map</h1>\n\n<p>We generate a segmentation mask for a Back Bumper by inspecting which activation maps the network used to make its decision that the image was a Back Bumper. In this case, we see that it used maps 2, 4, 5. Therefore if we add these maps together we get a segmentation map for Back Bumper.</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1723677%2F66e3814e110e25b107d2a55a7598b1dd%2Fadd.jpg?generation=1573072220466711&amp;alt=media\" alt=\"\"></p>\n\n<h1>Evaluation</h1>\n\n<p>Using this technique, one can obtain (at least) an impressive CV 0.606 using our cloud images and generating <code>Fish</code>, <code>Flower</code>, <code>Gravel</code>, and <code>Sugar</code> masks. That's pretty good for never seeing any annotators' masks. It may be that these unsupervised segmentation masks are more accurate (more consistently matching similar cloud formations) than the annotators' masks! I published a notebook illustrating this <a href=\"https://www.kaggle.com/cdeotte/unsupervised-masks-cv-0-60\">here</a>.</p>",
      "rawMarkdown": "It's amazing that a classifier can generate segmentation masks without ever seeing the annotators' provided training masks. If you just train a classifier to identify which images are `Fish`, `Flower`, `Gravel`, and `Sugar`. The classifier will learn segmentation masks on its own unsupervised!!\n\nBelow are some examples. In the right images, the yellow masks are true mask and the blue masks are generated. The heat map on the left is why the classifier made it's decision. This classifier never saw any training masks!! For more examples and source code, see my notebook [here][1]\n\n# Examples\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1723677%2Fd458f55214032302dc1cb645771ed448%2Fsug-grav.png?generation=1573071239901517&amp;alt=media)\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1723677%2Ff30867959fb8874af0df7f2f13b22487%2Fflow.png?generation=1573071438393907&amp;alt=media)\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1723677%2Fff350e450ecec4d51dd8cd870804a956%2Ffish.png?generation=1573084162484500&amp;alt=media)\n\n\n# Why This Works\nTo understand why this works, we first look at a typical ImageNet pretrained backbone. Notice how we input an image of size `32W by 32H` and after 5 downsamples (halvings), we have many maps of size `W by H`. These small maps are little segmentation masks that specialize in finding certain patterns.\n   \n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1723677%2F57d22309cd6b728d672e396a96c4c261%2Fmaps.jpg?generation=1573073279072376&amp;alt=media)\n   \n# Small Maps Examples\nLet's imagine that we input an image of a car. This might activate maps 1, 2, 3, 4, 5, 6 which specialize in locating Red patterns, Orange patterns, Rectangle patterns, Circle patterns, Small patterns, and Large patterns respectively. If you train the classifier to find Back Bumpers, then it will learn to associate Back Bumpers with activation maps 2, 4, 5 which find Orange, Circle, and Small respectively.\n  \n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1723677%2Fe22d58519d432169cc7d18d4f903a1f3%2Fcar2.jpg?generation=1573073253975085&amp;alt=media)\n  \n# Generate Segmentation Map\nWe generate a segmentation mask for a Back Bumper by inspecting which activation maps the network used to make its decision that the image was a Back Bumper. In this case, we see that it used maps 2, 4, 5. Therefore if we add these maps together we get a segmentation map for Back Bumper.\n  \n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1723677%2F66e3814e110e25b107d2a55a7598b1dd%2Fadd.jpg?generation=1573072220466711&amp;alt=media)\n  \n# Evaluation\nUsing this technique, one can obtain (at least) an impressive CV 0.606 using our cloud images and generating `Fish`, `Flower`, `Gravel`, and `Sugar` masks. That's pretty good for never seeing any annotators' masks. It may be that these unsupervised segmentation masks are more accurate (more consistently matching similar cloud formations) than the annotators' masks! I published a notebook illustrating this [here][1].\n\n\n[1]: https://www.kaggle.com/cdeotte/unsupervised-masks-cv-0-60",
      "votes": 112
    },
    {
      "id": 675640,
      "postDate": "2019-11-18T10:59:57.560Z",
      "content": "<p>This is awesome. \nFun fact: This is how this whole project started. We had around 900 images where just the dominant category was labeled. I then did exactly what you did and created heatmaps. They kind of sucked because 900 images is not really enough but that gave us the idea to do this on a much larger scale. Your results look really cool!</p>",
      "rawMarkdown": "This is awesome. \nFun fact: This is how this whole project started. We had around 900 images where just the dominant category was labeled. I then did exactly what you did and created heatmaps. They kind of sucked because 900 images is not really enough but that gave us the idea to do this on a much larger scale. Your results look really cool!",
      "votes": 9,
      "replies": [
        {
          "id": 676186,
          "postDate": "2019-11-19T02:28:15.293Z",
          "content": "<p>Thanks Stephan. Thanks for sharing the data and hosting a fun competition.</p>",
          "rawMarkdown": "Thanks Stephan. Thanks for sharing the data and hosting a fun competition."
        },
        {
          "id": 679524,
          "postDate": "2019-11-22T22:39:19.003Z",
          "content": "<p>heat map is great, but can anybody direct me to how they train for rotated images? I see some captchas are training their netowrks for this case as well.</p>",
          "rawMarkdown": "heat map is great, but can anybody direct me to how they train for rotated images? I see some captchas are training their netowrks for this case as well."
        }
      ]
    },
    {
      "id": 667266,
      "postDate": "2019-11-07T03:08:46.480Z",
      "content": "<p><a href=\"https://www.kaggle.com/samusram/gradcam-extracting-masks-from-classifier\">https://www.kaggle.com/samusram/gradcam-extracting-masks-from-classifier</a></p>\n\n<p>Just want to share some underappreciated work that was posted earlier in the competition that was similar. </p>",
      "rawMarkdown": "https://www.kaggle.com/samusram/gradcam-extracting-masks-from-classifier\n\nJust want to share some underappreciated work that was posted earlier in the competition that was similar. ",
      "votes": 10,
      "replies": [
        {
          "id": 667420,
          "postDate": "2019-11-07T08:05:39.457Z",
          "content": "<p>Ryan <a href=\"/ryches\">@ryches</a> ,</p>\n\n<p>thank You for the comment! I was taken by surprise when I discovered your kind evaluation of that kernel of mine.. it means a lot to me.</p>",
          "rawMarkdown": "Ryan @ryches ,\n\nthank You for the comment! I was taken by surprise when I discovered your kind evaluation of that kernel of mine.. it means a lot to me.",
          "votes": 4
        },
        {
          "id": 668136,
          "postDate": "2019-11-08T02:37:42.360Z",
          "content": "<p>Two great guys (Raman and Chris) coincidentally discovered the same thing!</p>",
          "rawMarkdown": "Two great guys (Raman and Chris) coincidentally discovered the same thing!",
          "votes": 1
        }
      ]
    },
    {
      "id": 668373,
      "postDate": "2019-11-08T10:39:51.953Z",
      "content": "<p>Masking is integral part of Image Processing and You demonstrated it really well. One can also try other masking techniques like Alpha Channel Masking or Layer Masking.</p>",
      "rawMarkdown": "Masking is integral part of Image Processing and You demonstrated it really well. One can also try other masking techniques like Alpha Channel Masking or Layer Masking.",
      "votes": 6
    },
    {
      "id": 667190,
      "postDate": "2019-11-06T23:40:23.743Z",
      "content": "<p>Great job. The masks look better than the original ones. This may be useful for organisers' research, however, whether this is useful for fitting the noisy labels in the test set remains a question. Looking forward to your future results!</p>",
      "rawMarkdown": "Great job. The masks look better than the original ones. This may be useful for organisers' research, however, whether this is useful for fitting the noisy labels in the test set remains a question. Looking forward to your future results!",
      "votes": 3
    },
    {
      "id": 674331,
      "postDate": "2019-11-16T09:32:14.680Z",
      "content": "<p>for creating mask from pure classifier, i would like to introduce this paper:</p>\n\n<p>[1] <a href=\"https://arxiv.org/abs/1812.10025\">https://arxiv.org/abs/1812.10025</a>\n\"Attention Branch Network: Learning of Attention Mechanism for Visual Explanation\"</p>\n\n<p><a href=\"https://github.com/machine-perception-robotics-group/attention_branch_network\">https://github.com/machine-perception-robotics-group/attention_branch_network</a>\n<img src=\"https://github.com/machine-perception-robotics-group/attention_branch_network/raw/master/example.jpeg\" alt=\"\"></p>\n\n<p><img src=\"https://www.researchgate.net/profile/Hironobu_Fujiyoshi/publication/329945702/figure/fig1/AS:708477844459522@1545925689894/Network-structures-of-Class-Activation-Mapping-and-our-Attention-Branch-Network.png\" alt=\"\"></p>\n\n<p>[2] <a href=\"https://arxiv.org/pdf/1905.03540.pdf\">https://arxiv.org/pdf/1905.03540.pdf</a>\nEmbedding Human Knowledge in Deep Neural Network via Attention Map</p>\n\n<hr>\n\n<p>the first paper[1] describes a method to generate attention map (mask) from training a classifier.</p>\n\n<p>more importantly, the paper[2] uses [1] to \"create human in the loop\" training process. if human can provide ground truth mask, the network learns to modify its attention and improve classification</p>",
      "rawMarkdown": "for creating mask from pure classifier, i would like to introduce this paper:\n\n[1] https://arxiv.org/abs/1812.10025\n\"Attention Branch Network: Learning of Attention Mechanism for Visual Explanation\"\n\nhttps://github.com/machine-perception-robotics-group/attention_branch_network\n![](https://github.com/machine-perception-robotics-group/attention_branch_network/raw/master/example.jpeg)\n\n![](https://www.researchgate.net/profile/Hironobu_Fujiyoshi/publication/329945702/figure/fig1/AS:708477844459522@1545925689894/Network-structures-of-Class-Activation-Mapping-and-our-Attention-Branch-Network.png)\n\n\n[2] https://arxiv.org/pdf/1905.03540.pdf\nEmbedding Human Knowledge in Deep Neural Network via Attention Map\n\n----\n\nthe first paper[1] describes a method to generate attention map (mask) from training a classifier.\n\nmore importantly, the paper[2] uses [1] to \"create human in the loop\" training process. if human can provide ground truth mask, the network learns to modify its attention and improve classification\n",
      "votes": 4,
      "replies": [
        {
          "id": 674982,
          "postDate": "2019-11-17T11:48:34.623Z",
          "content": "<p><a href=\"/hengck23\">@hengck23</a> Nice stuffs. I will read it... thanks!!!!</p>",
          "rawMarkdown": "@hengck23 Nice stuffs. I will read it... thanks!!!!"
        }
      ]
    },
    {
      "id": 686674,
      "postDate": "2019-12-03T11:54:41.353Z",
      "content": "<p>Great work 👍 </p>",
      "rawMarkdown": "Great work 👍 ",
      "votes": 1
    },
    {
      "id": 685256,
      "postDate": "2019-12-01T09:15:28.193Z",
      "content": "<p>Great job!</p>",
      "rawMarkdown": "Great job!",
      "votes": 1
    },
    {
      "id": 684642,
      "postDate": "2019-11-30T06:32:02.753Z",
      "content": "<p>Great </p>",
      "rawMarkdown": "Great ",
      "votes": 1
    },
    {
      "id": 679765,
      "postDate": "2019-11-23T10:38:39.340Z",
      "content": "<p>Great work chris and thanks for sharing your ideas!!!!</p>",
      "rawMarkdown": "Great work chris and thanks for sharing your ideas!!!!",
      "votes": 1
    },
    {
      "id": 677497,
      "postDate": "2019-11-20T08:38:08.753Z",
      "content": "<p>Nice.</p>",
      "rawMarkdown": "Nice.",
      "votes": 1
    },
    {
      "id": 676183,
      "postDate": "2019-11-19T02:26:53.277Z",
      "content": "<p>Nice!</p>",
      "rawMarkdown": "Nice!",
      "votes": 1
    },
    {
      "id": 675403,
      "postDate": "2019-11-18T03:10:25.060Z",
      "content": "<p>&lt;3 Great read !</p>",
      "rawMarkdown": "&lt;3 Great read !",
      "votes": 1,
      "replies": [
        {
          "id": 675407,
          "postDate": "2019-11-18T03:13:20.663Z",
          "content": "<p>Thank you</p>",
          "rawMarkdown": "Thank you"
        }
      ]
    },
    {
      "id": 675192,
      "postDate": "2019-11-17T18:23:29.823Z",
      "content": "<p>Great read! Thanks for sharing!</p>",
      "rawMarkdown": "Great read! Thanks for sharing!\n",
      "votes": 1,
      "replies": [
        {
          "id": 675408,
          "postDate": "2019-11-18T03:13:26.517Z",
          "content": "<p>Thank you</p>",
          "rawMarkdown": "Thank you"
        }
      ]
    },
    {
      "id": 673477,
      "postDate": "2019-11-15T02:53:33.217Z",
      "content": "<p>This is a really great found. Thanks in advance!</p>",
      "rawMarkdown": "This is a really great found. Thanks in advance!",
      "votes": 1
    },
    {
      "id": 672024,
      "postDate": "2019-11-13T13:07:54.620Z",
      "content": "<p>Wow, amazing!  Thank you very much for sharing!!!😄 </p>",
      "rawMarkdown": "Wow, amazing!  Thank you very much for sharing!!!😄 ",
      "votes": 1
    },
    {
      "id": 671417,
      "postDate": "2019-11-12T17:06:24.530Z",
      "content": "<p>Nice explanation! 👍 </p>",
      "rawMarkdown": "Nice explanation! 👍 ",
      "votes": 1
    },
    {
      "id": 669626,
      "postDate": "2019-11-10T08:54:30.870Z",
      "content": "<p>Thank you for the explaination, really impressive!</p>",
      "rawMarkdown": "Thank you for the explaination, really impressive!",
      "votes": 1
    },
    {
      "id": 668291,
      "postDate": "2019-11-08T08:22:26.713Z",
      "content": "<p>Very interesting concept!\nEven for debugging purposes, this seems very interesting, thanks for sharing!</p>",
      "rawMarkdown": "Very interesting concept!\nEven for debugging purposes, this seems very interesting, thanks for sharing!",
      "votes": 1
    },
    {
      "id": 667901,
      "postDate": "2019-11-07T20:03:48.147Z",
      "content": "<p>Amazing! I studied about this in the fast.ai course. Too bad I couldn't think of applying it here. As much as I love competing on kaggle, I love reading your posts and kernels. Thank you chris! </p>",
      "rawMarkdown": "Amazing! I studied about this in the fast.ai course. Too bad I couldn't think of applying it here. As much as I love competing on kaggle, I love reading your posts and kernels. Thank you chris! \n ",
      "votes": 1
    },
    {
      "id": 667530,
      "postDate": "2019-11-07T10:39:00.513Z",
      "content": "<p>Amazing!\nI think it's better than hand-labels in some way ;)</p>",
      "rawMarkdown": "Amazing!\nI think it's better than hand-labels in some way ;)\n",
      "votes": 1
    },
    {
      "id": 667326,
      "postDate": "2019-11-07T05:54:26.300Z",
      "content": "<p>Great\nAmazing as Always &amp; All Ways.... <a href=\"/cdeotte\">@cdeotte</a> </p>",
      "rawMarkdown": "Great\nAmazing as Always &amp; All Ways.... @cdeotte ",
      "votes": 1
    },
    {
      "id": 667246,
      "postDate": "2019-11-07T02:25:43.247Z",
      "content": "<p>Your knowledge and methods are awesome. Thanks</p>",
      "rawMarkdown": "Your knowledge and methods are awesome. Thanks",
      "votes": 1
    },
    {
      "id": 667231,
      "postDate": "2019-11-07T01:33:45.387Z",
      "content": "<p>This is a useful trick. Thanks for sharing.</p>",
      "rawMarkdown": "This is a useful trick. Thanks for sharing.",
      "votes": 1
    },
    {
      "id": 667229,
      "postDate": "2019-11-07T01:28:18.900Z",
      "content": "<p>Thanks for sharing! Agree that the masks look better than the original. This is very useful for real world problems to generate masks from labels </p>",
      "rawMarkdown": "Thanks for sharing! Agree that the masks look better than the original. This is very useful for real world problems to generate masks from labels ",
      "votes": 1
    },
    {
      "id": 667193,
      "postDate": "2019-11-06T23:43:23.763Z",
      "content": "<p>Amazing <a href=\"/cdeotte\">@cdeotte</a> 😮</p>",
      "rawMarkdown": "Amazing @cdeotte 😮",
      "votes": 1
    },
    {
      "id": 682562,
      "postDate": "2019-11-27T15:51:08.453Z",
      "content": "<p>how to find prediction value from two data sets given example train.csv ,test.csv see attachment and help me </p>",
      "rawMarkdown": "how to find prediction value from two data sets given example train.csv ,test.csv see attachment and help me "
    },
    {
      "id": 672126,
      "postDate": "2019-11-13T14:35:30.430Z",
      "content": "<p>how to find which customers will make a specific transaction in\nthe future, irrespective of the amount of money transacted in r train and test  data sets</p>",
      "rawMarkdown": "how to find which customers will make a specific transaction in\nthe future, irrespective of the amount of money transacted in r train and test  data sets"
    },
    {
      "id": 672123,
      "postDate": "2019-11-13T14:32:11.847Z",
      "content": "<p>how to find which customers will make a specific transaction in\nthe future, irrespective of the amount of money transacted?</p>",
      "rawMarkdown": "how to find which customers will make a specific transaction in\nthe future, irrespective of the amount of money transacted?"
    },
    {
      "id": 682521,
      "postDate": "2019-11-27T14:37:18.540Z",
      "rawMarkdown": "",
      "votes": 1,
      "isDeleted": true
    },
    {
      "id": 680756,
      "postDate": "2019-11-25T07:11:47.187Z",
      "rawMarkdown": "",
      "votes": 1,
      "isDeleted": true
    },
    {
      "id": 687060,
      "postDate": "2019-12-03T21:15:17.787Z",
      "content": "<p>Thank you for sharing!</p>",
      "rawMarkdown": "Thank you for sharing!",
      "votes": 1
    },
    {
      "id": 686020,
      "postDate": "2019-12-02T16:54:22.187Z",
      "content": "<p>Amazing read. Thanks a lot!!!</p>",
      "rawMarkdown": "Amazing read. Thanks a lot!!!",
      "votes": 1
    },
    {
      "id": 685130,
      "postDate": "2019-12-01T02:24:04.800Z",
      "content": "<p>Thanks for your contribution!! c:</p>",
      "rawMarkdown": "Thanks for your contribution!! c:",
      "votes": 1
    },
    {
      "id": 683416,
      "postDate": "2019-11-28T12:03:08.890Z",
      "content": "<p>thanks for your share!</p>",
      "rawMarkdown": "thanks for your share!",
      "votes": 1
    },
    {
      "id": 677096,
      "postDate": "2019-11-19T19:42:54.573Z",
      "content": "<p>Thank you for sharing!</p>",
      "rawMarkdown": "Thank you for sharing!",
      "votes": 1
    },
    {
      "id": 673363,
      "postDate": "2019-11-14T22:23:42.580Z",
      "content": "<p>This is great read, thank you!</p>",
      "rawMarkdown": "This is great read, thank you!",
      "votes": 1
    }
  ],
  "comments": [
    {
      "id": 675640,
      "author_name": "Stephan Rasp",
      "author_url": "",
      "post_date": "2019-11-18T10:59:57.560000",
      "content": "<p>This is awesome. \nFun fact: This is how this whole project started. We had around 900 images where just the dominant category was labeled. I then did exactly what you did and created heatmaps. They kind of sucked because 900 images is not really enough but that gave us the idea to do this on a much larger scale. Your results look really cool!</p>",
      "votes": 9,
      "replies": [
        {
          "id": 676186,
          "author_name": "Chris Deotte",
          "author_url": "",
          "post_date": "2019-11-19T02:28:15.293000",
          "content": "<p>Thanks Stephan. Thanks for sharing the data and hosting a fun competition.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 679524,
          "author_name": "Brandon Wu",
          "author_url": "",
          "post_date": "2019-11-22T22:39:19.003000",
          "content": "<p>heat map is great, but can anybody direct me to how they train for rotated images? I see some captchas are training their netowrks for this case as well.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 667266,
      "author_name": "ryches",
      "author_url": "",
      "post_date": "2019-11-07T03:08:46.480000",
      "content": "<p><a href=\"https://www.kaggle.com/samusram/gradcam-extracting-masks-from-classifier\">https://www.kaggle.com/samusram/gradcam-extracting-masks-from-classifier</a></p>\n\n<p>Just want to share some underappreciated work that was posted earlier in the competition that was similar. </p>",
      "votes": 10,
      "replies": [
        {
          "id": 667420,
          "author_name": "Raman",
          "author_url": "",
          "post_date": "2019-11-07T08:05:39.457000",
          "content": "<p>Ryan <a href=\"/ryches\">@ryches</a> ,</p>\n\n<p>thank You for the comment! I was taken by surprise when I discovered your kind evaluation of that kernel of mine.. it means a lot to me.</p>",
          "votes": 4,
          "replies": []
        },
        {
          "id": 668136,
          "author_name": "Neuron Engineer",
          "author_url": "",
          "post_date": "2019-11-08T02:37:42.360000",
          "content": "<p>Two great guys (Raman and Chris) coincidentally discovered the same thing!</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 668373,
      "author_name": "itsshavar",
      "author_url": "",
      "post_date": "2019-11-08T10:39:51.953000",
      "content": "<p>Masking is integral part of Image Processing and You demonstrated it really well. One can also try other masking techniques like Alpha Channel Masking or Layer Masking.</p>",
      "votes": 6,
      "replies": []
    },
    {
      "id": 667190,
      "author_name": "Yirun Zhang",
      "author_url": "",
      "post_date": "2019-11-06T23:40:23.743000",
      "content": "<p>Great job. The masks look better than the original ones. This may be useful for organisers' research, however, whether this is useful for fitting the noisy labels in the test set remains a question. Looking forward to your future results!</p>",
      "votes": 3,
      "replies": []
    },
    {
      "id": 674331,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2019-11-16T09:32:14.680000",
      "content": "<p>for creating mask from pure classifier, i would like to introduce this paper:</p>\n\n<p>[1] <a href=\"https://arxiv.org/abs/1812.10025\">https://arxiv.org/abs/1812.10025</a>\n\"Attention Branch Network: Learning of Attention Mechanism for Visual Explanation\"</p>\n\n<p><a href=\"https://github.com/machine-perception-robotics-group/attention_branch_network\">https://github.com/machine-perception-robotics-group/attention_branch_network</a>\n<img src=\"https://github.com/machine-perception-robotics-group/attention_branch_network/raw/master/example.jpeg\" alt=\"\"></p>\n\n<p><img src=\"https://www.researchgate.net/profile/Hironobu_Fujiyoshi/publication/329945702/figure/fig1/AS:708477844459522@1545925689894/Network-structures-of-Class-Activation-Mapping-and-our-Attention-Branch-Network.png\" alt=\"\"></p>\n\n<p>[2] <a href=\"https://arxiv.org/pdf/1905.03540.pdf\">https://arxiv.org/pdf/1905.03540.pdf</a>\nEmbedding Human Knowledge in Deep Neural Network via Attention Map</p>\n\n<hr>\n\n<p>the first paper[1] describes a method to generate attention map (mask) from training a classifier.</p>\n\n<p>more importantly, the paper[2] uses [1] to \"create human in the loop\" training process. if human can provide ground truth mask, the network learns to modify its attention and improve classification</p>",
      "votes": 4,
      "replies": [
        {
          "id": 674982,
          "author_name": "Raghawendra Singh",
          "author_url": "",
          "post_date": "2019-11-17T11:48:34.623000",
          "content": "<p><a href=\"/hengck23\">@hengck23</a> Nice stuffs. I will read it... thanks!!!!</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 686674,
      "author_name": "GökhanAkay",
      "author_url": "",
      "post_date": "2019-12-03T11:54:41.353000",
      "content": "<p>Great work 👍 </p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 685256,
      "author_name": "Espresso_martini",
      "author_url": "",
      "post_date": "2019-12-01T09:15:28.193000",
      "content": "<p>Great job!</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 684642,
      "author_name": "Aruna Ojha",
      "author_url": "",
      "post_date": "2019-11-30T06:32:02.753000",
      "content": "<p>Great </p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 679765,
      "author_name": "Himanshu Soni",
      "author_url": "",
      "post_date": "2019-11-23T10:38:39.340000",
      "content": "<p>Great work chris and thanks for sharing your ideas!!!!</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 677497,
      "author_name": "Abhishek Udayashankar",
      "author_url": "",
      "post_date": "2019-11-20T08:38:08.753000",
      "content": "<p>Nice.</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 676183,
      "author_name": "Wei Ping Tong",
      "author_url": "",
      "post_date": "2019-11-19T02:26:53.277000",
      "content": "<p>Nice!</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 675403,
      "author_name": "Chinmaye Jain ",
      "author_url": "",
      "post_date": "2019-11-18T03:10:25.060000",
      "content": "<p>&lt;3 Great read !</p>",
      "votes": 1,
      "replies": [
        {
          "id": 675407,
          "author_name": "Chris Deotte",
          "author_url": "",
          "post_date": "2019-11-18T03:13:20.663000",
          "content": "<p>Thank you</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 675192,
      "author_name": "AshitShrivastava",
      "author_url": "",
      "post_date": "2019-11-17T18:23:29.823000",
      "content": "<p>Great read! Thanks for sharing!</p>",
      "votes": 1,
      "replies": [
        {
          "id": 675408,
          "author_name": "Chris Deotte",
          "author_url": "",
          "post_date": "2019-11-18T03:13:26.517000",
          "content": "<p>Thank you</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 673477,
      "author_name": "Chenglu",
      "author_url": "",
      "post_date": "2019-11-15T02:53:33.217000",
      "content": "<p>This is a really great found. Thanks in advance!</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 672024,
      "author_name": "Miyabon",
      "author_url": "",
      "post_date": "2019-11-13T13:07:54.620000",
      "content": "<p>Wow, amazing!  Thank you very much for sharing!!!😄 </p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 671417,
      "author_name": "BommisettyIndraneel",
      "author_url": "",
      "post_date": "2019-11-12T17:06:24.530000",
      "content": "<p>Nice explanation! 👍 </p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 669626,
      "author_name": "Laevatein",
      "author_url": "",
      "post_date": "2019-11-10T08:54:30.870000",
      "content": "<p>Thank you for the explaination, really impressive!</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 668291,
      "author_name": "Maxime Lenormand",
      "author_url": "",
      "post_date": "2019-11-08T08:22:26.713000",
      "content": "<p>Very interesting concept!\nEven for debugging purposes, this seems very interesting, thanks for sharing!</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 667901,
      "author_name": "timetraveller",
      "author_url": "",
      "post_date": "2019-11-07T20:03:48.147000",
      "content": "<p>Amazing! I studied about this in the fast.ai course. Too bad I couldn't think of applying it here. As much as I love competing on kaggle, I love reading your posts and kernels. Thank you chris! </p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 667530,
      "author_name": "Qishen Ha",
      "author_url": "",
      "post_date": "2019-11-07T10:39:00.513000",
      "content": "<p>Amazing!\nI think it's better than hand-labels in some way ;)</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 667326,
      "author_name": "Ailurophile",
      "author_url": "",
      "post_date": "2019-11-07T05:54:26.300000",
      "content": "<p>Great\nAmazing as Always &amp; All Ways.... <a href=\"/cdeotte\">@cdeotte</a> </p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 667246,
      "author_name": "SeshuRaju 🧘‍♂️",
      "author_url": "",
      "post_date": "2019-11-07T02:25:43.247000",
      "content": "<p>Your knowledge and methods are awesome. Thanks</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 667231,
      "author_name": "Oldognewfun",
      "author_url": "",
      "post_date": "2019-11-07T01:33:45.387000",
      "content": "<p>This is a useful trick. Thanks for sharing.</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 667229,
      "author_name": "David Ten",
      "author_url": "",
      "post_date": "2019-11-07T01:28:18.900000",
      "content": "<p>Thanks for sharing! Agree that the masks look better than the original. This is very useful for real world problems to generate masks from labels </p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 667193,
      "author_name": "Hieu Phung",
      "author_url": "",
      "post_date": "2019-11-06T23:43:23.763000",
      "content": "<p>Amazing <a href=\"/cdeotte\">@cdeotte</a> 😮</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 682562,
      "author_name": "sajeed",
      "author_url": "",
      "post_date": "2019-11-27T15:51:08.453000",
      "content": "<p>how to find prediction value from two data sets given example train.csv ,test.csv see attachment and help me </p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 672126,
      "author_name": "sajeed",
      "author_url": "",
      "post_date": "2019-11-13T14:35:30.430000",
      "content": "<p>how to find which customers will make a specific transaction in\nthe future, irrespective of the amount of money transacted in r train and test  data sets</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 672123,
      "author_name": "sajeed",
      "author_url": "",
      "post_date": "2019-11-13T14:32:11.847000",
      "content": "<p>how to find which customers will make a specific transaction in\nthe future, irrespective of the amount of money transacted?</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 682521,
      "author_name": "",
      "author_url": "",
      "post_date": "2019-11-27T14:37:18.540000",
      "content": "",
      "votes": 1,
      "replies": []
    },
    {
      "id": 680756,
      "author_name": "",
      "author_url": "",
      "post_date": "2019-11-25T07:11:47.187000",
      "content": "",
      "votes": 1,
      "replies": []
    },
    {
      "id": 687060,
      "author_name": "",
      "author_url": "",
      "post_date": "2019-12-03T21:15:17.787000",
      "content": "",
      "votes": 1,
      "replies": []
    },
    {
      "id": 686020,
      "author_name": "",
      "author_url": "",
      "post_date": "2019-12-02T16:54:22.187000",
      "content": "",
      "votes": 1,
      "replies": []
    },
    {
      "id": 685130,
      "author_name": "",
      "author_url": "",
      "post_date": "2019-12-01T02:24:04.800000",
      "content": "",
      "votes": 1,
      "replies": []
    },
    {
      "id": 683416,
      "author_name": "",
      "author_url": "",
      "post_date": "2019-11-28T12:03:08.890000",
      "content": "",
      "votes": 1,
      "replies": []
    },
    {
      "id": 677096,
      "author_name": "",
      "author_url": "",
      "post_date": "2019-11-19T19:42:54.573000",
      "content": "",
      "votes": 1,
      "replies": []
    },
    {
      "id": 673363,
      "author_name": "",
      "author_url": "",
      "post_date": "2019-11-14T22:23:42.580000",
      "content": "",
      "votes": 1,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "667120": "It's amazing that a classifier can generate segmentation masks without ever seeing the annotators' provided training masks. If you just train a classifier to identify which images are `Fish`, `Flower`, `Gravel`, and `Sugar`. The classifier will learn segmentation masks on its own unsupervised!!\n\nBelow are some examples. In the right images, the yellow masks are true mask and the blue masks are generated. The heat map on the left is why the classifier made it's decision. This classifier never saw any training masks!! For more examples and source code, see my notebook [here][1]\n\n# Examples\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1723677%2Fd458f55214032302dc1cb645771ed448%2Fsug-grav.png?generation=1573071239901517&amp;alt=media)\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1723677%2Ff30867959fb8874af0df7f2f13b22487%2Fflow.png?generation=1573071438393907&amp;alt=media)\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1723677%2Fff350e450ecec4d51dd8cd870804a956%2Ffish.png?generation=1573084162484500&amp;alt=media)\n\n\n# Why This Works\nTo understand why this works, we first look at a typical ImageNet pretrained backbone. Notice how we input an image of size `32W by 32H` and after 5 downsamples (halvings), we have many maps of size `W by H`. These small maps are little segmentation masks that specialize in finding certain patterns.\n   \n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1723677%2F57d22309cd6b728d672e396a96c4c261%2Fmaps.jpg?generation=1573073279072376&amp;alt=media)\n   \n# Small Maps Examples\nLet's imagine that we input an image of a car. This might activate maps 1, 2, 3, 4, 5, 6 which specialize in locating Red patterns, Orange patterns, Rectangle patterns, Circle patterns, Small patterns, and Large patterns respectively. If you train the classifier to find Back Bumpers, then it will learn to associate Back Bumpers with activation maps 2, 4, 5 which find Orange, Circle, and Small respectively.\n  \n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1723677%2Fe22d58519d432169cc7d18d4f903a1f3%2Fcar2.jpg?generation=1573073253975085&amp;alt=media)\n  \n# Generate Segmentation Map\nWe generate a segmentation mask for a Back Bumper by inspecting which activation maps the network used to make its decision that the image was a Back Bumper. In this case, we see that it used maps 2, 4, 5. Therefore if we add these maps together we get a segmentation map for Back Bumper.\n  \n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1723677%2F66e3814e110e25b107d2a55a7598b1dd%2Fadd.jpg?generation=1573072220466711&amp;alt=media)\n  \n# Evaluation\nUsing this technique, one can obtain (at least) an impressive CV 0.606 using our cloud images and generating `Fish`, `Flower`, `Gravel`, and `Sugar` masks. That's pretty good for never seeing any annotators' masks. It may be that these unsupervised segmentation masks are more accurate (more consistently matching similar cloud formations) than the annotators' masks! I published a notebook illustrating this [here][1].\n\n\n[1]: https://www.kaggle.com/cdeotte/unsupervised-masks-cv-0-60",
    "675640": "This is awesome. \nFun fact: This is how this whole project started. We had around 900 images where just the dominant category was labeled. I then did exactly what you did and created heatmaps. They kind of sucked because 900 images is not really enough but that gave us the idea to do this on a much larger scale. Your results look really cool!",
    "667266": "https://www.kaggle.com/samusram/gradcam-extracting-masks-from-classifier\n\nJust want to share some underappreciated work that was posted earlier in the competition that was similar. ",
    "668373": "Masking is integral part of Image Processing and You demonstrated it really well. One can also try other masking techniques like Alpha Channel Masking or Layer Masking.",
    "667190": "Great job. The masks look better than the original ones. This may be useful for organisers' research, however, whether this is useful for fitting the noisy labels in the test set remains a question. Looking forward to your future results!",
    "674331": "for creating mask from pure classifier, i would like to introduce this paper:\n\n[1] https://arxiv.org/abs/1812.10025\n\"Attention Branch Network: Learning of Attention Mechanism for Visual Explanation\"\n\nhttps://github.com/machine-perception-robotics-group/attention_branch_network\n![](https://github.com/machine-perception-robotics-group/attention_branch_network/raw/master/example.jpeg)\n\n![](https://www.researchgate.net/profile/Hironobu_Fujiyoshi/publication/329945702/figure/fig1/AS:708477844459522@1545925689894/Network-structures-of-Class-Activation-Mapping-and-our-Attention-Branch-Network.png)\n\n\n[2] https://arxiv.org/pdf/1905.03540.pdf\nEmbedding Human Knowledge in Deep Neural Network via Attention Map\n\n----\n\nthe first paper[1] describes a method to generate attention map (mask) from training a classifier.\n\nmore importantly, the paper[2] uses [1] to \"create human in the loop\" training process. if human can provide ground truth mask, the network learns to modify its attention and improve classification\n",
    "686674": "Great work 👍 ",
    "685256": "Great job!",
    "684642": "Great ",
    "679765": "Great work chris and thanks for sharing your ideas!!!!",
    "677497": "Nice.",
    "676183": "Nice!",
    "675403": "&lt;3 Great read !",
    "675192": "Great read! Thanks for sharing!\n",
    "673477": "This is a really great found. Thanks in advance!",
    "672024": "Wow, amazing!  Thank you very much for sharing!!!😄 ",
    "671417": "Nice explanation! 👍 ",
    "669626": "Thank you for the explaination, really impressive!",
    "668291": "Very interesting concept!\nEven for debugging purposes, this seems very interesting, thanks for sharing!",
    "667901": "Amazing! I studied about this in the fast.ai course. Too bad I couldn't think of applying it here. As much as I love competing on kaggle, I love reading your posts and kernels. Thank you chris! \n ",
    "667530": "Amazing!\nI think it's better than hand-labels in some way ;)\n",
    "667326": "Great\nAmazing as Always &amp; All Ways.... @cdeotte ",
    "667246": "Your knowledge and methods are awesome. Thanks",
    "667231": "This is a useful trick. Thanks for sharing.",
    "667229": "Thanks for sharing! Agree that the masks look better than the original. This is very useful for real world problems to generate masks from labels ",
    "667193": "Amazing @cdeotte 😮",
    "682562": "how to find prediction value from two data sets given example train.csv ,test.csv see attachment and help me ",
    "672126": "how to find which customers will make a specific transaction in\nthe future, irrespective of the amount of money transacted in r train and test  data sets",
    "672123": "how to find which customers will make a specific transaction in\nthe future, irrespective of the amount of money transacted?",
    "682521": "",
    "680756": "",
    "687060": "Thank you for sharing!",
    "686020": "Amazing read. Thanks a lot!!!",
    "685130": "Thanks for your contribution!! c:",
    "683416": "thanks for your share!",
    "677096": "Thank you for sharing!",
    "673363": "This is great read, thank you!"
  }
}