{
  "id": 79115,
  "title": "8th solution",
  "url": "/competitions/rsna-pneumonia-detection-challenge/discussion/79115",
  "author_name": "Mu Song",
  "post_date": "2019-01-31T04:34:44.469000",
  "votes": 3,
  "comment_count": 0,
  "views": 0,
  "content": "<p>8th-Solution：\nI’m pleasure to here to share my solution of detection. In the stage one/ two, my score is 0.237 (Pubic LB) / 0.228 (Private LB). My detection framework, similarity to S3FD (face detection framework), was implemented with myself using Pytorch. \nIn the training phase, I have chosen 5158 positive samples (‘Pneumonia’) as the training set. The validation set consist of 500 ‘Pneumonia’ images, 500 ‘No Lung Opacity’ / Not Normal images and 500 ‘Lung Opacity’ images. Due to time constraints, I did not use cross validation method. In order to reduce the GPU memory and keep the high resolution, I resized the input images to 800 x 800. And some data augmentation techniques (RandomSampleCrop and RandomMirror) are used in the training phase. Firstly, I designed my multi-layer detection loss to calculate the input image without ground truth, so I can use the all images to train the detection model. Actually, the results of the experiment are not good. After that, I cropped the box area in the Pneumonia images and put it in the Normal images to generate new training set. Finally, I putted the original training set and the new training set data together to improve the performance of the detection model. \nAnchor\nThe anchor design is very importance to detection task, so I designed two anchor solutions using k-menas.\n1： Size: detection layer 1 [0.1, 0.1] detection layer 2 [0.2, 0.2] detection layer 3 [0.4, 0.4]\ndetection layer 4 [0.8, 0.8]， ratios are [1:1].\n2： Size: detection layer 1 [0.1, 0.1] detection layer 2 [0.2, 0.2] detection layer 3 [0.4, 0.4]\ndetection layer 4 [0.8, 0.8]， ratios are [[1:1], [0.3:1], [0.6:1], [1.2:1]]\nThe 2th anchor solution was achieved the better result.\nLoss Function\nIn the loss function, the original classification loss with cross entropy and regression loss with smooth L1 are changed to weighted cross entropy and weighted smooth L1, respectively. The weight depends on the IOU between the GT box and anchor. This method can to slightly reduce the unbalance between the regression confidence and classification confidence.\nDetection Network\nIn order to improve the feature extraction capability of my detection model, a Feature Pyramid Network (FPN) was also used. And also I tried to implement the RefineDet (two stages SSD <a href=\"https://arxiv.org/abs/1711.06897\">https://arxiv.org/abs/1711.06897</a>) to detection the Pneumonia, but it have many false positive samples.\nBackbone\nMy base models are only use pre-trained VGG16 model.\nPost-Processing\nThe two stage NMS method was used in the inference phase, firstly I removed the predicted boxes which are overlap &gt;= 0.7, but the xmin, ymin, xmax, ymax of the keep box is mean of the removed boxes and itself. Then the normal NMS method with overlap &gt;= 0.05 as the two-stage NMS method.\nEnsemble\nThe six models which I have attempted are used to ensemble a submission result. The two stage NMS and multi-scale testing methods are used in here.\nThanks organizers for this competitions.</p>",
  "messages": [
    {
      "id": 464026,
      "postDate": "2019-01-31T04:34:44.470Z",
      "content": "<p>8th-Solution：\nI’m pleasure to here to share my solution of detection. In the stage one/ two, my score is 0.237 (Pubic LB) / 0.228 (Private LB). My detection framework, similarity to S3FD (face detection framework), was implemented with myself using Pytorch. \nIn the training phase, I have chosen 5158 positive samples (‘Pneumonia’) as the training set. The validation set consist of 500 ‘Pneumonia’ images, 500 ‘No Lung Opacity’ / Not Normal images and 500 ‘Lung Opacity’ images. Due to time constraints, I did not use cross validation method. In order to reduce the GPU memory and keep the high resolution, I resized the input images to 800 x 800. And some data augmentation techniques (RandomSampleCrop and RandomMirror) are used in the training phase. Firstly, I designed my multi-layer detection loss to calculate the input image without ground truth, so I can use the all images to train the detection model. Actually, the results of the experiment are not good. After that, I cropped the box area in the Pneumonia images and put it in the Normal images to generate new training set. Finally, I putted the original training set and the new training set data together to improve the performance of the detection model. \nAnchor\nThe anchor design is very importance to detection task, so I designed two anchor solutions using k-menas.\n1： Size: detection layer 1 [0.1, 0.1] detection layer 2 [0.2, 0.2] detection layer 3 [0.4, 0.4]\ndetection layer 4 [0.8, 0.8]， ratios are [1:1].\n2： Size: detection layer 1 [0.1, 0.1] detection layer 2 [0.2, 0.2] detection layer 3 [0.4, 0.4]\ndetection layer 4 [0.8, 0.8]， ratios are [[1:1], [0.3:1], [0.6:1], [1.2:1]]\nThe 2th anchor solution was achieved the better result.\nLoss Function\nIn the loss function, the original classification loss with cross entropy and regression loss with smooth L1 are changed to weighted cross entropy and weighted smooth L1, respectively. The weight depends on the IOU between the GT box and anchor. This method can to slightly reduce the unbalance between the regression confidence and classification confidence.\nDetection Network\nIn order to improve the feature extraction capability of my detection model, a Feature Pyramid Network (FPN) was also used. And also I tried to implement the RefineDet (two stages SSD <a href=\"https://arxiv.org/abs/1711.06897\">https://arxiv.org/abs/1711.06897</a>) to detection the Pneumonia, but it have many false positive samples.\nBackbone\nMy base models are only use pre-trained VGG16 model.\nPost-Processing\nThe two stage NMS method was used in the inference phase, firstly I removed the predicted boxes which are overlap &gt;= 0.7, but the xmin, ymin, xmax, ymax of the keep box is mean of the removed boxes and itself. Then the normal NMS method with overlap &gt;= 0.05 as the two-stage NMS method.\nEnsemble\nThe six models which I have attempted are used to ensemble a submission result. The two stage NMS and multi-scale testing methods are used in here.\nThanks organizers for this competitions.</p>",
      "rawMarkdown": "8th-Solution：\nI’m pleasure to here to share my solution of detection. In the stage one/ two, my score is 0.237 (Pubic LB) / 0.228 (Private LB). My detection framework, similarity to S3FD (face detection framework), was implemented with myself using Pytorch. \nIn the training phase, I have chosen 5158 positive samples (‘Pneumonia’) as the training set. The validation set consist of 500 ‘Pneumonia’ images, 500 ‘No Lung Opacity’ / Not Normal images and 500 ‘Lung Opacity’ images. Due to time constraints, I did not use cross validation method. In order to reduce the GPU memory and keep the high resolution, I resized the input images to 800 x 800. And some data augmentation techniques (RandomSampleCrop and RandomMirror) are used in the training phase. Firstly, I designed my multi-layer detection loss to calculate the input image without ground truth, so I can use the all images to train the detection model. Actually, the results of the experiment are not good. After that, I cropped the box area in the Pneumonia images and put it in the Normal images to generate new training set. Finally, I putted the original training set and the new training set data together to improve the performance of the detection model. \nAnchor\nThe anchor design is very importance to detection task, so I designed two anchor solutions using k-menas.\n1： Size: detection layer 1 [0.1, 0.1] detection layer 2 [0.2, 0.2] detection layer 3 [0.4, 0.4]\ndetection layer 4 [0.8, 0.8]， ratios are [1:1].\n2： Size: detection layer 1 [0.1, 0.1] detection layer 2 [0.2, 0.2] detection layer 3 [0.4, 0.4]\ndetection layer 4 [0.8, 0.8]， ratios are [[1:1], [0.3:1], [0.6:1], [1.2:1]]\nThe 2th anchor solution was achieved the better result.\nLoss Function\nIn the loss function, the original classification loss with cross entropy and regression loss with smooth L1 are changed to weighted cross entropy and weighted smooth L1, respectively. The weight depends on the IOU between the GT box and anchor. This method can to slightly reduce the unbalance between the regression confidence and classification confidence.\nDetection Network\nIn order to improve the feature extraction capability of my detection model, a Feature Pyramid Network (FPN) was also used. And also I tried to implement the RefineDet (two stages SSD https://arxiv.org/abs/1711.06897) to detection the Pneumonia, but it have many false positive samples.\nBackbone\nMy base models are only use pre-trained VGG16 model.\nPost-Processing\nThe two stage NMS method was used in the inference phase, firstly I removed the predicted boxes which are overlap &gt;= 0.7, but the xmin, ymin, xmax, ymax of the keep box is mean of the removed boxes and itself. Then the normal NMS method with overlap &gt;= 0.05 as the two-stage NMS method.\nEnsemble\nThe six models which I have attempted are used to ensemble a submission result. The two stage NMS and multi-scale testing methods are used in here.\nThanks organizers for this competitions.\n",
      "votes": 3
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "464026": "8th-Solution：\nI’m pleasure to here to share my solution of detection. In the stage one/ two, my score is 0.237 (Pubic LB) / 0.228 (Private LB). My detection framework, similarity to S3FD (face detection framework), was implemented with myself using Pytorch. \nIn the training phase, I have chosen 5158 positive samples (‘Pneumonia’) as the training set. The validation set consist of 500 ‘Pneumonia’ images, 500 ‘No Lung Opacity’ / Not Normal images and 500 ‘Lung Opacity’ images. Due to time constraints, I did not use cross validation method. In order to reduce the GPU memory and keep the high resolution, I resized the input images to 800 x 800. And some data augmentation techniques (RandomSampleCrop and RandomMirror) are used in the training phase. Firstly, I designed my multi-layer detection loss to calculate the input image without ground truth, so I can use the all images to train the detection model. Actually, the results of the experiment are not good. After that, I cropped the box area in the Pneumonia images and put it in the Normal images to generate new training set. Finally, I putted the original training set and the new training set data together to improve the performance of the detection model. \nAnchor\nThe anchor design is very importance to detection task, so I designed two anchor solutions using k-menas.\n1： Size: detection layer 1 [0.1, 0.1] detection layer 2 [0.2, 0.2] detection layer 3 [0.4, 0.4]\ndetection layer 4 [0.8, 0.8]， ratios are [1:1].\n2： Size: detection layer 1 [0.1, 0.1] detection layer 2 [0.2, 0.2] detection layer 3 [0.4, 0.4]\ndetection layer 4 [0.8, 0.8]， ratios are [[1:1], [0.3:1], [0.6:1], [1.2:1]]\nThe 2th anchor solution was achieved the better result.\nLoss Function\nIn the loss function, the original classification loss with cross entropy and regression loss with smooth L1 are changed to weighted cross entropy and weighted smooth L1, respectively. The weight depends on the IOU between the GT box and anchor. This method can to slightly reduce the unbalance between the regression confidence and classification confidence.\nDetection Network\nIn order to improve the feature extraction capability of my detection model, a Feature Pyramid Network (FPN) was also used. And also I tried to implement the RefineDet (two stages SSD https://arxiv.org/abs/1711.06897) to detection the Pneumonia, but it have many false positive samples.\nBackbone\nMy base models are only use pre-trained VGG16 model.\nPost-Processing\nThe two stage NMS method was used in the inference phase, firstly I removed the predicted boxes which are overlap &gt;= 0.7, but the xmin, ymin, xmax, ymax of the keep box is mean of the removed boxes and itself. Then the normal NMS method with overlap &gt;= 0.05 as the two-stage NMS method.\nEnsemble\nThe six models which I have attempted are used to ensemble a submission result. The two stage NMS and multi-scale testing methods are used in here.\nThanks organizers for this competitions.\n"
  }
}