{
  "id": 389275,
  "title": "'pretrained or not pretrained'",
  "url": "/competitions/rsna-breast-cancer-detection/discussion/389275",
  "author_name": "GUNER",
  "post_date": "2023-02-21T09:58:11.803000",
  "votes": 1,
  "comment_count": 5,
  "views": 0,
  "content": "<p>Especially with lower resource settings, my experience is that imagenet-pretrained weights (always) score better to their unpretrained counterparts, although the link from imagenet and medical images are not that obvious. (yes the story about low levels learning lower level details: an edge is always an edge).</p>\n<p>So my question is: Especially with the focus on medical imaging and this competition, is there any opportunity for using unpretrained weights and get good results? My experience is that, they usually start low in performance, and I probably stop early or use hyperparameters that are optimized for pretrained models, so they never surpass their pretrained twins. </p>",
  "messages": [
    {
      "id": 2153787,
      "postDate": "2023-02-21T16:36:46.193Z",
      "content": "<p>I have read that training from scratch benefits from good initialization. The random initializations available in different frameworks might not be the best for all tasks.</p>\n<p>If you have some easier task you are able to train well, then you could use those weights to initialize the base of your model, given that you keep the base same in both tasks, right?</p>",
      "rawMarkdown": "I have read that training from scratch benefits from good initialization. The random initializations available in different frameworks might not be the best for all tasks.\n\nIf you have some easier task you are able to train well, then you could use those weights to initialize the base of your model, given that you keep the base same in both tasks, right?",
      "votes": 1,
      "replies": [
        {
          "id": 2153830,
          "postDate": "2023-02-21T16:54:21.057Z",
          "content": "<p>I'm not qualified enough to answer this, but I think such tàsks really aren't 'easy'. Even if there is, imagenet pretrained weights might score similar to our from scratch model.</p>\n<p>Training from scratch could be most useful in scenarios where the domain of application is drastically separate from the original data on which model was trained on (like in this task: medical vs generic objects).  But resources to train are a huge stumbling block. <br>\nNo wonder why transfer learning is such a hit.</p>",
          "rawMarkdown": "I'm not qualified enough to answer this, but I think such tàsks really aren't 'easy'. Even if there is, imagenet pretrained weights might score similar to our from scratch model.\n\nTraining from scratch could be most useful in scenarios where the domain of application is drastically separate from the original data on which model was trained on (like in this task: medical vs generic objects).  But resources to train are a huge stumbling block. \nNo wonder why transfer learning is such a hit.",
          "votes": 1
        }
      ]
    },
    {
      "id": 2153420,
      "postDate": "2023-02-21T12:12:58.867Z",
      "content": "<p>Not an expert, but my take is that one needs to train the network for far too long and that too with a bunch of GPUs which anyway we don't have access to in Kaggle, to produce any meaningful result. Hence Pretrained weights of imagenet would be better off than training the model from scratch. <br>\nOff course you could unfreeze some last layers of the model, with a very low LR, while training on this dataset, which again means you could easily run into an OOM issue if not careful.</p>",
      "rawMarkdown": "Not an expert, but my take is that one needs to train the network for far too long and that too with a bunch of GPUs which anyway we don't have access to in Kaggle, to produce any meaningful result. Hence Pretrained weights of imagenet would be better off than training the model from scratch. \nOff course you could unfreeze some last layers of the model, with a very low LR, while training on this dataset, which again means you could easily run into an OOM issue if not careful.",
      "votes": 1,
      "replies": [
        {
          "id": 2153474,
          "postDate": "2023-02-21T12:48:17.450Z",
          "content": "<p>I was thinking, having much less detail then an imagenette dataset in medical imaging with sufficient data and strong models..? <br>\nMaybe that would be an easy overfit for a capable model, causing the low performance on a test set,, unless pretrained.</p>",
          "rawMarkdown": "I was thinking, having much less detail then an imagenette dataset in medical imaging with sufficient data and strong models..? \nMaybe that would be an easy overfit for a capable model, causing the low performance on a test set,, unless pretrained.",
          "votes": 1,
          "replies": [
            {
              "id": 2153489,
              "postDate": "2023-02-21T12:56:54.660Z",
              "content": "<p>Maybe, maybe not. You may test the performance of models with cross validation folds, having taken care of data leakage. You could also employ many regularisation techniques to tackle overfitting.</p>",
              "rawMarkdown": "Maybe, maybe not. You may test the performance of models with cross validation folds, having taken care of data leakage. You could also employ many regularisation techniques to tackle overfitting."
            }
          ]
        }
      ]
    },
    {
      "id": 2153249,
      "postDate": "2023-02-21T09:58:11.803Z",
      "content": "<p>Especially with lower resource settings, my experience is that imagenet-pretrained weights (always) score better to their unpretrained counterparts, although the link from imagenet and medical images are not that obvious. (yes the story about low levels learning lower level details: an edge is always an edge).</p>\n<p>So my question is: Especially with the focus on medical imaging and this competition, is there any opportunity for using unpretrained weights and get good results? My experience is that, they usually start low in performance, and I probably stop early or use hyperparameters that are optimized for pretrained models, so they never surpass their pretrained twins. </p>",
      "rawMarkdown": "Especially with lower resource settings, my experience is that imagenet-pretrained weights (always) score better to their unpretrained counterparts, although the link from imagenet and medical images are not that obvious. (yes the story about low levels learning lower level details: an edge is always an edge).\n\nSo my question is: Especially with the focus on medical imaging and this competition, is there any opportunity for using unpretrained weights and get good results? My experience is that, they usually start low in performance, and I probably stop early or use hyperparameters that are optimized for pretrained models, so they never surpass their pretrained twins. \n\n",
      "votes": 1
    }
  ],
  "comments": [
    {
      "id": 2153787,
      "author_name": "Antti Isosalo",
      "author_url": "",
      "post_date": "2023-02-21T16:36:46.193000",
      "content": "<p>I have read that training from scratch benefits from good initialization. The random initializations available in different frameworks might not be the best for all tasks.</p>\n<p>If you have some easier task you are able to train well, then you could use those weights to initialize the base of your model, given that you keep the base same in both tasks, right?</p>",
      "votes": 1,
      "replies": [
        {
          "id": 2153830,
          "author_name": "Sandy",
          "author_url": "",
          "post_date": "2023-02-21T16:54:21.057000",
          "content": "<p>I'm not qualified enough to answer this, but I think such tàsks really aren't 'easy'. Even if there is, imagenet pretrained weights might score similar to our from scratch model.</p>\n<p>Training from scratch could be most useful in scenarios where the domain of application is drastically separate from the original data on which model was trained on (like in this task: medical vs generic objects).  But resources to train are a huge stumbling block. <br>\nNo wonder why transfer learning is such a hit.</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 2153420,
      "author_name": "Sandy",
      "author_url": "",
      "post_date": "2023-02-21T12:12:58.867000",
      "content": "<p>Not an expert, but my take is that one needs to train the network for far too long and that too with a bunch of GPUs which anyway we don't have access to in Kaggle, to produce any meaningful result. Hence Pretrained weights of imagenet would be better off than training the model from scratch. <br>\nOff course you could unfreeze some last layers of the model, with a very low LR, while training on this dataset, which again means you could easily run into an OOM issue if not careful.</p>",
      "votes": 1,
      "replies": [
        {
          "id": 2153474,
          "author_name": "GUNER",
          "author_url": "",
          "post_date": "2023-02-21T12:48:17.450000",
          "content": "<p>I was thinking, having much less detail then an imagenette dataset in medical imaging with sufficient data and strong models..? <br>\nMaybe that would be an easy overfit for a capable model, causing the low performance on a test set,, unless pretrained.</p>",
          "votes": 1,
          "replies": [
            {
              "id": 2153489,
              "author_name": "Sandy",
              "author_url": "",
              "post_date": "2023-02-21T12:56:54.660000",
              "content": "<p>Maybe, maybe not. You may test the performance of models with cross validation folds, having taken care of data leakage. You could also employ many regularisation techniques to tackle overfitting.</p>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2153787": "I have read that training from scratch benefits from good initialization. The random initializations available in different frameworks might not be the best for all tasks.\n\nIf you have some easier task you are able to train well, then you could use those weights to initialize the base of your model, given that you keep the base same in both tasks, right?",
    "2153420": "Not an expert, but my take is that one needs to train the network for far too long and that too with a bunch of GPUs which anyway we don't have access to in Kaggle, to produce any meaningful result. Hence Pretrained weights of imagenet would be better off than training the model from scratch. \nOff course you could unfreeze some last layers of the model, with a very low LR, while training on this dataset, which again means you could easily run into an OOM issue if not careful.",
    "2153249": "Especially with lower resource settings, my experience is that imagenet-pretrained weights (always) score better to their unpretrained counterparts, although the link from imagenet and medical images are not that obvious. (yes the story about low levels learning lower level details: an edge is always an edge).\n\nSo my question is: Especially with the focus on medical imaging and this competition, is there any opportunity for using unpretrained weights and get good results? My experience is that, they usually start low in performance, and I probably stop early or use hyperparameters that are optimized for pretrained models, so they never surpass their pretrained twins. \n\n"
  }
}