{
  "id": 430622,
  "title": "346 Rank on leader board",
  "url": "/competitions/google-research-identify-contrails-reduce-global-warming/discussion/430622",
  "author_name": "Shailja Kant Tiwari",
  "post_date": "2023-08-10T13:45:40.888000",
  "votes": 4,
  "comment_count": 4,
  "views": 0,
  "content": "<h1>My Approach and Achievements</h1>\n<h2>Leveraging Image Channels and False Color</h2>\n<p>I tackled the challenge of detecting contrails using an innovative strategy. The provided images were captured in 8 different wavelengths, and annotators used a false color image for labeling contrails. I decided to train my model using this false color representation, as it seemed to improve the visibility of contrails and enhance their detectability.</p>\n<h2>Effective Interpolation for Boundary Annotations</h2>\n<p>A significant hurdle I encountered was accurately labeling contrail boundaries. Since contrails suddenly appear or enter from the sides of the image, capturing their true extent was crucial. To address this, I employed an interpolation technique. I first upscaled the image to 384 x 384 and then downscaled it to 256 x 256 using bilinear interpolation. This innovative approach proved successful in obtaining precise boundary labels.</p>\n<h2>Iterative Model Refinement</h2>\n<p>I pursued an iterative model refinement strategy that gradually improved my results. I initially trained a U-Net model from scratch using PyTorch. While this yielded a decent dice score of around 0.53, I knew I could do better. I then turned to the <code>segmentation_models_pytorch</code> library and selected a U-Net architecture with a pretrained <code>resnet26</code> encoder. This choice pushed my dice score up to 0.59 on the Kaggle Public leaderboard, showcasing noticeable progress. My determination to enhance performance led me to the final step: training a U-Net model with a pretrained <code>resnet50</code> encoder. This decision paid off with a remarkable dice score of 0.64985 on the Kaggle Public leaderboard and 0.64455 on the Private leaderboard.</p>\n<h2>Harnessing PyTorch Lightning for Efficiency</h2>\n<p>To accelerate my training process and streamline metric tracking and hyperparameter management, I adopted the PyTorch Lightning framework. This choice enabled me to harness the power of multiple GPUs efficiently and focus more on experimenting with various strategies rather than dealing with technical intricacies.</p>\n<h1>Things that Didn't Work</h1>\n<h2>Time Dependency and LSTMConv Layer</h2>\n<p>Understanding that contrails must either suddenly appear or be visible in at least 2 images, I attempted to incorporate the temporal aspect by using an LSTMConv layer in my model. Unfortunately, this approach didn't yield the anticipated results. It appears that the temporal aspect might not play a significant role in this problem, or perhaps the architecture I selected wasn't suited for effectively utilizing this information.</p>\n<h2>Exploring Additional Convolutional Layer</h2>\n<p>In an effort to enhance the model's input capabilities, I added an extra convolutional layer before the input entered the encoder. This adjustment was aimed at allowing the pretrained model to take a 3-channel input while utilizing data from all 8 wavelengths. However, this change didn't lead to significant performance improvements. It appeared that the resnet50 encoder could already effectively extract relevant features from the multi-channel data. As a result, further alterations at this stage in the architecture didn't seem to provide the anticipated benefits.</p>\n<h1>Opportunities for Improvement</h1>\n<h2>Soft Labels for More Accurate Annotations</h2>\n<p>In hindsight, I realized that using the mean of the annotations from the four annotators might have provided a more accurate representation of contrail regions. This could have potentially reduced noise caused by differing interpretations and improved overall model performance.</p>\n<h2>Hybrid Loss Functions</h2>\n<p>Initially starting with Binary Cross-Entropy and then shifting to Dice Loss to align with evaluation metrics, I now recognize the value of potentially combining both loss functions. This hybrid approach could strike a better balance between precision and recall during training, leading to improved overall results.</p>\n<p>My journey in tackling this complex contrail detection problem has taught me a great deal about <code>model architecture</code>, <code>data preprocessing</code>, and the importance of learning from both successes and failures. Armed with these insights, I am excited to continue refining my strategies and exploring new avenues for even better performance.</p>",
  "messages": [
    {
      "id": 2383645,
      "postDate": "2023-08-10T13:45:40.887Z",
      "content": "<h1>My Approach and Achievements</h1>\n<h2>Leveraging Image Channels and False Color</h2>\n<p>I tackled the challenge of detecting contrails using an innovative strategy. The provided images were captured in 8 different wavelengths, and annotators used a false color image for labeling contrails. I decided to train my model using this false color representation, as it seemed to improve the visibility of contrails and enhance their detectability.</p>\n<h2>Effective Interpolation for Boundary Annotations</h2>\n<p>A significant hurdle I encountered was accurately labeling contrail boundaries. Since contrails suddenly appear or enter from the sides of the image, capturing their true extent was crucial. To address this, I employed an interpolation technique. I first upscaled the image to 384 x 384 and then downscaled it to 256 x 256 using bilinear interpolation. This innovative approach proved successful in obtaining precise boundary labels.</p>\n<h2>Iterative Model Refinement</h2>\n<p>I pursued an iterative model refinement strategy that gradually improved my results. I initially trained a U-Net model from scratch using PyTorch. While this yielded a decent dice score of around 0.53, I knew I could do better. I then turned to the <code>segmentation_models_pytorch</code> library and selected a U-Net architecture with a pretrained <code>resnet26</code> encoder. This choice pushed my dice score up to 0.59 on the Kaggle Public leaderboard, showcasing noticeable progress. My determination to enhance performance led me to the final step: training a U-Net model with a pretrained <code>resnet50</code> encoder. This decision paid off with a remarkable dice score of 0.64985 on the Kaggle Public leaderboard and 0.64455 on the Private leaderboard.</p>\n<h2>Harnessing PyTorch Lightning for Efficiency</h2>\n<p>To accelerate my training process and streamline metric tracking and hyperparameter management, I adopted the PyTorch Lightning framework. This choice enabled me to harness the power of multiple GPUs efficiently and focus more on experimenting with various strategies rather than dealing with technical intricacies.</p>\n<h1>Things that Didn't Work</h1>\n<h2>Time Dependency and LSTMConv Layer</h2>\n<p>Understanding that contrails must either suddenly appear or be visible in at least 2 images, I attempted to incorporate the temporal aspect by using an LSTMConv layer in my model. Unfortunately, this approach didn't yield the anticipated results. It appears that the temporal aspect might not play a significant role in this problem, or perhaps the architecture I selected wasn't suited for effectively utilizing this information.</p>\n<h2>Exploring Additional Convolutional Layer</h2>\n<p>In an effort to enhance the model's input capabilities, I added an extra convolutional layer before the input entered the encoder. This adjustment was aimed at allowing the pretrained model to take a 3-channel input while utilizing data from all 8 wavelengths. However, this change didn't lead to significant performance improvements. It appeared that the resnet50 encoder could already effectively extract relevant features from the multi-channel data. As a result, further alterations at this stage in the architecture didn't seem to provide the anticipated benefits.</p>\n<h1>Opportunities for Improvement</h1>\n<h2>Soft Labels for More Accurate Annotations</h2>\n<p>In hindsight, I realized that using the mean of the annotations from the four annotators might have provided a more accurate representation of contrail regions. This could have potentially reduced noise caused by differing interpretations and improved overall model performance.</p>\n<h2>Hybrid Loss Functions</h2>\n<p>Initially starting with Binary Cross-Entropy and then shifting to Dice Loss to align with evaluation metrics, I now recognize the value of potentially combining both loss functions. This hybrid approach could strike a better balance between precision and recall during training, leading to improved overall results.</p>\n<p>My journey in tackling this complex contrail detection problem has taught me a great deal about <code>model architecture</code>, <code>data preprocessing</code>, and the importance of learning from both successes and failures. Armed with these insights, I am excited to continue refining my strategies and exploring new avenues for even better performance.</p>",
      "rawMarkdown": "# My Approach and Achievements\n\n## Leveraging Image Channels and False Color\n\nI tackled the challenge of detecting contrails using an innovative strategy. The provided images were captured in 8 different wavelengths, and annotators used a false color image for labeling contrails. I decided to train my model using this false color representation, as it seemed to improve the visibility of contrails and enhance their detectability.\n\n## Effective Interpolation for Boundary Annotations\n\nA significant hurdle I encountered was accurately labeling contrail boundaries. Since contrails suddenly appear or enter from the sides of the image, capturing their true extent was crucial. To address this, I employed an interpolation technique. I first upscaled the image to 384 x 384 and then downscaled it to 256 x 256 using bilinear interpolation. This innovative approach proved successful in obtaining precise boundary labels.\n\n## Iterative Model Refinement\n\nI pursued an iterative model refinement strategy that gradually improved my results. I initially trained a U-Net model from scratch using PyTorch. While this yielded a decent dice score of around 0.53, I knew I could do better. I then turned to the `segmentation_models_pytorch` library and selected a U-Net architecture with a pretrained `resnet26` encoder. This choice pushed my dice score up to 0.59 on the Kaggle Public leaderboard, showcasing noticeable progress. My determination to enhance performance led me to the final step: training a U-Net model with a pretrained `resnet50` encoder. This decision paid off with a remarkable dice score of 0.64985 on the Kaggle Public leaderboard and 0.64455 on the Private leaderboard.\n\n## Harnessing PyTorch Lightning for Efficiency\n\nTo accelerate my training process and streamline metric tracking and hyperparameter management, I adopted the PyTorch Lightning framework. This choice enabled me to harness the power of multiple GPUs efficiently and focus more on experimenting with various strategies rather than dealing with technical intricacies.\n\n# Things that Didn't Work\n\n## Time Dependency and LSTMConv Layer\n\nUnderstanding that contrails must either suddenly appear or be visible in at least 2 images, I attempted to incorporate the temporal aspect by using an LSTMConv layer in my model. Unfortunately, this approach didn't yield the anticipated results. It appears that the temporal aspect might not play a significant role in this problem, or perhaps the architecture I selected wasn't suited for effectively utilizing this information.\n\n## Exploring Additional Convolutional Layer\n\nIn an effort to enhance the model's input capabilities, I added an extra convolutional layer before the input entered the encoder. This adjustment was aimed at allowing the pretrained model to take a 3-channel input while utilizing data from all 8 wavelengths. However, this change didn't lead to significant performance improvements. It appeared that the resnet50 encoder could already effectively extract relevant features from the multi-channel data. As a result, further alterations at this stage in the architecture didn't seem to provide the anticipated benefits.\n\n# Opportunities for Improvement\n\n## Soft Labels for More Accurate Annotations\n\nIn hindsight, I realized that using the mean of the annotations from the four annotators might have provided a more accurate representation of contrail regions. This could have potentially reduced noise caused by differing interpretations and improved overall model performance.\n\n## Hybrid Loss Functions\n\nInitially starting with Binary Cross-Entropy and then shifting to Dice Loss to align with evaluation metrics, I now recognize the value of potentially combining both loss functions. This hybrid approach could strike a better balance between precision and recall during training, leading to improved overall results.\n\nMy journey in tackling this complex contrail detection problem has taught me a great deal about `model architecture`, `data preprocessing`, and the importance of learning from both successes and failures. Armed with these insights, I am excited to continue refining my strategies and exploring new avenues for even better performance.",
      "votes": 3
    },
    {
      "id": 2385107,
      "postDate": "2023-08-11T07:16:36.613Z",
      "content": "<p>You should try Fabric by lightning with 16-mixed precision or bf16-mixed precision</p>",
      "rawMarkdown": "You should try Fabric by lightning with 16-mixed precision or bf16-mixed precision",
      "votes": 1,
      "replies": [
        {
          "id": 2387184,
          "postDate": "2023-08-12T13:18:31.583Z",
          "content": "<p>Sure, I will give a try to that also. Thanks for the suggestion.</p>",
          "rawMarkdown": "Sure, I will give a try to that also. Thanks for the suggestion."
        }
      ]
    },
    {
      "id": 2383662,
      "postDate": "2023-08-10T14:00:39.613Z",
      "content": "<p>Great that you describe your solution! 👍</p>",
      "rawMarkdown": "Great that you describe your solution! 👍",
      "votes": 1,
      "replies": [
        {
          "id": 2383839,
          "postDate": "2023-08-10T15:31:42.693Z",
          "content": "<p>Thank you. 😊</p>",
          "rawMarkdown": "Thank you. 😊",
          "votes": 1
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 2385107,
      "author_name": "sahilsg",
      "author_url": "",
      "post_date": "2023-08-11T07:16:36.613000",
      "content": "<p>You should try Fabric by lightning with 16-mixed precision or bf16-mixed precision</p>",
      "votes": 1,
      "replies": [
        {
          "id": 2387184,
          "author_name": "Shailja Kant Tiwari",
          "author_url": "",
          "post_date": "2023-08-12T13:18:31.583000",
          "content": "<p>Sure, I will give a try to that also. Thanks for the suggestion.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2383662,
      "author_name": "Remek Kinas",
      "author_url": "",
      "post_date": "2023-08-10T14:00:39.613000",
      "content": "<p>Great that you describe your solution! 👍</p>",
      "votes": 1,
      "replies": [
        {
          "id": 2383839,
          "author_name": "Shailja Kant Tiwari",
          "author_url": "",
          "post_date": "2023-08-10T15:31:42.693000",
          "content": "<p>Thank you. 😊</p>",
          "votes": 1,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2383645": "# My Approach and Achievements\n\n## Leveraging Image Channels and False Color\n\nI tackled the challenge of detecting contrails using an innovative strategy. The provided images were captured in 8 different wavelengths, and annotators used a false color image for labeling contrails. I decided to train my model using this false color representation, as it seemed to improve the visibility of contrails and enhance their detectability.\n\n## Effective Interpolation for Boundary Annotations\n\nA significant hurdle I encountered was accurately labeling contrail boundaries. Since contrails suddenly appear or enter from the sides of the image, capturing their true extent was crucial. To address this, I employed an interpolation technique. I first upscaled the image to 384 x 384 and then downscaled it to 256 x 256 using bilinear interpolation. This innovative approach proved successful in obtaining precise boundary labels.\n\n## Iterative Model Refinement\n\nI pursued an iterative model refinement strategy that gradually improved my results. I initially trained a U-Net model from scratch using PyTorch. While this yielded a decent dice score of around 0.53, I knew I could do better. I then turned to the `segmentation_models_pytorch` library and selected a U-Net architecture with a pretrained `resnet26` encoder. This choice pushed my dice score up to 0.59 on the Kaggle Public leaderboard, showcasing noticeable progress. My determination to enhance performance led me to the final step: training a U-Net model with a pretrained `resnet50` encoder. This decision paid off with a remarkable dice score of 0.64985 on the Kaggle Public leaderboard and 0.64455 on the Private leaderboard.\n\n## Harnessing PyTorch Lightning for Efficiency\n\nTo accelerate my training process and streamline metric tracking and hyperparameter management, I adopted the PyTorch Lightning framework. This choice enabled me to harness the power of multiple GPUs efficiently and focus more on experimenting with various strategies rather than dealing with technical intricacies.\n\n# Things that Didn't Work\n\n## Time Dependency and LSTMConv Layer\n\nUnderstanding that contrails must either suddenly appear or be visible in at least 2 images, I attempted to incorporate the temporal aspect by using an LSTMConv layer in my model. Unfortunately, this approach didn't yield the anticipated results. It appears that the temporal aspect might not play a significant role in this problem, or perhaps the architecture I selected wasn't suited for effectively utilizing this information.\n\n## Exploring Additional Convolutional Layer\n\nIn an effort to enhance the model's input capabilities, I added an extra convolutional layer before the input entered the encoder. This adjustment was aimed at allowing the pretrained model to take a 3-channel input while utilizing data from all 8 wavelengths. However, this change didn't lead to significant performance improvements. It appeared that the resnet50 encoder could already effectively extract relevant features from the multi-channel data. As a result, further alterations at this stage in the architecture didn't seem to provide the anticipated benefits.\n\n# Opportunities for Improvement\n\n## Soft Labels for More Accurate Annotations\n\nIn hindsight, I realized that using the mean of the annotations from the four annotators might have provided a more accurate representation of contrail regions. This could have potentially reduced noise caused by differing interpretations and improved overall model performance.\n\n## Hybrid Loss Functions\n\nInitially starting with Binary Cross-Entropy and then shifting to Dice Loss to align with evaluation metrics, I now recognize the value of potentially combining both loss functions. This hybrid approach could strike a better balance between precision and recall during training, leading to improved overall results.\n\nMy journey in tackling this complex contrail detection problem has taught me a great deal about `model architecture`, `data preprocessing`, and the importance of learning from both successes and failures. Armed with these insights, I am excited to continue refining my strategies and exploring new avenues for even better performance.",
    "2385107": "You should try Fabric by lightning with 16-mixed precision or bf16-mixed precision",
    "2383662": "Great that you describe your solution! 👍"
  }
}