{
  "id": 208887,
  "title": "AutoAugment - Learning augmentation policy from data",
  "url": "/competitions/cassava-leaf-disease-classification/discussion/208887",
  "author_name": "Gabriel Prado",
  "post_date": "2021-01-05T13:00:00.219000",
  "votes": 17,
  "comment_count": 8,
  "views": 0,
  "content": "<p>Augmentation is a very important step in an image model, but with a lot of hyperparameters and almost infinite permutations it can be quite a difficult task deciding which policies work better than others. It is proposed that by either defining an adversarial network or by calculating gradients of the augmentation functions we can arrive at a better augmentation policy.</p>\n<p>The papers explaining how it can perform better than handpicked augmentations:<br>\nAutoAugment: <a href=\"https://arxiv.org/abs/1805.09501\" target=\"_blank\">https://arxiv.org/abs/1805.09501</a><br>\nFaster AutoAugment: <a href=\"https://arxiv.org/abs/1911.06987\" target=\"_blank\">https://arxiv.org/abs/1911.06987</a></p>\n<p>Albumentations has an implementation of Faster AutoAugment called AutoAlbument, the downside is that kaggle doesn't support it (as far as i tried). Which is super simple to setup, all you need to do is provide a dataset.py that reads the cassava dataset and if you want to, edit the parameter file by replacing for instance the model it uses for the classification task.</p>\n<p>You can find AutoAlbument here: <a href=\"https://albumentations.ai/docs/autoalbument/how_to_use/\" target=\"_blank\">https://albumentations.ai/docs/autoalbument/how_to_use/</a></p>\n<p>You need to have a computer that can run torch &gt;= 1.6 and has cuda &gt;=10.0.</p>\n<p>If that is available to you, please share if it improved your model!!</p>",
  "messages": [
    {
      "id": 1139521,
      "postDate": "2021-01-05T13:00:00.220Z",
      "content": "<p>Augmentation is a very important step in an image model, but with a lot of hyperparameters and almost infinite permutations it can be quite a difficult task deciding which policies work better than others. It is proposed that by either defining an adversarial network or by calculating gradients of the augmentation functions we can arrive at a better augmentation policy.</p>\n<p>The papers explaining how it can perform better than handpicked augmentations:<br>\nAutoAugment: <a href=\"https://arxiv.org/abs/1805.09501\" target=\"_blank\">https://arxiv.org/abs/1805.09501</a><br>\nFaster AutoAugment: <a href=\"https://arxiv.org/abs/1911.06987\" target=\"_blank\">https://arxiv.org/abs/1911.06987</a></p>\n<p>Albumentations has an implementation of Faster AutoAugment called AutoAlbument, the downside is that kaggle doesn't support it (as far as i tried). Which is super simple to setup, all you need to do is provide a dataset.py that reads the cassava dataset and if you want to, edit the parameter file by replacing for instance the model it uses for the classification task.</p>\n<p>You can find AutoAlbument here: <a href=\"https://albumentations.ai/docs/autoalbument/how_to_use/\" target=\"_blank\">https://albumentations.ai/docs/autoalbument/how_to_use/</a></p>\n<p>You need to have a computer that can run torch &gt;= 1.6 and has cuda &gt;=10.0.</p>\n<p>If that is available to you, please share if it improved your model!!</p>",
      "rawMarkdown": "Augmentation is a very important step in an image model, but with a lot of hyperparameters and almost infinite permutations it can be quite a difficult task deciding which policies work better than others. It is proposed that by either defining an adversarial network or by calculating gradients of the augmentation functions we can arrive at a better augmentation policy.\n\nThe papers explaining how it can perform better than handpicked augmentations:\nAutoAugment: https://arxiv.org/abs/1805.09501\nFaster AutoAugment: https://arxiv.org/abs/1911.06987\n\nAlbumentations has an implementation of Faster AutoAugment called AutoAlbument, the downside is that kaggle doesn't support it (as far as i tried). Which is super simple to setup, all you need to do is provide a dataset.py that reads the cassava dataset and if you want to, edit the parameter file by replacing for instance the model it uses for the classification task.\n\nYou can find AutoAlbument here: https://albumentations.ai/docs/autoalbument/how_to_use/\n\nYou need to have a computer that can run torch >= 1.6 and has cuda >=10.0.\n\nIf that is available to you, please share if it improved your model!!\n\n",
      "votes": 17
    },
    {
      "id": 1139995,
      "postDate": "2021-01-05T18:26:25.703Z",
      "content": "<p>I use often AutoAugment but with the default Imagenet Policy. Because looking for the best policy can be computationnally very expensive.</p>\n<p>RandAugment or UniformAugment may be better alternative for faster convergence if you wanna fine-tune best policy</p>",
      "rawMarkdown": "I use often AutoAugment but with the default Imagenet Policy. Because looking for the best policy can be computationnally very expensive.\n\nRandAugment or UniformAugment may be better alternative for faster convergence if you wanna fine-tune best policy\n\n",
      "votes": 1,
      "replies": [
        {
          "id": 1140241,
          "postDate": "2021-01-05T21:52:51.777Z",
          "content": "<p>Can you share any pytorch implementation of RandAugment or UniformAugment?</p>",
          "rawMarkdown": "Can you share any pytorch implementation of RandAugment or UniformAugment?"
        },
        {
          "id": 1142771,
          "postDate": "2021-01-07T15:28:46.430Z",
          "content": "<p>Check this out: <a href=\"https://github.com/rwightman/pytorch-image-models/blob/186075ef03b2400ade0fcb7410621ba752223e0a/timm/data/auto_augment.py#L334\" target=\"_blank\">https://github.com/rwightman/pytorch-image-models/blob/186075ef03b2400ade0fcb7410621ba752223e0a/timm/data/auto_augment.py#L334</a></p>",
          "rawMarkdown": "Check this out: https://github.com/rwightman/pytorch-image-models/blob/186075ef03b2400ade0fcb7410621ba752223e0a/timm/data/auto_augment.py#L334",
          "votes": 1
        },
        {
          "id": 1142794,
          "postDate": "2021-01-07T15:36:39.137Z",
          "content": "<p>Thank you!</p>",
          "rawMarkdown": "Thank you!"
        },
        {
          "id": 1142826,
          "postDate": "2021-01-07T16:00:49.663Z",
          "content": "<p><a href=\"https://www.kaggle.com/debarshichanda\" target=\"_blank\">@debarshichanda</a>   <br>\nReally Sorry I didn't see your question.  I've never used RandAugment and UniformAugment.  But I suppose they are faster to fine-tune based on their papers. <br>\nI just use AutoAugment with default policy (heavy to fine-tune) . And It give descent results for all my training. <br>\nYou can find it on the link given by <a href=\"https://www.kaggle.com/keremt\" target=\"_blank\">@keremt</a>  or  simply <a href=\"https://github.com/DeepVoltaire/AutoAugment/blob/master/autoaugment.py\" target=\"_blank\">here</a></p>\n<p>P.S:   I use Torchvision and not Albumentations because it's easier for me to extend while being as fast as Albumentations</p>",
          "rawMarkdown": "@debarshichanda   \nReally Sorry I didn't see your question.  I've never used RandAugment and UniformAugment.  But I suppose they are faster to fine-tune based on their papers. \nI just use AutoAugment with default policy (heavy to fine-tune) . And It give descent results for all my training. \nYou can find it on the link given by @keremt  or  simply [here](https://github.com/DeepVoltaire/AutoAugment/blob/master/autoaugment.py)\n\nP.S:   I use Torchvision and not Albumentations because it's easier for me to extend while being as fast as Albumentations",
          "votes": 1
        },
        {
          "id": 1142840,
          "postDate": "2021-01-07T16:13:07.733Z",
          "content": "<p>Thank you so much <a href=\"https://www.kaggle.com/serigne\" target=\"_blank\">@serigne</a>!</p>",
          "rawMarkdown": "Thank you so much @serigne!"
        }
      ]
    },
    {
      "id": 1139841,
      "postDate": "2021-01-05T16:49:18.663Z",
      "content": "<p>The another one is here - <code>RandAugment</code>.<br>\n<a href=\"https://arxiv.org/abs/1909.13719\" target=\"_blank\">https://arxiv.org/abs/1909.13719</a></p>",
      "rawMarkdown": "The another one is here - `RandAugment`.\nhttps://arxiv.org/abs/1909.13719\n",
      "votes": 1
    },
    {
      "id": 1139996,
      "postDate": "2021-01-05T18:26:25.703Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 1139995,
      "author_name": "Serigne ",
      "author_url": "",
      "post_date": "2021-01-05T18:26:25.703000",
      "content": "<p>I use often AutoAugment but with the default Imagenet Policy. Because looking for the best policy can be computationnally very expensive.</p>\n<p>RandAugment or UniformAugment may be better alternative for faster convergence if you wanna fine-tune best policy</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1140241,
          "author_name": "Debarshi Chanda",
          "author_url": "",
          "post_date": "2021-01-05T21:52:51.777000",
          "content": "<p>Can you share any pytorch implementation of RandAugment or UniformAugment?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1142771,
          "author_name": "Kerem Turgutlu",
          "author_url": "",
          "post_date": "2021-01-07T15:28:46.430000",
          "content": "<p>Check this out: <a href=\"https://github.com/rwightman/pytorch-image-models/blob/186075ef03b2400ade0fcb7410621ba752223e0a/timm/data/auto_augment.py#L334\" target=\"_blank\">https://github.com/rwightman/pytorch-image-models/blob/186075ef03b2400ade0fcb7410621ba752223e0a/timm/data/auto_augment.py#L334</a></p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1142794,
          "author_name": "Debarshi Chanda",
          "author_url": "",
          "post_date": "2021-01-07T15:36:39.137000",
          "content": "<p>Thank you!</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1142826,
          "author_name": "Serigne ",
          "author_url": "",
          "post_date": "2021-01-07T16:00:49.663000",
          "content": "<p><a href=\"https://www.kaggle.com/debarshichanda\" target=\"_blank\">@debarshichanda</a>   <br>\nReally Sorry I didn't see your question.  I've never used RandAugment and UniformAugment.  But I suppose they are faster to fine-tune based on their papers. <br>\nI just use AutoAugment with default policy (heavy to fine-tune) . And It give descent results for all my training. <br>\nYou can find it on the link given by <a href=\"https://www.kaggle.com/keremt\" target=\"_blank\">@keremt</a>  or  simply <a href=\"https://github.com/DeepVoltaire/AutoAugment/blob/master/autoaugment.py\" target=\"_blank\">here</a></p>\n<p>P.S:   I use Torchvision and not Albumentations because it's easier for me to extend while being as fast as Albumentations</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1142840,
          "author_name": "Debarshi Chanda",
          "author_url": "",
          "post_date": "2021-01-07T16:13:07.733000",
          "content": "<p>Thank you so much <a href=\"https://www.kaggle.com/serigne\" target=\"_blank\">@serigne</a>!</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1139841,
      "author_name": "Heroseo",
      "author_url": "",
      "post_date": "2021-01-05T16:49:18.663000",
      "content": "<p>The another one is here - <code>RandAugment</code>.<br>\n<a href=\"https://arxiv.org/abs/1909.13719\" target=\"_blank\">https://arxiv.org/abs/1909.13719</a></p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 1139996,
      "author_name": "",
      "author_url": "",
      "post_date": "2021-01-05T18:26:25.703000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1139521": "Augmentation is a very important step in an image model, but with a lot of hyperparameters and almost infinite permutations it can be quite a difficult task deciding which policies work better than others. It is proposed that by either defining an adversarial network or by calculating gradients of the augmentation functions we can arrive at a better augmentation policy.\n\nThe papers explaining how it can perform better than handpicked augmentations:\nAutoAugment: https://arxiv.org/abs/1805.09501\nFaster AutoAugment: https://arxiv.org/abs/1911.06987\n\nAlbumentations has an implementation of Faster AutoAugment called AutoAlbument, the downside is that kaggle doesn't support it (as far as i tried). Which is super simple to setup, all you need to do is provide a dataset.py that reads the cassava dataset and if you want to, edit the parameter file by replacing for instance the model it uses for the classification task.\n\nYou can find AutoAlbument here: https://albumentations.ai/docs/autoalbument/how_to_use/\n\nYou need to have a computer that can run torch >= 1.6 and has cuda >=10.0.\n\nIf that is available to you, please share if it improved your model!!\n\n",
    "1139995": "I use often AutoAugment but with the default Imagenet Policy. Because looking for the best policy can be computationnally very expensive.\n\nRandAugment or UniformAugment may be better alternative for faster convergence if you wanna fine-tune best policy\n\n",
    "1139841": "The another one is here - `RandAugment`.\nhttps://arxiv.org/abs/1909.13719\n",
    "1139996": ""
  }
}