{
  "id": 77637,
  "title": "39th solution-Attention Gated Resnet18 ( single model without cv)",
  "url": "/competitions/human-protein-atlas-image-classification/discussion/77637",
  "author_name": "Kevin Zheng",
  "post_date": "2019-01-15T07:15:07.833000",
  "votes": 18,
  "comment_count": 3,
  "views": 0,
  "content": "<p>Our solution is based on the Attention Gated Network (AGN). In our model, Resnet18 is used as the backbone and feature maps of the last 3 blocks are used to generate attention gate. Given the attended features at last 3 blocks of Resnet18, we combine them for final prediction by average mean.We random crop the original image(512x512) into 3 different size (256,384,512) to fit 3 different AGN model, and finally ensemble their predict prob on full size (512x512) with threshold 0.2 as the final results. Our solution used only single model and 512x512 PNG files with HPA external  data, and did't use cross validation.</p>\n\n<p>Attention Gated Network (AGN): <a href=\"https://arxiv.org/pdf/1804.05338.pdf\">https://arxiv.org/pdf/1804.05338.pdf</a>\n<img src=\"https://drive.google.com/file/d/18lVqM3YEI2Z6u-b3LFT5zqr6gKR8_Dm_/view\" alt=\"Attention Gated Network\">\n<img src=\"https://drive.google.com/file/d/1zSJ1KZOIn-ngS3LPGL-kOROL7VOcUAG3/view\" alt=\"Attention Unit\"></p>\n\n<p><strong>Dataset</strong>\nkaggle data and HPA external data(512x512 RGBY), split by Multilabel Stratification Python Package, not use TIFF images </p>\n\n<p><strong>Training methods</strong>\nSimply training, SGD with momentum, learning rate = 0.1, ReduceLROnPlateau lr scheduler.</p>\n\n<p><strong>Loss functions</strong>\nThe sum of soft f1 loss and focal loss</p>\n\n<p><strong>Data augmentation</strong>\nRandom flip and random crop.</p>\n\n<p><strong>TTA</strong>\nRandom flip</p>\n\n<p><strong>Result</strong>\nensemble three image size: 0.604| 0.540\nensemble three image size and oversample(size 256): 0.601|0.547</p>",
  "messages": [
    {
      "id": 456119,
      "postDate": "2019-01-15T07:15:07.833Z",
      "content": "<p>Our solution is based on the Attention Gated Network (AGN). In our model, Resnet18 is used as the backbone and feature maps of the last 3 blocks are used to generate attention gate. Given the attended features at last 3 blocks of Resnet18, we combine them for final prediction by average mean.We random crop the original image(512x512) into 3 different size (256,384,512) to fit 3 different AGN model, and finally ensemble their predict prob on full size (512x512) with threshold 0.2 as the final results. Our solution used only single model and 512x512 PNG files with HPA external  data, and did't use cross validation.</p>\n\n<p>Attention Gated Network (AGN): <a href=\"https://arxiv.org/pdf/1804.05338.pdf\">https://arxiv.org/pdf/1804.05338.pdf</a>\n<img src=\"https://drive.google.com/file/d/18lVqM3YEI2Z6u-b3LFT5zqr6gKR8_Dm_/view\" alt=\"Attention Gated Network\">\n<img src=\"https://drive.google.com/file/d/1zSJ1KZOIn-ngS3LPGL-kOROL7VOcUAG3/view\" alt=\"Attention Unit\"></p>\n\n<p><strong>Dataset</strong>\nkaggle data and HPA external data(512x512 RGBY), split by Multilabel Stratification Python Package, not use TIFF images </p>\n\n<p><strong>Training methods</strong>\nSimply training, SGD with momentum, learning rate = 0.1, ReduceLROnPlateau lr scheduler.</p>\n\n<p><strong>Loss functions</strong>\nThe sum of soft f1 loss and focal loss</p>\n\n<p><strong>Data augmentation</strong>\nRandom flip and random crop.</p>\n\n<p><strong>TTA</strong>\nRandom flip</p>\n\n<p><strong>Result</strong>\nensemble three image size: 0.604| 0.540\nensemble three image size and oversample(size 256): 0.601|0.547</p>",
      "rawMarkdown": "Our solution is based on the Attention Gated Network (AGN). In our model, Resnet18 is used as the backbone and feature maps of the last 3 blocks are used to generate attention gate. Given the attended features at last 3 blocks of Resnet18, we combine them for final prediction by average mean.We random crop the original image(512x512) into 3 different size (256,384,512) to fit 3 different AGN model, and finally ensemble their predict prob on full size (512x512) with threshold 0.2 as the final results. Our solution used only single model and 512x512 PNG files with HPA external  data, and did't use cross validation.\n\nAttention Gated Network (AGN): https://arxiv.org/pdf/1804.05338.pdf\n![Attention Gated Network][1]\n![Attention Unit][2]\n\n**Dataset**\nkaggle data and HPA external data(512x512 RGBY), split by Multilabel Stratification Python Package, not use TIFF images \n\n**Training methods**\nSimply training, SGD with momentum, learning rate = 0.1, ReduceLROnPlateau lr scheduler.\n\n**Loss functions**\nThe sum of soft f1 loss and focal loss\n\n**Data augmentation**\nRandom flip and random crop.\n\n**TTA**\nRandom flip\n\n**Result**\nensemble three image size: 0.604| 0.540\nensemble three image size and oversample(size 256): 0.601|0.547\n\n\n  [1]: https://drive.google.com/file/d/18lVqM3YEI2Z6u-b3LFT5zqr6gKR8_Dm_/view\n  [2]: https://drive.google.com/file/d/1zSJ1KZOIn-ngS3LPGL-kOROL7VOcUAG3/view",
      "votes": 18
    },
    {
      "id": 456242,
      "postDate": "2019-01-15T12:02:39.210Z",
      "content": "<p>Congratulations for your work, really neat approach. You did not use the HPA leak data then?</p>",
      "rawMarkdown": "Congratulations for your work, really neat approach. You did not use the HPA leak data then?",
      "replies": [
        {
          "id": 456590,
          "postDate": "2019-01-16T06:17:32.347Z",
          "content": "<p>Sorry. I used HPA external data.  Already edited.</p>",
          "rawMarkdown": "Sorry. I used HPA external data.  Already edited."
        }
      ]
    },
    {
      "id": 886445,
      "postDate": "2020-06-15T03:47:30.027Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 456242,
      "author_name": "FlYM",
      "author_url": "",
      "post_date": "2019-01-15T12:02:39.210000",
      "content": "<p>Congratulations for your work, really neat approach. You did not use the HPA leak data then?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 456590,
          "author_name": "Kevin Zheng",
          "author_url": "",
          "post_date": "2019-01-16T06:17:32.347000",
          "content": "<p>Sorry. I used HPA external data.  Already edited.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 886445,
      "author_name": "",
      "author_url": "",
      "post_date": "2020-06-15T03:47:30.027000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "456119": "Our solution is based on the Attention Gated Network (AGN). In our model, Resnet18 is used as the backbone and feature maps of the last 3 blocks are used to generate attention gate. Given the attended features at last 3 blocks of Resnet18, we combine them for final prediction by average mean.We random crop the original image(512x512) into 3 different size (256,384,512) to fit 3 different AGN model, and finally ensemble their predict prob on full size (512x512) with threshold 0.2 as the final results. Our solution used only single model and 512x512 PNG files with HPA external  data, and did't use cross validation.\n\nAttention Gated Network (AGN): https://arxiv.org/pdf/1804.05338.pdf\n![Attention Gated Network][1]\n![Attention Unit][2]\n\n**Dataset**\nkaggle data and HPA external data(512x512 RGBY), split by Multilabel Stratification Python Package, not use TIFF images \n\n**Training methods**\nSimply training, SGD with momentum, learning rate = 0.1, ReduceLROnPlateau lr scheduler.\n\n**Loss functions**\nThe sum of soft f1 loss and focal loss\n\n**Data augmentation**\nRandom flip and random crop.\n\n**TTA**\nRandom flip\n\n**Result**\nensemble three image size: 0.604| 0.540\nensemble three image size and oversample(size 256): 0.601|0.547\n\n\n  [1]: https://drive.google.com/file/d/18lVqM3YEI2Z6u-b3LFT5zqr6gKR8_Dm_/view\n  [2]: https://drive.google.com/file/d/1zSJ1KZOIn-ngS3LPGL-kOROL7VOcUAG3/view",
    "456242": "Congratulations for your work, really neat approach. You did not use the HPA leak data then?",
    "886445": ""
  }
}