{
  "id": 641008,
  "title": "Using Segment Anything (SAM2) Masks to Generate Forgery Candidates",
  "url": "/competitions/recodai-luc-scientific-image-forgery-detection/discussion/641008",
  "author_name": "",
  "post_date": "2025-11-26T12:55:29.753619300Z",
  "votes": 3,
  "comment_count": 7,
  "views": 0,
  "content": "<p>The key challenge in digital forgery detection is efficiently identifying potential candidate regions. I'm proposing a novel approach: using the <strong>Segment Anything Model (SAM) to generate high-confidence, object-level forgery candidates</strong> based on the idea that most attacks involve manipulating distinct objects.</p>\n<p>This strategy uses SAM's segmentation power to drastically narrow the search space for a final detection model.</p>\n<h2>Resources for Discussion &amp; Collaboration</h2>\n<p>To start the discussion and modeling, I've shared the following:</p>\n<ol>\n<li><p><strong>EDA + Visualization Kernel:</strong></p>\n<ul>\n<li><strong>Link:</strong> <a href=\"https://www.kaggle.com/code/jirkaborovec/forgery-eda-visual-annot-sam2-instances\" target=\"_blank\">https://www.kaggle.com/code/jirkaborovec/forgery-eda-visual-annot-sam2-instances</a></li>\n<li><em>What it shows:</em> Visualization of SAM-generated masks and their overlap with ground truth forged regions.</li></ul></li>\n<li><p><strong>Generated Dataset (Images + Masks):</strong></p>\n<ul>\n<li><strong>Link:</strong> <a href=\"https://www.kaggle.com/datasets/jirkaborovec/forgery-segment-sam2-npz\" target=\"_blank\">https://www.kaggle.com/datasets/jirkaborovec/forgery-segment-sam2-npz</a></li>\n<li><em>What it is:</em> The full dataset of images and corresponding SAM2 segmented masks (<code>.npz</code> format).</li></ul></li>\n<li><p><strong>SAM Generation Kernel:</strong></p>\n<ul>\n<li><strong>Link:</strong> <a href=\"https://www.kaggle.com/code/jirkaborovec/forgery-using-sam2-for-candidate-generation\" target=\"_blank\">https://www.kaggle.com/code/jirkaborovec/forgery-using-sam2-for-candidate-generation</a></li>\n<li><em>What it does:</em> The kernel used to generate the mask dataset.</li></ul></li>\n</ol>\n<p>Let's discuss and optimize this approach for powerful detection!</p>",
  "messages": [
    {
      "id": "3349109",
      "postDate": "11/26/2025 12:55:29",
      "content": "<p>The key challenge in digital forgery detection is efficiently identifying potential candidate regions. I'm proposing a novel approach: using the <strong>Segment Anything Model (SAM) to generate high-confidence, object-level forgery candidates</strong> based on the idea that most attacks involve manipulating distinct objects.</p>\n<p>This strategy uses SAM's segmentation power to drastically narrow the search space for a final detection model.</p>\n<h2>Resources for Discussion &amp; Collaboration</h2>\n<p>To start the discussion and modeling, I've shared the following:</p>\n<ol>\n<li><p><strong>EDA + Visualization Kernel:</strong></p>\n<ul>\n<li><strong>Link:</strong> <a href=\"https://www.kaggle.com/code/jirkaborovec/forgery-eda-visual-annot-sam2-instances\" target=\"_blank\">https://www.kaggle.com/code/jirkaborovec/forgery-eda-visual-annot-sam2-instances</a></li>\n<li><em>What it shows:</em> Visualization of SAM-generated masks and their overlap with ground truth forged regions.</li></ul></li>\n<li><p><strong>Generated Dataset (Images + Masks):</strong></p>\n<ul>\n<li><strong>Link:</strong> <a href=\"https://www.kaggle.com/datasets/jirkaborovec/forgery-segment-sam2-npz\" target=\"_blank\">https://www.kaggle.com/datasets/jirkaborovec/forgery-segment-sam2-npz</a></li>\n<li><em>What it is:</em> The full dataset of images and corresponding SAM2 segmented masks (<code>.npz</code> format).</li></ul></li>\n<li><p><strong>SAM Generation Kernel:</strong></p>\n<ul>\n<li><strong>Link:</strong> <a href=\"https://www.kaggle.com/code/jirkaborovec/forgery-using-sam2-for-candidate-generation\" target=\"_blank\">https://www.kaggle.com/code/jirkaborovec/forgery-using-sam2-for-candidate-generation</a></li>\n<li><em>What it does:</em> The kernel used to generate the mask dataset.</li></ul></li>\n</ol>\n<p>Let's discuss and optimize this approach for powerful detection!</p>",
      "rawMarkdown": "The key challenge in digital forgery detection is efficiently identifying potential candidate regions. I'm proposing a novel approach: using the **Segment Anything Model (SAM) to generate high-confidence, object-level forgery candidates** based on the idea that most attacks involve manipulating distinct objects.\n\nThis strategy uses SAM's segmentation power to drastically narrow the search space for a final detection model.\n\n## Resources for Discussion & Collaboration\n\nTo start the discussion and modeling, I've shared the following:\n\n1. **EDA + Visualization Kernel:**\n   * **Link:** <https://www.kaggle.com/code/jirkaborovec/forgery-eda-visual-annot-sam2-instances>\n   * *What it shows:* Visualization of SAM-generated masks and their overlap with ground truth forged regions.\n\n2. **Generated Dataset (Images + Masks):**\n   * **Link:** <https://www.kaggle.com/datasets/jirkaborovec/forgery-segment-sam2-npz>\n   * *What it is:* The full dataset of images and corresponding SAM2 segmented masks (`.npz` format).\n\n3. **SAM Generation Kernel:**\n   * **Link:** <https://www.kaggle.com/code/jirkaborovec/forgery-using-sam2-for-candidate-generation>\n   * *What it does:* The kernel used to generate the mask dataset.\n\nLet's discuss and optimize this approach for powerful detection!",
      "votes": null
    },
    {
      "id": "3351678",
      "postDate": "11/28/2025 15:12:49",
      "content": "<p>I took this approach a couple weeks ago but was not able to beat the default all “authentic” submission. It may be worth revisiting with Segment Anything 3 which just released</p>",
      "rawMarkdown": "I took this approach a couple weeks ago but was not able to beat the default all “authentic” submission. It may be worth revisiting with Segment Anything 3 which just released",
      "votes": null
    },
    {
      "id": "3351731",
      "postDate": "11/28/2025 15:43:27",
      "content": "<p>so you think that the candidates are weak? Also, how did it perform on the validation set?</p>",
      "rawMarkdown": "so you think that the candidates are weak? Also, how did it perform on the validation set?",
      "votes": null
    },
    {
      "id": "3352026",
      "postDate": "11/28/2025 20:17:16",
      "content": "<p>validation F1 score of 0.29</p>",
      "rawMarkdown": "validation F1 score of 0.29",
      "votes": null
    },
    {
      "id": "3380894",
      "postDate": "12/23/2025 09:41:11",
      "content": "<p>The problem is many copy-moves involve replacing objects with the background to hide them, so it won't work. You need something that generates copy-move candidates including Background Patches + a refining step to get pixel-perfect boundaries </p>",
      "rawMarkdown": "The problem is many copy-moves involve replacing objects with the background to hide them, so it won't work. You need something that generates copy-move candidates including Background Patches + a refining step to get pixel-perfect boundaries",
      "votes": null
    },
    {
      "id": "3380899",
      "postDate": "12/23/2025 10:08:56",
      "content": "<p>That is a good call, I think a good initial version would be just identify copied foreground objects.. </p>",
      "rawMarkdown": "That is a good call, I think a good initial version would be just identify copied foreground objects..",
      "votes": null
    },
    {
      "id": "3380908",
      "postDate": "12/23/2025 10:41:50",
      "content": "<p>Yes, you can try using object detector from the recodai discord, they used it to make this forgery dataset automatically</p>",
      "rawMarkdown": "Yes, you can try using object detector from the recodai discord, they used it to make this forgery dataset automatically",
      "votes": null
    },
    {
      "id": "3380920",
      "postDate": "12/23/2025 11:10:04",
      "content": "<p>Yes I know…</p>",
      "rawMarkdown": "Yes I know...",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 3351678,
      "author_name": "returnofsputnik",
      "author_url": "",
      "post_date": "11/28/2025 15:12:49",
      "content": "<p>I took this approach a couple weeks ago but was not able to beat the default all “authentic” submission. It may be worth revisiting with Segment Anything 3 which just released</p>",
      "votes": null,
      "replies": [
        {
          "id": 3351731,
          "author_name": "jirkaborovec",
          "author_url": "",
          "post_date": "11/28/2025 15:43:27",
          "content": "<p>so you think that the candidates are weak? Also, how did it perform on the validation set?</p>",
          "votes": null,
          "replies": [
            {
              "id": 3352026,
              "author_name": "returnofsputnik",
              "author_url": "",
              "post_date": "11/28/2025 20:17:16",
              "content": "<p>validation F1 score of 0.29</p>",
              "votes": null,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 3380894,
      "author_name": "theodorlu",
      "author_url": "",
      "post_date": "12/23/2025 09:41:11",
      "content": "<p>The problem is many copy-moves involve replacing objects with the background to hide them, so it won't work. You need something that generates copy-move candidates including Background Patches + a refining step to get pixel-perfect boundaries </p>",
      "votes": null,
      "replies": [
        {
          "id": 3380899,
          "author_name": "jirkaborovec",
          "author_url": "",
          "post_date": "12/23/2025 10:08:56",
          "content": "<p>That is a good call, I think a good initial version would be just identify copied foreground objects.. </p>",
          "votes": null,
          "replies": [
            {
              "id": 3380908,
              "author_name": "theodorlu",
              "author_url": "",
              "post_date": "12/23/2025 10:41:50",
              "content": "<p>Yes, you can try using object detector from the recodai discord, they used it to make this forgery dataset automatically</p>",
              "votes": null,
              "replies": [
                {
                  "id": 3380920,
                  "author_name": "jirkaborovec",
                  "author_url": "",
                  "post_date": "12/23/2025 11:10:04",
                  "content": "<p>Yes I know…</p>",
                  "votes": null,
                  "replies": []
                }
              ]
            }
          ]
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "3349109": "The key challenge in digital forgery detection is efficiently identifying potential candidate regions. I'm proposing a novel approach: using the **Segment Anything Model (SAM) to generate high-confidence, object-level forgery candidates** based on the idea that most attacks involve manipulating distinct objects.\n\nThis strategy uses SAM's segmentation power to drastically narrow the search space for a final detection model.\n\n## Resources for Discussion & Collaboration\n\nTo start the discussion and modeling, I've shared the following:\n\n1. **EDA + Visualization Kernel:**\n   * **Link:** <https://www.kaggle.com/code/jirkaborovec/forgery-eda-visual-annot-sam2-instances>\n   * *What it shows:* Visualization of SAM-generated masks and their overlap with ground truth forged regions.\n\n2. **Generated Dataset (Images + Masks):**\n   * **Link:** <https://www.kaggle.com/datasets/jirkaborovec/forgery-segment-sam2-npz>\n   * *What it is:* The full dataset of images and corresponding SAM2 segmented masks (`.npz` format).\n\n3. **SAM Generation Kernel:**\n   * **Link:** <https://www.kaggle.com/code/jirkaborovec/forgery-using-sam2-for-candidate-generation>\n   * *What it does:* The kernel used to generate the mask dataset.\n\nLet's discuss and optimize this approach for powerful detection!",
    "3351678": "I took this approach a couple weeks ago but was not able to beat the default all “authentic” submission. It may be worth revisiting with Segment Anything 3 which just released",
    "3351731": "so you think that the candidates are weak? Also, how did it perform on the validation set?",
    "3352026": "validation F1 score of 0.29",
    "3380894": "The problem is many copy-moves involve replacing objects with the background to hide them, so it won't work. You need something that generates copy-move candidates including Background Patches + a refining step to get pixel-perfect boundaries",
    "3380899": "That is a good call, I think a good initial version would be just identify copied foreground objects..",
    "3380908": "Yes, you can try using object detector from the recodai discord, they used it to make this forgery dataset automatically",
    "3380920": "Yes I know..."
  },
  "source": "meta"
}