{
  "id": 102613,
  "title": "Green is all u(may) need!!",
  "url": "/competitions/aptos2019-blindness-detection/discussion/102613",
  "author_name": "Bibek",
  "post_date": "2019-08-03T07:45:54.688000",
  "votes": 37,
  "comment_count": 13,
  "views": 0,
  "content": "<p>Looks like <code>green</code> channel has more information!!</p>\n\n<p><code>\nGreen Channel of the three color channels in the image (Red, Green, and Blue) the contrast between the blood vessels, exudates and hemorrhages is best seen in the green channel and this channels neither under- illuminated nor over-saturated like the other two\n</code></p>\n\n\n  \n<p></p>\n\n<p><a href=\"http://biomedpharmajournal.org/vol10no2/diabetic-retinal-fundus-images-preprocessing-and-feature-extraction-for-early-detection-of-diabetic-retinopathy/\">reference</a></p>",
  "messages": [
    {
      "id": 591135,
      "postDate": "2019-08-03T07:45:54.690Z",
      "content": "<p>Looks like <code>green</code> channel has more information!!</p>\n\n<p><code>\nGreen Channel of the three color channels in the image (Red, Green, and Blue) the contrast between the blood vessels, exudates and hemorrhages is best seen in the green channel and this channels neither under- illuminated nor over-saturated like the other two\n</code></p>\n\n\n  \n<p></p>\n\n<p><a href=\"http://biomedpharmajournal.org/vol10no2/diabetic-retinal-fundus-images-preprocessing-and-feature-extraction-for-early-detection-of-diabetic-retinopathy/\">reference</a></p>",
      "rawMarkdown": "Looks like `green` channel has more information!!\n\n```\nGreen Channel of the three color channels in the image (Red, Green, and Blue) the contrast between the blood vessels, exudates and hemorrhages is best seen in the green channel and this channels neither under- illuminated nor over-saturated like the other two\n```\n\n\n<p align=\"center\">\n  <img width=\"460\" height=\"300\" src=\"http://biomedpharmajournal.org/wp-content/uploads/2017/06/Vol10No2_Diab_Dili_fig2.jpg\">\n</p>\n\n\n[reference](http://biomedpharmajournal.org/vol10no2/diabetic-retinal-fundus-images-preprocessing-and-feature-extraction-for-early-detection-of-diabetic-retinopathy/)\n\n",
      "votes": 37
    },
    {
      "id": 591316,
      "postDate": "2019-08-03T13:39:35.763Z",
      "content": "<p>If you need the code for this:</p>\n\n<p><code>\ndef toCLAHEgreen(img): <br>\n    clipLimit=2.0 \n    tileGridSize=(8, 8) <br>\n    img = np.array(img) <br>\n    green_channel = img[:, :, 1] <br>\n    clahe = cv2.createCLAHE(clipLimit=clipLimit, tileGridSize=tileGridSize)\n    cla = clahe.apply(green_channel) \n    cla=clahe.apply(cla)\n    return cla\n</code></p>",
      "rawMarkdown": "If you need the code for this:\n\n```\ndef toCLAHEgreen(img):  \n    clipLimit=2.0 \n    tileGridSize=(8, 8)  \n    img = np.array(img)     \n    green_channel = img[:, :, 1]    \n    clahe = cv2.createCLAHE(clipLimit=clipLimit, tileGridSize=tileGridSize)\n    cla = clahe.apply(green_channel) \n    cla=clahe.apply(cla)\n    return cla\n```\n\n",
      "votes": 11,
      "replies": [
        {
          "id": 593923,
          "postDate": "2019-08-07T09:44:49.963Z",
          "content": "<p>Hi, thanks for the sharing.</p>\n\n<p>Sorry for asking a stupid question.  For one channel data, should I apply data augmentation on it?\nAlso model structure is changed. We do not have three channel any more. Then we need to change the architecture of resnet or efficientnet?</p>",
          "rawMarkdown": "Hi, thanks for the sharing.\n\nSorry for asking a stupid question.  For one channel data, should I apply data augmentation on it?\nAlso model structure is changed. We do not have three channel any more. Then we need to change the architecture of resnet or efficientnet?",
          "votes": 2
        },
        {
          "id": 594157,
          "postDate": "2019-08-07T16:43:25.287Z",
          "content": "<p>thanks for the code! i was just wondering what's the purpose of applying the cv2 function <code>createCLAHE</code> here, i don't know this processing method before but a quick google search suggests that it's related to Histograms Equalization which is used to increase contrast, but shouldn't CNN (hopefully) be able to learn it? have you noticed difference between just using green channel vs the one with <code>createCLAHE</code> applied?</p>",
          "rawMarkdown": "thanks for the code! i was just wondering what's the purpose of applying the cv2 function `createCLAHE` here, i don't know this processing method before but a quick google search suggests that it's related to Histograms Equalization which is used to increase contrast, but shouldn't CNN (hopefully) be able to learn it? have you noticed difference between just using green channel vs the one with `createCLAHE` applied?",
          "votes": 1
        },
        {
          "id": 594265,
          "postDate": "2019-08-07T19:22:34.003Z",
          "content": "<p>&gt; Sorry for asking a stupid question. For one channel data, should I apply data augmentation on it?\nAlso model structure is changed. We do not have three channel any more. Then we need to change the architecture of resnet or efficientnet?</p>\n\n<p>Thy are no stupid questions. If you get one channel image you can easily convert to 3 channels by just copying same image to 2 other channels. In this way you won't have any issues reusing your architectures.  Regarding Augmentations yes you should always try to use them,  hope it helps =) </p>\n\n<p>P.S in here is the code that converts single to 3 channel.</p>\n\n<p><code>\nimg = your_one_channel_image\nimg_3 = cv2.merge((img, img, img))\n</code></p>",
          "rawMarkdown": "&gt; Sorry for asking a stupid question. For one channel data, should I apply data augmentation on it?\nAlso model structure is changed. We do not have three channel any more. Then we need to change the architecture of resnet or efficientnet?\n\nThy are no stupid questions. If you get one channel image you can easily convert to 3 channels by just copying same image to 2 other channels. In this way you won't have any issues reusing your architectures.  Regarding Augmentations yes you should always try to use them,  hope it helps =) \n\nP.S in here is the code that converts single to 3 channel.\n\n```\nimg = your_one_channel_image\nimg_3 = cv2.merge((img, img, img))\n```",
          "votes": 4
        },
        {
          "id": 594698,
          "postDate": "2019-08-08T09:41:04.017Z",
          "content": "<p><a href=\"/drhabib\">@drhabib</a> Thanks for your help!</p>",
          "rawMarkdown": "@drhabib Thanks for your help!",
          "votes": 1
        },
        {
          "id": 608558,
          "postDate": "2019-08-27T00:08:40.973Z",
          "content": "<p>Hi <a href=\"/samshipengs\">@samshipengs</a> did you have any insight vs using just the green channel only or using createCLAHE?</p>",
          "rawMarkdown": "Hi @samshipengs did you have any insight vs using just the green channel only or using createCLAHE?\n"
        },
        {
          "id": 608574,
          "postDate": "2019-08-27T00:47:29.310Z",
          "content": "<p>using clahe boost the lb score in my case</p>",
          "rawMarkdown": "using clahe boost the lb score in my case"
        },
        {
          "id": 614367,
          "postDate": "2019-08-31T11:58:55.547Z",
          "content": "<p>If you don't mind could you share a bit more? I tried the followings but didn't get better results.</p>\n\n<ul>\n<li>Only used clahe-d green channel x 3 as image</li>\n<li>clahed each r, g and b channel and merge and train</li>\n</ul>\n\n<p>thank you!</p>",
          "rawMarkdown": "If you don't mind could you share a bit more? I tried the followings but didn't get better results.\n\n- Only used clahe-d green channel x 3 as image\n- clahed each r, g and b channel and merge and train\n\nthank you!"
        }
      ]
    },
    {
      "id": 598093,
      "postDate": "2019-08-13T05:39:11.230Z",
      "content": "<p>Thanks <a href=\"/bibek777\">@bibek777</a>  and <a href=\"/solomonk\">@solomonk</a> . I do see sharp contrast in green channel compared to original images. </p>\n\n<p>Original:\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2988282%2F46de27603bd0cd51d66aa2673c314a60%2Fretino1.png?generation=1565674682803673&amp;alt=media\" alt=\"\"></p>\n\n<p>Green channel:\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2988282%2F71b92f9508b6dc664cfc4a9f228d9513%2Fretino2.png?generation=1565674745840407&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "Thanks @bibek777  and @solomonk . I do see sharp contrast in green channel compared to original images. \n\nOriginal:\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2988282%2F46de27603bd0cd51d66aa2673c314a60%2Fretino1.png?generation=1565674682803673&amp;alt=media)\n\nGreen channel:\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2988282%2F71b92f9508b6dc664cfc4a9f228d9513%2Fretino2.png?generation=1565674745840407&amp;alt=media)\n",
      "votes": 4
    },
    {
      "id": 591159,
      "postDate": "2019-08-03T08:32:16.447Z",
      "content": "<p>That could be true! I measured strong correlation between the standard deviation of the green channel and the diagnosis! Correlation with the other channels are lighter.</p>",
      "rawMarkdown": "That could be true! I measured strong correlation between the standard deviation of the green channel and the diagnosis! Correlation with the other channels are lighter.",
      "votes": 2
    },
    {
      "id": 1095278,
      "postDate": "2020-11-29T12:40:17.573Z",
      "content": "<p>bro?<br>\nhow to calculate clahe manually?</p>",
      "rawMarkdown": "bro?\nhow to calculate clahe manually?"
    },
    {
      "id": 621678,
      "postDate": "2019-09-08T20:31:09.403Z",
      "rawMarkdown": "",
      "isDeleted": true
    },
    {
      "id": 591262,
      "postDate": "2019-08-03T12:17:25.207Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 591316,
      "author_name": "QuantScientist",
      "author_url": "",
      "post_date": "2019-08-03T13:39:35.763000",
      "content": "<p>If you need the code for this:</p>\n\n<p><code>\ndef toCLAHEgreen(img): <br>\n    clipLimit=2.0 \n    tileGridSize=(8, 8) <br>\n    img = np.array(img) <br>\n    green_channel = img[:, :, 1] <br>\n    clahe = cv2.createCLAHE(clipLimit=clipLimit, tileGridSize=tileGridSize)\n    cla = clahe.apply(green_channel) \n    cla=clahe.apply(cla)\n    return cla\n</code></p>",
      "votes": 11,
      "replies": [
        {
          "id": 593923,
          "author_name": "DeepInvolution",
          "author_url": "",
          "post_date": "2019-08-07T09:44:49.963000",
          "content": "<p>Hi, thanks for the sharing.</p>\n\n<p>Sorry for asking a stupid question.  For one channel data, should I apply data augmentation on it?\nAlso model structure is changed. We do not have three channel any more. Then we need to change the architecture of resnet or efficientnet?</p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 594157,
          "author_name": "samshipengs",
          "author_url": "",
          "post_date": "2019-08-07T16:43:25.287000",
          "content": "<p>thanks for the code! i was just wondering what's the purpose of applying the cv2 function <code>createCLAHE</code> here, i don't know this processing method before but a quick google search suggests that it's related to Histograms Equalization which is used to increase contrast, but shouldn't CNN (hopefully) be able to learn it? have you noticed difference between just using green channel vs the one with <code>createCLAHE</code> applied?</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 594265,
          "author_name": "DrHB",
          "author_url": "",
          "post_date": "2019-08-07T19:22:34.003000",
          "content": "<p>&gt; Sorry for asking a stupid question. For one channel data, should I apply data augmentation on it?\nAlso model structure is changed. We do not have three channel any more. Then we need to change the architecture of resnet or efficientnet?</p>\n\n<p>Thy are no stupid questions. If you get one channel image you can easily convert to 3 channels by just copying same image to 2 other channels. In this way you won't have any issues reusing your architectures.  Regarding Augmentations yes you should always try to use them,  hope it helps =) </p>\n\n<p>P.S in here is the code that converts single to 3 channel.</p>\n\n<p><code>\nimg = your_one_channel_image\nimg_3 = cv2.merge((img, img, img))\n</code></p>",
          "votes": 4,
          "replies": []
        },
        {
          "id": 594698,
          "author_name": "DeepInvolution",
          "author_url": "",
          "post_date": "2019-08-08T09:41:04.017000",
          "content": "<p><a href=\"/drhabib\">@drhabib</a> Thanks for your help!</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 608558,
          "author_name": "Antonio De Perio",
          "author_url": "",
          "post_date": "2019-08-27T00:08:40.973000",
          "content": "<p>Hi <a href=\"/samshipengs\">@samshipengs</a> did you have any insight vs using just the green channel only or using createCLAHE?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 608574,
          "author_name": "leixiang@AInnovation",
          "author_url": "",
          "post_date": "2019-08-27T00:47:29.310000",
          "content": "<p>using clahe boost the lb score in my case</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 614367,
          "author_name": "higepon",
          "author_url": "",
          "post_date": "2019-08-31T11:58:55.547000",
          "content": "<p>If you don't mind could you share a bit more? I tried the followings but didn't get better results.</p>\n\n<ul>\n<li>Only used clahe-d green channel x 3 as image</li>\n<li>clahed each r, g and b channel and merge and train</li>\n</ul>\n\n<p>thank you!</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 598093,
      "author_name": "Ram Muthiah",
      "author_url": "",
      "post_date": "2019-08-13T05:39:11.230000",
      "content": "<p>Thanks <a href=\"/bibek777\">@bibek777</a>  and <a href=\"/solomonk\">@solomonk</a> . I do see sharp contrast in green channel compared to original images. </p>\n\n<p>Original:\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2988282%2F46de27603bd0cd51d66aa2673c314a60%2Fretino1.png?generation=1565674682803673&amp;alt=media\" alt=\"\"></p>\n\n<p>Green channel:\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2988282%2F71b92f9508b6dc664cfc4a9f228d9513%2Fretino2.png?generation=1565674745840407&amp;alt=media\" alt=\"\"></p>",
      "votes": 4,
      "replies": []
    },
    {
      "id": 591159,
      "author_name": "Peter Nemeth",
      "author_url": "",
      "post_date": "2019-08-03T08:32:16.447000",
      "content": "<p>That could be true! I measured strong correlation between the standard deviation of the green channel and the diagnosis! Correlation with the other channels are lighter.</p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 1095278,
      "author_name": "felix_indra",
      "author_url": "",
      "post_date": "2020-11-29T12:40:17.573000",
      "content": "<p>bro?<br>\nhow to calculate clahe manually?</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 621678,
      "author_name": "",
      "author_url": "",
      "post_date": "2019-09-08T20:31:09.403000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 591262,
      "author_name": "",
      "author_url": "",
      "post_date": "2019-08-03T12:17:25.207000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "591135": "Looks like `green` channel has more information!!\n\n```\nGreen Channel of the three color channels in the image (Red, Green, and Blue) the contrast between the blood vessels, exudates and hemorrhages is best seen in the green channel and this channels neither under- illuminated nor over-saturated like the other two\n```\n\n\n<p align=\"center\">\n  <img width=\"460\" height=\"300\" src=\"http://biomedpharmajournal.org/wp-content/uploads/2017/06/Vol10No2_Diab_Dili_fig2.jpg\">\n</p>\n\n\n[reference](http://biomedpharmajournal.org/vol10no2/diabetic-retinal-fundus-images-preprocessing-and-feature-extraction-for-early-detection-of-diabetic-retinopathy/)\n\n",
    "591316": "If you need the code for this:\n\n```\ndef toCLAHEgreen(img):  \n    clipLimit=2.0 \n    tileGridSize=(8, 8)  \n    img = np.array(img)     \n    green_channel = img[:, :, 1]    \n    clahe = cv2.createCLAHE(clipLimit=clipLimit, tileGridSize=tileGridSize)\n    cla = clahe.apply(green_channel) \n    cla=clahe.apply(cla)\n    return cla\n```\n\n",
    "598093": "Thanks @bibek777  and @solomonk . I do see sharp contrast in green channel compared to original images. \n\nOriginal:\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2988282%2F46de27603bd0cd51d66aa2673c314a60%2Fretino1.png?generation=1565674682803673&amp;alt=media)\n\nGreen channel:\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2988282%2F71b92f9508b6dc664cfc4a9f228d9513%2Fretino2.png?generation=1565674745840407&amp;alt=media)\n",
    "591159": "That could be true! I measured strong correlation between the standard deviation of the green channel and the diagnosis! Correlation with the other channels are lighter.",
    "1095278": "bro?\nhow to calculate clahe manually?",
    "621678": "",
    "591262": ""
  }
}