{
  "id": 99243,
  "title": "Domain Adaptation",
  "url": "/competitions/recursion-cellular-image-classification/discussion/99243",
  "author_name": "",
  "post_date": "2019-07-09T20:21:50.588314400Z",
  "votes": 5,
  "comment_count": 9,
  "views": 0,
  "content": "<p>Hi all, </p>\n\n<p>The images from this dataset belong to the biology domain which is very different from the natural scenes that we can get in most of the public datasets. \n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1169433%2F04efac493d3781e8e0bd1acc228ea8cb%2FScreenshot%20from%202019-07-09%2021-01-05.png?generation=1562703515986758&amp;alt=media\" alt=\"\"></p>\n\n<p>I would not consider using Transfer Learning from a model pre-trained on such dataset as the domain of application is very distant, but rather training from scratch an architecture or using Transfer Learning from a similar dataset. I have been looking for similar datasets to see how people have tackled this in the past. I may look at this amazing list of datasets during the competition to see if that's possible: <a href=\"https://github.com/awesomedata/awesome-public-datasets#biology\">https://github.com/awesomedata/awesome-public-datasets#biology</a>.</p>\n\n<p>The dataset is made of about 100k images for 1k labels, so this should be possible however I would love to have your opinions on this!</p>",
  "messages": [
    {
      "id": "571610",
      "postDate": "07/09/2019 20:21:50",
      "content": "<p>Hi all, </p>\n\n<p>The images from this dataset belong to the biology domain which is very different from the natural scenes that we can get in most of the public datasets. \n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1169433%2F04efac493d3781e8e0bd1acc228ea8cb%2FScreenshot%20from%202019-07-09%2021-01-05.png?generation=1562703515986758&amp;alt=media\" alt=\"\"></p>\n\n<p>I would not consider using Transfer Learning from a model pre-trained on such dataset as the domain of application is very distant, but rather training from scratch an architecture or using Transfer Learning from a similar dataset. I have been looking for similar datasets to see how people have tackled this in the past. I may look at this amazing list of datasets during the competition to see if that's possible: <a href=\"https://github.com/awesomedata/awesome-public-datasets#biology\">https://github.com/awesomedata/awesome-public-datasets#biology</a>.</p>\n\n<p>The dataset is made of about 100k images for 1k labels, so this should be possible however I would love to have your opinions on this!</p>",
      "rawMarkdown": "Hi all, \n\nThe images from this dataset belong to the biology domain which is very different from the natural scenes that we can get in most of the public datasets. \n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1169433%2F04efac493d3781e8e0bd1acc228ea8cb%2FScreenshot%20from%202019-07-09%2021-01-05.png?generation=1562703515986758&amp;alt=media)\n\nI would not consider using Transfer Learning from a model pre-trained on such dataset as the domain of application is very distant, but rather training from scratch an architecture or using Transfer Learning from a similar dataset. I have been looking for similar datasets to see how people have tackled this in the past. I may look at this amazing list of datasets during the competition to see if that's possible: [https://github.com/awesomedata/awesome-public-datasets#biology](https://github.com/awesomedata/awesome-public-datasets#biology).\n\nThe dataset is made of about 100k images for 1k labels, so this should be possible however I would love to have your opinions on this!",
      "votes": null
    },
    {
      "id": "571618",
      "postDate": "07/09/2019 20:40:32",
      "content": "<p>From my experience, using ImageNet pretrained models is almost always beneficial, even if the target domain seems to be very different from the natural images. A pretrained model has already seen millions of images and learned all imaginable types of edge and gradient detectors inside, so it's not really wise to waste so precious time doing this job again. </p>",
      "rawMarkdown": "From my experience, using ImageNet pretrained models is almost always beneficial, even if the target domain seems to be very different from the natural images. A pretrained model has already seen millions of images and learned all imaginable types of edge and gradient detectors inside, so it's not really wise to waste so precious time doing this job again.",
      "votes": null
    },
    {
      "id": "572014",
      "postDate": "07/10/2019 10:53:20",
      "content": "<p>In that case, using ImageNet pretrained models are actually good initiate weights. It's not finetune it's train from zero  with initial from pretrain. 1M images - good but all images is real life and don't represent specific biology images</p>",
      "rawMarkdown": "In that case, using ImageNet pretrained models are actually good initiate weights. It's not finetune it's train from zero  with initial from pretrain. 1M images - good but all images is real life and don't represent specific biology images",
      "votes": null
    },
    {
      "id": "572055",
      "postDate": "07/10/2019 11:56:42",
      "content": "<p>Sure, these pretrained networks should be probably trained for quite a long time in order to adapt to a new domain. What I really wanted to point out is that starting from a pretrained checkpoint is a better strategy compared to a random initialization regardless of the target domain, since in this case you already have quite good low-level feature extractors that seem to be common to almost any images.</p>",
      "rawMarkdown": "Sure, these pretrained networks should be probably trained for quite a long time in order to adapt to a new domain. What I really wanted to point out is that starting from a pretrained checkpoint is a better strategy compared to a random initialization regardless of the target domain, since in this case you already have quite good low-level feature extractors that seem to be common to almost any images.",
      "votes": null
    },
    {
      "id": "572290",
      "postDate": "07/10/2019 18:24:17",
      "content": "<p>Thanks for commenting!</p>\n\n<p>The thing is that if you use a pre-trained model on a RGB dataset then you won't make the most of the spectral information as you will have to reshape the image of depth 6 into a standard image of depth 3. I think that the 6 bands contains different spectral information and some cells may be more receptive to different lights.</p>\n\n<p>Any thoughts?</p>",
      "rawMarkdown": "Thanks for commenting!\n\nThe thing is that if you use a pre-trained model on a RGB dataset then you won't make the most of the spectral information as you will have to reshape the image of depth 6 into a standard image of depth 3. I think that the 6 bands contains different spectral information and some cells may be more receptive to different lights.\n\nAny thoughts?",
      "votes": null
    },
    {
      "id": "572334",
      "postDate": "07/10/2019 19:29:36",
      "content": "<p>It is absolutely fine to use 6 channel images with an RGB pretrained net. You just need to replace the first convolution with a new one and initialize the kernel properly in order to keep approximately the same variance that the original model had.</p>",
      "rawMarkdown": "It is absolutely fine to use 6 channel images with an RGB pretrained net. You just need to replace the first convolution with a new one and initialize the kernel properly in order to keep approximately the same variance that the original model had.",
      "votes": null
    },
    {
      "id": "573266",
      "postDate": "07/12/2019 03:48:42",
      "content": "<p>This paper is relevant to your question: <a href=\"https://www.biorxiv.org/content/10.1101/161422v1\">https://www.biorxiv.org/content/10.1101/161422v1</a></p>\n\n<p>In it researchers from Google use a pretrained model (trained on 100 million RGB consumer images) to get State-of-the-Art results on a standard microscopy dataset/task (<a href=\"https://data.broadinstitute.org/bbbc/BBBC021/\">https://data.broadinstitute.org/bbbc/BBBC021/</a>).  See the \"Overview of the approach\" in the section in that paper to understand how they adapted the pre-trained model to the different channels.</p>",
      "rawMarkdown": "This paper is relevant to your question: https://www.biorxiv.org/content/10.1101/161422v1\n\nIn it researchers from Google use a pretrained model (trained on 100 million RGB consumer images) to get State-of-the-Art results on a standard microscopy dataset/task (https://data.broadinstitute.org/bbbc/BBBC021/).  See the \"Overview of the approach\" in the section in that paper to understand how they adapted the pre-trained model to the different channels.",
      "votes": null
    },
    {
      "id": "573273",
      "postDate": "07/12/2019 04:19:34",
      "content": "<p>Excellent. Thanks!</p>",
      "rawMarkdown": "Excellent. Thanks!",
      "votes": null
    },
    {
      "id": "573476",
      "postDate": "07/12/2019 10:27:35",
      "content": "<p>Thanks for the tips!</p>",
      "rawMarkdown": "Thanks for the tips!",
      "votes": null
    },
    {
      "id": "863699",
      "postDate": "05/27/2020 13:53:51",
      "content": "<p>I haven't thought about that. Thanks!</p>",
      "rawMarkdown": "I haven't thought about that. Thanks!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 571618,
      "author_name": "ddanevskyi",
      "author_url": "",
      "post_date": "07/09/2019 20:40:32",
      "content": "<p>From my experience, using ImageNet pretrained models is almost always beneficial, even if the target domain seems to be very different from the natural images. A pretrained model has already seen millions of images and learned all imaginable types of edge and gradient detectors inside, so it's not really wise to waste so precious time doing this job again. </p>",
      "votes": null,
      "replies": [
        {
          "id": 572014,
          "author_name": "leighplt",
          "author_url": "",
          "post_date": "07/10/2019 10:53:20",
          "content": "<p>In that case, using ImageNet pretrained models are actually good initiate weights. It's not finetune it's train from zero  with initial from pretrain. 1M images - good but all images is real life and don't represent specific biology images</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 572055,
          "author_name": "ddanevskyi",
          "author_url": "",
          "post_date": "07/10/2019 11:56:42",
          "content": "<p>Sure, these pretrained networks should be probably trained for quite a long time in order to adapt to a new domain. What I really wanted to point out is that starting from a pretrained checkpoint is a better strategy compared to a random initialization regardless of the target domain, since in this case you already have quite good low-level feature extractors that seem to be common to almost any images.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 572290,
      "author_name": "pheaboo",
      "author_url": "",
      "post_date": "07/10/2019 18:24:17",
      "content": "<p>Thanks for commenting!</p>\n\n<p>The thing is that if you use a pre-trained model on a RGB dataset then you won't make the most of the spectral information as you will have to reshape the image of depth 6 into a standard image of depth 3. I think that the 6 bands contains different spectral information and some cells may be more receptive to different lights.</p>\n\n<p>Any thoughts?</p>",
      "votes": null,
      "replies": [
        {
          "id": 572334,
          "author_name": "ddanevskyi",
          "author_url": "",
          "post_date": "07/10/2019 19:29:36",
          "content": "<p>It is absolutely fine to use 6 channel images with an RGB pretrained net. You just need to replace the first convolution with a new one and initialize the kernel properly in order to keep approximately the same variance that the original model had.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 863699,
          "author_name": "pheaboo",
          "author_url": "",
          "post_date": "05/27/2020 13:53:51",
          "content": "<p>I haven't thought about that. Thanks!</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 573266,
      "author_name": "bmabey",
      "author_url": "",
      "post_date": "07/12/2019 03:48:42",
      "content": "<p>This paper is relevant to your question: <a href=\"https://www.biorxiv.org/content/10.1101/161422v1\">https://www.biorxiv.org/content/10.1101/161422v1</a></p>\n\n<p>In it researchers from Google use a pretrained model (trained on 100 million RGB consumer images) to get State-of-the-Art results on a standard microscopy dataset/task (<a href=\"https://data.broadinstitute.org/bbbc/BBBC021/\">https://data.broadinstitute.org/bbbc/BBBC021/</a>).  See the \"Overview of the approach\" in the section in that paper to understand how they adapted the pre-trained model to the different channels.</p>",
      "votes": null,
      "replies": [
        {
          "id": 573273,
          "author_name": "interneuron",
          "author_url": "",
          "post_date": "07/12/2019 04:19:34",
          "content": "<p>Excellent. Thanks!</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 573476,
          "author_name": "pheaboo",
          "author_url": "",
          "post_date": "07/12/2019 10:27:35",
          "content": "<p>Thanks for the tips!</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "571610": "Hi all, \n\nThe images from this dataset belong to the biology domain which is very different from the natural scenes that we can get in most of the public datasets. \n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1169433%2F04efac493d3781e8e0bd1acc228ea8cb%2FScreenshot%20from%202019-07-09%2021-01-05.png?generation=1562703515986758&amp;alt=media)\n\nI would not consider using Transfer Learning from a model pre-trained on such dataset as the domain of application is very distant, but rather training from scratch an architecture or using Transfer Learning from a similar dataset. I have been looking for similar datasets to see how people have tackled this in the past. I may look at this amazing list of datasets during the competition to see if that's possible: [https://github.com/awesomedata/awesome-public-datasets#biology](https://github.com/awesomedata/awesome-public-datasets#biology).\n\nThe dataset is made of about 100k images for 1k labels, so this should be possible however I would love to have your opinions on this!",
    "571618": "From my experience, using ImageNet pretrained models is almost always beneficial, even if the target domain seems to be very different from the natural images. A pretrained model has already seen millions of images and learned all imaginable types of edge and gradient detectors inside, so it's not really wise to waste so precious time doing this job again.",
    "572014": "In that case, using ImageNet pretrained models are actually good initiate weights. It's not finetune it's train from zero  with initial from pretrain. 1M images - good but all images is real life and don't represent specific biology images",
    "572055": "Sure, these pretrained networks should be probably trained for quite a long time in order to adapt to a new domain. What I really wanted to point out is that starting from a pretrained checkpoint is a better strategy compared to a random initialization regardless of the target domain, since in this case you already have quite good low-level feature extractors that seem to be common to almost any images.",
    "572290": "Thanks for commenting!\n\nThe thing is that if you use a pre-trained model on a RGB dataset then you won't make the most of the spectral information as you will have to reshape the image of depth 6 into a standard image of depth 3. I think that the 6 bands contains different spectral information and some cells may be more receptive to different lights.\n\nAny thoughts?",
    "572334": "It is absolutely fine to use 6 channel images with an RGB pretrained net. You just need to replace the first convolution with a new one and initialize the kernel properly in order to keep approximately the same variance that the original model had.",
    "573266": "This paper is relevant to your question: https://www.biorxiv.org/content/10.1101/161422v1\n\nIn it researchers from Google use a pretrained model (trained on 100 million RGB consumer images) to get State-of-the-Art results on a standard microscopy dataset/task (https://data.broadinstitute.org/bbbc/BBBC021/).  See the \"Overview of the approach\" in the section in that paper to understand how they adapted the pre-trained model to the different channels.",
    "573273": "Excellent. Thanks!",
    "573476": "Thanks for the tips!",
    "863699": "I haven't thought about that. Thanks!"
  },
  "source": "meta"
}