{
  "id": 71607,
  "title": "10th MaskRCNN without ensemble and TTA solution.",
  "url": "/competitions/airbus-ship-detection/discussion/71607",
  "author_name": "tkuanlun350",
  "post_date": "2018-11-15T04:54:20.933000",
  "votes": 33,
  "comment_count": 8,
  "views": 0,
  "content": "<p>Congratulations to all the winners ! Since most team used Unet-based solution so I think others may be interested in MaskRCNN based solution.</p>\n\n<p>My pipeline is ordinary: Unet101 with 384*384 + MaskRCNN.\nNo TTA and ensemble because the score all drop in public LB. (But actually better in Private LB)</p>\n\n<h2>What Works</h2>\n\n<ol>\n<li><p>I implemented <a href=\"https://arxiv.org/abs/1604.03540\">Online-Hard-Example-Mining</a> selecting top 128 roi's for training.</p></li>\n<li><p>Multi-Scale Training: Since small object are hard for detection, I resize the image randomly from 1200 ~ 2000.</p></li>\n<li>I used <a href=\"https://arxiv.org/abs/1704.04503\">softnms</a> for post-processing. I used mask's overlap instead of box overlap to rescore each instance to avoid dealing with the rotated box problem.</li>\n<li>MaskRCNN is prone to overfitting (The lesson learned from DSB2018). Data augmentation with MotionBlur, GaussNoise, ShiftScale, Rotate, CLAHE, RandomBrightness, RandomContrast ...</li>\n<li>Enlarge mask crop from 28 to 56, using diceloss + BCE loss.</li>\n</ol>\n\n<h2>Doesn't Work</h2>\n\n<ol>\n<li>Add stride 2 featuremap in FPN and add size 16 anchor. Improve local cv to 0.61 but worse public LB and private LB.</li>\n<li><a href=\"https://arxiv.org/abs/1712.00726\">Cascade-RCNN</a> No improvement.</li>\n<li>Try to turn mask prediction into box as post-processing.</li>\n</ol>\n\n<p>I have implemented TTA and checkpoint ensemble (see eval.py) but all results in worse public LB. Turns out they are better in private LB (best 0.853 TTA with scale range(1200,  1400 ... 2000)). \nThe final score (0.851) are based on single model without TTA. </p>\n\n<p>Hope other team using Detection-Based solution can share their experience too ! I wonder how rotated box will perform.</p>\n\n<p>The un-cleaned code is <a href=\"https://github.com/tkuanlun350/Kaggle_Ship_Detection_2018\">here</a>. (will be cleaned after my recent deadline ...)</p>",
  "messages": [
    {
      "id": 421513,
      "postDate": "2018-11-15T04:54:20.933Z",
      "content": "<p>Congratulations to all the winners ! Since most team used Unet-based solution so I think others may be interested in MaskRCNN based solution.</p>\n\n<p>My pipeline is ordinary: Unet101 with 384*384 + MaskRCNN.\nNo TTA and ensemble because the score all drop in public LB. (But actually better in Private LB)</p>\n\n<h2>What Works</h2>\n\n<ol>\n<li><p>I implemented <a href=\"https://arxiv.org/abs/1604.03540\">Online-Hard-Example-Mining</a> selecting top 128 roi's for training.</p></li>\n<li><p>Multi-Scale Training: Since small object are hard for detection, I resize the image randomly from 1200 ~ 2000.</p></li>\n<li>I used <a href=\"https://arxiv.org/abs/1704.04503\">softnms</a> for post-processing. I used mask's overlap instead of box overlap to rescore each instance to avoid dealing with the rotated box problem.</li>\n<li>MaskRCNN is prone to overfitting (The lesson learned from DSB2018). Data augmentation with MotionBlur, GaussNoise, ShiftScale, Rotate, CLAHE, RandomBrightness, RandomContrast ...</li>\n<li>Enlarge mask crop from 28 to 56, using diceloss + BCE loss.</li>\n</ol>\n\n<h2>Doesn't Work</h2>\n\n<ol>\n<li>Add stride 2 featuremap in FPN and add size 16 anchor. Improve local cv to 0.61 but worse public LB and private LB.</li>\n<li><a href=\"https://arxiv.org/abs/1712.00726\">Cascade-RCNN</a> No improvement.</li>\n<li>Try to turn mask prediction into box as post-processing.</li>\n</ol>\n\n<p>I have implemented TTA and checkpoint ensemble (see eval.py) but all results in worse public LB. Turns out they are better in private LB (best 0.853 TTA with scale range(1200,  1400 ... 2000)). \nThe final score (0.851) are based on single model without TTA. </p>\n\n<p>Hope other team using Detection-Based solution can share their experience too ! I wonder how rotated box will perform.</p>\n\n<p>The un-cleaned code is <a href=\"https://github.com/tkuanlun350/Kaggle_Ship_Detection_2018\">here</a>. (will be cleaned after my recent deadline ...)</p>",
      "rawMarkdown": "Congratulations to all the winners ! Since most team used Unet-based solution so I think others may be interested in MaskRCNN based solution.\n\nMy pipeline is ordinary: Unet101 with 384*384 + MaskRCNN.\nNo TTA and ensemble because the score all drop in public LB. (But actually better in Private LB)\n\n## What Works ##\n1. I implemented [Online-Hard-Example-Mining][1] selecting top 128 roi's for training.\n\n2. Multi-Scale Training: Since small object are hard for detection, I resize the image randomly from 1200 ~ 2000.\n3. I used [softnms][2] for post-processing. I used mask's overlap instead of box overlap to rescore each instance to avoid dealing with the rotated box problem.\n4. MaskRCNN is prone to overfitting (The lesson learned from DSB2018). Data augmentation with MotionBlur, GaussNoise, ShiftScale, Rotate, CLAHE, RandomBrightness, RandomContrast ...\n5. Enlarge mask crop from 28 to 56, using diceloss + BCE loss.\n\n## Doesn't Work ##\n 1.  Add stride 2 featuremap in FPN and add size 16 anchor. Improve local cv to 0.61 but worse public LB and private LB.\n 2. [Cascade-RCNN][3] No improvement.\n 3. Try to turn mask prediction into box as post-processing.\n\nI have implemented TTA and checkpoint ensemble (see eval.py) but all results in worse public LB. Turns out they are better in private LB (best 0.853 TTA with scale range(1200,  1400 ... 2000)). \nThe final score (0.851) are based on single model without TTA. \n\nHope other team using Detection-Based solution can share their experience too ! I wonder how rotated box will perform.\n\nThe un-cleaned code is [here][4]. (will be cleaned after my recent deadline ...)\n\n\n\n  [1]: https://arxiv.org/abs/1604.03540\n  [2]: https://arxiv.org/abs/1704.04503\n  [3]: https://arxiv.org/abs/1712.00726\n  [4]: https://github.com/tkuanlun350/Kaggle_Ship_Detection_2018",
      "votes": 33
    },
    {
      "id": 421523,
      "postDate": "2018-11-15T05:14:16.983Z",
      "content": "<p>The score of mask rcnn is  lower than unet models in public LB :(  Same observation as u. Finally, we only utilize the instance information of mask rcnn to split the nearby ships of unets output.</p>",
      "rawMarkdown": "The score of mask rcnn is  lower than unet models in public LB :(  Same observation as u. Finally, we only utilize the instance information of mask rcnn to split the nearby ships of unets output.",
      "votes": 1,
      "replies": [
        {
          "id": 421592,
          "postDate": "2018-11-15T07:02:45.427Z",
          "content": "<p>Parameter tuning is painful in MaskRCNN :( \nWhat is your inference size in MaskRCNN ? Detection based solution always suffer from small object. Using 2000 make it impossible to use &gt; 1 batch size (only got 1 gpu )</p>",
          "rawMarkdown": "Parameter tuning is painful in MaskRCNN :( \nWhat is your inference size in MaskRCNN ? Detection based solution always suffer from small object. Using 2000 make it impossible to use &gt; 1 batch size (only got 1 gpu )"
        }
      ]
    },
    {
      "id": 421525,
      "postDate": "2018-11-15T05:15:55.313Z",
      "content": "<p>Congratulations！ Waiting for your  MaskRCNN based solution code.</p>",
      "rawMarkdown": "Congratulations！ Waiting for your  MaskRCNN based solution code.",
      "votes": 2,
      "replies": [
        {
          "id": 421595,
          "postDate": "2018-11-15T07:03:56.667Z",
          "content": "<p>Thanks ! I will make it more user friendly as soon as possible. </p>",
          "rawMarkdown": "Thanks ! I will make it more user friendly as soon as possible. "
        }
      ]
    },
    {
      "id": 762914,
      "postDate": "2020-03-03T23:49:55.137Z",
      "content": "<p>dealing with the rotated box problem.: what  is the rotated box problem? and how'softnms for post-processing. ' this post-processing solved the problem?</p>",
      "rawMarkdown": "dealing with the rotated box problem.: what  is the rotated box problem? and how'softnms for post-processing. ' this post-processing solved the problem?"
    },
    {
      "id": 762904,
      "postDate": "2020-03-03T23:38:35.307Z",
      "content": "<p>Multi-Scale Training: Since small object are hard for detection, I resize the image randomly from 1200 ~ 2000. : you unscaling the image?</p>",
      "rawMarkdown": "Multi-Scale Training: Since small object are hard for detection, I resize the image randomly from 1200 ~ 2000. : you unscaling the image?"
    },
    {
      "id": 421764,
      "postDate": "2018-11-15T11:48:12.587Z",
      "content": "<p>Congrats @tkuanlun350,  and thanks for sharing.</p>",
      "rawMarkdown": "Congrats @tkuanlun350,  and thanks for sharing."
    },
    {
      "id": 423229,
      "postDate": "2018-11-17T18:19:41.963Z",
      "rawMarkdown": "",
      "votes": 2,
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 421523,
      "author_name": "SeuTao",
      "author_url": "",
      "post_date": "2018-11-15T05:14:16.983000",
      "content": "<p>The score of mask rcnn is  lower than unet models in public LB :(  Same observation as u. Finally, we only utilize the instance information of mask rcnn to split the nearby ships of unets output.</p>",
      "votes": 1,
      "replies": [
        {
          "id": 421592,
          "author_name": "tkuanlun350",
          "author_url": "",
          "post_date": "2018-11-15T07:02:45.427000",
          "content": "<p>Parameter tuning is painful in MaskRCNN :( \nWhat is your inference size in MaskRCNN ? Detection based solution always suffer from small object. Using 2000 make it impossible to use &gt; 1 batch size (only got 1 gpu )</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 421525,
      "author_name": "Kevin Zheng",
      "author_url": "",
      "post_date": "2018-11-15T05:15:55.313000",
      "content": "<p>Congratulations！ Waiting for your  MaskRCNN based solution code.</p>",
      "votes": 2,
      "replies": [
        {
          "id": 421595,
          "author_name": "tkuanlun350",
          "author_url": "",
          "post_date": "2018-11-15T07:03:56.667000",
          "content": "<p>Thanks ! I will make it more user friendly as soon as possible. </p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 762914,
      "author_name": "Footprint🐾",
      "author_url": "",
      "post_date": "2020-03-03T23:49:55.137000",
      "content": "<p>dealing with the rotated box problem.: what  is the rotated box problem? and how'softnms for post-processing. ' this post-processing solved the problem?</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 762904,
      "author_name": "Footprint🐾",
      "author_url": "",
      "post_date": "2020-03-03T23:38:35.307000",
      "content": "<p>Multi-Scale Training: Since small object are hard for detection, I resize the image randomly from 1200 ~ 2000. : you unscaling the image?</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 421764,
      "author_name": "YaGana Sheriff-Hussaini",
      "author_url": "",
      "post_date": "2018-11-15T11:48:12.587000",
      "content": "<p>Congrats @tkuanlun350,  and thanks for sharing.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 423229,
      "author_name": "",
      "author_url": "",
      "post_date": "2018-11-17T18:19:41.963000",
      "content": "",
      "votes": 2,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "421513": "Congratulations to all the winners ! Since most team used Unet-based solution so I think others may be interested in MaskRCNN based solution.\n\nMy pipeline is ordinary: Unet101 with 384*384 + MaskRCNN.\nNo TTA and ensemble because the score all drop in public LB. (But actually better in Private LB)\n\n## What Works ##\n1. I implemented [Online-Hard-Example-Mining][1] selecting top 128 roi's for training.\n\n2. Multi-Scale Training: Since small object are hard for detection, I resize the image randomly from 1200 ~ 2000.\n3. I used [softnms][2] for post-processing. I used mask's overlap instead of box overlap to rescore each instance to avoid dealing with the rotated box problem.\n4. MaskRCNN is prone to overfitting (The lesson learned from DSB2018). Data augmentation with MotionBlur, GaussNoise, ShiftScale, Rotate, CLAHE, RandomBrightness, RandomContrast ...\n5. Enlarge mask crop from 28 to 56, using diceloss + BCE loss.\n\n## Doesn't Work ##\n 1.  Add stride 2 featuremap in FPN and add size 16 anchor. Improve local cv to 0.61 but worse public LB and private LB.\n 2. [Cascade-RCNN][3] No improvement.\n 3. Try to turn mask prediction into box as post-processing.\n\nI have implemented TTA and checkpoint ensemble (see eval.py) but all results in worse public LB. Turns out they are better in private LB (best 0.853 TTA with scale range(1200,  1400 ... 2000)). \nThe final score (0.851) are based on single model without TTA. \n\nHope other team using Detection-Based solution can share their experience too ! I wonder how rotated box will perform.\n\nThe un-cleaned code is [here][4]. (will be cleaned after my recent deadline ...)\n\n\n\n  [1]: https://arxiv.org/abs/1604.03540\n  [2]: https://arxiv.org/abs/1704.04503\n  [3]: https://arxiv.org/abs/1712.00726\n  [4]: https://github.com/tkuanlun350/Kaggle_Ship_Detection_2018",
    "421523": "The score of mask rcnn is  lower than unet models in public LB :(  Same observation as u. Finally, we only utilize the instance information of mask rcnn to split the nearby ships of unets output.",
    "421525": "Congratulations！ Waiting for your  MaskRCNN based solution code.",
    "762914": "dealing with the rotated box problem.: what  is the rotated box problem? and how'softnms for post-processing. ' this post-processing solved the problem?",
    "762904": "Multi-Scale Training: Since small object are hard for detection, I resize the image randomly from 1200 ~ 2000. : you unscaling the image?",
    "421764": "Congrats @tkuanlun350,  and thanks for sharing.",
    "423229": ""
  }
}