{
  "id": 35087,
  "title": "Solution Sharing and Congratulations",
  "url": "/competitions/intel-mobileodt-cervical-cancer-screening/discussion/35087",
  "author_name": "Russ Wolfinger",
  "post_date": "2017-06-22T00:28:52.172000",
  "votes": 29,
  "comment_count": 12,
  "views": 0,
  "content": "<p>Great job and congrats to team TEST for a very nice win, another one right after Fisheries.   Some smart guys from Lithuania for sure--they've got some secret sauce cooking!     Impressive solo second by I Rustandi and excellent work by all top finishers.</p>\n\n<p>A quick overview of our #3 solution:  First want to say what a pleasure it has been teaming with Giba, Xulei, and Joe.   We had a lot of fun learning and strategizing together and effectively used slack to communicate across time zones.   To start out, we probed the leaderboard and had the public test set labels to train on a few weeks before the model submission deadline.   For most of our models we used yolo or faster-rcnn to do object detection--a big thanks to Paul for the bounding box annotations.   We then created crops and used bagged image classification with resnet50 and vgg16 backbones and then hillclimbing to ensemble based on 2-fold cv with the public train and test sets as our splits.   We only used the additional training data in one of our models and also included one custom model from Joe, plus one more based on unet from Scotty--thanks for sharing and raising the big concern about the near-duplicate images in Stage 2.  Hope to add some more details later; please feel free to ask any specific questions.</p>\n\n<p>Most importantly, hoping we can all pitch in to really improve treatment decisions and early prevention of this disease.</p>",
  "messages": [
    {
      "id": 194843,
      "postDate": "2017-06-22T00:28:52.173Z",
      "content": "<p>Great job and congrats to team TEST for a very nice win, another one right after Fisheries.   Some smart guys from Lithuania for sure--they've got some secret sauce cooking!     Impressive solo second by I Rustandi and excellent work by all top finishers.</p>\n\n<p>A quick overview of our #3 solution:  First want to say what a pleasure it has been teaming with Giba, Xulei, and Joe.   We had a lot of fun learning and strategizing together and effectively used slack to communicate across time zones.   To start out, we probed the leaderboard and had the public test set labels to train on a few weeks before the model submission deadline.   For most of our models we used yolo or faster-rcnn to do object detection--a big thanks to Paul for the bounding box annotations.   We then created crops and used bagged image classification with resnet50 and vgg16 backbones and then hillclimbing to ensemble based on 2-fold cv with the public train and test sets as our splits.   We only used the additional training data in one of our models and also included one custom model from Joe, plus one more based on unet from Scotty--thanks for sharing and raising the big concern about the near-duplicate images in Stage 2.  Hope to add some more details later; please feel free to ask any specific questions.</p>\n\n<p>Most importantly, hoping we can all pitch in to really improve treatment decisions and early prevention of this disease.</p>",
      "rawMarkdown": "Great job and congrats to team TEST for a very nice win, another one right after Fisheries.   Some smart guys from Lithuania for sure--they've got some secret sauce cooking!     Impressive solo second by I Rustandi and excellent work by all top finishers.\n\nA quick overview of our #3 solution:  First want to say what a pleasure it has been teaming with Giba, Xulei, and Joe.   We had a lot of fun learning and strategizing together and effectively used slack to communicate across time zones.   To start out, we probed the leaderboard and had the public test set labels to train on a few weeks before the model submission deadline.   For most of our models we used yolo or faster-rcnn to do object detection--a big thanks to Paul for the bounding box annotations.   We then created crops and used bagged image classification with resnet50 and vgg16 backbones and then hillclimbing to ensemble based on 2-fold cv with the public train and test sets as our splits.   We only used the additional training data in one of our models and also included one custom model from Joe, plus one more based on unet from Scotty--thanks for sharing and raising the big concern about the near-duplicate images in Stage 2.  Hope to add some more details later; please feel free to ask any specific questions.\n\nMost importantly, hoping we can all pitch in to really improve treatment decisions and early prevention of this disease.",
      "votes": 29
    },
    {
      "id": 194939,
      "postDate": "2017-06-22T09:21:57.313Z",
      "content": "<p>Thanks Russ for the brief sharing. And congratulations to all the top performers. </p>\n\n<p>As usual, I will share a bit more on my solution below:\nBasically, there are two stages involved: first is to do cervical detection by using yolo models on full images, then apply resnet-50 to do cervical classification on cropped cervical ROIs.  </p>\n\n<p><em><strong>1) Stage-1: cervical detection by using yolo on full images</strong></em></p>\n\n<p>1-1) <strong>Generate label txt files</strong>: I followed paul’s annotations from the forum discussion track “bounding boxes for type_1”  to generate the bounding box requested by yolo for object detection. I also resize all the images from all the image sets to square size by bordering the shorter side of the images with black pixels. </p>\n\n<p>1-2) <strong>Various yolo models</strong>: I then followed the instructions from [Link-5] to train three yolo models by using the annotated cervical data set with three different number of anchors, i.e., 5, 7, and 9, respectively. The yolo models also come out the probabilities of the cervical types for each detected object, but I found the results are a bit worse than those from Resnet-50 in Stage-2, so I did not use in the final submission. </p>\n\n<p>1-3) <strong>Crop cervical ROIs</strong>: I used the three trained yolo models for cervical detection on training image set, additional image set, as well as test_stg1 image set, and cropped cervical ROIs using the bounding box with the highest probability value from the three models. The yolo models work perfect for almost all the images from various sets. This is the reason why I discard faster r-cnn method (which was used in my early exploration for this competition) in my final solution.  I saved the cropped cervical ROIs for each image set separately.</p>\n\n<p>1-4) <strong>Re-train yolo models</strong>: I then check through all the rois in test_stg1 set and find all the results are quite reasonable.  So I decided to use the detected rois as bounding-box annotations for test_stg1 image set. Together with the annotations from Paul’s for training image set. We re-train the three yolo models and re-detect the cervical rois by repeat step 2-2 and step 2-3. The three re-trained models are the three final yolo models used for the final tst_stg2 image set. </p>\n\n<p>1-5) <strong>Post-filtering of ROIs for additional set</strong>: I also spend several days to check through all the rois in additional set. I used k-means to partition all the rois to 20 clusters, then further partition each cluster into 10-30 sub-clusters. For each sub-cluster, I manually removed the very blur images as well as duplicated images. The final number of rois for additional set is around 4760. </p>\n\n<p>1-6) <strong>Stage-1 output</strong>: 4760 rois in additional set, 1780 rois in training set, and 512 rois in tst_stg1 set. All the cropped rois are resized to 224x224 for further processing in stage-2. </p>\n\n<p><em><strong>2) Stage-2: cervical classification by Resnet-50 on rois images</strong></em></p>\n\n<p>2-1) <strong>Preprocessing</strong> -- I tried different data augmentation in terms of keras ImageDataGenerator, such as rotation, flipping, and shifting. I also tried to deal with the training sample imbalance by horizontal flipping of the images from Type_1 only, this will increase the performance a bit. </p>\n\n<p>2-2) <strong>Selection of CNN</strong> – I trained different CNNs (VGG16, VGG19, Inception_v3, and Resnet50) by using the rois in training set only, then validation on the rois in tst_stg1 set. I then found the results from Resnet50 is a bit better than all the other CNNs. It is expected that the ensembling of various CNNs would generate better results than by Resnet50 only. But since I don’t have sufficient time to train various CNN models, so finally decided to use Resnet50 only in this stage.</p>\n\n<p>2-3) <strong>Two sets of models</strong> – I trained one set of 30 Resnet50 models by using the rois from training set and tst_stg1 set, I run the training by epoch=30 and selected the best model with the least validation loss. Similarly, I then trained the other set of 30 Resnet50 models by using the rois from all the sets, i.e., additional set, training set, and tst_stg1 set. </p>\n\n<p>2-4) <strong>Final results</strong> – I uploaded the testing pipeline before the tst_stg2 image set comes out.  In which the first set of 30 Resnet50 models running on tst_stg2 and comes out tst_rst1, and the second set of 30 Resnet50 models running on tst_stg2 and comes out tst_rst2, I then average these two results and come out the final submission. The final score is less than 0.82. </p>",
      "rawMarkdown": "Thanks Russ for the brief sharing. And congratulations to all the top performers. \n\nAs usual, I will share a bit more on my solution below:\nBasically, there are two stages involved: first is to do cervical detection by using yolo models on full images, then apply resnet-50 to do cervical classification on cropped cervical ROIs.  \n\n***1) Stage-1: cervical detection by using yolo on full images***\n\n1-1) **Generate label txt files**: I followed paul’s annotations from the forum discussion track “bounding boxes for type_1”  to generate the bounding box requested by yolo for object detection. I also resize all the images from all the image sets to square size by bordering the shorter side of the images with black pixels. \n\n1-2) **Various yolo models**: I then followed the instructions from [Link-5] to train three yolo models by using the annotated cervical data set with three different number of anchors, i.e., 5, 7, and 9, respectively. The yolo models also come out the probabilities of the cervical types for each detected object, but I found the results are a bit worse than those from Resnet-50 in Stage-2, so I did not use in the final submission. \n\n1-3) **Crop cervical ROIs**: I used the three trained yolo models for cervical detection on training image set, additional image set, as well as test_stg1 image set, and cropped cervical ROIs using the bounding box with the highest probability value from the three models. The yolo models work perfect for almost all the images from various sets. This is the reason why I discard faster r-cnn method (which was used in my early exploration for this competition) in my final solution.  I saved the cropped cervical ROIs for each image set separately.\n\n1-4) **Re-train yolo models**: I then check through all the rois in test_stg1 set and find all the results are quite reasonable.  So I decided to use the detected rois as bounding-box annotations for test_stg1 image set. Together with the annotations from Paul’s for training image set. We re-train the three yolo models and re-detect the cervical rois by repeat step 2-2 and step 2-3. The three re-trained models are the three final yolo models used for the final tst_stg2 image set. \n\n1-5) **Post-filtering of ROIs for additional set**: I also spend several days to check through all the rois in additional set. I used k-means to partition all the rois to 20 clusters, then further partition each cluster into 10-30 sub-clusters. For each sub-cluster, I manually removed the very blur images as well as duplicated images. The final number of rois for additional set is around 4760. \n\n1-6) **Stage-1 output**: 4760 rois in additional set, 1780 rois in training set, and 512 rois in tst_stg1 set. All the cropped rois are resized to 224x224 for further processing in stage-2. \n\n***2) Stage-2: cervical classification by Resnet-50 on rois images***\n\n2-1) **Preprocessing** -- I tried different data augmentation in terms of keras ImageDataGenerator, such as rotation, flipping, and shifting. I also tried to deal with the training sample imbalance by horizontal flipping of the images from Type_1 only, this will increase the performance a bit. \n\n2-2) **Selection of CNN** – I trained different CNNs (VGG16, VGG19, Inception_v3, and Resnet50) by using the rois in training set only, then validation on the rois in tst_stg1 set. I then found the results from Resnet50 is a bit better than all the other CNNs. It is expected that the ensembling of various CNNs would generate better results than by Resnet50 only. But since I don’t have sufficient time to train various CNN models, so finally decided to use Resnet50 only in this stage.\n\n2-3) **Two sets of models** – I trained one set of 30 Resnet50 models by using the rois from training set and tst_stg1 set, I run the training by epoch=30 and selected the best model with the least validation loss. Similarly, I then trained the other set of 30 Resnet50 models by using the rois from all the sets, i.e., additional set, training set, and tst_stg1 set. \n\n2-4) **Final results** – I uploaded the testing pipeline before the tst_stg2 image set comes out.  In which the first set of 30 Resnet50 models running on tst_stg2 and comes out tst_rst1, and the second set of 30 Resnet50 models running on tst_stg2 and comes out tst_rst2, I then average these two results and come out the final submission. The final score is less than 0.82. \n\n\n\n",
      "votes": 12,
      "replies": [
        {
          "id": 201838,
          "postDate": "2017-07-11T13:15:38.890Z",
          "content": "<p>Thanks for the detailed description . Just one clarification , In this statement - 'I then followed the instructions from [Link-5] ' can [Link-5] be updated \n-Thanks!</p>",
          "rawMarkdown": "Thanks for the detailed description . Just one clarification , In this statement - 'I then followed the instructions from [Link-5] ' can [Link-5] be updated \n-Thanks!"
        }
      ]
    },
    {
      "id": 2239466,
      "postDate": "2023-04-29T14:19:43.123Z",
      "content": "<p>Sir Could u please share the code</p>",
      "rawMarkdown": "Sir Could u please share the code"
    },
    {
      "id": 209390,
      "postDate": "2017-08-02T04:41:44.097Z",
      "content": "<p>Hi XuleiYang, could you tell me how to train resnet with my own cropped images? Thanks!</p>",
      "rawMarkdown": "Hi XuleiYang, could you tell me how to train resnet with my own cropped images? Thanks!"
    },
    {
      "id": 195005,
      "postDate": "2017-06-22T15:13:24.753Z",
      "content": "<p>Hi Russ, </p>\n\n<p>Thanks for sharing and congratulations! Your solution sounds extremely interesting. I will have to research how Faster-RCNNs work for sure.</p>\n\n<p>It sounds like you guys used tensorflow in at least on of your models. I am curious, were you ever using Keras with the tensorflow backend? I switched to Theano as a backend right before the code submission deadline because I was not able to fix all of the seeds that tensorflow/keras used. In other words, I was not able to get completely reproducible results (although the results on successive runs were practically the same). Were you or your teammates able to figure out a way to fix all the seeds when using tensorflow/keras?</p>",
      "rawMarkdown": "Hi Russ, \n\nThanks for sharing and congratulations! Your solution sounds extremely interesting. I will have to research how Faster-RCNNs work for sure.\n\nIt sounds like you guys used tensorflow in at least on of your models. I am curious, were you ever using Keras with the tensorflow backend? I switched to Theano as a backend right before the code submission deadline because I was not able to fix all of the seeds that tensorflow/keras used. In other words, I was not able to get completely reproducible results (although the results on successive runs were practically the same). Were you or your teammates able to figure out a way to fix all the seeds when using tensorflow/keras?",
      "replies": [
        {
          "id": 195172,
          "postDate": "2017-06-22T22:03:21.517Z",
          "content": "<p>Hi gkericks, no, my understanding is this is still an issue with tensorflow.   Fortunately I think the Kaggle organizers are okay with it and are instead, and rightly so, focused on making sure we have reproducibility within a reasonable random range and are compliant with the rules.</p>",
          "rawMarkdown": "Hi gkericks, no, my understanding is this is still an issue with tensorflow.   Fortunately I think the Kaggle organizers are okay with it and are instead, and rightly so, focused on making sure we have reproducibility within a reasonable random range and are compliant with the rules.",
          "votes": 2
        }
      ]
    },
    {
      "id": 194865,
      "postDate": "2017-06-22T01:55:58.370Z",
      "content": "<p>Thank you for sharing!  Would you share some more details for the top 2-3 models in the ensemble?</p>",
      "rawMarkdown": "Thank you for sharing!  Would you share some more details for the top 2-3 models in the ensemble?",
      "replies": [
        {
          "id": 194866,
          "postDate": "2017-06-22T02:12:04.027Z",
          "content": "<p>Sure...for faster-rcnn we used tensorflow (tf-faster-rcnn by endernewton) and mxnet, each trained for around 10 epochs and thenused the most confidently predicted bounding box for each image to create crops.   We then resized these to 197 x 197 and did basic image classification in keras with 15% simple random holdout for 30 reps (bagging), including a typical suite of data augmentation methods and saving the best model from each rep based on its holdout set.  </p>",
          "rawMarkdown": "Sure...for faster-rcnn we used tensorflow (tf-faster-rcnn by endernewton) and mxnet, each trained for around 10 epochs and thenused the most confidently predicted bounding box for each image to create crops.   We then resized these to 197 x 197 and did basic image classification in keras with 15% simple random holdout for 30 reps (bagging), including a typical suite of data augmentation methods and saving the best model from each rep based on its holdout set.  ",
          "votes": 3
        }
      ]
    },
    {
      "id": 194853,
      "postDate": "2017-06-22T01:29:32.123Z",
      "content": "<p>Hi Russ, is it possible for your team to share the code for learning purposes?</p>",
      "rawMarkdown": "Hi Russ, is it possible for your team to share the code for learning purposes?\n",
      "replies": [
        {
          "id": 194855,
          "postDate": "2017-06-22T01:37:45.157Z",
          "content": "<p>We'll need to see how the organizers want to handle things moving forward.   At the very least guessing we should be able to share what software packages we used and enough detail to get you close.</p>",
          "rawMarkdown": "We'll need to see how the organizers want to handle things moving forward.   At the very least guessing we should be able to share what software packages we used and enough detail to get you close.",
          "votes": 3
        }
      ]
    },
    {
      "id": 3119255,
      "postDate": "2025-02-09T04:54:03.080Z",
      "content": "<p>hello, I have one question the image provided in the datasets are taken from normal smartphone or with dedicated tool like colposcope?if anyone knows please reply it will be really helpfull</p>",
      "rawMarkdown": "hello, I have one question the image provided in the datasets are taken from normal smartphone or with dedicated tool like colposcope?if anyone knows please reply it will be really helpfull",
      "isDeleted": true
    },
    {
      "id": 719939,
      "postDate": "2020-01-16T02:12:11.400Z",
      "content": "<p>Thanks Russ</p>",
      "rawMarkdown": "Thanks Russ"
    }
  ],
  "comments": [
    {
      "id": 194939,
      "author_name": "XuleiYang",
      "author_url": "",
      "post_date": "2017-06-22T09:21:57.313000",
      "content": "<p>Thanks Russ for the brief sharing. And congratulations to all the top performers. </p>\n\n<p>As usual, I will share a bit more on my solution below:\nBasically, there are two stages involved: first is to do cervical detection by using yolo models on full images, then apply resnet-50 to do cervical classification on cropped cervical ROIs.  </p>\n\n<p><em><strong>1) Stage-1: cervical detection by using yolo on full images</strong></em></p>\n\n<p>1-1) <strong>Generate label txt files</strong>: I followed paul’s annotations from the forum discussion track “bounding boxes for type_1”  to generate the bounding box requested by yolo for object detection. I also resize all the images from all the image sets to square size by bordering the shorter side of the images with black pixels. </p>\n\n<p>1-2) <strong>Various yolo models</strong>: I then followed the instructions from [Link-5] to train three yolo models by using the annotated cervical data set with three different number of anchors, i.e., 5, 7, and 9, respectively. The yolo models also come out the probabilities of the cervical types for each detected object, but I found the results are a bit worse than those from Resnet-50 in Stage-2, so I did not use in the final submission. </p>\n\n<p>1-3) <strong>Crop cervical ROIs</strong>: I used the three trained yolo models for cervical detection on training image set, additional image set, as well as test_stg1 image set, and cropped cervical ROIs using the bounding box with the highest probability value from the three models. The yolo models work perfect for almost all the images from various sets. This is the reason why I discard faster r-cnn method (which was used in my early exploration for this competition) in my final solution.  I saved the cropped cervical ROIs for each image set separately.</p>\n\n<p>1-4) <strong>Re-train yolo models</strong>: I then check through all the rois in test_stg1 set and find all the results are quite reasonable.  So I decided to use the detected rois as bounding-box annotations for test_stg1 image set. Together with the annotations from Paul’s for training image set. We re-train the three yolo models and re-detect the cervical rois by repeat step 2-2 and step 2-3. The three re-trained models are the three final yolo models used for the final tst_stg2 image set. </p>\n\n<p>1-5) <strong>Post-filtering of ROIs for additional set</strong>: I also spend several days to check through all the rois in additional set. I used k-means to partition all the rois to 20 clusters, then further partition each cluster into 10-30 sub-clusters. For each sub-cluster, I manually removed the very blur images as well as duplicated images. The final number of rois for additional set is around 4760. </p>\n\n<p>1-6) <strong>Stage-1 output</strong>: 4760 rois in additional set, 1780 rois in training set, and 512 rois in tst_stg1 set. All the cropped rois are resized to 224x224 for further processing in stage-2. </p>\n\n<p><em><strong>2) Stage-2: cervical classification by Resnet-50 on rois images</strong></em></p>\n\n<p>2-1) <strong>Preprocessing</strong> -- I tried different data augmentation in terms of keras ImageDataGenerator, such as rotation, flipping, and shifting. I also tried to deal with the training sample imbalance by horizontal flipping of the images from Type_1 only, this will increase the performance a bit. </p>\n\n<p>2-2) <strong>Selection of CNN</strong> – I trained different CNNs (VGG16, VGG19, Inception_v3, and Resnet50) by using the rois in training set only, then validation on the rois in tst_stg1 set. I then found the results from Resnet50 is a bit better than all the other CNNs. It is expected that the ensembling of various CNNs would generate better results than by Resnet50 only. But since I don’t have sufficient time to train various CNN models, so finally decided to use Resnet50 only in this stage.</p>\n\n<p>2-3) <strong>Two sets of models</strong> – I trained one set of 30 Resnet50 models by using the rois from training set and tst_stg1 set, I run the training by epoch=30 and selected the best model with the least validation loss. Similarly, I then trained the other set of 30 Resnet50 models by using the rois from all the sets, i.e., additional set, training set, and tst_stg1 set. </p>\n\n<p>2-4) <strong>Final results</strong> – I uploaded the testing pipeline before the tst_stg2 image set comes out.  In which the first set of 30 Resnet50 models running on tst_stg2 and comes out tst_rst1, and the second set of 30 Resnet50 models running on tst_stg2 and comes out tst_rst2, I then average these two results and come out the final submission. The final score is less than 0.82. </p>",
      "votes": 12,
      "replies": [
        {
          "id": 201838,
          "author_name": "dreeux",
          "author_url": "",
          "post_date": "2017-07-11T13:15:38.890000",
          "content": "<p>Thanks for the detailed description . Just one clarification , In this statement - 'I then followed the instructions from [Link-5] ' can [Link-5] be updated \n-Thanks!</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2239466,
      "author_name": "PothineniSowbhagya",
      "author_url": "",
      "post_date": "2023-04-29T14:19:43.123000",
      "content": "<p>Sir Could u please share the code</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 209390,
      "author_name": "DanielAlbertoCruzMoreno",
      "author_url": "",
      "post_date": "2017-08-02T04:41:44.097000",
      "content": "<p>Hi XuleiYang, could you tell me how to train resnet with my own cropped images? Thanks!</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 195005,
      "author_name": "gkericks",
      "author_url": "",
      "post_date": "2017-06-22T15:13:24.753000",
      "content": "<p>Hi Russ, </p>\n\n<p>Thanks for sharing and congratulations! Your solution sounds extremely interesting. I will have to research how Faster-RCNNs work for sure.</p>\n\n<p>It sounds like you guys used tensorflow in at least on of your models. I am curious, were you ever using Keras with the tensorflow backend? I switched to Theano as a backend right before the code submission deadline because I was not able to fix all of the seeds that tensorflow/keras used. In other words, I was not able to get completely reproducible results (although the results on successive runs were practically the same). Were you or your teammates able to figure out a way to fix all the seeds when using tensorflow/keras?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 195172,
          "author_name": "Russ Wolfinger",
          "author_url": "",
          "post_date": "2017-06-22T22:03:21.517000",
          "content": "<p>Hi gkericks, no, my understanding is this is still an issue with tensorflow.   Fortunately I think the Kaggle organizers are okay with it and are instead, and rightly so, focused on making sure we have reproducibility within a reasonable random range and are compliant with the rules.</p>",
          "votes": 2,
          "replies": []
        }
      ]
    },
    {
      "id": 194865,
      "author_name": "kubilai",
      "author_url": "",
      "post_date": "2017-06-22T01:55:58.370000",
      "content": "<p>Thank you for sharing!  Would you share some more details for the top 2-3 models in the ensemble?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 194866,
          "author_name": "Russ Wolfinger",
          "author_url": "",
          "post_date": "2017-06-22T02:12:04.027000",
          "content": "<p>Sure...for faster-rcnn we used tensorflow (tf-faster-rcnn by endernewton) and mxnet, each trained for around 10 epochs and thenused the most confidently predicted bounding box for each image to create crops.   We then resized these to 197 x 197 and did basic image classification in keras with 15% simple random holdout for 30 reps (bagging), including a typical suite of data augmentation methods and saving the best model from each rep based on its holdout set.  </p>",
          "votes": 3,
          "replies": []
        }
      ]
    },
    {
      "id": 194853,
      "author_name": "Rodney Thomas",
      "author_url": "",
      "post_date": "2017-06-22T01:29:32.123000",
      "content": "<p>Hi Russ, is it possible for your team to share the code for learning purposes?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 194855,
          "author_name": "Russ Wolfinger",
          "author_url": "",
          "post_date": "2017-06-22T01:37:45.157000",
          "content": "<p>We'll need to see how the organizers want to handle things moving forward.   At the very least guessing we should be able to share what software packages we used and enough detail to get you close.</p>",
          "votes": 3,
          "replies": []
        }
      ]
    },
    {
      "id": 3119255,
      "author_name": "",
      "author_url": "",
      "post_date": "2025-02-09T04:54:03.080000",
      "content": "<p>hello, I have one question the image provided in the datasets are taken from normal smartphone or with dedicated tool like colposcope?if anyone knows please reply it will be really helpfull</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 719939,
      "author_name": "Thuy Bui",
      "author_url": "",
      "post_date": "2020-01-16T02:12:11.400000",
      "content": "<p>Thanks Russ</p>",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "194843": "Great job and congrats to team TEST for a very nice win, another one right after Fisheries.   Some smart guys from Lithuania for sure--they've got some secret sauce cooking!     Impressive solo second by I Rustandi and excellent work by all top finishers.\n\nA quick overview of our #3 solution:  First want to say what a pleasure it has been teaming with Giba, Xulei, and Joe.   We had a lot of fun learning and strategizing together and effectively used slack to communicate across time zones.   To start out, we probed the leaderboard and had the public test set labels to train on a few weeks before the model submission deadline.   For most of our models we used yolo or faster-rcnn to do object detection--a big thanks to Paul for the bounding box annotations.   We then created crops and used bagged image classification with resnet50 and vgg16 backbones and then hillclimbing to ensemble based on 2-fold cv with the public train and test sets as our splits.   We only used the additional training data in one of our models and also included one custom model from Joe, plus one more based on unet from Scotty--thanks for sharing and raising the big concern about the near-duplicate images in Stage 2.  Hope to add some more details later; please feel free to ask any specific questions.\n\nMost importantly, hoping we can all pitch in to really improve treatment decisions and early prevention of this disease.",
    "194939": "Thanks Russ for the brief sharing. And congratulations to all the top performers. \n\nAs usual, I will share a bit more on my solution below:\nBasically, there are two stages involved: first is to do cervical detection by using yolo models on full images, then apply resnet-50 to do cervical classification on cropped cervical ROIs.  \n\n***1) Stage-1: cervical detection by using yolo on full images***\n\n1-1) **Generate label txt files**: I followed paul’s annotations from the forum discussion track “bounding boxes for type_1”  to generate the bounding box requested by yolo for object detection. I also resize all the images from all the image sets to square size by bordering the shorter side of the images with black pixels. \n\n1-2) **Various yolo models**: I then followed the instructions from [Link-5] to train three yolo models by using the annotated cervical data set with three different number of anchors, i.e., 5, 7, and 9, respectively. The yolo models also come out the probabilities of the cervical types for each detected object, but I found the results are a bit worse than those from Resnet-50 in Stage-2, so I did not use in the final submission. \n\n1-3) **Crop cervical ROIs**: I used the three trained yolo models for cervical detection on training image set, additional image set, as well as test_stg1 image set, and cropped cervical ROIs using the bounding box with the highest probability value from the three models. The yolo models work perfect for almost all the images from various sets. This is the reason why I discard faster r-cnn method (which was used in my early exploration for this competition) in my final solution.  I saved the cropped cervical ROIs for each image set separately.\n\n1-4) **Re-train yolo models**: I then check through all the rois in test_stg1 set and find all the results are quite reasonable.  So I decided to use the detected rois as bounding-box annotations for test_stg1 image set. Together with the annotations from Paul’s for training image set. We re-train the three yolo models and re-detect the cervical rois by repeat step 2-2 and step 2-3. The three re-trained models are the three final yolo models used for the final tst_stg2 image set. \n\n1-5) **Post-filtering of ROIs for additional set**: I also spend several days to check through all the rois in additional set. I used k-means to partition all the rois to 20 clusters, then further partition each cluster into 10-30 sub-clusters. For each sub-cluster, I manually removed the very blur images as well as duplicated images. The final number of rois for additional set is around 4760. \n\n1-6) **Stage-1 output**: 4760 rois in additional set, 1780 rois in training set, and 512 rois in tst_stg1 set. All the cropped rois are resized to 224x224 for further processing in stage-2. \n\n***2) Stage-2: cervical classification by Resnet-50 on rois images***\n\n2-1) **Preprocessing** -- I tried different data augmentation in terms of keras ImageDataGenerator, such as rotation, flipping, and shifting. I also tried to deal with the training sample imbalance by horizontal flipping of the images from Type_1 only, this will increase the performance a bit. \n\n2-2) **Selection of CNN** – I trained different CNNs (VGG16, VGG19, Inception_v3, and Resnet50) by using the rois in training set only, then validation on the rois in tst_stg1 set. I then found the results from Resnet50 is a bit better than all the other CNNs. It is expected that the ensembling of various CNNs would generate better results than by Resnet50 only. But since I don’t have sufficient time to train various CNN models, so finally decided to use Resnet50 only in this stage.\n\n2-3) **Two sets of models** – I trained one set of 30 Resnet50 models by using the rois from training set and tst_stg1 set, I run the training by epoch=30 and selected the best model with the least validation loss. Similarly, I then trained the other set of 30 Resnet50 models by using the rois from all the sets, i.e., additional set, training set, and tst_stg1 set. \n\n2-4) **Final results** – I uploaded the testing pipeline before the tst_stg2 image set comes out.  In which the first set of 30 Resnet50 models running on tst_stg2 and comes out tst_rst1, and the second set of 30 Resnet50 models running on tst_stg2 and comes out tst_rst2, I then average these two results and come out the final submission. The final score is less than 0.82. \n\n\n\n",
    "2239466": "Sir Could u please share the code",
    "209390": "Hi XuleiYang, could you tell me how to train resnet with my own cropped images? Thanks!",
    "195005": "Hi Russ, \n\nThanks for sharing and congratulations! Your solution sounds extremely interesting. I will have to research how Faster-RCNNs work for sure.\n\nIt sounds like you guys used tensorflow in at least on of your models. I am curious, were you ever using Keras with the tensorflow backend? I switched to Theano as a backend right before the code submission deadline because I was not able to fix all of the seeds that tensorflow/keras used. In other words, I was not able to get completely reproducible results (although the results on successive runs were practically the same). Were you or your teammates able to figure out a way to fix all the seeds when using tensorflow/keras?",
    "194865": "Thank you for sharing!  Would you share some more details for the top 2-3 models in the ensemble?",
    "194853": "Hi Russ, is it possible for your team to share the code for learning purposes?\n",
    "3119255": "hello, I have one question the image provided in the datasets are taken from normal smartphone or with dedicated tool like colposcope?if anyone knows please reply it will be really helpfull",
    "719939": "Thanks Russ"
  }
}