{
  "id": 211686,
  "title": "Comparison of Using ImageNet Normalization and Dataset Normalization",
  "url": "/competitions/cassava-leaf-disease-classification/discussion/211686",
  "author_name": "",
  "post_date": "2021-01-16T07:06:47.057486200Z",
  "votes": 6,
  "comment_count": 9,
  "views": 0,
  "content": "<p>I recently learned that using Custom Dataset Mean and Std Normalization can help your model to learn and perform better. Hence I have tried to compare the images by normalizing with Normal Stats and ImageNet Stats</p>\n<p>Means and STD's used - </p>\n<pre><code>ImageNet - \n Mean - [0.485, 0.456, 0.406] \n STD - [0.229, 0.224, 0.225]\n\nDataset - \n Mean - [0.4303, 0.4967, 0.3134]\n STD - [0.2142, 0.2191, 0.1954]\n</code></pre>\n<p>I have taken the values from <a href=\"https://www.kaggle.com/woshifym/cassava-mean-std-calculation/notebook\" target=\"_blank\">this</a> notebook.<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4630396%2Fecc23148ecbc394237d240e64c35de30%2Fcomparison.png?generation=1610780740528070&amp;alt=media\" alt=\"\"></p>\n<p>Interested to know your thoughts on these images.</p>",
  "messages": [
    {
      "id": "1155060",
      "postDate": "01/16/2021 07:06:47",
      "content": "<p>I recently learned that using Custom Dataset Mean and Std Normalization can help your model to learn and perform better. Hence I have tried to compare the images by normalizing with Normal Stats and ImageNet Stats</p>\n<p>Means and STD's used - </p>\n<pre><code>ImageNet - \n Mean - [0.485, 0.456, 0.406] \n STD - [0.229, 0.224, 0.225]\n\nDataset - \n Mean - [0.4303, 0.4967, 0.3134]\n STD - [0.2142, 0.2191, 0.1954]\n</code></pre>\n<p>I have taken the values from <a href=\"https://www.kaggle.com/woshifym/cassava-mean-std-calculation/notebook\" target=\"_blank\">this</a> notebook.<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4630396%2Fecc23148ecbc394237d240e64c35de30%2Fcomparison.png?generation=1610780740528070&amp;alt=media\" alt=\"\"></p>\n<p>Interested to know your thoughts on these images.</p>",
      "rawMarkdown": "I recently learned that using Custom Dataset Mean and Std Normalization can help your model to learn and perform better. Hence I have tried to compare the images by normalizing with Normal Stats and ImageNet Stats\n\nMeans and STD's used - \n```\nImageNet - \n Mean - [0.485, 0.456, 0.406] \n STD - [0.229, 0.224, 0.225]\n\nDataset - \n Mean - [0.4303, 0.4967, 0.3134]\n STD - [0.2142, 0.2191, 0.1954]\n```\nI have taken the values from [this](https://www.kaggle.com/woshifym/cassava-mean-std-calculation/notebook) notebook.\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4630396%2Fecc23148ecbc394237d240e64c35de30%2Fcomparison.png?generation=1610780740528070&alt=media)\n\nInterested to know your thoughts on these images.",
      "votes": null
    },
    {
      "id": "1155075",
      "postDate": "01/16/2021 07:24:34",
      "content": "<p>i tried with and without normalization in the past and never observed much difference,let me know if you get boost in CV with dataset normalization in this competition,thank you</p>",
      "rawMarkdown": "i tried with and without normalization in the past and never observed much difference,let me know if you get boost in CV with dataset normalization in this competition,thank you",
      "votes": null
    },
    {
      "id": "1155078",
      "postDate": "01/16/2021 07:29:36",
      "content": "<p>Definitely. I will report back my results here.</p>",
      "rawMarkdown": "Definitely. I will report back my results here.",
      "votes": null
    },
    {
      "id": "1155249",
      "postDate": "01/16/2021 10:21:04",
      "content": "<p>Here are my Model training results - <br>\nI changed the Mean and STD of my Notebook <a href=\"https://www.kaggle.com/yerramvarun/cassava-taylorce-loss-label-smoothing-combo\" target=\"_blank\">here</a></p>\n<pre><code>Best Accuracy with ImageNet Normalization - 0.89319934\nBest Accuracy with Custom Normalization - 0.89390044 \n</code></pre>\n<p>Using Custom Dataset Normalization Helps with the CV.</p>",
      "rawMarkdown": "Here are my Model training results - \nI changed the Mean and STD of my Notebook [here](https://www.kaggle.com/yerramvarun/cassava-taylorce-loss-label-smoothing-combo)\n\n```\nBest Accuracy with ImageNet Normalization - 0.89319934\nBest Accuracy with Custom Normalization - 0.89390044 \n```\nUsing Custom Dataset Normalization Helps with the CV.",
      "votes": null
    },
    {
      "id": "1155382",
      "postDate": "01/16/2021 11:22:02",
      "content": "<p>now train without any normalization and observe the difference?</p>",
      "rawMarkdown": "now train without any normalization and observe the difference?",
      "votes": null
    },
    {
      "id": "1155720",
      "postDate": "01/16/2021 15:54:38",
      "content": "<p><a href=\"https://www.kaggle.com/mobassir\" target=\"_blank\">@mobassir</a> I have run the training without any normalization and it performs slightly worse than the other two.</p>\n<pre><code>Best Accuracy without any Normalization - 0.8903949\n</code></pre>",
      "rawMarkdown": "mobassir I have run the training without any normalization and it performs slightly worse than the other two.\n```\nBest Accuracy without any Normalization - 0.8903949\n```",
      "votes": null
    },
    {
      "id": "1155770",
      "postDate": "01/16/2021 16:56:54",
      "content": "<p>Are you sure that a difference at fourth decimal place is significant for this competition ??</p>",
      "rawMarkdown": "Are you sure that a difference at fourth decimal place is significant for this competition ??",
      "votes": null
    },
    {
      "id": "1155827",
      "postDate": "01/16/2021 17:45:22",
      "content": "<p>I understand that it might seem insignificant, but do consider that the above values are for a single fold and using a loss which is not used generally, I am currently training for remaining folds and using a common loss and then I can say for sure if they matter or not.</p>",
      "rawMarkdown": "I understand that it might seem insignificant, but do consider that the above values are for a single fold and using a loss which is not used generally, I am currently training for remaining folds and using a common loss and then I can say for sure if they matter or not.",
      "votes": null
    },
    {
      "id": "1155876",
      "postDate": "01/16/2021 18:31:55",
      "content": "<p>Frankly, I am having a hard time understanding why the change in the normalization would have any effect at all. After all, renormalizing the images is just a simple linear transformation. Our neural net with millions trainable parameters should have no problem learning such a transformation if it is indeed beneficial. Please let me know if I am missing something.</p>",
      "rawMarkdown": "Frankly, I am having a hard time understanding why the change in the normalization would have any effect at all. After all, renormalizing the images is just a simple linear transformation. Our neural net with millions trainable parameters should have no problem learning such a transformation if it is indeed beneficial. Please let me know if I am missing something.",
      "votes": null
    },
    {
      "id": "1155934",
      "postDate": "01/16/2021 19:33:10",
      "content": "<p>Agreed<br>\nI read many stuffs in discussion topics here that I am sure have, at best,  very marginal impact on model performance. <br>\nBut it may be a misinterpretation on my part to reassure myself because I don't have GPU/Time to try them out ^^</p>",
      "rawMarkdown": "Agreed\nI read many stuffs in discussion topics here that I am sure have, at best,  very marginal impact on model performance. \nBut it may be a misinterpretation on my part to reassure myself because I don't have GPU/Time to try them out ^^",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1155075,
      "author_name": "mobassir",
      "author_url": "",
      "post_date": "01/16/2021 07:24:34",
      "content": "<p>i tried with and without normalization in the past and never observed much difference,let me know if you get boost in CV with dataset normalization in this competition,thank you</p>",
      "votes": null,
      "replies": [
        {
          "id": 1155078,
          "author_name": "yerramvarun",
          "author_url": "",
          "post_date": "01/16/2021 07:29:36",
          "content": "<p>Definitely. I will report back my results here.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1155249,
      "author_name": "yerramvarun",
      "author_url": "",
      "post_date": "01/16/2021 10:21:04",
      "content": "<p>Here are my Model training results - <br>\nI changed the Mean and STD of my Notebook <a href=\"https://www.kaggle.com/yerramvarun/cassava-taylorce-loss-label-smoothing-combo\" target=\"_blank\">here</a></p>\n<pre><code>Best Accuracy with ImageNet Normalization - 0.89319934\nBest Accuracy with Custom Normalization - 0.89390044 \n</code></pre>\n<p>Using Custom Dataset Normalization Helps with the CV.</p>",
      "votes": null,
      "replies": [
        {
          "id": 1155382,
          "author_name": "mobassir",
          "author_url": "",
          "post_date": "01/16/2021 11:22:02",
          "content": "<p>now train without any normalization and observe the difference?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1155720,
          "author_name": "yerramvarun",
          "author_url": "",
          "post_date": "01/16/2021 15:54:38",
          "content": "<p><a href=\"https://www.kaggle.com/mobassir\" target=\"_blank\">@mobassir</a> I have run the training without any normalization and it performs slightly worse than the other two.</p>\n<pre><code>Best Accuracy without any Normalization - 0.8903949\n</code></pre>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1155770,
          "author_name": "ks2019",
          "author_url": "",
          "post_date": "01/16/2021 16:56:54",
          "content": "<p>Are you sure that a difference at fourth decimal place is significant for this competition ??</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1155827,
          "author_name": "yerramvarun",
          "author_url": "",
          "post_date": "01/16/2021 17:45:22",
          "content": "<p>I understand that it might seem insignificant, but do consider that the above values are for a single fold and using a loss which is not used generally, I am currently training for remaining folds and using a common loss and then I can say for sure if they matter or not.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1155876,
      "author_name": "graf10a",
      "author_url": "",
      "post_date": "01/16/2021 18:31:55",
      "content": "<p>Frankly, I am having a hard time understanding why the change in the normalization would have any effect at all. After all, renormalizing the images is just a simple linear transformation. Our neural net with millions trainable parameters should have no problem learning such a transformation if it is indeed beneficial. Please let me know if I am missing something.</p>",
      "votes": null,
      "replies": [
        {
          "id": 1155934,
          "author_name": "serigne",
          "author_url": "",
          "post_date": "01/16/2021 19:33:10",
          "content": "<p>Agreed<br>\nI read many stuffs in discussion topics here that I am sure have, at best,  very marginal impact on model performance. <br>\nBut it may be a misinterpretation on my part to reassure myself because I don't have GPU/Time to try them out ^^</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1155060": "I recently learned that using Custom Dataset Mean and Std Normalization can help your model to learn and perform better. Hence I have tried to compare the images by normalizing with Normal Stats and ImageNet Stats\n\nMeans and STD's used - \n```\nImageNet - \n Mean - [0.485, 0.456, 0.406] \n STD - [0.229, 0.224, 0.225]\n\nDataset - \n Mean - [0.4303, 0.4967, 0.3134]\n STD - [0.2142, 0.2191, 0.1954]\n```\nI have taken the values from [this](https://www.kaggle.com/woshifym/cassava-mean-std-calculation/notebook) notebook.\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F4630396%2Fecc23148ecbc394237d240e64c35de30%2Fcomparison.png?generation=1610780740528070&alt=media)\n\nInterested to know your thoughts on these images.",
    "1155075": "i tried with and without normalization in the past and never observed much difference,let me know if you get boost in CV with dataset normalization in this competition,thank you",
    "1155078": "Definitely. I will report back my results here.",
    "1155249": "Here are my Model training results - \nI changed the Mean and STD of my Notebook [here](https://www.kaggle.com/yerramvarun/cassava-taylorce-loss-label-smoothing-combo)\n\n```\nBest Accuracy with ImageNet Normalization - 0.89319934\nBest Accuracy with Custom Normalization - 0.89390044 \n```\nUsing Custom Dataset Normalization Helps with the CV.",
    "1155382": "now train without any normalization and observe the difference?",
    "1155720": "mobassir I have run the training without any normalization and it performs slightly worse than the other two.\n```\nBest Accuracy without any Normalization - 0.8903949\n```",
    "1155770": "Are you sure that a difference at fourth decimal place is significant for this competition ??",
    "1155827": "I understand that it might seem insignificant, but do consider that the above values are for a single fold and using a loss which is not used generally, I am currently training for remaining folds and using a common loss and then I can say for sure if they matter or not.",
    "1155876": "Frankly, I am having a hard time understanding why the change in the normalization would have any effect at all. After all, renormalizing the images is just a simple linear transformation. Our neural net with millions trainable parameters should have no problem learning such a transformation if it is indeed beneficial. Please let me know if I am missing something.",
    "1155934": "Agreed\nI read many stuffs in discussion topics here that I am sure have, at best,  very marginal impact on model performance. \nBut it may be a misinterpretation on my part to reassure myself because I don't have GPU/Time to try them out ^^"
  },
  "source": "meta"
}