QQiuyp / FIN

This is the source code of paper FIN: Flow-based Robust Watermarking with Invertible Noise Layer for Black-box Distortions, which is received by AAAI' 23.
48 stars 5 forks source link

请问Dropout应该如何测量 #3

Open RenzhiHu111 opened 1 year ago

RenzhiHu111 commented 1 year ago

这是MBRS的 class Dropout(nn.Module):

def __init__(self, prob):
    super(Dropout, self).__init__()
    self.prob = prob

def forward(self, image_and_cover):
    image, cover_image = image_and_cover

    rdn = torch.rand(image.shape).to(image.device)
    output = torch.where(rdn > self.prob * 1., cover_image, image)
    return output

你的是改成下面这样吗 class Dropout(nn.Module):

def __init__(self, prob):
    super(Dropout, self).__init__()
    self.prob = prob

def forward(self, image):
    rdn = torch.rand(image.shape).to(image.device)
    output = torch.where(rdn > self.prob * 1., image, image)
    return output
RenzhiHu111 commented 1 year ago

还有用MBRS的组合噪声训练你的效果很差,而且只能用64bit的水印训练,所以论文里面都是单噪声训练的结果吗

QQiuyp commented 1 year ago

这是MBRS的 class Dropout(nn.Module):

def __init__(self, prob):
  super(Dropout, self).__init__()
  self.prob = prob

def forward(self, image_and_cover):
  image, cover_image = image_and_cover

  rdn = torch.rand(image.shape).to(image.device)
  output = torch.where(rdn > self.prob * 1., cover_image, image)
  return output

你的是改成下面这样吗 class Dropout(nn.Module):

def __init__(self, prob):
  super(Dropout, self).__init__()
  self.prob = prob

def forward(self, image):
  rdn = torch.rand(image.shape).to(image.device)
  output = torch.where(rdn > self.prob * 1., image, image)
  return output
  1. In Section 4.3 of our paper, we detail the settings for the White-box Distortions, which align with the configurations used in MBRS.
  2. Regarding your second method, I've observed some inconsistencies. It just returns the same image back.
QQiuyp commented 1 year ago

还有用MBRS的组合噪声训练你的效果很差,而且只能用64bit的水印训练,所以论文里面都是单噪声训练的结果吗

  1. Although the secret message length in the paper is 64 bits, the message length can be flexibly adjusted by adding a linear layer at the forefront, just as the diffusion block proposed in MBRS.

  2. In the paper, FIN was not tested under combined noise, but our recent research also verified the advantages of FIN under combined noise compared to MBRS. The poor results you observed might stem from incorrect training settings and the construction of the combined noise layer. Your training approach should follow the methods and settings in our paper more closely.

RenzhiHu111 commented 1 year ago

感谢您的回答,我训练用的组合噪声是Combined([JpegMask(50),Jpeg(10),Identity(),GF(2),Crop(0.15, 0.15)]),可能强度确实有点大。

RenzhiHu111 commented 1 year ago

After adding a linear layer at the beginning, the watermark cannot be extracted during the training process at all

QQiuyp commented 1 year ago

After adding a linear layer at the beginning, the watermark cannot be extracted during the training process at all

I have uploaded the updated model designed for various message lengths, and we tested it with a message length of 30 bits under JPEG compression. The results showed a PSNR of 47.14dB and an ACC of 99.54%. You can review the new model now. As for the issues you encountered, I cannot pinpoint the exact cause without access to your code.

QQiuyp commented 1 year ago

感谢您的回答,我训练用的组合噪声是Combined([JpegMask(50),Jpeg(10),Identity(),GF(2),Crop(0.15, 0.15)]),可能强度确实有点大。

Yes, the noise settings you've implemented are quite stringent. Especially under mixed noise and facing multiple such severe distortions, the model might struggle to converge initially. Even if it does converge, the final performance might not be satisfactory. Typically, the quantization values for JpegMask(50) and Jpeg(10) are set to be the same. My suggestion would be 50, as 10 is a rather rigorous setting.