{
  "id": 210615,
  "title": "Working with single channel data",
  "url": "/competitions/vinbigdata-chest-xray-abnormalities-detection/discussion/210615",
  "author_name": "DeepUnderstanding",
  "post_date": "2021-01-11T13:11:21.019000",
  "votes": 4,
  "comment_count": 1,
  "views": 0,
  "content": "<p>working with single-channel data, which many pretrained networks do not support one of the ways to make it 3 channel is stacking the same image 3 times as seen on <a href=\"https://www.kaggle.com/pestipeti/vinbigdata-fasterrcnn-pytorch-train/notebook\" target=\"_blank\">https://www.kaggle.com/pestipeti/vinbigdata-fasterrcnn-pytorch-train/notebook</a><br>\nCan you suggest some more ideas?<br>\nThank you.</p>",
  "messages": [
    {
      "id": 1148895,
      "postDate": "2021-01-11T13:11:21.020Z",
      "content": "<p>working with single-channel data, which many pretrained networks do not support one of the ways to make it 3 channel is stacking the same image 3 times as seen on <a href=\"https://www.kaggle.com/pestipeti/vinbigdata-fasterrcnn-pytorch-train/notebook\" target=\"_blank\">https://www.kaggle.com/pestipeti/vinbigdata-fasterrcnn-pytorch-train/notebook</a><br>\nCan you suggest some more ideas?<br>\nThank you.</p>",
      "rawMarkdown": "working with single-channel data, which many pretrained networks do not support one of the ways to make it 3 channel is stacking the same image 3 times as seen on https://www.kaggle.com/pestipeti/vinbigdata-fasterrcnn-pytorch-train/notebook\nCan you suggest some more ideas?\nThank you.",
      "votes": 4
    },
    {
      "id": 1149445,
      "postDate": "2021-01-11T20:56:46.417Z",
      "content": "<p>You can change first Conv layer expecting 3 channels (e.g. RGB) to a Conv layer with only 1 (e.g. Grayscale). Then in order to load the pretrained weights you can average them for that layer. That works because <code>R*w0+G*w1+B*w2</code> is equivalent to <code>R*(w0+w1+w2)</code> when <code>R=G=B</code>.</p>",
      "rawMarkdown": "You can change first Conv layer expecting 3 channels (e.g. RGB) to a Conv layer with only 1 (e.g. Grayscale). Then in order to load the pretrained weights you can average them for that layer. That works because `R*w0+G*w1+B*w2` is equivalent to `R*(w0+w1+w2)` when `R=G=B`.",
      "votes": 1
    }
  ],
  "comments": [
    {
      "id": 1149445,
      "author_name": "cayala",
      "author_url": "",
      "post_date": "2021-01-11T20:56:46.417000",
      "content": "<p>You can change first Conv layer expecting 3 channels (e.g. RGB) to a Conv layer with only 1 (e.g. Grayscale). Then in order to load the pretrained weights you can average them for that layer. That works because <code>R*w0+G*w1+B*w2</code> is equivalent to <code>R*(w0+w1+w2)</code> when <code>R=G=B</code>.</p>",
      "votes": 1,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1148895": "working with single-channel data, which many pretrained networks do not support one of the ways to make it 3 channel is stacking the same image 3 times as seen on https://www.kaggle.com/pestipeti/vinbigdata-fasterrcnn-pytorch-train/notebook\nCan you suggest some more ideas?\nThank you.",
    "1149445": "You can change first Conv layer expecting 3 channels (e.g. RGB) to a Conv layer with only 1 (e.g. Grayscale). Then in order to load the pretrained weights you can average them for that layer. That works because `R*w0+G*w1+B*w2` is equivalent to `R*(w0+w1+w2)` when `R=G=B`."
  }
}