{
  "id": 219672,
  "title": "1-step training & prediction",
  "url": "/competitions/vinbigdata-chest-xray-abnormalities-detection/discussion/219672",
  "author_name": "corochann",
  "post_date": "2021-02-15T23:22:43.695000",
  "votes": 45,
  "comment_count": 14,
  "views": 0,
  "content": "<p>Common approach to improve the score is to use <strong>detection model + 2-class classifier</strong>, as I also introduced in <a href=\"https://www.kaggle.com/corochann/vinbigdata-2-class-classifier-complete-pipeline\" target=\"_blank\">📸VinBigData 2-class classifier complete pipeline</a>.<br>\nDetection model is used to locate abnormal bounding box class, where 2-class classifier is used to classify \"No finding\" images. So far this approach achieves LB 0.230.</p>\n<p>Can we consider 1-step pipeline that does not need 2-class classifier?<br>\nActually \"No finding\" class is also evaluated as \"bonding box\" in the mAP competition metric, as discussed in this <a href=\"https://www.kaggle.com/c/vinbigdata-chest-xray-abnormalities-detection/discussion/211971\" target=\"_blank\">discussion</a>.</p>\n<p>Here, I tried a new approach: <strong>learn \"No finding\" as bounding boxes where bounding box covers all the image in the detection model</strong>.<br>\nNote that \"No finding\" class must be submitted with the bounding box with <code>0 0 1 1</code>, so you need to change bounding box area in the submission, after the prediction (which highly likely covers all the image area).<br>\nI also added extra post-processing to only use 1 \"No finding\" bounding box per each image, <strong>with the maximum probability (score)</strong> in the prediction.</p>\n<p>I got almost same score with the 2-class classifier approach (LB 0.230), which indicates that we can experiment with the simple pipeline to focus on detection model. </p>\n<p>The code for this training is available with this kernel:</p>\n<ul>\n<li><a href=\"https://www.kaggle.com/corochann/vinbigdata-detectron2-train\" target=\"_blank\">📸VinBigData detectron2 train</a></li>\n</ul>\n<p>You can just set <code>use_class14=True</code> in the <code>Flags</code> class.</p>",
  "messages": [
    {
      "id": 1204201,
      "postDate": "2021-02-15T23:22:43.697Z",
      "content": "<p>Common approach to improve the score is to use <strong>detection model + 2-class classifier</strong>, as I also introduced in <a href=\"https://www.kaggle.com/corochann/vinbigdata-2-class-classifier-complete-pipeline\" target=\"_blank\">📸VinBigData 2-class classifier complete pipeline</a>.<br>\nDetection model is used to locate abnormal bounding box class, where 2-class classifier is used to classify \"No finding\" images. So far this approach achieves LB 0.230.</p>\n<p>Can we consider 1-step pipeline that does not need 2-class classifier?<br>\nActually \"No finding\" class is also evaluated as \"bonding box\" in the mAP competition metric, as discussed in this <a href=\"https://www.kaggle.com/c/vinbigdata-chest-xray-abnormalities-detection/discussion/211971\" target=\"_blank\">discussion</a>.</p>\n<p>Here, I tried a new approach: <strong>learn \"No finding\" as bounding boxes where bounding box covers all the image in the detection model</strong>.<br>\nNote that \"No finding\" class must be submitted with the bounding box with <code>0 0 1 1</code>, so you need to change bounding box area in the submission, after the prediction (which highly likely covers all the image area).<br>\nI also added extra post-processing to only use 1 \"No finding\" bounding box per each image, <strong>with the maximum probability (score)</strong> in the prediction.</p>\n<p>I got almost same score with the 2-class classifier approach (LB 0.230), which indicates that we can experiment with the simple pipeline to focus on detection model. </p>\n<p>The code for this training is available with this kernel:</p>\n<ul>\n<li><a href=\"https://www.kaggle.com/corochann/vinbigdata-detectron2-train\" target=\"_blank\">📸VinBigData detectron2 train</a></li>\n</ul>\n<p>You can just set <code>use_class14=True</code> in the <code>Flags</code> class.</p>",
      "rawMarkdown": "Common approach to improve the score is to use **detection model + 2-class classifier**, as I also introduced in [📸VinBigData 2-class classifier complete pipeline](https://www.kaggle.com/corochann/vinbigdata-2-class-classifier-complete-pipeline).\nDetection model is used to locate abnormal bounding box class, where 2-class classifier is used to classify \"No finding\" images. So far this approach achieves LB 0.230.\n\nCan we consider 1-step pipeline that does not need 2-class classifier?\nActually \"No finding\" class is also evaluated as \"bonding box\" in the mAP competition metric, as discussed in this [discussion](https://www.kaggle.com/c/vinbigdata-chest-xray-abnormalities-detection/discussion/211971).\n\nHere, I tried a new approach: **learn \"No finding\" as bounding boxes where bounding box covers all the image in the detection model**.\nNote that \"No finding\" class must be submitted with the bounding box with `0 0 1 1`, so you need to change bounding box area in the submission, after the prediction (which highly likely covers all the image area).\nI also added extra post-processing to only use 1 \"No finding\" bounding box per each image, **with the maximum probability (score)** in the prediction.\n\nI got almost same score with the 2-class classifier approach (LB 0.230), which indicates that we can experiment with the simple pipeline to focus on detection model. \n\nThe code for this training is available with this kernel:\n - [📸VinBigData detectron2 train](https://www.kaggle.com/corochann/vinbigdata-detectron2-train)\n\nYou can just set `use_class14=True` in the `Flags` class.\n",
      "votes": 45
    },
    {
      "id": 1204454,
      "postDate": "2021-02-16T06:43:57.470Z",
      "content": "<p>I've also been training with Normal images (on a partial train dataset to enable validation) and post processing to change bbox format to 14 0 0 1 1 in the submission csv.<br>\nI tried the 2-class classifier and found its performance was not too different from the detection only model. <br>\nBut the main advantage of the detection-only approach is more reliable validation - I think it is harder to validate the detection+classifier pipeline correctly.</p>",
      "rawMarkdown": "I've also been training with Normal images (on a partial train dataset to enable validation) and post processing to change bbox format to 14 0 0 1 1 in the submission csv.\nI tried the 2-class classifier and found its performance was not too different from the detection only model. \nBut the main advantage of the detection-only approach is more reliable validation - I think it is harder to validate the detection+classifier pipeline correctly.",
      "votes": 3
    },
    {
      "id": 1229607,
      "postDate": "2021-03-07T13:32:13.640Z",
      "content": "<p><a href=\"https://www.kaggle.com/corochann\" target=\"_blank\">@corochann</a> hello, 2-class classifier you mentioned, is trained on kaggle kernel?<br>\nis that convenient if  i train it on my own server</p>",
      "rawMarkdown": "@corochann hello, 2-class classifier you mentioned, is trained on kaggle kernel?\nis that convenient if  i train it on my own server",
      "votes": 1,
      "replies": [
        {
          "id": 1230255,
          "postDate": "2021-03-07T23:54:41.597Z",
          "content": "<p>I trained in my local machine for the dataset: <a href=\"https://www.kaggle.com/corochann/vinbigdata2classpred\" target=\"_blank\">https://www.kaggle.com/corochann/vinbigdata2classpred</a><br>\nYou can also check training configuration in <code>flags.yaml</code>.</p>",
          "rawMarkdown": "I trained in my local machine for the dataset: https://www.kaggle.com/corochann/vinbigdata2classpred\nYou can also check training configuration in `flags.yaml`."
        },
        {
          "id": 1230283,
          "postDate": "2021-03-08T01:13:12.187Z",
          "content": "<p>appreciate it,dude🙌</p>",
          "rawMarkdown": "appreciate it,dude🙌"
        }
      ]
    },
    {
      "id": 1212734,
      "postDate": "2021-02-21T14:27:06.597Z",
      "content": "<p>I would like to know more details about the 'test_meta.csv' file in VinBigData 2-class classifier complete pipeline. Looking at 3000 rows, it seems that you did additional work on the test data, so please explain how it was generated and the columns '#dim0', '#dim1'.</p>",
      "rawMarkdown": "I would like to know more details about the 'test_meta.csv' file in VinBigData 2-class classifier complete pipeline. Looking at 3000 rows, it seems that you did additional work on the test data, so please explain how it was generated and the columns '#dim0', '#dim1'.",
      "votes": 1,
      "replies": [
        {
          "id": 1213481,
          "postDate": "2021-02-22T06:27:40.920Z",
          "content": "<p>test_meat.csv is generated in the same way with train_meta.csv file. It just saves the original image size, so that we can rescale-back the bounding box position to original image's position.<br>\nPlease refer <a href=\"https://www.kaggle.com/corochann/vinbigdata-create-test-meta\" target=\"_blank\">https://www.kaggle.com/corochann/vinbigdata-create-test-meta</a></p>",
          "rawMarkdown": "test_meat.csv is generated in the same way with train_meta.csv file. It just saves the original image size, so that we can rescale-back the bounding box position to original image's position.\nPlease refer https://www.kaggle.com/corochann/vinbigdata-create-test-meta",
          "votes": 1
        },
        {
          "id": 1213903,
          "postDate": "2021-02-22T12:29:49.773Z",
          "content": "<p>Thank you for your kind answer!</p>",
          "rawMarkdown": "Thank you for your kind answer!",
          "votes": 1
        },
        {
          "id": 1229615,
          "postDate": "2021-03-07T13:34:50.507Z",
          "content": "<p>can you help me, dude,<br>\nfor submision, we simply dump all detection result that model prediction on test_data,<br>\nor if it's better that we set a threshold(like 0.5) to filter out some low-score results</p>",
          "rawMarkdown": "can you help me, dude,\nfor submision, we simply dump all detection result that model prediction on test_data,\nor if it's better that we set a threshold(like 0.5) to filter out some low-score results"
        },
        {
          "id": 1230410,
          "postDate": "2021-03-08T05:33:15.850Z",
          "content": "<p>It's better not to filter out low-score results, for mAP metric.<br>\nSee <a href=\"https://www.kaggle.com/its7171/map-understanding-with-code-and-its-tips\" target=\"_blank\">https://www.kaggle.com/its7171/map-understanding-with-code-and-its-tips</a></p>",
          "rawMarkdown": "It's better not to filter out low-score results, for mAP metric.\nSee https://www.kaggle.com/its7171/map-understanding-with-code-and-its-tips"
        },
        {
          "id": 1230429,
          "postDate": "2021-03-08T06:03:00.713Z",
          "content": "<p>roger that.<br>\ncould you please answer my another stupid question<br>\ni'm still using coco_metric, is it better to use pascal_voc metric as vin-bigdata do?</p>",
          "rawMarkdown": "roger that.\ncould you please answer my another stupid question\ni'm still using coco_metric, is it better to use pascal_voc metric as vin-bigdata do?"
        },
        {
          "id": 1230499,
          "postDate": "2021-03-08T07:41:57.923Z",
          "content": "<p>It's better if you can align metric calculation with the organizer. But I think coco_metric also work fine to see the correlation between LB.</p>",
          "rawMarkdown": "It's better if you can align metric calculation with the organizer. But I think coco_metric also work fine to see the correlation between LB."
        }
      ]
    },
    {
      "id": 1217724,
      "postDate": "2021-02-25T09:10:03.277Z",
      "content": "<p>Is 1-stage training highly affected by the imbalance between No Finding bboxes and the other classes' boxes ? </p>",
      "rawMarkdown": "Is 1-stage training highly affected by the imbalance between No Finding bboxes and the other classes' boxes ? ",
      "replies": [
        {
          "id": 1217863,
          "postDate": "2021-02-25T11:24:57.287Z",
          "content": "<p>IMO, including No Finding bboxes is \"True\" distribution, evaluated in test dataset.</p>",
          "rawMarkdown": "IMO, including No Finding bboxes is \"True\" distribution, evaluated in test dataset."
        }
      ]
    },
    {
      "id": 1248049,
      "postDate": "2021-03-22T09:44:33.750Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 1204454,
      "author_name": "InDSweTrust",
      "author_url": "",
      "post_date": "2021-02-16T06:43:57.470000",
      "content": "<p>I've also been training with Normal images (on a partial train dataset to enable validation) and post processing to change bbox format to 14 0 0 1 1 in the submission csv.<br>\nI tried the 2-class classifier and found its performance was not too different from the detection only model. <br>\nBut the main advantage of the detection-only approach is more reliable validation - I think it is harder to validate the detection+classifier pipeline correctly.</p>",
      "votes": 3,
      "replies": []
    },
    {
      "id": 1229607,
      "author_name": "xuzhaocheng",
      "author_url": "",
      "post_date": "2021-03-07T13:32:13.640000",
      "content": "<p><a href=\"https://www.kaggle.com/corochann\" target=\"_blank\">@corochann</a> hello, 2-class classifier you mentioned, is trained on kaggle kernel?<br>\nis that convenient if  i train it on my own server</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1230255,
          "author_name": "corochann",
          "author_url": "",
          "post_date": "2021-03-07T23:54:41.597000",
          "content": "<p>I trained in my local machine for the dataset: <a href=\"https://www.kaggle.com/corochann/vinbigdata2classpred\" target=\"_blank\">https://www.kaggle.com/corochann/vinbigdata2classpred</a><br>\nYou can also check training configuration in <code>flags.yaml</code>.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1230283,
          "author_name": "xuzhaocheng",
          "author_url": "",
          "post_date": "2021-03-08T01:13:12.187000",
          "content": "<p>appreciate it,dude🙌</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1212734,
      "author_name": "stonebell",
      "author_url": "",
      "post_date": "2021-02-21T14:27:06.597000",
      "content": "<p>I would like to know more details about the 'test_meta.csv' file in VinBigData 2-class classifier complete pipeline. Looking at 3000 rows, it seems that you did additional work on the test data, so please explain how it was generated and the columns '#dim0', '#dim1'.</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1213481,
          "author_name": "corochann",
          "author_url": "",
          "post_date": "2021-02-22T06:27:40.920000",
          "content": "<p>test_meat.csv is generated in the same way with train_meta.csv file. It just saves the original image size, so that we can rescale-back the bounding box position to original image's position.<br>\nPlease refer <a href=\"https://www.kaggle.com/corochann/vinbigdata-create-test-meta\" target=\"_blank\">https://www.kaggle.com/corochann/vinbigdata-create-test-meta</a></p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1213903,
          "author_name": "stonebell",
          "author_url": "",
          "post_date": "2021-02-22T12:29:49.773000",
          "content": "<p>Thank you for your kind answer!</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1229615,
          "author_name": "xuzhaocheng",
          "author_url": "",
          "post_date": "2021-03-07T13:34:50.507000",
          "content": "<p>can you help me, dude,<br>\nfor submision, we simply dump all detection result that model prediction on test_data,<br>\nor if it's better that we set a threshold(like 0.5) to filter out some low-score results</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1230410,
          "author_name": "corochann",
          "author_url": "",
          "post_date": "2021-03-08T05:33:15.850000",
          "content": "<p>It's better not to filter out low-score results, for mAP metric.<br>\nSee <a href=\"https://www.kaggle.com/its7171/map-understanding-with-code-and-its-tips\" target=\"_blank\">https://www.kaggle.com/its7171/map-understanding-with-code-and-its-tips</a></p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1230429,
          "author_name": "xuzhaocheng",
          "author_url": "",
          "post_date": "2021-03-08T06:03:00.713000",
          "content": "<p>roger that.<br>\ncould you please answer my another stupid question<br>\ni'm still using coco_metric, is it better to use pascal_voc metric as vin-bigdata do?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1230499,
          "author_name": "corochann",
          "author_url": "",
          "post_date": "2021-03-08T07:41:57.923000",
          "content": "<p>It's better if you can align metric calculation with the organizer. But I think coco_metric also work fine to see the correlation between LB.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1217724,
      "author_name": "Liam Nguyen",
      "author_url": "",
      "post_date": "2021-02-25T09:10:03.277000",
      "content": "<p>Is 1-stage training highly affected by the imbalance between No Finding bboxes and the other classes' boxes ? </p>",
      "votes": 0,
      "replies": [
        {
          "id": 1217863,
          "author_name": "corochann",
          "author_url": "",
          "post_date": "2021-02-25T11:24:57.287000",
          "content": "<p>IMO, including No Finding bboxes is \"True\" distribution, evaluated in test dataset.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1248049,
      "author_name": "",
      "author_url": "",
      "post_date": "2021-03-22T09:44:33.750000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1204201": "Common approach to improve the score is to use **detection model + 2-class classifier**, as I also introduced in [📸VinBigData 2-class classifier complete pipeline](https://www.kaggle.com/corochann/vinbigdata-2-class-classifier-complete-pipeline).\nDetection model is used to locate abnormal bounding box class, where 2-class classifier is used to classify \"No finding\" images. So far this approach achieves LB 0.230.\n\nCan we consider 1-step pipeline that does not need 2-class classifier?\nActually \"No finding\" class is also evaluated as \"bonding box\" in the mAP competition metric, as discussed in this [discussion](https://www.kaggle.com/c/vinbigdata-chest-xray-abnormalities-detection/discussion/211971).\n\nHere, I tried a new approach: **learn \"No finding\" as bounding boxes where bounding box covers all the image in the detection model**.\nNote that \"No finding\" class must be submitted with the bounding box with `0 0 1 1`, so you need to change bounding box area in the submission, after the prediction (which highly likely covers all the image area).\nI also added extra post-processing to only use 1 \"No finding\" bounding box per each image, **with the maximum probability (score)** in the prediction.\n\nI got almost same score with the 2-class classifier approach (LB 0.230), which indicates that we can experiment with the simple pipeline to focus on detection model. \n\nThe code for this training is available with this kernel:\n - [📸VinBigData detectron2 train](https://www.kaggle.com/corochann/vinbigdata-detectron2-train)\n\nYou can just set `use_class14=True` in the `Flags` class.\n",
    "1204454": "I've also been training with Normal images (on a partial train dataset to enable validation) and post processing to change bbox format to 14 0 0 1 1 in the submission csv.\nI tried the 2-class classifier and found its performance was not too different from the detection only model. \nBut the main advantage of the detection-only approach is more reliable validation - I think it is harder to validate the detection+classifier pipeline correctly.",
    "1229607": "@corochann hello, 2-class classifier you mentioned, is trained on kaggle kernel?\nis that convenient if  i train it on my own server",
    "1212734": "I would like to know more details about the 'test_meta.csv' file in VinBigData 2-class classifier complete pipeline. Looking at 3000 rows, it seems that you did additional work on the test data, so please explain how it was generated and the columns '#dim0', '#dim1'.",
    "1217724": "Is 1-stage training highly affected by the imbalance between No Finding bboxes and the other classes' boxes ? ",
    "1248049": ""
  }
}