{
  "id": 210880,
  "title": "Major Challenges and Considerations in this competition",
  "url": "/competitions/ranzcr-clip-catheter-line-classification/discussion/210880",
  "author_name": "Izzy Adesanya",
  "post_date": "2021-01-12T19:31:33.816000",
  "votes": 21,
  "comment_count": 10,
  "views": 0,
  "content": "<p>Hi Kagglers,</p>\n<p>According to many, it is important to list out the <strong>major challenges and considerations</strong> of the problem statement before actually starting out to try and solve it. This allows you to tackle in a structured manner.</p>\n<p>Here is the list that I made before starting to think about the approach to the solution.<br>\nI have tried to include only those challenges which are specific to this competition.</p>\n<ol>\n<li><strong>Size</strong> of the images is comparatively large (2-3k pixels). How to deal with it? What size of the input image would be best as input?</li>\n<li>Data is highly skewed. With one category i.e. CVC - Normal having 21324 records with the lowest category <strong>ETT - Abnormal</strong> having 79 records. Best way to deal with this?</li>\n<li>There is one <strong>odd category</strong> i.e. NGT - Incompletely Imaged. The name of the categorical is self-explanatory. How to incorporate this category? It cannot be ignored because it spans over 2748 records.</li>\n<li>Since the input is an X-ray image, we mostly deal with black and white color pixels. So don't have to bother much about <strong>color spaces</strong> to pick.</li>\n<li>What <strong>image augmentations</strong> to choose for Training, Validation, and Testing. Some augmentations might not make sense like vertical flipping.</li>\n<li>How to utilize the X-ray annotations given in the input data?</li>\n<li>There are some patients who have 172 records in the data and many with 1 record as well.<br>\nHow to deal with this? If not properly dealt with, this could cause data leakage and hence overfitting.</li>\n<li>What type of cross-validation technique to be used?</li>\n<li>Since this is a multi-label classification problem, what loss function to choose?</li>\n<li>How to normalize the image?</li>\n<li>Some labels have quite an overlapping occurrence and some have no overlap. E.g. CVC - Normal and CVC - Borderline have co-occurrence of 2536. Can we make use of this information?</li>\n<li>Which pre-trained model would be best suited to this problem setting?  </li>\n</ol>\n<p>If I missed adding something to the list please feel free to comment.<br>\nAlso if you think you have good answers to any of the questions, drop them in the comments.</p>\n<p>At last, don't forget to upvote :)</p>\n<p>Let's make this discussion worthwhile for everyone :)</p>",
  "messages": [
    {
      "id": 1150709,
      "postDate": "2021-01-12T19:31:33.817Z",
      "content": "<p>Hi Kagglers,</p>\n<p>According to many, it is important to list out the <strong>major challenges and considerations</strong> of the problem statement before actually starting out to try and solve it. This allows you to tackle in a structured manner.</p>\n<p>Here is the list that I made before starting to think about the approach to the solution.<br>\nI have tried to include only those challenges which are specific to this competition.</p>\n<ol>\n<li><strong>Size</strong> of the images is comparatively large (2-3k pixels). How to deal with it? What size of the input image would be best as input?</li>\n<li>Data is highly skewed. With one category i.e. CVC - Normal having 21324 records with the lowest category <strong>ETT - Abnormal</strong> having 79 records. Best way to deal with this?</li>\n<li>There is one <strong>odd category</strong> i.e. NGT - Incompletely Imaged. The name of the categorical is self-explanatory. How to incorporate this category? It cannot be ignored because it spans over 2748 records.</li>\n<li>Since the input is an X-ray image, we mostly deal with black and white color pixels. So don't have to bother much about <strong>color spaces</strong> to pick.</li>\n<li>What <strong>image augmentations</strong> to choose for Training, Validation, and Testing. Some augmentations might not make sense like vertical flipping.</li>\n<li>How to utilize the X-ray annotations given in the input data?</li>\n<li>There are some patients who have 172 records in the data and many with 1 record as well.<br>\nHow to deal with this? If not properly dealt with, this could cause data leakage and hence overfitting.</li>\n<li>What type of cross-validation technique to be used?</li>\n<li>Since this is a multi-label classification problem, what loss function to choose?</li>\n<li>How to normalize the image?</li>\n<li>Some labels have quite an overlapping occurrence and some have no overlap. E.g. CVC - Normal and CVC - Borderline have co-occurrence of 2536. Can we make use of this information?</li>\n<li>Which pre-trained model would be best suited to this problem setting?  </li>\n</ol>\n<p>If I missed adding something to the list please feel free to comment.<br>\nAlso if you think you have good answers to any of the questions, drop them in the comments.</p>\n<p>At last, don't forget to upvote :)</p>\n<p>Let's make this discussion worthwhile for everyone :)</p>",
      "rawMarkdown": "Hi Kagglers,\n\nAccording to many, it is important to list out the **major challenges and considerations** of the problem statement before actually starting out to try and solve it. This allows you to tackle in a structured manner.\n\nHere is the list that I made before starting to think about the approach to the solution.\nI have tried to include only those challenges which are specific to this competition.\n\n1. **Size** of the images is comparatively large (2-3k pixels). How to deal with it? What size of the input image would be best as input?\n2.  Data is highly skewed. With one category i.e. CVC - Normal having 21324 records with the lowest category **ETT - Abnormal** having 79 records. Best way to deal with this?\n3.  There is one **odd category** i.e. NGT - Incompletely Imaged. The name of the categorical is self-explanatory. How to incorporate this category? It cannot be ignored because it spans over 2748 records.\n4.  Since the input is an X-ray image, we mostly deal with black and white color pixels. So don't have to bother much about **color spaces** to pick.\n5.  What **image augmentations** to choose for Training, Validation, and Testing. Some augmentations might not make sense like vertical flipping.\n6.  How to utilize the X-ray annotations given in the input data?\n7.  There are some patients who have 172 records in the data and many with 1 record as well.\nHow to deal with this? If not properly dealt with, this could cause data leakage and hence overfitting.\n8.   What type of cross-validation technique to be used?\n9.   Since this is a multi-label classification problem, what loss function to choose?\n10.  How to normalize the image?\n11.  Some labels have quite an overlapping occurrence and some have no overlap. E.g. CVC - Normal and CVC - Borderline have co-occurrence of 2536. Can we make use of this information?\n12.  Which pre-trained model would be best suited to this problem setting?  \n\nIf I missed adding something to the list please feel free to comment.\nAlso if you think you have good answers to any of the questions, drop them in the comments.\n\nAt last, don't forget to upvote :)\n\nLet's make this discussion worthwhile for everyone :)",
      "votes": 21
    },
    {
      "id": 1151908,
      "postDate": "2021-01-13T16:31:57.013Z",
      "content": "<p><strong><em>Size of the images is comparatively large (2-3k pixels). How to deal with it? What size of the input image would be best as input?</em></strong></p>\n<p>According to plenty of high score notebooks (AUC &gt; 95.5%) the size was ranging between 456 - 900. However the size depends on the model you choose too. For ResNet the best size detected was 512, for efficient the 600 and Inception_Resnet 712.</p>\n<p><strong><em>Which pre-trained model would be best suited to this problem setting?</em></strong><br>\nResNet 200d, InceptionResNet, Xception, EfficientNet7</p>\n<p><strong><em>How to normalize the image?</em></strong><br>\n/255</p>\n<p><strong><em>How to utilize the X-ray annotations given in the input data?</em></strong></p>\n<p>There are some discussion threads which propose some approaches. <br>\nHowever mine approach is to train a UNET model and then feed its output to a second CNN classification model. The second model's input will combine the original image with the UNET output mask. It is a heavy approach but leads to good and robust results.</p>",
      "rawMarkdown": "***Size of the images is comparatively large (2-3k pixels). How to deal with it? What size of the input image would be best as input?***\n\nAccording to plenty of high score notebooks (AUC > 95.5%) the size was ranging between 456 - 900. However the size depends on the model you choose too. For ResNet the best size detected was 512, for efficient the 600 and Inception_Resnet 712.\n\n***Which pre-trained model would be best suited to this problem setting?***\nResNet 200d, InceptionResNet, Xception, EfficientNet7\n\n***How to normalize the image?***\n/255\n\n***How to utilize the X-ray annotations given in the input data?***\n\nThere are some discussion threads which propose some approaches. \nHowever mine approach is to train a UNET model and then feed its output to a second CNN classification model. The second model's input will combine the original image with the UNET output mask. It is a heavy approach but leads to good and robust results.",
      "votes": 9,
      "replies": [
        {
          "id": 1155113,
          "postDate": "2021-01-16T08:06:22.070Z",
          "content": "<ul>\n<li>I have tried with 512 and 600 and it indeed works better than lower image sizes. But not sure about 900 though.</li>\n<li>Normalizing with 255 is fine but is there any better way of doing it?</li>\n<li>Sound like a good approach with UNet but as you said this is an expensive approach. I have read some approaches to generating heatmaps of the points. </li>\n</ul>",
          "rawMarkdown": "- I have tried with 512 and 600 and it indeed works better than lower image sizes. But not sure about 900 though.\n- Normalizing with 255 is fine but is there any better way of doing it?\n- Sound like a good approach with UNet but as you said this is an expensive approach. I have read some approaches to generating heatmaps of the points. ",
          "votes": 1
        },
        {
          "id": 1155885,
          "postDate": "2021-01-16T18:44:56.150Z",
          "content": "<p>Another common way especially  used in pytorch models is by normalizing:</p>\n<pre><code>transforms_test = albumentations.Compose([\n    Resize(image_size, image_size),\n    Normalize(\n         mean=[0.485, 0.456, 0.406],\n         std=[0.229, 0.224, 0.225],\n     ),\n    ToTensorV2()\n])\n</code></pre>",
          "rawMarkdown": "Another common way especially  used in pytorch models is by normalizing:\n\n    transforms_test = albumentations.Compose([\n        Resize(image_size, image_size),\n        Normalize(\n             mean=[0.485, 0.456, 0.406],\n             std=[0.229, 0.224, 0.225],\n         ),\n        ToTensorV2()\n    ])",
          "votes": 1
        },
        {
          "id": 1158307,
          "postDate": "2021-01-18T14:02:34.717Z",
          "content": "<p>Yeah that is a more effective way</p>",
          "rawMarkdown": "Yeah that is a more effective way"
        }
      ]
    },
    {
      "id": 1206956,
      "postDate": "2021-02-17T16:17:38.503Z",
      "content": "<p>Thanks for sharing. <br>\nCan you please clarify why you suppose vertical flip as a useless augmentation?</p>",
      "rawMarkdown": "Thanks for sharing. \nCan you please clarify why you suppose vertical flip as a useless augmentation?",
      "votes": 1
    },
    {
      "id": 1151530,
      "postDate": "2021-01-13T11:52:50.020Z",
      "content": "<blockquote>\n  <p>Data is highly skewed. With one category i.e. CVC - Normal having 21324 records with the lowest category ETT - Normal having 79 records</p>\n</blockquote>\n<p>It is <strong>ETT-Abnormal</strong>  is having 79 positive records</p>",
      "rawMarkdown": "> Data is highly skewed. With one category i.e. CVC - Normal having 21324 records with the lowest category ETT - Normal having 79 records\n\nIt is **ETT-Abnormal**  is having 79 positive records",
      "votes": 1,
      "replies": [
        {
          "id": 1151782,
          "postDate": "2021-01-13T14:49:23.737Z",
          "rawMarkdown": "",
          "isDeleted": true
        },
        {
          "id": 1151781,
          "postDate": "2021-01-13T14:49:23.737Z",
          "content": "<p><a href=\"https://www.kaggle.com/ademyanchuk\" target=\"_blank\">@ademyanchuk</a> Thanks for the correction mate.</p>",
          "rawMarkdown": "@ademyanchuk Thanks for the correction mate."
        }
      ]
    },
    {
      "id": 1150994,
      "postDate": "2021-01-13T03:43:16.177Z",
      "content": "<p>For 7.  Make sure that the folds for training and validation are such that each patient's images do not appear in multiple folds to avoid data leakage.</p>",
      "rawMarkdown": "For 7.  Make sure that the folds for training and validation are such that each patient's images do not appear in multiple folds to avoid data leakage.",
      "votes": 1,
      "replies": [
        {
          "id": 1151389,
          "postDate": "2021-01-13T09:39:14.533Z",
          "content": "<p><a href=\"https://www.kaggle.com/jonbjones\" target=\"_blank\">@jonbjones</a> That correct. Here is good notebook to refer to <a href=\"https://www.kaggle.com/underwearfitting/how-to-properly-split-folds\" target=\"_blank\">https://www.kaggle.com/underwearfitting/how-to-properly-split-folds</a></p>",
          "rawMarkdown": "@jonbjones That correct. Here is good notebook to refer to https://www.kaggle.com/underwearfitting/how-to-properly-split-folds",
          "votes": 1
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 1151908,
      "author_name": "",
      "author_url": "",
      "post_date": "2021-01-13T16:31:57.013000",
      "content": "<p><strong><em>Size of the images is comparatively large (2-3k pixels). How to deal with it? What size of the input image would be best as input?</em></strong></p>\n<p>According to plenty of high score notebooks (AUC &gt; 95.5%) the size was ranging between 456 - 900. However the size depends on the model you choose too. For ResNet the best size detected was 512, for efficient the 600 and Inception_Resnet 712.</p>\n<p><strong><em>Which pre-trained model would be best suited to this problem setting?</em></strong><br>\nResNet 200d, InceptionResNet, Xception, EfficientNet7</p>\n<p><strong><em>How to normalize the image?</em></strong><br>\n/255</p>\n<p><strong><em>How to utilize the X-ray annotations given in the input data?</em></strong></p>\n<p>There are some discussion threads which propose some approaches. <br>\nHowever mine approach is to train a UNET model and then feed its output to a second CNN classification model. The second model's input will combine the original image with the UNET output mask. It is a heavy approach but leads to good and robust results.</p>",
      "votes": 9,
      "replies": [
        {
          "id": 1155113,
          "author_name": "Izzy Adesanya",
          "author_url": "",
          "post_date": "2021-01-16T08:06:22.070000",
          "content": "<ul>\n<li>I have tried with 512 and 600 and it indeed works better than lower image sizes. But not sure about 900 though.</li>\n<li>Normalizing with 255 is fine but is there any better way of doing it?</li>\n<li>Sound like a good approach with UNet but as you said this is an expensive approach. I have read some approaches to generating heatmaps of the points. </li>\n</ul>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1155885,
          "author_name": "",
          "author_url": "",
          "post_date": "2021-01-16T18:44:56.150000",
          "content": "<p>Another common way especially  used in pytorch models is by normalizing:</p>\n<pre><code>transforms_test = albumentations.Compose([\n    Resize(image_size, image_size),\n    Normalize(\n         mean=[0.485, 0.456, 0.406],\n         std=[0.229, 0.224, 0.225],\n     ),\n    ToTensorV2()\n])\n</code></pre>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1158307,
          "author_name": "Izzy Adesanya",
          "author_url": "",
          "post_date": "2021-01-18T14:02:34.717000",
          "content": "<p>Yeah that is a more effective way</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1206956,
      "author_name": "Gleb_k",
      "author_url": "",
      "post_date": "2021-02-17T16:17:38.503000",
      "content": "<p>Thanks for sharing. <br>\nCan you please clarify why you suppose vertical flip as a useless augmentation?</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 1151530,
      "author_name": "A.Demyanchuk",
      "author_url": "",
      "post_date": "2021-01-13T11:52:50.020000",
      "content": "<blockquote>\n  <p>Data is highly skewed. With one category i.e. CVC - Normal having 21324 records with the lowest category ETT - Normal having 79 records</p>\n</blockquote>\n<p>It is <strong>ETT-Abnormal</strong>  is having 79 positive records</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1151782,
          "author_name": "",
          "author_url": "",
          "post_date": "2021-01-13T14:49:23.737000",
          "content": "",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1151781,
          "author_name": "Izzy Adesanya",
          "author_url": "",
          "post_date": "2021-01-13T14:49:23.737000",
          "content": "<p><a href=\"https://www.kaggle.com/ademyanchuk\" target=\"_blank\">@ademyanchuk</a> Thanks for the correction mate.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1150994,
      "author_name": "Jon B Jones",
      "author_url": "",
      "post_date": "2021-01-13T03:43:16.177000",
      "content": "<p>For 7.  Make sure that the folds for training and validation are such that each patient's images do not appear in multiple folds to avoid data leakage.</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1151389,
          "author_name": "Izzy Adesanya",
          "author_url": "",
          "post_date": "2021-01-13T09:39:14.533000",
          "content": "<p><a href=\"https://www.kaggle.com/jonbjones\" target=\"_blank\">@jonbjones</a> That correct. Here is good notebook to refer to <a href=\"https://www.kaggle.com/underwearfitting/how-to-properly-split-folds\" target=\"_blank\">https://www.kaggle.com/underwearfitting/how-to-properly-split-folds</a></p>",
          "votes": 1,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1150709": "Hi Kagglers,\n\nAccording to many, it is important to list out the **major challenges and considerations** of the problem statement before actually starting out to try and solve it. This allows you to tackle in a structured manner.\n\nHere is the list that I made before starting to think about the approach to the solution.\nI have tried to include only those challenges which are specific to this competition.\n\n1. **Size** of the images is comparatively large (2-3k pixels). How to deal with it? What size of the input image would be best as input?\n2.  Data is highly skewed. With one category i.e. CVC - Normal having 21324 records with the lowest category **ETT - Abnormal** having 79 records. Best way to deal with this?\n3.  There is one **odd category** i.e. NGT - Incompletely Imaged. The name of the categorical is self-explanatory. How to incorporate this category? It cannot be ignored because it spans over 2748 records.\n4.  Since the input is an X-ray image, we mostly deal with black and white color pixels. So don't have to bother much about **color spaces** to pick.\n5.  What **image augmentations** to choose for Training, Validation, and Testing. Some augmentations might not make sense like vertical flipping.\n6.  How to utilize the X-ray annotations given in the input data?\n7.  There are some patients who have 172 records in the data and many with 1 record as well.\nHow to deal with this? If not properly dealt with, this could cause data leakage and hence overfitting.\n8.   What type of cross-validation technique to be used?\n9.   Since this is a multi-label classification problem, what loss function to choose?\n10.  How to normalize the image?\n11.  Some labels have quite an overlapping occurrence and some have no overlap. E.g. CVC - Normal and CVC - Borderline have co-occurrence of 2536. Can we make use of this information?\n12.  Which pre-trained model would be best suited to this problem setting?  \n\nIf I missed adding something to the list please feel free to comment.\nAlso if you think you have good answers to any of the questions, drop them in the comments.\n\nAt last, don't forget to upvote :)\n\nLet's make this discussion worthwhile for everyone :)",
    "1151908": "***Size of the images is comparatively large (2-3k pixels). How to deal with it? What size of the input image would be best as input?***\n\nAccording to plenty of high score notebooks (AUC > 95.5%) the size was ranging between 456 - 900. However the size depends on the model you choose too. For ResNet the best size detected was 512, for efficient the 600 and Inception_Resnet 712.\n\n***Which pre-trained model would be best suited to this problem setting?***\nResNet 200d, InceptionResNet, Xception, EfficientNet7\n\n***How to normalize the image?***\n/255\n\n***How to utilize the X-ray annotations given in the input data?***\n\nThere are some discussion threads which propose some approaches. \nHowever mine approach is to train a UNET model and then feed its output to a second CNN classification model. The second model's input will combine the original image with the UNET output mask. It is a heavy approach but leads to good and robust results.",
    "1206956": "Thanks for sharing. \nCan you please clarify why you suppose vertical flip as a useless augmentation?",
    "1151530": "> Data is highly skewed. With one category i.e. CVC - Normal having 21324 records with the lowest category ETT - Normal having 79 records\n\nIt is **ETT-Abnormal**  is having 79 positive records",
    "1150994": "For 7.  Make sure that the folds for training and validation are such that each patient's images do not appear in multiple folds to avoid data leakage."
  }
}