{
  "id": 133393,
  "title": "Help needed with Normalize",
  "url": "/competitions/bengaliai-cv19/discussion/133393",
  "author_name": "",
  "post_date": "2020-03-02T13:55:41.755254Z",
  "votes": null,
  "comment_count": 3,
  "views": 0,
  "content": "<p>When I train any of the models with normalized image data, I am getting really bad validation accuracy which gets worse when I train more and completely incorrect predictions with the trained models. Any idea on what might cause this ?\nI am using:\n<code>\ntransforms = albumentations.Compose([Normalize(mean=(0.0692), std=(0.2051))])\n</code>\non both my train as well as test dataset. If I remove this, the model trains fine and got 0.955 LB.\nAny help is really appreciated, thanks.</p>",
  "messages": [
    {
      "id": "761421",
      "postDate": "03/02/2020 13:55:41",
      "content": "<p>When I train any of the models with normalized image data, I am getting really bad validation accuracy which gets worse when I train more and completely incorrect predictions with the trained models. Any idea on what might cause this ?\nI am using:\n<code>\ntransforms = albumentations.Compose([Normalize(mean=(0.0692), std=(0.2051))])\n</code>\non both my train as well as test dataset. If I remove this, the model trains fine and got 0.955 LB.\nAny help is really appreciated, thanks.</p>",
      "rawMarkdown": "When I train any of the models with normalized image data, I am getting really bad validation accuracy which gets worse when I train more and completely incorrect predictions with the trained models. Any idea on what might cause this ?\nI am using:\n`\ntransforms = albumentations.Compose([Normalize(mean=(0.0692), std=(0.2051))])\n`\non both my train as well as test dataset. If I remove this, the model trains fine and got 0.955 LB.\nAny help is really appreciated, thanks.",
      "votes": null
    },
    {
      "id": "761433",
      "postDate": "03/02/2020 14:11:52",
      "content": "<p>No way to tell without looking at your code. My guess is you're already normalizing your data somewhere else in your pipeline, e.g. on the images directly or elsewhere, and so this particular augmentation line is actually tipping you away from 0-mean.</p>",
      "rawMarkdown": "No way to tell without looking at your code. My guess is you're already normalizing your data somewhere else in your pipeline, e.g. on the images directly or elsewhere, and so this particular augmentation line is actually tipping you away from 0-mean.",
      "votes": null
    },
    {
      "id": "761439",
      "postDate": "03/02/2020 14:20:11",
      "content": "<p>`\nimage = (image*(255.0/image.max())).astype(np.uint8)</p>\n\n<p>image = image.astype(np.float)/255.0\n`\nThis is what I am doing for each image and I have already done 255 - image</p>",
      "rawMarkdown": "`\nimage = (image*(255.0/image.max())).astype(np.uint8)\n\nimage = image.astype(np.float)/255.0\n`\nThis is what I am doing for each image and I have already done 255 - image",
      "votes": null
    },
    {
      "id": "761499",
      "postDate": "03/02/2020 15:47:21",
      "content": "<p>Are you normalizing twice?</p>",
      "rawMarkdown": "Are you normalizing twice?",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 761433,
      "author_name": "authman",
      "author_url": "",
      "post_date": "03/02/2020 14:11:52",
      "content": "<p>No way to tell without looking at your code. My guess is you're already normalizing your data somewhere else in your pipeline, e.g. on the images directly or elsewhere, and so this particular augmentation line is actually tipping you away from 0-mean.</p>",
      "votes": null,
      "replies": [
        {
          "id": 761439,
          "author_name": "utsavnandi",
          "author_url": "",
          "post_date": "03/02/2020 14:20:11",
          "content": "<p>`\nimage = (image*(255.0/image.max())).astype(np.uint8)</p>\n\n<p>image = image.astype(np.float)/255.0\n`\nThis is what I am doing for each image and I have already done 255 - image</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 761499,
      "author_name": "mightyrains",
      "author_url": "",
      "post_date": "03/02/2020 15:47:21",
      "content": "<p>Are you normalizing twice?</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "761421": "When I train any of the models with normalized image data, I am getting really bad validation accuracy which gets worse when I train more and completely incorrect predictions with the trained models. Any idea on what might cause this ?\nI am using:\n`\ntransforms = albumentations.Compose([Normalize(mean=(0.0692), std=(0.2051))])\n`\non both my train as well as test dataset. If I remove this, the model trains fine and got 0.955 LB.\nAny help is really appreciated, thanks.",
    "761433": "No way to tell without looking at your code. My guess is you're already normalizing your data somewhere else in your pipeline, e.g. on the images directly or elsewhere, and so this particular augmentation line is actually tipping you away from 0-mean.",
    "761439": "`\nimage = (image*(255.0/image.max())).astype(np.uint8)\n\nimage = image.astype(np.float)/255.0\n`\nThis is what I am doing for each image and I have already done 255 - image",
    "761499": "Are you normalizing twice?"
  },
  "source": "meta"
}