{
  "id": 229899,
  "title": "8th Place: Last hours top and late to be higher",
  "url": "/competitions/vinbigdata-chest-xray-abnormalities-detection/discussion/229899",
  "author_name": "Nick Sergievskiy",
  "post_date": "2021-04-01T08:26:51.298000",
  "votes": 11,
  "comment_count": 1,
  "views": 0,
  "content": "<p>Let's talk about a two-week adventure in the black-and-white world of lung.</p>\n<h2>Classification</h2>\n<p>We had 2 classification models:</p>\n<ul>\n<li>Binary classification for 14 / non-14 class. It was used for the postprocessing / filtering of the object detection predictions</li>\n<li>Multilabel classification for 14 disease classes. It was used to calculate the final box probability as: <code>p_box * 0.9 + p_cls * 0.1</code>, where <code>p_box</code> is a probability of the box itself, and <code>p_cls</code> is the probability of the corresponding class for the whole image</li>\n</ul>\n<p>Both models were using ResNet34 as a backbone and standard augmentations: HorizontalFlip, RandomBrightnessContrast, ShiftScaleRotate. Binary classifier was achieving 0.992 ROC AUC locally, however got only 0.059 mAP submitted separately on the LB. So, probably, our classifiers were quite weak, that's why in the final models we've ensembled binary classifier with publicly available ones.</p>\n<h2>Preprocessing</h2>\n<p>Preprocessing did not produce any results. We tried</p>\n<ul>\n<li>Equalization</li>\n<li><a href=\"https://www.kaggle.com/ratthachat/aptos-eye-preprocessing-in-diabetic-retinopathy#2.-Try-Ben-Graham's-preprocessing-method.\" target=\"_blank\">Graham's-preprocessing</a></li>\n<li>combine preprocessing options into different channels<br>\n<img src=\"https://i.imgur.com/BkzsbeP.png\" alt=\"\"></li>\n</ul>\n<h2>Preparing training data:</h2>\n<ul>\n<li>Remove duplicates</li>\n<li>Different radiologist at different images</li>\n<li>R11-17 (rare) radiologist</li>\n<li>Add 35% No finding</li>\n</ul>\n<h2>Detector</h2>\n<ul>\n<li><a href=\"https://github.com/shinya7y/UniverseNet\" target=\"_blank\">Universenet</a><br>\n-- universenet50-gfl<br>\n-- universenet101-gfl</li>\n<li>FasterRCNN R101</li>\n<li>YoloV5</li>\n</ul>\n<p>The universenet50-gfl universenet101-gfl models gave the greatest contribution. Probably Focal Loss is not bad for this task.<br>\nBest model: univernet50-gfl on all data (Different radiologist) with 35% No finding give <strong>LB 0.288 / 0.281</strong> . CV 0.492 with all data and 0.54 without no finding on GT</p>\n<h2>Extra data for pseudo labeling</h2>\n<p>Take NIH dataset and run ensemble.<br>\nBring in the appropriate classes:<br>\n'Hernia' -&gt; 'Aortic enlargement'.  <br>\nWe kept only the bounding box classes that matched the nih labels<br>\nLight class balance -- take 31000 images with pseudo labels from NiH<br>\nFinetune some folds on it give 0.001 to ensemble. It gives boost 9, 11,12 classes</p>\n<h2>BBox aggregation:</h2>\n<p>Use some kind of <a href=\"https://github.com/dereyly/signate_tobaco/blob/b458e4fbd312b186ed0cac92321486b7d2fce175/data_utils/boxes_mask.py#L394\" target=\"_blank\">voting</a>. It depends on score, IOU score and unique bbox. Unique part just calculate how many models votes for current bbox (its better then pre nms all results to make sure that model not give multi bbox in position with current nms). Its boost No finding images, if we are not sure about the classifier:<br>\nvoting 0.502 all / 0.564 val only on gt<br>\nuniq voting 0.522 all / 0.56 val only on gt</p>\n<p>The picture started to come together towards the end and so only a fraction of the cool stuff got done. Best of the unpublished private 0.317 (public 0.309)<br>\nBest too late moments:</p>\n<ul>\n<li>no filtering by class 14 -- +0.08</li>\n<li>more models with rare R11-17 (less models with all data) in final ensemble -- +0.09<br>\nThanks to the team <a href=\"https://www.kaggle.com/ybabakhin\" target=\"_blank\">@ybabakhin</a> <a href=\"https://www.kaggle.com/golubev\" target=\"_blank\">@golubev</a> for this trip</li>\n</ul>",
  "messages": [
    {
      "id": 1259217,
      "postDate": "2021-04-01T08:26:51.297Z",
      "content": "<p>Let's talk about a two-week adventure in the black-and-white world of lung.</p>\n<h2>Classification</h2>\n<p>We had 2 classification models:</p>\n<ul>\n<li>Binary classification for 14 / non-14 class. It was used for the postprocessing / filtering of the object detection predictions</li>\n<li>Multilabel classification for 14 disease classes. It was used to calculate the final box probability as: <code>p_box * 0.9 + p_cls * 0.1</code>, where <code>p_box</code> is a probability of the box itself, and <code>p_cls</code> is the probability of the corresponding class for the whole image</li>\n</ul>\n<p>Both models were using ResNet34 as a backbone and standard augmentations: HorizontalFlip, RandomBrightnessContrast, ShiftScaleRotate. Binary classifier was achieving 0.992 ROC AUC locally, however got only 0.059 mAP submitted separately on the LB. So, probably, our classifiers were quite weak, that's why in the final models we've ensembled binary classifier with publicly available ones.</p>\n<h2>Preprocessing</h2>\n<p>Preprocessing did not produce any results. We tried</p>\n<ul>\n<li>Equalization</li>\n<li><a href=\"https://www.kaggle.com/ratthachat/aptos-eye-preprocessing-in-diabetic-retinopathy#2.-Try-Ben-Graham's-preprocessing-method.\" target=\"_blank\">Graham's-preprocessing</a></li>\n<li>combine preprocessing options into different channels<br>\n<img src=\"https://i.imgur.com/BkzsbeP.png\" alt=\"\"></li>\n</ul>\n<h2>Preparing training data:</h2>\n<ul>\n<li>Remove duplicates</li>\n<li>Different radiologist at different images</li>\n<li>R11-17 (rare) radiologist</li>\n<li>Add 35% No finding</li>\n</ul>\n<h2>Detector</h2>\n<ul>\n<li><a href=\"https://github.com/shinya7y/UniverseNet\" target=\"_blank\">Universenet</a><br>\n-- universenet50-gfl<br>\n-- universenet101-gfl</li>\n<li>FasterRCNN R101</li>\n<li>YoloV5</li>\n</ul>\n<p>The universenet50-gfl universenet101-gfl models gave the greatest contribution. Probably Focal Loss is not bad for this task.<br>\nBest model: univernet50-gfl on all data (Different radiologist) with 35% No finding give <strong>LB 0.288 / 0.281</strong> . CV 0.492 with all data and 0.54 without no finding on GT</p>\n<h2>Extra data for pseudo labeling</h2>\n<p>Take NIH dataset and run ensemble.<br>\nBring in the appropriate classes:<br>\n'Hernia' -&gt; 'Aortic enlargement'.  <br>\nWe kept only the bounding box classes that matched the nih labels<br>\nLight class balance -- take 31000 images with pseudo labels from NiH<br>\nFinetune some folds on it give 0.001 to ensemble. It gives boost 9, 11,12 classes</p>\n<h2>BBox aggregation:</h2>\n<p>Use some kind of <a href=\"https://github.com/dereyly/signate_tobaco/blob/b458e4fbd312b186ed0cac92321486b7d2fce175/data_utils/boxes_mask.py#L394\" target=\"_blank\">voting</a>. It depends on score, IOU score and unique bbox. Unique part just calculate how many models votes for current bbox (its better then pre nms all results to make sure that model not give multi bbox in position with current nms). Its boost No finding images, if we are not sure about the classifier:<br>\nvoting 0.502 all / 0.564 val only on gt<br>\nuniq voting 0.522 all / 0.56 val only on gt</p>\n<p>The picture started to come together towards the end and so only a fraction of the cool stuff got done. Best of the unpublished private 0.317 (public 0.309)<br>\nBest too late moments:</p>\n<ul>\n<li>no filtering by class 14 -- +0.08</li>\n<li>more models with rare R11-17 (less models with all data) in final ensemble -- +0.09<br>\nThanks to the team <a href=\"https://www.kaggle.com/ybabakhin\" target=\"_blank\">@ybabakhin</a> <a href=\"https://www.kaggle.com/golubev\" target=\"_blank\">@golubev</a> for this trip</li>\n</ul>",
      "rawMarkdown": "Let's talk about a two-week adventure in the black-and-white world of lung.\n\n## Classification\nWe had 2 classification models:\n* Binary classification for 14 / non-14 class. It was used for the postprocessing / filtering of the object detection predictions\n* Multilabel classification for 14 disease classes. It was used to calculate the final box probability as: `p_box * 0.9 + p_cls * 0.1`, where `p_box` is a probability of the box itself, and `p_cls` is the probability of the corresponding class for the whole image\n\nBoth models were using ResNet34 as a backbone and standard augmentations: HorizontalFlip, RandomBrightnessContrast, ShiftScaleRotate. Binary classifier was achieving 0.992 ROC AUC locally, however got only 0.059 mAP submitted separately on the LB. So, probably, our classifiers were quite weak, that's why in the final models we've ensembled binary classifier with publicly available ones.\n\n## Preprocessing\nPreprocessing did not produce any results. We tried\n- Equalization\n- [Graham's-preprocessing]( https://www.kaggle.com/ratthachat/aptos-eye-preprocessing-in-diabetic-retinopathy#2.-Try-Ben-Graham's-preprocessing-method.)\n- combine preprocessing options into different channels\n![](https://i.imgur.com/BkzsbeP.png)\n\n\n\n\n\n## Preparing training data:\n- Remove duplicates\n- Different radiologist at different images\n- R11-17 (rare) radiologist\n- Add 35% No finding\n\n\n\n## Detector\n- [Universenet](https://github.com/shinya7y/UniverseNet)\n-- universenet50-gfl\n-- universenet101-gfl\n- FasterRCNN R101\n- YoloV5\n\n\nThe universenet50-gfl universenet101-gfl models gave the greatest contribution. Probably Focal Loss is not bad for this task.\nBest model: univernet50-gfl on all data (Different radiologist) with 35% No finding give **LB 0.288 / 0.281** . CV 0.492 with all data and 0.54 without no finding on GT\n\n## Extra data for pseudo labeling\nTake NIH dataset and run ensemble.\nBring in the appropriate classes:\n'Hernia' -> 'Aortic enlargement'.  \nWe kept only the bounding box classes that matched the nih labels\nLight class balance -- take 31000 images with pseudo labels from NiH\nFinetune some folds on it give 0.001 to ensemble. It gives boost 9, 11,12 classes\n\n## BBox aggregation:\nUse some kind of [voting](https://github.com/dereyly/signate_tobaco/blob/b458e4fbd312b186ed0cac92321486b7d2fce175/data_utils/boxes_mask.py#L394). It depends on score, IOU score and unique bbox. Unique part just calculate how many models votes for current bbox (its better then pre nms all results to make sure that model not give multi bbox in position with current nms). Its boost No finding images, if we are not sure about the classifier:\nvoting 0.502 all / 0.564 val only on gt\nuniq voting 0.522 all / 0.56 val only on gt\n\n\n\nThe picture started to come together towards the end and so only a fraction of the cool stuff got done. Best of the unpublished private 0.317 (public 0.309)\nBest too late moments:\n- no filtering by class 14 -- +0.08\n- more models with rare R11-17 (less models with all data) in final ensemble -- +0.09\nThanks to the team @ybabakhin @golubev for this trip",
      "votes": 11
    },
    {
      "id": 1259433,
      "postDate": "2021-04-01T12:10:09.777Z",
      "content": "<p>Good job, congrats <a href=\"https://www.kaggle.com/nicksergievskiy\" target=\"_blank\">@nicksergievskiy</a> <a href=\"https://www.kaggle.com/golubev\" target=\"_blank\">@golubev</a> and <a href=\"https://www.kaggle.com/ybabakhin\" target=\"_blank\">@ybabakhin</a> on 8th place. Thanks for sharing detailed solution!</p>",
      "rawMarkdown": "Good job, congrats @nicksergievskiy @golubev and @ybabakhin on 8th place. Thanks for sharing detailed solution!",
      "votes": 2
    }
  ],
  "comments": [
    {
      "id": 1259433,
      "author_name": "KhanhVD",
      "author_url": "",
      "post_date": "2021-04-01T12:10:09.777000",
      "content": "<p>Good job, congrats <a href=\"https://www.kaggle.com/nicksergievskiy\" target=\"_blank\">@nicksergievskiy</a> <a href=\"https://www.kaggle.com/golubev\" target=\"_blank\">@golubev</a> and <a href=\"https://www.kaggle.com/ybabakhin\" target=\"_blank\">@ybabakhin</a> on 8th place. Thanks for sharing detailed solution!</p>",
      "votes": 2,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1259217": "Let's talk about a two-week adventure in the black-and-white world of lung.\n\n## Classification\nWe had 2 classification models:\n* Binary classification for 14 / non-14 class. It was used for the postprocessing / filtering of the object detection predictions\n* Multilabel classification for 14 disease classes. It was used to calculate the final box probability as: `p_box * 0.9 + p_cls * 0.1`, where `p_box` is a probability of the box itself, and `p_cls` is the probability of the corresponding class for the whole image\n\nBoth models were using ResNet34 as a backbone and standard augmentations: HorizontalFlip, RandomBrightnessContrast, ShiftScaleRotate. Binary classifier was achieving 0.992 ROC AUC locally, however got only 0.059 mAP submitted separately on the LB. So, probably, our classifiers were quite weak, that's why in the final models we've ensembled binary classifier with publicly available ones.\n\n## Preprocessing\nPreprocessing did not produce any results. We tried\n- Equalization\n- [Graham's-preprocessing]( https://www.kaggle.com/ratthachat/aptos-eye-preprocessing-in-diabetic-retinopathy#2.-Try-Ben-Graham's-preprocessing-method.)\n- combine preprocessing options into different channels\n![](https://i.imgur.com/BkzsbeP.png)\n\n\n\n\n\n## Preparing training data:\n- Remove duplicates\n- Different radiologist at different images\n- R11-17 (rare) radiologist\n- Add 35% No finding\n\n\n\n## Detector\n- [Universenet](https://github.com/shinya7y/UniverseNet)\n-- universenet50-gfl\n-- universenet101-gfl\n- FasterRCNN R101\n- YoloV5\n\n\nThe universenet50-gfl universenet101-gfl models gave the greatest contribution. Probably Focal Loss is not bad for this task.\nBest model: univernet50-gfl on all data (Different radiologist) with 35% No finding give **LB 0.288 / 0.281** . CV 0.492 with all data and 0.54 without no finding on GT\n\n## Extra data for pseudo labeling\nTake NIH dataset and run ensemble.\nBring in the appropriate classes:\n'Hernia' -> 'Aortic enlargement'.  \nWe kept only the bounding box classes that matched the nih labels\nLight class balance -- take 31000 images with pseudo labels from NiH\nFinetune some folds on it give 0.001 to ensemble. It gives boost 9, 11,12 classes\n\n## BBox aggregation:\nUse some kind of [voting](https://github.com/dereyly/signate_tobaco/blob/b458e4fbd312b186ed0cac92321486b7d2fce175/data_utils/boxes_mask.py#L394). It depends on score, IOU score and unique bbox. Unique part just calculate how many models votes for current bbox (its better then pre nms all results to make sure that model not give multi bbox in position with current nms). Its boost No finding images, if we are not sure about the classifier:\nvoting 0.502 all / 0.564 val only on gt\nuniq voting 0.522 all / 0.56 val only on gt\n\n\n\nThe picture started to come together towards the end and so only a fraction of the cool stuff got done. Best of the unpublished private 0.317 (public 0.309)\nBest too late moments:\n- no filtering by class 14 -- +0.08\n- more models with rare R11-17 (less models with all data) in final ensemble -- +0.09\nThanks to the team @ybabakhin @golubev for this trip",
    "1259433": "Good job, congrats @nicksergievskiy @golubev and @ybabakhin on 8th place. Thanks for sharing detailed solution!"
  }
}