{
  "id": 164319,
  "title": "Ideas for augmentation, network design, etc",
  "url": "/competitions/alaska2-image-steganalysis/discussion/164319",
  "author_name": "",
  "post_date": "2020-07-05T17:51:38.265599500Z",
  "votes": 22,
  "comment_count": 20,
  "views": 0,
  "content": "<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2F5a57fb7bab78469843ba11ddd8b0ebce%2FSelection_181.png?generation=1593971392222457&amp;alt=media\" alt=\"\"></p>\n\n<p>domain knowledge (i.e. probability of DCT change in steganography, distortion cost) will help. If not, any random small change should help i think.  I think the simplest could be just flipping from +1 to -1 and vice versa since most steganography use same distortion cost for +ve and -ve change</p>",
  "messages": [
    {
      "id": "916506",
      "postDate": "07/05/2020 17:51:38",
      "content": "<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2F5a57fb7bab78469843ba11ddd8b0ebce%2FSelection_181.png?generation=1593971392222457&amp;alt=media\" alt=\"\"></p>\n\n<p>domain knowledge (i.e. probability of DCT change in steganography, distortion cost) will help. If not, any random small change should help i think.  I think the simplest could be just flipping from +1 to -1 and vice versa since most steganography use same distortion cost for +ve and -ve change</p>",
      "rawMarkdown": "![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2F5a57fb7bab78469843ba11ddd8b0ebce%2FSelection_181.png?generation=1593971392222457&amp;alt=media)\n\n\ndomain knowledge (i.e. probability of DCT change in steganography, distortion cost) will help. If not, any random small change should help i think.  I think the simplest could be just flipping from +1 to -1 and vice versa since most steganography use same distortion cost for +ve and -ve change",
      "votes": null
    },
    {
      "id": "916745",
      "postDate": "07/06/2020 01:46:31",
      "content": "<p>using channel selection\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2F174adb31da5762559a7a37ea9cd75c3b%2FSelection_187.png?generation=1593999988435412&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "using channel selection\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2F174adb31da5762559a7a37ea9cd75c3b%2FSelection_187.png?generation=1593999988435412&amp;alt=media)",
      "votes": null
    },
    {
      "id": "916746",
      "postDate": "07/06/2020 01:47:27",
      "content": "<p>use pretrained model for DCT?</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2Fd9caebcac72f036d8b34a9592aa9b39f%2FSelection_188.png?generation=1594000044851089&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "use pretrained model for DCT?\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2Fd9caebcac72f036d8b34a9592aa9b39f%2FSelection_188.png?generation=1594000044851089&amp;alt=media)",
      "votes": null
    },
    {
      "id": "916749",
      "postDate": "07/06/2020 02:02:45",
      "content": "<p>learning the distortion function or embedding cost???</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2Ffca357f0278efe010094e2740c99acbd%2FSelection_191.png?generation=1594000962388992&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "learning the distortion function or embedding cost???\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2Ffca357f0278efe010094e2740c99acbd%2FSelection_191.png?generation=1594000962388992&amp;alt=media)",
      "votes": null
    },
    {
      "id": "916934",
      "postDate": "07/06/2020 06:11:42",
      "content": "<p>Did you manage to get improvement from using the DCT coefficient ? </p>",
      "rawMarkdown": "Did you manage to get improvement from using the DCT coefficient ?",
      "votes": null
    },
    {
      "id": "920436",
      "postDate": "07/08/2020 15:42:19",
      "content": "<p><a href=\"/hengck23\">@hengck23</a>: how to produce those dct (3x64x64x64) &amp; q table (2x8x8) records? Is it based on this idea? <a href=\"https://www.kaggle.com/remicogranne/inspect-impact-of-steganography-on-dct-coefs\">https://www.kaggle.com/remicogranne/inspect-impact-of-steganography-on-dct-coefs</a></p>",
      "rawMarkdown": "hengck23: how to produce those dct (3x64x64x64) &amp; q table (2x8x8) records? Is it based on this idea? https://www.kaggle.com/remicogranne/inspect-impact-of-steganography-on-dct-coefs",
      "votes": null
    },
    {
      "id": "920442",
      "postDate": "07/08/2020 15:47:04",
      "content": "<p>yes, here is some code:</p>\n\n<p>```</p>\n\n<p>class IDCT(nn.Module):\n    def <strong>init</strong>(self):\n        super(IDCT, self).<strong>init</strong>()</p>\n\n<pre><code>    #---\n    #def make_cosine_maxtrix():\n    [c, r] = np.meshgrid(range(8), range(8))\n    cosine = 0.5 * np.cos(np.pi * (2 * c + 1) * r / (2 * 8))\n    cosine[0, :] = cosine[0, :] / np.sqrt(2)\n\n    cosine2 = []\n    for i in range(64):\n        z = np.zeros((8,8))\n        z[i//8,i%8]=1\n        c = cosine.T@z@cosine\n        #image_show_norm('c',m,resize=32)\n        #cv2.waitKey(0)\n        cosine2.append(c)\n    cosine2 = np.stack(cosine2).reshape(64,64)\n\n    #---\n    self.cosine2 = nn.Parameter(torch.from_numpy(cosine2).float())\n    self.bias = nn.Parameter(torch.FloatTensor([128,0,0]))\n    self.transform = nn.Parameter(torch.from_numpy(np.array([\n            [1,        0, 1.402   ],\n            [1,-0.344136,-0.714136],\n            [1, 1.772,           0],\n    ]).T)).float()\n\ndef forward(self, dct, quant):\n    dct = schuffle_yx_to_c(dct)\n    quant = quant.reshape(-1,1,1,3,8*8)\n\n    x = (dct * quant) @ self.cosine2 #torch.Size([8, 64, 64, 3, 64])\n    x = schuffle_c_to_yx(x) + self.bias\n    x = x @ self.transform\n    x = x.permute(0,3,1,2).contiguous()\n    return x\n</code></pre>\n\n<p>```</p>",
      "rawMarkdown": "yes, here is some code:\n\n\n```\n\n\nclass IDCT(nn.Module):\n    def __init__(self):\n        super(IDCT, self).__init__()\n\n        #---\n        #def make_cosine_maxtrix():\n        [c, r] = np.meshgrid(range(8), range(8))\n        cosine = 0.5 * np.cos(np.pi * (2 * c + 1) * r / (2 * 8))\n        cosine[0, :] = cosine[0, :] / np.sqrt(2)\n\n        cosine2 = []\n        for i in range(64):\n            z = np.zeros((8,8))\n            z[i//8,i%8]=1\n            c = cosine.T@z@cosine\n            #image_show_norm('c',m,resize=32)\n            #cv2.waitKey(0)\n            cosine2.append(c)\n        cosine2 = np.stack(cosine2).reshape(64,64)\n\n        #---\n        self.cosine2 = nn.Parameter(torch.from_numpy(cosine2).float())\n        self.bias = nn.Parameter(torch.FloatTensor([128,0,0]))\n        self.transform = nn.Parameter(torch.from_numpy(np.array([\n                [1,        0, 1.402   ],\n                [1,-0.344136,-0.714136],\n                [1, 1.772,           0],\n        ]).T)).float()\n\n    def forward(self, dct, quant):\n        dct = schuffle_yx_to_c(dct)\n        quant = quant.reshape(-1,1,1,3,8*8)\n\n        x = (dct * quant) @ self.cosine2 #torch.Size([8, 64, 64, 3, 64])\n        x = schuffle_c_to_yx(x) + self.bias\n        x = x @ self.transform\n        x = x.permute(0,3,1,2).contiguous()\n        return x\n\n\n```",
      "votes": null
    },
    {
      "id": "920451",
      "postDate": "07/08/2020 15:52:08",
      "content": "",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "920460",
      "postDate": "07/08/2020 15:58:56",
      "content": "<p>I've not found any public description, consumable by a stego-lay person, to create these 'embedding change probability maps'. They'd be highly useful! Maybe just some texture segmentation would work.</p>",
      "rawMarkdown": "I've not found any public description, consumable by a stego-lay person, to create these 'embedding change probability maps'. They'd be highly useful! Maybe just some texture segmentation would work.",
      "votes": null
    },
    {
      "id": "920465",
      "postDate": "07/08/2020 16:04:11",
      "content": "<p>not sure why the my posting get reformatted and becomes unreadable ... i attach the code snippets instead for the dct decode layer in pytorch</p>",
      "rawMarkdown": "not sure why the my posting get reformatted and becomes unreadable ... i attach the code snippets instead for the dct decode layer in pytorch",
      "votes": null
    },
    {
      "id": "920960",
      "postDate": "07/09/2020 01:32:32",
      "content": "<p><a href=\"/hengck23\">@hengck23</a>: thank you very much!</p>",
      "rawMarkdown": "hengck23: thank you very much!",
      "votes": null
    },
    {
      "id": "920961",
      "postDate": "07/09/2020 01:36:37",
      "content": "<p>flip image =  flip dct sign ... see code attached. Good for rotation and flip augmentation</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2Fbf76e1ad28b97d7a0f42b2c181d4e7a4%2FSelection_221.png?generation=1594258587077643&amp;alt=media\" alt=\"\"></p>\n\n<p>if you you want to do a mapping of DCT change, you can either work out the maths or:\n1.  make a 8x8 DCT cofficient array. \n2.  set one of the DCT to 1\n3.  inverse DCT to get the 8x8 image\n4. compute DCT of the  8x8 image. this will show how one DCT coefficient affects another.</p>\n\n<p>Or simply create image of the 8x8=64 basis DCT images and try to match between them</p>",
      "rawMarkdown": "flip image =  flip dct sign ... see code attached. Good for rotation and flip augmentation\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2Fbf76e1ad28b97d7a0f42b2c181d4e7a4%2FSelection_221.png?generation=1594258587077643&amp;alt=media)\n\n\nif you you want to do a mapping of DCT change, you can either work out the maths or:\n1.  make a 8x8 DCT cofficient array. \n2.  set one of the DCT to 1\n3.  inverse DCT to get the 8x8 image\n4. compute DCT of the  8x8 image. this will show how one DCT coefficient affects another.\n\nOr simply create image of the 8x8=64 basis DCT images and try to match between them",
      "votes": null
    },
    {
      "id": "920962",
      "postDate": "07/09/2020 01:37:18",
      "content": "<p>how about to treat this problem as classification/segmentation wherein in DCT coefficient acted as a mask?</p>",
      "rawMarkdown": "how about to treat this problem as classification/segmentation wherein in DCT coefficient acted as a mask?",
      "votes": null
    },
    {
      "id": "920994",
      "postDate": "07/09/2020 02:10:49",
      "content": "<p>it would be interesting to do basic experiments like this. </p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2F74d073d65923fac47846738b48d73da2%2FSelection_226.png?generation=1594260747771601&amp;alt=media\" alt=\"\"></p>\n\n<p>if so, classifier output can be used as \"additional features\" for this challenge</p>",
      "rawMarkdown": "it would be interesting to do basic experiments like this. \n\n ![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2F74d073d65923fac47846738b48d73da2%2FSelection_226.png?generation=1594260747771601&amp;alt=media)\n\nif so, classifier output can be used as \"additional features\" for this challenge",
      "votes": null
    },
    {
      "id": "923868",
      "postDate": "07/11/2020 06:50:23",
      "content": "<p>jpeg features:\n<a href=\"http://dde.binghamton.edu/download/feature_extractors/\">http://dde.binghamton.edu/download/feature_extractors/</a></p>\n\n<p>JPEG-Phase-Aware Convolutional Neural Network for Steganalysis of JPEG Images\nRandom Projections of Residuals for Digital Image Steganalysis\nSteganalysis of JPEG images using rich models</p>",
      "rawMarkdown": "jpeg features:\nhttp://dde.binghamton.edu/download/feature_extractors/\n\nJPEG-Phase-Aware Convolutional Neural Network for Steganalysis of JPEG Images\nRandom Projections of Residuals for Digital Image Steganalysis\nSteganalysis of JPEG images using rich models",
      "votes": null
    },
    {
      "id": "924453",
      "postDate": "07/11/2020 12:36:35",
      "content": "<p>i wonder if this can work: </p>\n\n<p>\"Our method, PatchVAE, constrains the encoder architecture to only learn patches that are repetitive and consistent in images as opposed to learning everything, and therefore results in representations that perform much better for recognition tasks compared to vanilla VAEs.\"</p>\n\n<p><a href=\"https://arxiv.org/pdf/2004.03623.pdf\">https://arxiv.org/pdf/2004.03623.pdf</a></p>",
      "rawMarkdown": "i wonder if this can work: \n\n\"Our method, PatchVAE, constrains the encoder architecture to only learn patches that are repetitive and consistent in images as opposed to learning everything, and therefore results in representations that perform much better for recognition tasks compared to vanilla VAEs.\"\n\nhttps://arxiv.org/pdf/2004.03623.pdf",
      "votes": null
    },
    {
      "id": "924848",
      "postDate": "07/11/2020 16:53:58",
      "content": "<p>one observation is that one can train 64-classifier ... each is a weak classifier to say if each of the 64 DCT coefficient mode has been changed or not</p>",
      "rawMarkdown": "one observation is that one can train 64-classifier ... each is a weak classifier to say if each of the 64 DCT coefficient mode has been changed or not",
      "votes": null
    },
    {
      "id": "927452",
      "postDate": "07/13/2020 11:51:09",
      "content": "<p>can neighbors help?\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2F68dc994edf12c51a192fe02b0f88ee87%2FSelection_031.png?generation=1594641060808356&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "can neighbors help?\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2F68dc994edf12c51a192fe02b0f88ee87%2FSelection_031.png?generation=1594641060808356&amp;alt=media)",
      "votes": null
    },
    {
      "id": "927835",
      "postDate": "07/13/2020 15:47:16",
      "content": "<p>Isn't this more or less exactly what CNN is doing in the embedding space of the penultimate layer?</p>",
      "rawMarkdown": "Isn't this more or less exactly what CNN is doing in the embedding space of the penultimate layer?",
      "votes": null
    },
    {
      "id": "928414",
      "postDate": "07/14/2020 00:59:28",
      "content": "<p>viewing projection of results</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2F23843dd58e13fc55e3b59ddd09e8d4a1%2FSelection_041.png?generation=1594688474317772&amp;alt=media\" alt=\"\"></p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2F2b73145dcbfd27728fa0cd8979947cb2%2FSelection_042.png?generation=1594688472340099&amp;alt=media\" alt=\"\"></p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2F64e3fdd67b97ff18f053e420d6961a3a%2FSelection_046.png?generation=1594688468255387&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "viewing projection of results\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2F23843dd58e13fc55e3b59ddd09e8d4a1%2FSelection_041.png?generation=1594688474317772&amp;alt=media)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2F2b73145dcbfd27728fa0cd8979947cb2%2FSelection_042.png?generation=1594688472340099&amp;alt=media)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2F64e3fdd67b97ff18f053e420d6961a3a%2FSelection_046.png?generation=1594688468255387&amp;alt=media)",
      "votes": null
    },
    {
      "id": "933119",
      "postDate": "07/17/2020 14:00:33",
      "content": "<p>interesting paper:\n\"Detection based Defense against Adversarial Examples from the Steganalysis Point of View\"\n<a href=\"https://openaccess.thecvf.com/content_CVPR_2019/papers/Liu_Detection_Based_Defense_Against_Adversarial_Examples_From_the_Steganalysis_Point_CVPR_2019_paper.pdf\">https://openaccess.thecvf.com/content_CVPR_2019/papers/Liu_Detection_Based_Defense_Against_Adversarial_Examples_From_the_Steganalysis_Point_CVPR_2019_paper.pdf</a></p>",
      "rawMarkdown": "interesting paper:\n\"Detection based Defense against Adversarial Examples from the Steganalysis Point of View\"\nhttps://openaccess.thecvf.com/content_CVPR_2019/papers/Liu_Detection_Based_Defense_Against_Adversarial_Examples_From_the_Steganalysis_Point_CVPR_2019_paper.pdf",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 916745,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "07/06/2020 01:46:31",
      "content": "<p>using channel selection\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2F174adb31da5762559a7a37ea9cd75c3b%2FSelection_187.png?generation=1593999988435412&amp;alt=media\" alt=\"\"></p>",
      "votes": null,
      "replies": [
        {
          "id": 920460,
          "author_name": "robga",
          "author_url": "",
          "post_date": "07/08/2020 15:58:56",
          "content": "<p>I've not found any public description, consumable by a stego-lay person, to create these 'embedding change probability maps'. They'd be highly useful! Maybe just some texture segmentation would work.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 916746,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "07/06/2020 01:47:27",
      "content": "<p>use pretrained model for DCT?</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2Fd9caebcac72f036d8b34a9592aa9b39f%2FSelection_188.png?generation=1594000044851089&amp;alt=media\" alt=\"\"></p>",
      "votes": null,
      "replies": [
        {
          "id": 920436,
          "author_name": "projdev",
          "author_url": "",
          "post_date": "07/08/2020 15:42:19",
          "content": "<p><a href=\"/hengck23\">@hengck23</a>: how to produce those dct (3x64x64x64) &amp; q table (2x8x8) records? Is it based on this idea? <a href=\"https://www.kaggle.com/remicogranne/inspect-impact-of-steganography-on-dct-coefs\">https://www.kaggle.com/remicogranne/inspect-impact-of-steganography-on-dct-coefs</a></p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 920442,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "07/08/2020 15:47:04",
          "content": "<p>yes, here is some code:</p>\n\n<p>```</p>\n\n<p>class IDCT(nn.Module):\n    def <strong>init</strong>(self):\n        super(IDCT, self).<strong>init</strong>()</p>\n\n<pre><code>    #---\n    #def make_cosine_maxtrix():\n    [c, r] = np.meshgrid(range(8), range(8))\n    cosine = 0.5 * np.cos(np.pi * (2 * c + 1) * r / (2 * 8))\n    cosine[0, :] = cosine[0, :] / np.sqrt(2)\n\n    cosine2 = []\n    for i in range(64):\n        z = np.zeros((8,8))\n        z[i//8,i%8]=1\n        c = cosine.T@z@cosine\n        #image_show_norm('c',m,resize=32)\n        #cv2.waitKey(0)\n        cosine2.append(c)\n    cosine2 = np.stack(cosine2).reshape(64,64)\n\n    #---\n    self.cosine2 = nn.Parameter(torch.from_numpy(cosine2).float())\n    self.bias = nn.Parameter(torch.FloatTensor([128,0,0]))\n    self.transform = nn.Parameter(torch.from_numpy(np.array([\n            [1,        0, 1.402   ],\n            [1,-0.344136,-0.714136],\n            [1, 1.772,           0],\n    ]).T)).float()\n\ndef forward(self, dct, quant):\n    dct = schuffle_yx_to_c(dct)\n    quant = quant.reshape(-1,1,1,3,8*8)\n\n    x = (dct * quant) @ self.cosine2 #torch.Size([8, 64, 64, 3, 64])\n    x = schuffle_c_to_yx(x) + self.bias\n    x = x @ self.transform\n    x = x.permute(0,3,1,2).contiguous()\n    return x\n</code></pre>\n\n<p>```</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 920451,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "07/08/2020 15:52:08",
          "content": "",
          "votes": null,
          "replies": []
        },
        {
          "id": 920960,
          "author_name": "projdev",
          "author_url": "",
          "post_date": "07/09/2020 01:32:32",
          "content": "<p><a href=\"/hengck23\">@hengck23</a>: thank you very much!</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 916749,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "07/06/2020 02:02:45",
      "content": "<p>learning the distortion function or embedding cost???</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2Ffca357f0278efe010094e2740c99acbd%2FSelection_191.png?generation=1594000962388992&amp;alt=media\" alt=\"\"></p>",
      "votes": null,
      "replies": [
        {
          "id": 920962,
          "author_name": "projdev",
          "author_url": "",
          "post_date": "07/09/2020 01:37:18",
          "content": "<p>how about to treat this problem as classification/segmentation wherein in DCT coefficient acted as a mask?</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 916934,
      "author_name": "nyleve",
      "author_url": "",
      "post_date": "07/06/2020 06:11:42",
      "content": "<p>Did you manage to get improvement from using the DCT coefficient ? </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 920465,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "07/08/2020 16:04:11",
      "content": "<p>not sure why the my posting get reformatted and becomes unreadable ... i attach the code snippets instead for the dct decode layer in pytorch</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 920961,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "07/09/2020 01:36:37",
      "content": "<p>flip image =  flip dct sign ... see code attached. Good for rotation and flip augmentation</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2Fbf76e1ad28b97d7a0f42b2c181d4e7a4%2FSelection_221.png?generation=1594258587077643&amp;alt=media\" alt=\"\"></p>\n\n<p>if you you want to do a mapping of DCT change, you can either work out the maths or:\n1.  make a 8x8 DCT cofficient array. \n2.  set one of the DCT to 1\n3.  inverse DCT to get the 8x8 image\n4. compute DCT of the  8x8 image. this will show how one DCT coefficient affects another.</p>\n\n<p>Or simply create image of the 8x8=64 basis DCT images and try to match between them</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 920994,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "07/09/2020 02:10:49",
      "content": "<p>it would be interesting to do basic experiments like this. </p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2F74d073d65923fac47846738b48d73da2%2FSelection_226.png?generation=1594260747771601&amp;alt=media\" alt=\"\"></p>\n\n<p>if so, classifier output can be used as \"additional features\" for this challenge</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 923868,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "07/11/2020 06:50:23",
      "content": "<p>jpeg features:\n<a href=\"http://dde.binghamton.edu/download/feature_extractors/\">http://dde.binghamton.edu/download/feature_extractors/</a></p>\n\n<p>JPEG-Phase-Aware Convolutional Neural Network for Steganalysis of JPEG Images\nRandom Projections of Residuals for Digital Image Steganalysis\nSteganalysis of JPEG images using rich models</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 924453,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "07/11/2020 12:36:35",
      "content": "<p>i wonder if this can work: </p>\n\n<p>\"Our method, PatchVAE, constrains the encoder architecture to only learn patches that are repetitive and consistent in images as opposed to learning everything, and therefore results in representations that perform much better for recognition tasks compared to vanilla VAEs.\"</p>\n\n<p><a href=\"https://arxiv.org/pdf/2004.03623.pdf\">https://arxiv.org/pdf/2004.03623.pdf</a></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 924848,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "07/11/2020 16:53:58",
      "content": "<p>one observation is that one can train 64-classifier ... each is a weak classifier to say if each of the 64 DCT coefficient mode has been changed or not</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 927452,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "07/13/2020 11:51:09",
      "content": "<p>can neighbors help?\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2F68dc994edf12c51a192fe02b0f88ee87%2FSelection_031.png?generation=1594641060808356&amp;alt=media\" alt=\"\"></p>",
      "votes": null,
      "replies": [
        {
          "id": 927835,
          "author_name": "authman",
          "author_url": "",
          "post_date": "07/13/2020 15:47:16",
          "content": "<p>Isn't this more or less exactly what CNN is doing in the embedding space of the penultimate layer?</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 928414,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "07/14/2020 00:59:28",
      "content": "<p>viewing projection of results</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2F23843dd58e13fc55e3b59ddd09e8d4a1%2FSelection_041.png?generation=1594688474317772&amp;alt=media\" alt=\"\"></p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2F2b73145dcbfd27728fa0cd8979947cb2%2FSelection_042.png?generation=1594688472340099&amp;alt=media\" alt=\"\"></p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2F64e3fdd67b97ff18f053e420d6961a3a%2FSelection_046.png?generation=1594688468255387&amp;alt=media\" alt=\"\"></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 933119,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "07/17/2020 14:00:33",
      "content": "<p>interesting paper:\n\"Detection based Defense against Adversarial Examples from the Steganalysis Point of View\"\n<a href=\"https://openaccess.thecvf.com/content_CVPR_2019/papers/Liu_Detection_Based_Defense_Against_Adversarial_Examples_From_the_Steganalysis_Point_CVPR_2019_paper.pdf\">https://openaccess.thecvf.com/content_CVPR_2019/papers/Liu_Detection_Based_Defense_Against_Adversarial_Examples_From_the_Steganalysis_Point_CVPR_2019_paper.pdf</a></p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "916506": "![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2F5a57fb7bab78469843ba11ddd8b0ebce%2FSelection_181.png?generation=1593971392222457&amp;alt=media)\n\n\ndomain knowledge (i.e. probability of DCT change in steganography, distortion cost) will help. If not, any random small change should help i think.  I think the simplest could be just flipping from +1 to -1 and vice versa since most steganography use same distortion cost for +ve and -ve change",
    "916745": "using channel selection\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2F174adb31da5762559a7a37ea9cd75c3b%2FSelection_187.png?generation=1593999988435412&amp;alt=media)",
    "916746": "use pretrained model for DCT?\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2Fd9caebcac72f036d8b34a9592aa9b39f%2FSelection_188.png?generation=1594000044851089&amp;alt=media)",
    "916749": "learning the distortion function or embedding cost???\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2Ffca357f0278efe010094e2740c99acbd%2FSelection_191.png?generation=1594000962388992&amp;alt=media)",
    "916934": "Did you manage to get improvement from using the DCT coefficient ?",
    "920436": "hengck23: how to produce those dct (3x64x64x64) &amp; q table (2x8x8) records? Is it based on this idea? https://www.kaggle.com/remicogranne/inspect-impact-of-steganography-on-dct-coefs",
    "920442": "yes, here is some code:\n\n\n```\n\n\nclass IDCT(nn.Module):\n    def __init__(self):\n        super(IDCT, self).__init__()\n\n        #---\n        #def make_cosine_maxtrix():\n        [c, r] = np.meshgrid(range(8), range(8))\n        cosine = 0.5 * np.cos(np.pi * (2 * c + 1) * r / (2 * 8))\n        cosine[0, :] = cosine[0, :] / np.sqrt(2)\n\n        cosine2 = []\n        for i in range(64):\n            z = np.zeros((8,8))\n            z[i//8,i%8]=1\n            c = cosine.T@z@cosine\n            #image_show_norm('c',m,resize=32)\n            #cv2.waitKey(0)\n            cosine2.append(c)\n        cosine2 = np.stack(cosine2).reshape(64,64)\n\n        #---\n        self.cosine2 = nn.Parameter(torch.from_numpy(cosine2).float())\n        self.bias = nn.Parameter(torch.FloatTensor([128,0,0]))\n        self.transform = nn.Parameter(torch.from_numpy(np.array([\n                [1,        0, 1.402   ],\n                [1,-0.344136,-0.714136],\n                [1, 1.772,           0],\n        ]).T)).float()\n\n    def forward(self, dct, quant):\n        dct = schuffle_yx_to_c(dct)\n        quant = quant.reshape(-1,1,1,3,8*8)\n\n        x = (dct * quant) @ self.cosine2 #torch.Size([8, 64, 64, 3, 64])\n        x = schuffle_c_to_yx(x) + self.bias\n        x = x @ self.transform\n        x = x.permute(0,3,1,2).contiguous()\n        return x\n\n\n```",
    "920451": "",
    "920460": "I've not found any public description, consumable by a stego-lay person, to create these 'embedding change probability maps'. They'd be highly useful! Maybe just some texture segmentation would work.",
    "920465": "not sure why the my posting get reformatted and becomes unreadable ... i attach the code snippets instead for the dct decode layer in pytorch",
    "920960": "hengck23: thank you very much!",
    "920961": "flip image =  flip dct sign ... see code attached. Good for rotation and flip augmentation\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2Fbf76e1ad28b97d7a0f42b2c181d4e7a4%2FSelection_221.png?generation=1594258587077643&amp;alt=media)\n\n\nif you you want to do a mapping of DCT change, you can either work out the maths or:\n1.  make a 8x8 DCT cofficient array. \n2.  set one of the DCT to 1\n3.  inverse DCT to get the 8x8 image\n4. compute DCT of the  8x8 image. this will show how one DCT coefficient affects another.\n\nOr simply create image of the 8x8=64 basis DCT images and try to match between them",
    "920962": "how about to treat this problem as classification/segmentation wherein in DCT coefficient acted as a mask?",
    "920994": "it would be interesting to do basic experiments like this. \n\n ![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2F74d073d65923fac47846738b48d73da2%2FSelection_226.png?generation=1594260747771601&amp;alt=media)\n\nif so, classifier output can be used as \"additional features\" for this challenge",
    "923868": "jpeg features:\nhttp://dde.binghamton.edu/download/feature_extractors/\n\nJPEG-Phase-Aware Convolutional Neural Network for Steganalysis of JPEG Images\nRandom Projections of Residuals for Digital Image Steganalysis\nSteganalysis of JPEG images using rich models",
    "924453": "i wonder if this can work: \n\n\"Our method, PatchVAE, constrains the encoder architecture to only learn patches that are repetitive and consistent in images as opposed to learning everything, and therefore results in representations that perform much better for recognition tasks compared to vanilla VAEs.\"\n\nhttps://arxiv.org/pdf/2004.03623.pdf",
    "924848": "one observation is that one can train 64-classifier ... each is a weak classifier to say if each of the 64 DCT coefficient mode has been changed or not",
    "927452": "can neighbors help?\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2F68dc994edf12c51a192fe02b0f88ee87%2FSelection_031.png?generation=1594641060808356&amp;alt=media)",
    "927835": "Isn't this more or less exactly what CNN is doing in the embedding space of the penultimate layer?",
    "928414": "viewing projection of results\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2F23843dd58e13fc55e3b59ddd09e8d4a1%2FSelection_041.png?generation=1594688474317772&amp;alt=media)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2F2b73145dcbfd27728fa0cd8979947cb2%2FSelection_042.png?generation=1594688472340099&amp;alt=media)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F113660%2F64e3fdd67b97ff18f053e420d6961a3a%2FSelection_046.png?generation=1594688468255387&amp;alt=media)",
    "933119": "interesting paper:\n\"Detection based Defense against Adversarial Examples from the Steganalysis Point of View\"\nhttps://openaccess.thecvf.com/content_CVPR_2019/papers/Liu_Detection_Based_Defense_Against_Adversarial_Examples_From_the_Steganalysis_Point_CVPR_2019_paper.pdf"
  },
  "source": "meta"
}