{
  "id": 397621,
  "title": "Suboptimal upsampling of two of the infrared images",
  "url": "/competitions/vesuvius-challenge-ink-detection/discussion/397621",
  "author_name": "",
  "post_date": "2023-03-26T12:39:24.004054700Z",
  "votes": 2,
  "comment_count": 6,
  "views": 0,
  "content": "<p>I don't think it will have any substantial effect on anyone's modeling, but I noticed that the infrared images for fragments 1 and 3 seem to have been generated from lower-resolution images, upsampling by a factor of 5 using <em>nearest neighbor</em> upsampling, and then rotated (with proper antialiasing this time) in order to register them against the CT scan.</p>\n<p>Not sure how that nearest neighbor step ended up in the pipeline. It does add aliasing artifacts that didn't need to be in there.</p>\n<p>Fragment 2 seems to have been done properly.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F42168%2Fdf5078c33a483bf846c674b1468330bc%2F2023-03-26-fragment-1-piece.png?generation=1679834249560158&amp;alt=media\" alt=\"\"> <img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F42168%2Fab657074f34c008dc5f42d4f6ec151e0%2F2023-03-26-fragment-3-piece.png?generation=1679834299885759&amp;alt=media\" alt=\"\"></p>",
  "messages": [
    {
      "id": "2197792",
      "postDate": "03/26/2023 12:39:24",
      "content": "<p>I don't think it will have any substantial effect on anyone's modeling, but I noticed that the infrared images for fragments 1 and 3 seem to have been generated from lower-resolution images, upsampling by a factor of 5 using <em>nearest neighbor</em> upsampling, and then rotated (with proper antialiasing this time) in order to register them against the CT scan.</p>\n<p>Not sure how that nearest neighbor step ended up in the pipeline. It does add aliasing artifacts that didn't need to be in there.</p>\n<p>Fragment 2 seems to have been done properly.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F42168%2Fdf5078c33a483bf846c674b1468330bc%2F2023-03-26-fragment-1-piece.png?generation=1679834249560158&amp;alt=media\" alt=\"\"> <img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F42168%2Fab657074f34c008dc5f42d4f6ec151e0%2F2023-03-26-fragment-3-piece.png?generation=1679834299885759&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "I don't think it will have any substantial effect on anyone's modeling, but I noticed that the infrared images for fragments 1 and 3 seem to have been generated from lower-resolution images, upsampling by a factor of 5 using *nearest neighbor* upsampling, and then rotated (with proper antialiasing this time) in order to register them against the CT scan.\n\nNot sure how that nearest neighbor step ended up in the pipeline. It does add aliasing artifacts that didn't need to be in there.\n\nFragment 2 seems to have been done properly.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F42168%2Fdf5078c33a483bf846c674b1468330bc%2F2023-03-26-fragment-1-piece.png?generation=1679834249560158&alt=media) ![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F42168%2Fab657074f34c008dc5f42d4f6ec151e0%2F2023-03-26-fragment-3-piece.png?generation=1679834299885759&alt=media)",
      "votes": null
    },
    {
      "id": "2199587",
      "postDate": "03/27/2023 20:39:37",
      "content": "<p>Would be great to hear the organisers thoughts on this. - or if we can get access to the raw data to find a better up sampling method.</p>",
      "rawMarkdown": "Would be great to hear the organisers thoughts on this. - or if we can get access to the raw data to find a better up sampling method.",
      "votes": null
    },
    {
      "id": "2199598",
      "postDate": "03/27/2023 20:58:05",
      "content": "<p>The same process was used for all fragments. The original infrared photos are available for each fragment in <code>fragments/Frag.volpkg/working/reference</code>, for example <code>fragments/Frag1.volpkg/working/reference/Frag1-1000nmS40-Lens=105mm{OG.tif</code>. These photos are then aligned to the texture image using Puppet Warp in Photoshop. The originals are indeed lower resolution than the texture image derived from CT.</p>\n<p>The artifacts do not seem to appear for Fragment 2 because the fragment occupied more of the field of view (so the original pixels look smaller in the aligned image) and it was more axis aligned (required close to 90 degree rotation so the enlarged pixels don't look so tilted).</p>\n<p>Feel free to experiment with other alignment methods!</p>",
      "rawMarkdown": "The same process was used for all fragments. The original infrared photos are available for each fragment in `fragments/Frag.volpkg/working/reference`, for example `fragments/Frag1.volpkg/working/reference/Frag1-1000nmS40-Lens=105mm{OG.tif`. These photos are then aligned to the texture image using Puppet Warp in Photoshop. The originals are indeed lower resolution than the texture image derived from CT.\n\nThe artifacts do not seem to appear for Fragment 2 because the fragment occupied more of the field of view (so the original pixels look smaller in the aligned image) and it was more axis aligned (required close to 90 degree rotation so the enlarged pixels don't look so tilted).\n\nFeel free to experiment with other alignment methods!",
      "votes": null
    },
    {
      "id": "2199623",
      "postDate": "03/27/2023 21:29:01",
      "content": "<p><a href=\"https://www.kaggle.com/stephenrparsons\" target=\"_blank\">@stephenrparsons</a> The original infrared photo you mention (from the full Vesuvius Challenge, not this Kaggle sub-challenge) is indeed lower resolution. The problem is in the pipeline that was used to upsample that image and register it to the texture image. That pipeline has used nearest neighbor upsampling, which distorts the image with aliasing artifacts. If it was upsampled using a properly antialised upsampling method, that extra aliasing noise would not be present.</p>\n<p>For example, here are some screenshots showing the original image upsampled with nearest neighbor, compared to the Kaggle version, as well as the original upsampled with a properly antialiased upsampling method, again compared to the Kaggle version. (I have not tried to match the size exactly; this is just for illustration).</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F42168%2F870789c0598cf21e526800cca69022f0%2F2023-03-27-kaggle-bad-upsample-compare.png?generation=1679952336192955&amp;alt=media\" alt=\"\"></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F42168%2F75fb2f2806a867151c2c27d3440855f8%2F2023-03-27-kaggle-good-upsample-compare.png?generation=1679952377011719&amp;alt=media\" alt=\"\"></p>\n<p>Would it be possible for you (or whoever prepared the data for this Kaggle comp) to rerun that pipeline and switch out the nearest neighbor kernel for a kernel that is properly antialiased?</p>\n<p>Thanks!</p>",
      "rawMarkdown": "stephenrparsons The original infrared photo you mention (from the full Vesuvius Challenge, not this Kaggle sub-challenge) is indeed lower resolution. The problem is in the pipeline that was used to upsample that image and register it to the texture image. That pipeline has used nearest neighbor upsampling, which distorts the image with aliasing artifacts. If it was upsampled using a properly antialised upsampling method, that extra aliasing noise would not be present.\n\nFor example, here are some screenshots showing the original image upsampled with nearest neighbor, compared to the Kaggle version, as well as the original upsampled with a properly antialiased upsampling method, again compared to the Kaggle version. (I have not tried to match the size exactly; this is just for illustration).\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F42168%2F870789c0598cf21e526800cca69022f0%2F2023-03-27-kaggle-bad-upsample-compare.png?generation=1679952336192955&alt=media)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F42168%2F75fb2f2806a867151c2c27d3440855f8%2F2023-03-27-kaggle-good-upsample-compare.png?generation=1679952377011719&alt=media)\n\nWould it be possible for you (or whoever prepared the data for this Kaggle comp) to rerun that pipeline and switch out the nearest neighbor kernel for a kernel that is properly antialiased?\n\nThanks!",
      "votes": null
    },
    {
      "id": "2200519",
      "postDate": "03/28/2023 15:47:27",
      "content": "<p>Downloaded the original ir image files and played in GIMP - not much of a Photoshop person these days (was pretty good a decade ago) and first real use of GIMP but getting the IR image aligned with the first tif was a real pain of a job.  I gave up after manual playing with one fragment for an hour.  I believe the alignment method that I will use will be \"let someone else do it\".</p>\n<p>So anyone wanting some upvotes for a kaggle dataset - you will get mine for sure if you generate a new IR image that's 'better' for all three fragments.</p>\n<p>After this play time it would seem that a source of model error that will be present is a result of both alignment and threshold cutoff for conversion from gray scale to the mask.  A single pixel change in the threshold will add or subtract some \"painted area' as there is a decent amount of partial ink present.</p>",
      "rawMarkdown": "Downloaded the original ir image files and played in GIMP - not much of a Photoshop person these days (was pretty good a decade ago) and first real use of GIMP but getting the IR image aligned with the first tif was a real pain of a job.  I gave up after manual playing with one fragment for an hour.  I believe the alignment method that I will use will be \"let someone else do it\".\n\nSo anyone wanting some upvotes for a kaggle dataset - you will get mine for sure if you generate a new IR image that's 'better' for all three fragments.\n\nAfter this play time it would seem that a source of model error that will be present is a result of both alignment and threshold cutoff for conversion from gray scale to the mask.  A single pixel change in the threshold will add or subtract some \"painted area' as there is a decent amount of partial ink present.",
      "votes": null
    },
    {
      "id": "2200536",
      "postDate": "03/28/2023 15:53:35",
      "content": "<p>Note that the photoshop files that were used for the alignment are in the scrollprize.org/data dataset, so if anyone wants to run a different algorithm on those and see if that helps, feel free!</p>",
      "rawMarkdown": "Note that the photoshop files that were used for the alignment are in the scrollprize.org/data dataset, so if anyone wants to run a different algorithm on those and see if that helps, feel free!",
      "votes": null
    },
    {
      "id": "2200644",
      "postDate": "03/28/2023 17:20:10",
      "content": "<p>OK. Thanks!</p>",
      "rawMarkdown": "OK. Thanks!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2199587,
      "author_name": "themecheng",
      "author_url": "",
      "post_date": "03/27/2023 20:39:37",
      "content": "<p>Would be great to hear the organisers thoughts on this. - or if we can get access to the raw data to find a better up sampling method.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2199598,
      "author_name": "stephenrparsons",
      "author_url": "",
      "post_date": "03/27/2023 20:58:05",
      "content": "<p>The same process was used for all fragments. The original infrared photos are available for each fragment in <code>fragments/Frag.volpkg/working/reference</code>, for example <code>fragments/Frag1.volpkg/working/reference/Frag1-1000nmS40-Lens=105mm{OG.tif</code>. These photos are then aligned to the texture image using Puppet Warp in Photoshop. The originals are indeed lower resolution than the texture image derived from CT.</p>\n<p>The artifacts do not seem to appear for Fragment 2 because the fragment occupied more of the field of view (so the original pixels look smaller in the aligned image) and it was more axis aligned (required close to 90 degree rotation so the enlarged pixels don't look so tilted).</p>\n<p>Feel free to experiment with other alignment methods!</p>",
      "votes": null,
      "replies": [
        {
          "id": 2199623,
          "author_name": "costella",
          "author_url": "",
          "post_date": "03/27/2023 21:29:01",
          "content": "<p><a href=\"https://www.kaggle.com/stephenrparsons\" target=\"_blank\">@stephenrparsons</a> The original infrared photo you mention (from the full Vesuvius Challenge, not this Kaggle sub-challenge) is indeed lower resolution. The problem is in the pipeline that was used to upsample that image and register it to the texture image. That pipeline has used nearest neighbor upsampling, which distorts the image with aliasing artifacts. If it was upsampled using a properly antialised upsampling method, that extra aliasing noise would not be present.</p>\n<p>For example, here are some screenshots showing the original image upsampled with nearest neighbor, compared to the Kaggle version, as well as the original upsampled with a properly antialiased upsampling method, again compared to the Kaggle version. (I have not tried to match the size exactly; this is just for illustration).</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F42168%2F870789c0598cf21e526800cca69022f0%2F2023-03-27-kaggle-bad-upsample-compare.png?generation=1679952336192955&amp;alt=media\" alt=\"\"></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F42168%2F75fb2f2806a867151c2c27d3440855f8%2F2023-03-27-kaggle-good-upsample-compare.png?generation=1679952377011719&amp;alt=media\" alt=\"\"></p>\n<p>Would it be possible for you (or whoever prepared the data for this Kaggle comp) to rerun that pipeline and switch out the nearest neighbor kernel for a kernel that is properly antialiased?</p>\n<p>Thanks!</p>",
          "votes": null,
          "replies": [
            {
              "id": 2200519,
              "author_name": "pcjimmmy",
              "author_url": "",
              "post_date": "03/28/2023 15:47:27",
              "content": "<p>Downloaded the original ir image files and played in GIMP - not much of a Photoshop person these days (was pretty good a decade ago) and first real use of GIMP but getting the IR image aligned with the first tif was a real pain of a job.  I gave up after manual playing with one fragment for an hour.  I believe the alignment method that I will use will be \"let someone else do it\".</p>\n<p>So anyone wanting some upvotes for a kaggle dataset - you will get mine for sure if you generate a new IR image that's 'better' for all three fragments.</p>\n<p>After this play time it would seem that a source of model error that will be present is a result of both alignment and threshold cutoff for conversion from gray scale to the mask.  A single pixel change in the threshold will add or subtract some \"painted area' as there is a decent amount of partial ink present.</p>",
              "votes": null,
              "replies": []
            },
            {
              "id": 2200536,
              "author_name": "jpposma",
              "author_url": "",
              "post_date": "03/28/2023 15:53:35",
              "content": "<p>Note that the photoshop files that were used for the alignment are in the scrollprize.org/data dataset, so if anyone wants to run a different algorithm on those and see if that helps, feel free!</p>",
              "votes": null,
              "replies": [
                {
                  "id": 2200644,
                  "author_name": "costella",
                  "author_url": "",
                  "post_date": "03/28/2023 17:20:10",
                  "content": "<p>OK. Thanks!</p>",
                  "votes": null,
                  "replies": []
                }
              ]
            }
          ]
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2197792": "I don't think it will have any substantial effect on anyone's modeling, but I noticed that the infrared images for fragments 1 and 3 seem to have been generated from lower-resolution images, upsampling by a factor of 5 using *nearest neighbor* upsampling, and then rotated (with proper antialiasing this time) in order to register them against the CT scan.\n\nNot sure how that nearest neighbor step ended up in the pipeline. It does add aliasing artifacts that didn't need to be in there.\n\nFragment 2 seems to have been done properly.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F42168%2Fdf5078c33a483bf846c674b1468330bc%2F2023-03-26-fragment-1-piece.png?generation=1679834249560158&alt=media) ![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F42168%2Fab657074f34c008dc5f42d4f6ec151e0%2F2023-03-26-fragment-3-piece.png?generation=1679834299885759&alt=media)",
    "2199587": "Would be great to hear the organisers thoughts on this. - or if we can get access to the raw data to find a better up sampling method.",
    "2199598": "The same process was used for all fragments. The original infrared photos are available for each fragment in `fragments/Frag.volpkg/working/reference`, for example `fragments/Frag1.volpkg/working/reference/Frag1-1000nmS40-Lens=105mm{OG.tif`. These photos are then aligned to the texture image using Puppet Warp in Photoshop. The originals are indeed lower resolution than the texture image derived from CT.\n\nThe artifacts do not seem to appear for Fragment 2 because the fragment occupied more of the field of view (so the original pixels look smaller in the aligned image) and it was more axis aligned (required close to 90 degree rotation so the enlarged pixels don't look so tilted).\n\nFeel free to experiment with other alignment methods!",
    "2199623": "stephenrparsons The original infrared photo you mention (from the full Vesuvius Challenge, not this Kaggle sub-challenge) is indeed lower resolution. The problem is in the pipeline that was used to upsample that image and register it to the texture image. That pipeline has used nearest neighbor upsampling, which distorts the image with aliasing artifacts. If it was upsampled using a properly antialised upsampling method, that extra aliasing noise would not be present.\n\nFor example, here are some screenshots showing the original image upsampled with nearest neighbor, compared to the Kaggle version, as well as the original upsampled with a properly antialiased upsampling method, again compared to the Kaggle version. (I have not tried to match the size exactly; this is just for illustration).\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F42168%2F870789c0598cf21e526800cca69022f0%2F2023-03-27-kaggle-bad-upsample-compare.png?generation=1679952336192955&alt=media)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F42168%2F75fb2f2806a867151c2c27d3440855f8%2F2023-03-27-kaggle-good-upsample-compare.png?generation=1679952377011719&alt=media)\n\nWould it be possible for you (or whoever prepared the data for this Kaggle comp) to rerun that pipeline and switch out the nearest neighbor kernel for a kernel that is properly antialiased?\n\nThanks!",
    "2200519": "Downloaded the original ir image files and played in GIMP - not much of a Photoshop person these days (was pretty good a decade ago) and first real use of GIMP but getting the IR image aligned with the first tif was a real pain of a job.  I gave up after manual playing with one fragment for an hour.  I believe the alignment method that I will use will be \"let someone else do it\".\n\nSo anyone wanting some upvotes for a kaggle dataset - you will get mine for sure if you generate a new IR image that's 'better' for all three fragments.\n\nAfter this play time it would seem that a source of model error that will be present is a result of both alignment and threshold cutoff for conversion from gray scale to the mask.  A single pixel change in the threshold will add or subtract some \"painted area' as there is a decent amount of partial ink present.",
    "2200536": "Note that the photoshop files that were used for the alignment are in the scrollprize.org/data dataset, so if anyone wants to run a different algorithm on those and see if that helps, feel free!",
    "2200644": "OK. Thanks!"
  },
  "source": "meta"
}