{
  "id": 168822,
  "title": "Something weird",
  "url": "/competitions/global-wheat-detection/discussion/168822",
  "author_name": "gzYou",
  "post_date": "2020-07-22T02:34:19.066000",
  "votes": 0,
  "comment_count": 11,
  "views": 0,
  "content": "<p>Hi, everyone. I found something that doesn't make sense.</p>\n\n<p>To make it clear, post a few pieces of code. May look bloated😑</p>\n\n<p>In the inference, two thresholds are involved：</p>\n\n<ol>\n<li><code>score_threshold</code> in the <code>make_tta_predictions</code> function</li>\n<li><code>skip_box_threshold</code> in the <code>run_wbf</code>function. </li>\n</ol>\n\n<p>Because the <code>make_tta_predictions</code> function is executed first, as long as the <code>score_threshold</code> is any value less than <code>skip_box_threshold</code>,  it is actually not effective, because <code>run_wbf</code> will filter the boxes again. </p>\n\n<p>But from my experimental results, this is not the case. For example, when I set <code>skip_box_threshold</code> to 0.4 and I changed <code>score_threshold</code> from 0.25 to 0.37, my score improves. why? Does anyone have the same problem?</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1705102%2F583f904a410bdce9db2bdc1de461936b%2Fcode1.png?generation=1595486645825845&amp;alt=media\" alt=\"\">\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1705102%2Fe7f89be64b1e2f426dea18e505abb647%2Fcode2.png?generation=1595486644524495&amp;alt=media\" alt=\"\"></p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1705102%2F8ef31c41dbb263231c977ea00ac58ba5%2Fcode3.png?generation=1595486693874657&amp;alt=media\" alt=\"\"></p>",
  "messages": [
    {
      "id": 939070,
      "postDate": "2020-07-22T02:34:19.067Z",
      "content": "<p>Hi, everyone. I found something that doesn't make sense.</p>\n\n<p>To make it clear, post a few pieces of code. May look bloated😑</p>\n\n<p>In the inference, two thresholds are involved：</p>\n\n<ol>\n<li><code>score_threshold</code> in the <code>make_tta_predictions</code> function</li>\n<li><code>skip_box_threshold</code> in the <code>run_wbf</code>function. </li>\n</ol>\n\n<p>Because the <code>make_tta_predictions</code> function is executed first, as long as the <code>score_threshold</code> is any value less than <code>skip_box_threshold</code>,  it is actually not effective, because <code>run_wbf</code> will filter the boxes again. </p>\n\n<p>But from my experimental results, this is not the case. For example, when I set <code>skip_box_threshold</code> to 0.4 and I changed <code>score_threshold</code> from 0.25 to 0.37, my score improves. why? Does anyone have the same problem?</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1705102%2F583f904a410bdce9db2bdc1de461936b%2Fcode1.png?generation=1595486645825845&amp;alt=media\" alt=\"\">\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1705102%2Fe7f89be64b1e2f426dea18e505abb647%2Fcode2.png?generation=1595486644524495&amp;alt=media\" alt=\"\"></p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1705102%2F8ef31c41dbb263231c977ea00ac58ba5%2Fcode3.png?generation=1595486693874657&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "Hi, everyone. I found something that doesn't make sense.\n\nTo make it clear, post a few pieces of code. May look bloated😑\n\nIn the inference, two thresholds are involved：\n\n1. `score_threshold` in the `make_tta_predictions` function\n2.  `skip_box_threshold` in the `run_wbf `function. \n\nBecause the `make_tta_predictions` function is executed first, as long as the `score_threshold` is any value less than `skip_box_threshold`,  it is actually not effective, because `run_wbf` will filter the boxes again. \n\nBut from my experimental results, this is not the case. For example, when I set `skip_box_threshold` to 0.4 and I changed `score_threshold` from 0.25 to 0.37, my score improves. why? Does anyone have the same problem?\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1705102%2F583f904a410bdce9db2bdc1de461936b%2Fcode1.png?generation=1595486645825845&amp;alt=media)\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1705102%2Fe7f89be64b1e2f426dea18e505abb647%2Fcode2.png?generation=1595486644524495&amp;alt=media)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1705102%2F8ef31c41dbb263231c977ea00ac58ba5%2Fcode3.png?generation=1595486693874657&amp;alt=media)\n"
    },
    {
      "id": 947045,
      "postDate": "2020-07-27T03:34:04.883Z",
      "content": "<p>after run_wbf , the score is changed, for example:\n1 image -&gt; 6 images( rotate , flip)  , 2 of them got a 0.9 box each ,other 4 got nothing, then wbf out 1.8/6 = 0.3</p>",
      "rawMarkdown": "after run_wbf , the score is changed, for example:\n1 image -&gt; 6 images( rotate , flip)  , 2 of them got a 0.9 box each ,other 4 got nothing, then wbf out 1.8/6 = 0.3",
      "replies": [
        {
          "id": 947057,
          "postDate": "2020-07-27T03:54:10.390Z",
          "content": "<p>Yes, after run_wbf , the score is changed.  But before boxes fusion, <code>prefilter_boxes</code> is executed, please see <a href=\"https://github.com/ZFTurbo/Weighted-Boxes-Fusion/blob/f15db97d6aadb20e86995e2f5416583e52b06ed6/ensemble_boxes/ensemble_boxes_wbf.py#L172\">here</a></p>",
          "rawMarkdown": "Yes, after run_wbf , the score is changed.  But before boxes fusion, `prefilter_boxes` is executed, please see [here](https://github.com/ZFTurbo/Weighted-Boxes-Fusion/blob/f15db97d6aadb20e86995e2f5416583e52b06ed6/ensemble_boxes/ensemble_boxes_wbf.py#L172)"
        },
        {
          "id": 947098,
          "postDate": "2020-07-27T04:38:00.003Z",
          "content": "<p>score_threshold from 0.25 to 0.37, is after run_wbf,  prefilter_boxes is 0.4 is  effective for input of run_wbf , so your result changes.</p>",
          "rawMarkdown": "score_threshold from 0.25 to 0.37, is after run_wbf,  prefilter_boxes is 0.4 is  effective for input of run_wbf , so your result changes."
        },
        {
          "id": 947176,
          "postDate": "2020-07-27T05:46:11.880Z",
          "content": "<p>Sorry, could you make it clear?  My work follows <a href=\"https://www.kaggle.com/raininbox/efficientdet-with-pseduo-labeling?scriptVersionId=34833370\">this</a></p>",
          "rawMarkdown": "Sorry, could you make it clear?  My work follows [this](https://www.kaggle.com/raininbox/efficientdet-with-pseduo-labeling?scriptVersionId=34833370)"
        },
        {
          "id": 947337,
          "postDate": "2020-07-27T07:33:52.333Z",
          "content": "<p>I think the code you use is not very good operations\nit should be : tta-&gt;collect all predictions-&gt; wbf -&gt; use score_threshold to filter again.</p>\n\n<p>the code you use : tta-&gt; filter with socre_threshold-&gt; wbf.</p>\n\n<p>if you encounter the 0.4 not effective, maybe under the code you havn't show , uses score_threshold again.</p>",
          "rawMarkdown": "I think the code you use is not very good operations\nit should be : tta-&gt;collect all predictions-&gt; wbf -&gt; use score_threshold to filter again.\n\nthe code you use : tta-&gt; filter with socre_threshold-&gt; wbf.\n\nif you encounter the 0.4 not effective, maybe under the code you havn't show , uses score_threshold again."
        },
        {
          "id": 947343,
          "postDate": "2020-07-27T07:40:04.647Z",
          "content": "<p>Thanks, I'll try:)</p>",
          "rawMarkdown": "Thanks, I'll try:)"
        }
      ]
    },
    {
      "id": 947002,
      "postDate": "2020-07-27T02:17:15.843Z",
      "content": "<p>that is strange indeed, can you reproduce this? like you said, <code>score_threshold</code> from 0.25 to 0.37 should not change under <code>skip_box_threshold</code> 0.4 since they are both less than 0.4 and anything &lt; 0.4 all get filtered in the <code>prefilter_boxes</code> function, was your seed fixed or anything possibly changing?</p>",
      "rawMarkdown": "that is strange indeed, can you reproduce this? like you said, `score_threshold` from 0.25 to 0.37 should not change under `skip_box_threshold` 0.4 since they are both less than 0.4 and anything &lt; 0.4 all get filtered in the `prefilter_boxes` function, was your seed fixed or anything possibly changing?",
      "replies": [
        {
          "id": 947059,
          "postDate": "2020-07-27T03:57:01.070Z",
          "content": "<p>I haven't do a experiment to reproduce it. Seed was fixed.</p>",
          "rawMarkdown": "I haven't do a experiment to reproduce it. Seed was fixed."
        }
      ]
    },
    {
      "id": 943428,
      "postDate": "2020-07-24T11:01:05.037Z",
      "content": "<p><a href=\"/guizengyou\">@guizengyou</a> \nThanks for posting this..\nI will let you know if i find this</p>\n\n<p>Btw. \nCan you help me understand if are training at less than full res image,then how bounding box predictions are scaled during inference to match ground truth that are based upon full res images ?</p>",
      "rawMarkdown": "@guizengyou \nThanks for posting this..\nI will let you know if i find this\n\nBtw. \nCan you help me understand if are training at less than full res image,then how bounding box predictions are scaled during inference to match ground truth that are based upon full res images ?",
      "replies": [
        {
          "id": 944280,
          "postDate": "2020-07-25T01:54:10.660Z",
          "content": "<p>Yes, you can reference <a href=\"https://www.kaggle.com/shonenkov\">shonenkov's</a> <a href=\"https://www.kaggle.com/shonenkov/inference-efficientdet/output\">notebook</a></p>",
          "rawMarkdown": "Yes, you can reference [shonenkov's](https://www.kaggle.com/shonenkov) [notebook](https://www.kaggle.com/shonenkov/inference-efficientdet/output)"
        }
      ]
    },
    {
      "id": 939076,
      "postDate": "2020-07-22T02:40:16.017Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 947045,
      "author_name": "Alex_Wang",
      "author_url": "",
      "post_date": "2020-07-27T03:34:04.883000",
      "content": "<p>after run_wbf , the score is changed, for example:\n1 image -&gt; 6 images( rotate , flip)  , 2 of them got a 0.9 box each ,other 4 got nothing, then wbf out 1.8/6 = 0.3</p>",
      "votes": 0,
      "replies": [
        {
          "id": 947057,
          "author_name": "gzYou",
          "author_url": "",
          "post_date": "2020-07-27T03:54:10.390000",
          "content": "<p>Yes, after run_wbf , the score is changed.  But before boxes fusion, <code>prefilter_boxes</code> is executed, please see <a href=\"https://github.com/ZFTurbo/Weighted-Boxes-Fusion/blob/f15db97d6aadb20e86995e2f5416583e52b06ed6/ensemble_boxes/ensemble_boxes_wbf.py#L172\">here</a></p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 947098,
          "author_name": "Alex_Wang",
          "author_url": "",
          "post_date": "2020-07-27T04:38:00.003000",
          "content": "<p>score_threshold from 0.25 to 0.37, is after run_wbf,  prefilter_boxes is 0.4 is  effective for input of run_wbf , so your result changes.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 947176,
          "author_name": "gzYou",
          "author_url": "",
          "post_date": "2020-07-27T05:46:11.880000",
          "content": "<p>Sorry, could you make it clear?  My work follows <a href=\"https://www.kaggle.com/raininbox/efficientdet-with-pseduo-labeling?scriptVersionId=34833370\">this</a></p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 947337,
          "author_name": "Alex_Wang",
          "author_url": "",
          "post_date": "2020-07-27T07:33:52.333000",
          "content": "<p>I think the code you use is not very good operations\nit should be : tta-&gt;collect all predictions-&gt; wbf -&gt; use score_threshold to filter again.</p>\n\n<p>the code you use : tta-&gt; filter with socre_threshold-&gt; wbf.</p>\n\n<p>if you encounter the 0.4 not effective, maybe under the code you havn't show , uses score_threshold again.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 947343,
          "author_name": "gzYou",
          "author_url": "",
          "post_date": "2020-07-27T07:40:04.647000",
          "content": "<p>Thanks, I'll try:)</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 947002,
      "author_name": "samshipengs",
      "author_url": "",
      "post_date": "2020-07-27T02:17:15.843000",
      "content": "<p>that is strange indeed, can you reproduce this? like you said, <code>score_threshold</code> from 0.25 to 0.37 should not change under <code>skip_box_threshold</code> 0.4 since they are both less than 0.4 and anything &lt; 0.4 all get filtered in the <code>prefilter_boxes</code> function, was your seed fixed or anything possibly changing?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 947059,
          "author_name": "gzYou",
          "author_url": "",
          "post_date": "2020-07-27T03:57:01.070000",
          "content": "<p>I haven't do a experiment to reproduce it. Seed was fixed.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 943428,
      "author_name": "Jaideep",
      "author_url": "",
      "post_date": "2020-07-24T11:01:05.037000",
      "content": "<p><a href=\"/guizengyou\">@guizengyou</a> \nThanks for posting this..\nI will let you know if i find this</p>\n\n<p>Btw. \nCan you help me understand if are training at less than full res image,then how bounding box predictions are scaled during inference to match ground truth that are based upon full res images ?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 944280,
          "author_name": "gzYou",
          "author_url": "",
          "post_date": "2020-07-25T01:54:10.660000",
          "content": "<p>Yes, you can reference <a href=\"https://www.kaggle.com/shonenkov\">shonenkov's</a> <a href=\"https://www.kaggle.com/shonenkov/inference-efficientdet/output\">notebook</a></p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 939076,
      "author_name": "",
      "author_url": "",
      "post_date": "2020-07-22T02:40:16.017000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "939070": "Hi, everyone. I found something that doesn't make sense.\n\nTo make it clear, post a few pieces of code. May look bloated😑\n\nIn the inference, two thresholds are involved：\n\n1. `score_threshold` in the `make_tta_predictions` function\n2.  `skip_box_threshold` in the `run_wbf `function. \n\nBecause the `make_tta_predictions` function is executed first, as long as the `score_threshold` is any value less than `skip_box_threshold`,  it is actually not effective, because `run_wbf` will filter the boxes again. \n\nBut from my experimental results, this is not the case. For example, when I set `skip_box_threshold` to 0.4 and I changed `score_threshold` from 0.25 to 0.37, my score improves. why? Does anyone have the same problem?\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1705102%2F583f904a410bdce9db2bdc1de461936b%2Fcode1.png?generation=1595486645825845&amp;alt=media)\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1705102%2Fe7f89be64b1e2f426dea18e505abb647%2Fcode2.png?generation=1595486644524495&amp;alt=media)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1705102%2F8ef31c41dbb263231c977ea00ac58ba5%2Fcode3.png?generation=1595486693874657&amp;alt=media)\n",
    "947045": "after run_wbf , the score is changed, for example:\n1 image -&gt; 6 images( rotate , flip)  , 2 of them got a 0.9 box each ,other 4 got nothing, then wbf out 1.8/6 = 0.3",
    "947002": "that is strange indeed, can you reproduce this? like you said, `score_threshold` from 0.25 to 0.37 should not change under `skip_box_threshold` 0.4 since they are both less than 0.4 and anything &lt; 0.4 all get filtered in the `prefilter_boxes` function, was your seed fixed or anything possibly changing?",
    "943428": "@guizengyou \nThanks for posting this..\nI will let you know if i find this\n\nBtw. \nCan you help me understand if are training at less than full res image,then how bounding box predictions are scaled during inference to match ground truth that are based upon full res images ?",
    "939076": ""
  }
}