{
  "id": 112445,
  "title": "Augmenting raw dcm inputs",
  "url": "/competitions/rsna-intracranial-hemorrhage-detection/discussion/112445",
  "author_name": "Nicholas Lyu",
  "post_date": "2019-10-13T01:53:33.996000",
  "votes": 4,
  "comment_count": 9,
  "views": 0,
  "content": "<p>As discussions pointed out, it's easy for human to miss hemorrhage when using default window. I tried reading from dcm raw pixel array. One problem I found is that due to extreme values, default setting of augmentation in albumentations like randombrightnesscontrast and randomgamma yield unsatisfactory results. How do you augment dcm inputs?</p>",
  "messages": [
    {
      "id": 648262,
      "postDate": "2019-10-14T00:29:44.163Z",
      "content": "<p>I don't think we can use the usual augmentations here. Brightness, contrast, gamma, etc. are for manipulating color spaces. DICOM pixel values are CT densities. If you modify the intensity, for example, pixel value 0 (water) to something higher, the water becomes blood or liver. </p>\n\n<p>The spatial-level transform should work. You can shift, scale, rotate the DICOM pixels freely.</p>\n\n<p>IMO, minimal augmentation is enough. I use only shift, scale, and rotate, and I can train my model 20+ epochs without overfitting.</p>",
      "rawMarkdown": "I don't think we can use the usual augmentations here. Brightness, contrast, gamma, etc. are for manipulating color spaces. DICOM pixel values are CT densities. If you modify the intensity, for example, pixel value 0 (water) to something higher, the water becomes blood or liver. \n\nThe spatial-level transform should work. You can shift, scale, rotate the DICOM pixels freely.\n\nIMO, minimal augmentation is enough. I use only shift, scale, and rotate, and I can train my model 20+ epochs without overfitting.",
      "votes": 4
    },
    {
      "id": 647628,
      "postDate": "2019-10-13T01:53:33.997Z",
      "content": "<p>As discussions pointed out, it's easy for human to miss hemorrhage when using default window. I tried reading from dcm raw pixel array. One problem I found is that due to extreme values, default setting of augmentation in albumentations like randombrightnesscontrast and randomgamma yield unsatisfactory results. How do you augment dcm inputs?</p>",
      "rawMarkdown": "As discussions pointed out, it's easy for human to miss hemorrhage when using default window. I tried reading from dcm raw pixel array. One problem I found is that due to extreme values, default setting of augmentation in albumentations like randombrightnesscontrast and randomgamma yield unsatisfactory results. How do you augment dcm inputs?",
      "votes": 4
    },
    {
      "id": 647781,
      "postDate": "2019-10-13T09:18:28.677Z",
      "content": "<p>I used a cut-off value to limit the upper data range to feed the images into my normal image data augmentations pipeline.</p>\n\n<p>I was looking into the data and it seems that the very high values are generated by dental implants or similar stuff:\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1686473%2Ff71423ef299782223a55a2660b9d34bc%2F01.png?generation=1570958130881013&amp;alt=media\" alt=\"\">\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1686473%2Fa2679db59952bfda3294e6e569913ed4%2F02.png?generation=1570958144475882&amp;alt=media\" alt=\"\">\nThese features should not be related to the intracranial hemorrhage, and, therefore, I thought this approach should fit.</p>\n\n<p>However, maybe fellows with more radiology background have more input to that?</p>\n\n<p>PS: This kernel has also some nice information on the pitfalls with dicom images: <a href=\"https://www.kaggle.com/jhoward/some-dicom-gotchas-to-be-aware-of-fastai\">https://www.kaggle.com/jhoward/some-dicom-gotchas-to-be-aware-of-fastai</a></p>",
      "rawMarkdown": "I used a cut-off value to limit the upper data range to feed the images into my normal image data augmentations pipeline.\n\nI was looking into the data and it seems that the very high values are generated by dental implants or similar stuff:\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1686473%2Ff71423ef299782223a55a2660b9d34bc%2F01.png?generation=1570958130881013&amp;alt=media)\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1686473%2Fa2679db59952bfda3294e6e569913ed4%2F02.png?generation=1570958144475882&amp;alt=media)\nThese features should not be related to the intracranial hemorrhage, and, therefore, I thought this approach should fit.\n\nHowever, maybe fellows with more radiology background have more input to that?\n\nPS: This kernel has also some nice information on the pitfalls with dicom images: https://www.kaggle.com/jhoward/some-dicom-gotchas-to-be-aware-of-fastai\n",
      "votes": 1
    },
    {
      "id": 647783,
      "postDate": "2019-10-13T09:26:43.767Z",
      "content": "<p>What exactly do you mean by 'unsatisfactory results'? I've encountered similar problems, some images became just white and black regions.</p>",
      "rawMarkdown": "What exactly do you mean by 'unsatisfactory results'? I've encountered similar problems, some images became just white and black regions.",
      "replies": [
        {
          "id": 647882,
          "postDate": "2019-10-13T12:31:29.523Z",
          "content": "<p><a href=\"/cateek\">@cateek</a> exactly what I mean. Fortunately my code includes a visualization of augmented images. The results of using randombrightnesscontrast(or any single one of both) is terrible. Same with Randomgamma. There are only black and white regions. Now I’m resorting to transformations like elastictransform and cutout that does not depend on pixel range. I also personally think that augmentations like cutmix will not be very helpful</p>",
          "rawMarkdown": "@cateek exactly what I mean. Fortunately my code includes a visualization of augmented images. The results of using randombrightnesscontrast(or any single one of both) is terrible. Same with Randomgamma. There are only black and white regions. Now I’m resorting to transformations like elastictransform and cutout that does not depend on pixel range. I also personally think that augmentations like cutmix will not be very helpful"
        },
        {
          "id": 647924,
          "postDate": "2019-10-13T13:49:28.130Z",
          "content": "<p>If you don't mind me asking, what other augmentation did you use? Are there any particular augments, that contributed to your score?</p>",
          "rawMarkdown": "If you don't mind me asking, what other augmentation did you use? Are there any particular augments, that contributed to your score?"
        }
      ]
    },
    {
      "id": 647629,
      "postDate": "2019-10-13T01:54:31.727Z",
      "content": "<p>My current position is from .jpg 512x512 dataset. Want to see whether raw input can get me further</p>",
      "rawMarkdown": "My current position is from .jpg 512x512 dataset. Want to see whether raw input can get me further",
      "replies": [
        {
          "id": 648398,
          "postDate": "2019-10-14T05:59:13.443Z",
          "content": "<p>Hi, Lyu. Did you use all the images in the dataset as your train/val set? Or you just random chose a balanced amount (for example: 10k pos and 10k neg)? Thx. =)</p>",
          "rawMarkdown": "Hi, Lyu. Did you use all the images in the dataset as your train/val set? Or you just random chose a balanced amount (for example: 10k pos and 10k neg)? Thx. =)"
        },
        {
          "id": 648541,
          "postDate": "2019-10-14T10:41:32.857Z",
          "content": "<p><a href=\"/kinghaw\">@kinghaw</a> All. It trained for &lt;10 epochs tho if I recall correctly</p>",
          "rawMarkdown": "@kinghaw All. It trained for &lt;10 epochs tho if I recall correctly"
        },
        {
          "id": 651314,
          "postDate": "2019-10-17T10:13:06.303Z",
          "content": "<p><a href=\"/roguekk007\">@roguekk007</a> Your current position is from .jpg 512x512 dataset?</p>",
          "rawMarkdown": "@roguekk007 Your current position is from .jpg 512x512 dataset?"
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 648262,
      "author_name": "Peter",
      "author_url": "",
      "post_date": "2019-10-14T00:29:44.163000",
      "content": "<p>I don't think we can use the usual augmentations here. Brightness, contrast, gamma, etc. are for manipulating color spaces. DICOM pixel values are CT densities. If you modify the intensity, for example, pixel value 0 (water) to something higher, the water becomes blood or liver. </p>\n\n<p>The spatial-level transform should work. You can shift, scale, rotate the DICOM pixels freely.</p>\n\n<p>IMO, minimal augmentation is enough. I use only shift, scale, and rotate, and I can train my model 20+ epochs without overfitting.</p>",
      "votes": 4,
      "replies": []
    },
    {
      "id": 647781,
      "author_name": "Michael Pieler",
      "author_url": "",
      "post_date": "2019-10-13T09:18:28.677000",
      "content": "<p>I used a cut-off value to limit the upper data range to feed the images into my normal image data augmentations pipeline.</p>\n\n<p>I was looking into the data and it seems that the very high values are generated by dental implants or similar stuff:\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1686473%2Ff71423ef299782223a55a2660b9d34bc%2F01.png?generation=1570958130881013&amp;alt=media\" alt=\"\">\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1686473%2Fa2679db59952bfda3294e6e569913ed4%2F02.png?generation=1570958144475882&amp;alt=media\" alt=\"\">\nThese features should not be related to the intracranial hemorrhage, and, therefore, I thought this approach should fit.</p>\n\n<p>However, maybe fellows with more radiology background have more input to that?</p>\n\n<p>PS: This kernel has also some nice information on the pitfalls with dicom images: <a href=\"https://www.kaggle.com/jhoward/some-dicom-gotchas-to-be-aware-of-fastai\">https://www.kaggle.com/jhoward/some-dicom-gotchas-to-be-aware-of-fastai</a></p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 647783,
      "author_name": "Eek The Cat",
      "author_url": "",
      "post_date": "2019-10-13T09:26:43.767000",
      "content": "<p>What exactly do you mean by 'unsatisfactory results'? I've encountered similar problems, some images became just white and black regions.</p>",
      "votes": 0,
      "replies": [
        {
          "id": 647882,
          "author_name": "Nicholas Lyu",
          "author_url": "",
          "post_date": "2019-10-13T12:31:29.523000",
          "content": "<p><a href=\"/cateek\">@cateek</a> exactly what I mean. Fortunately my code includes a visualization of augmented images. The results of using randombrightnesscontrast(or any single one of both) is terrible. Same with Randomgamma. There are only black and white regions. Now I’m resorting to transformations like elastictransform and cutout that does not depend on pixel range. I also personally think that augmentations like cutmix will not be very helpful</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 647924,
          "author_name": "Eek The Cat",
          "author_url": "",
          "post_date": "2019-10-13T13:49:28.130000",
          "content": "<p>If you don't mind me asking, what other augmentation did you use? Are there any particular augments, that contributed to your score?</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 647629,
      "author_name": "Nicholas Lyu",
      "author_url": "",
      "post_date": "2019-10-13T01:54:31.727000",
      "content": "<p>My current position is from .jpg 512x512 dataset. Want to see whether raw input can get me further</p>",
      "votes": 0,
      "replies": [
        {
          "id": 648398,
          "author_name": "Jiayu Huo",
          "author_url": "",
          "post_date": "2019-10-14T05:59:13.443000",
          "content": "<p>Hi, Lyu. Did you use all the images in the dataset as your train/val set? Or you just random chose a balanced amount (for example: 10k pos and 10k neg)? Thx. =)</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 648541,
          "author_name": "Nicholas Lyu",
          "author_url": "",
          "post_date": "2019-10-14T10:41:32.857000",
          "content": "<p><a href=\"/kinghaw\">@kinghaw</a> All. It trained for &lt;10 epochs tho if I recall correctly</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 651314,
          "author_name": "Gabriel",
          "author_url": "",
          "post_date": "2019-10-17T10:13:06.303000",
          "content": "<p><a href=\"/roguekk007\">@roguekk007</a> Your current position is from .jpg 512x512 dataset?</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "648262": "I don't think we can use the usual augmentations here. Brightness, contrast, gamma, etc. are for manipulating color spaces. DICOM pixel values are CT densities. If you modify the intensity, for example, pixel value 0 (water) to something higher, the water becomes blood or liver. \n\nThe spatial-level transform should work. You can shift, scale, rotate the DICOM pixels freely.\n\nIMO, minimal augmentation is enough. I use only shift, scale, and rotate, and I can train my model 20+ epochs without overfitting.",
    "647628": "As discussions pointed out, it's easy for human to miss hemorrhage when using default window. I tried reading from dcm raw pixel array. One problem I found is that due to extreme values, default setting of augmentation in albumentations like randombrightnesscontrast and randomgamma yield unsatisfactory results. How do you augment dcm inputs?",
    "647781": "I used a cut-off value to limit the upper data range to feed the images into my normal image data augmentations pipeline.\n\nI was looking into the data and it seems that the very high values are generated by dental implants or similar stuff:\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1686473%2Ff71423ef299782223a55a2660b9d34bc%2F01.png?generation=1570958130881013&amp;alt=media)\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1686473%2Fa2679db59952bfda3294e6e569913ed4%2F02.png?generation=1570958144475882&amp;alt=media)\nThese features should not be related to the intracranial hemorrhage, and, therefore, I thought this approach should fit.\n\nHowever, maybe fellows with more radiology background have more input to that?\n\nPS: This kernel has also some nice information on the pitfalls with dicom images: https://www.kaggle.com/jhoward/some-dicom-gotchas-to-be-aware-of-fastai\n",
    "647783": "What exactly do you mean by 'unsatisfactory results'? I've encountered similar problems, some images became just white and black regions.",
    "647629": "My current position is from .jpg 512x512 dataset. Want to see whether raw input can get me further"
  }
}