{
  "id": 112814,
  "title": "Model val loss going to 1, and val dice score to 0",
  "url": "/competitions/understanding_cloud_organization/discussion/112814",
  "author_name": "",
  "post_date": "2019-10-15T14:44:04.996940200Z",
  "votes": 1,
  "comment_count": 1,
  "views": 0,
  "content": "<p>Hi!</p>\n\n<p>I'm going towards the community because I just can't seem to figure out what is wrong with my pipeline. I'm using a custom data generator, and Keras using the <a href=\"https://github.com/qubvel/segmentation_models\">segmentation models library</a> to make a simple unet. I tried making one that would take all 4 labels at first and it didn't learn correctly. So I tried simplifying and making a model that would only take one label at first to try to see if that would still produce some bad results.\nThese are my loss and dice score measurements:\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2605845%2F572574b6e6c9fce1e8bbccee936abf18%2Fimage.png?generation=1571150483941191&amp;alt=media\" alt=\"\"></p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2605845%2Ffb82988432aecf567dae70b13762eae7%2Fimage%20(1\" alt=\"\">.png?generation=1571150497219032&amp;alt=media)</p>\n\n<p>It seems like the model is overfitting like crazy, but to the point where the loss goes to 1 and the dice score to 0, that sounds like a lot! Especially since the train loss and dice score are doing pretty good. I've checked a lot of different things, so I don't really know where to go now, thus turning to the community.</p>\n\n<p><a href=\"https://www.kaggle.com/maxlenormand/single-class-unet-with-datagenerator-class?scriptVersionId=21997720\">Here is the kernel</a> I'm currently running.\nIf you have any ides, I'm really open for suggestions, thanks a lot!</p>\n\n<p>EDIT: I've tried lowering the learning rate, there still is a massive overfit on validation. When plotting the predictions, all the predicted masks look the same. So there definitely is something wrong there, I just don't know what that is.</p>",
  "messages": [
    {
      "id": "649581",
      "postDate": "10/15/2019 14:44:04",
      "content": "<p>Hi!</p>\n\n<p>I'm going towards the community because I just can't seem to figure out what is wrong with my pipeline. I'm using a custom data generator, and Keras using the <a href=\"https://github.com/qubvel/segmentation_models\">segmentation models library</a> to make a simple unet. I tried making one that would take all 4 labels at first and it didn't learn correctly. So I tried simplifying and making a model that would only take one label at first to try to see if that would still produce some bad results.\nThese are my loss and dice score measurements:\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2605845%2F572574b6e6c9fce1e8bbccee936abf18%2Fimage.png?generation=1571150483941191&amp;alt=media\" alt=\"\"></p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2605845%2Ffb82988432aecf567dae70b13762eae7%2Fimage%20(1\" alt=\"\">.png?generation=1571150497219032&amp;alt=media)</p>\n\n<p>It seems like the model is overfitting like crazy, but to the point where the loss goes to 1 and the dice score to 0, that sounds like a lot! Especially since the train loss and dice score are doing pretty good. I've checked a lot of different things, so I don't really know where to go now, thus turning to the community.</p>\n\n<p><a href=\"https://www.kaggle.com/maxlenormand/single-class-unet-with-datagenerator-class?scriptVersionId=21997720\">Here is the kernel</a> I'm currently running.\nIf you have any ides, I'm really open for suggestions, thanks a lot!</p>\n\n<p>EDIT: I've tried lowering the learning rate, there still is a massive overfit on validation. When plotting the predictions, all the predicted masks look the same. So there definitely is something wrong there, I just don't know what that is.</p>",
      "rawMarkdown": "Hi!\n\nI'm going towards the community because I just can't seem to figure out what is wrong with my pipeline. I'm using a custom data generator, and Keras using the [segmentation models library](https://github.com/qubvel/segmentation_models) to make a simple unet. I tried making one that would take all 4 labels at first and it didn't learn correctly. So I tried simplifying and making a model that would only take one label at first to try to see if that would still produce some bad results.\nThese are my loss and dice score measurements:\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2605845%2F572574b6e6c9fce1e8bbccee936abf18%2Fimage.png?generation=1571150483941191&amp;alt=media)\n \n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2605845%2Ffb82988432aecf567dae70b13762eae7%2Fimage%20(1).png?generation=1571150497219032&amp;alt=media)\n\nIt seems like the model is overfitting like crazy, but to the point where the loss goes to 1 and the dice score to 0, that sounds like a lot! Especially since the train loss and dice score are doing pretty good. I've checked a lot of different things, so I don't really know where to go now, thus turning to the community.\n\n[Here is the kernel](https://www.kaggle.com/maxlenormand/single-class-unet-with-datagenerator-class?scriptVersionId=21997720) I'm currently running.\nIf you have any ides, I'm really open for suggestions, thanks a lot!\n\nEDIT: I've tried lowering the learning rate, there still is a massive overfit on validation. When plotting the predictions, all the predicted masks look the same. So there definitely is something wrong there, I just don't know what that is.",
      "votes": null
    },
    {
      "id": "651488",
      "postDate": "10/17/2019 14:36:38",
      "content": "<p>Problem seems to be solved.\nThe Semantic Segmentation library seems to have losses build-in, which I used, and that seemed to fix my problem, the validation dice loss goes up now. Pretty weird though, not sure what was wrong with my original loss.</p>",
      "rawMarkdown": "Problem seems to be solved.\nThe Semantic Segmentation library seems to have losses build-in, which I used, and that seemed to fix my problem, the validation dice loss goes up now. Pretty weird though, not sure what was wrong with my original loss.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 651488,
      "author_name": "maxlenormand",
      "author_url": "",
      "post_date": "10/17/2019 14:36:38",
      "content": "<p>Problem seems to be solved.\nThe Semantic Segmentation library seems to have losses build-in, which I used, and that seemed to fix my problem, the validation dice loss goes up now. Pretty weird though, not sure what was wrong with my original loss.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "649581": "Hi!\n\nI'm going towards the community because I just can't seem to figure out what is wrong with my pipeline. I'm using a custom data generator, and Keras using the [segmentation models library](https://github.com/qubvel/segmentation_models) to make a simple unet. I tried making one that would take all 4 labels at first and it didn't learn correctly. So I tried simplifying and making a model that would only take one label at first to try to see if that would still produce some bad results.\nThese are my loss and dice score measurements:\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2605845%2F572574b6e6c9fce1e8bbccee936abf18%2Fimage.png?generation=1571150483941191&amp;alt=media)\n \n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2605845%2Ffb82988432aecf567dae70b13762eae7%2Fimage%20(1).png?generation=1571150497219032&amp;alt=media)\n\nIt seems like the model is overfitting like crazy, but to the point where the loss goes to 1 and the dice score to 0, that sounds like a lot! Especially since the train loss and dice score are doing pretty good. I've checked a lot of different things, so I don't really know where to go now, thus turning to the community.\n\n[Here is the kernel](https://www.kaggle.com/maxlenormand/single-class-unet-with-datagenerator-class?scriptVersionId=21997720) I'm currently running.\nIf you have any ides, I'm really open for suggestions, thanks a lot!\n\nEDIT: I've tried lowering the learning rate, there still is a massive overfit on validation. When plotting the predictions, all the predicted masks look the same. So there definitely is something wrong there, I just don't know what that is.",
    "651488": "Problem seems to be solved.\nThe Semantic Segmentation library seems to have losses build-in, which I used, and that seemed to fix my problem, the validation dice loss goes up now. Pretty weird though, not sure what was wrong with my original loss."
  },
  "source": "meta"
}