Giter Club home page Giter Club logo

mbrs's People

Contributors

jzyustc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mbrs's Issues

About Dataset

Hi, I am wondering to know how you chose the training data and val data from Imagenet?

what(): NCCL Error 1: unhandled cuda error

I hope this message finds you well. I am writing to seek your assistance with an issue we encountered while attempting to replicate your project [Project Name]. We appreciate the work you've done and were eager to explore it further.

However, during the replication process, we faced a runtime error that halted our progress. The error message we received was as follows:
project_name = MBRS
with_diffusion = False
only_decoder = False
epoch_number = 101
batch_size = 4
train_continue = False
train_continue_path = /
train_continue_epoch = 0
dataset_path = datasets/
save_images_number = 4
H = 128
W = 128
message_length = 64
lr = 0.001
noise_layers = ['Combined([JpegMask(50),Jpeg(50),Identity()])']

0.001

Start training :

terminate called after throwing an instance of 'std::runtime_error'
what(): NCCL Error 1: unhandled cuda error
Aborted (core dumped)

We are currently using:
torch==1.5.0
torchvision==0.6.0
kornia==0.3.0
numpy==1.16.4
Pillow==6.0.0
scipy==1.3.0
, but unfortunately, we haven't been able to resolve the issue. We were wondering if you might have any insights or suggestions that could help us move forward.

unpack error

hi sorry to bother you i meet the problem ,can yo help me?

original_images, watermarked_images, noised_images = saved_all
TypeError: cannot unpack non-iterable NoneType object

The time of loading for the training data

Hello,Do datasets take long to load when you train models? What is the general training time?
I use the COCO2014 as the training datasets,it takes a long time to load.

The message length of the diffusion model

Thanks for your code.
The message length of the diffusion model is 30 bits, and 256 bits when fully connected. When I change the length to another value for testing, I get an error. If I want to increase the message length, e.g. to 128 or 256 bits, what should I do, do I need to retrain.

decode the message

sir,sorry to bother you ,if i want to know the message the model embed,what should i do

Training Error

save_images(saved_all, epoch, result_folder + "images/", resize_to=(W, H)) in train.py may occur error! since the param "saved_all" can be NONE !

run-time error

save_images_number = 4
H = 128
W = 128
message_length = 30
lr = 0.001
noise_layers = ['Combined([JpegMask(50),Jpeg(50),Identity()])']

0.001

Start training : 


Traceback (most recent call last):
  File "train.py", line 55, in <module>
    result = network.train(image, message) if not only_decoder else network.train_only_decoder(image, message)
  File "/home/admin/code/Watermarking/MBRS/network/Network.py", line 53, in train
    encoded_images, noised_images, decoded_messages = self.encoder_decoder(images, messages)
  File "/home/admin/miniconda3/envs/torch15_py37_ljz/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/admin/miniconda3/envs/torch15_py37_ljz/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 153, in forward
    return self.module(*inputs[0], **kwargs[0])
  File "/home/admin/miniconda3/envs/torch15_py37_ljz/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/admin/code/Watermarking/MBRS/network/Encoder_MP_Decoder.py", line 19, in forward
    encoded_image = self.encoder(image, message)
  File "/home/admin/miniconda3/envs/torch15_py37_ljz/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/admin/code/Watermarking/MBRS/network/Encoder_MP.py", line 39, in forward
    message_image = message.view(-1, 1, size, size)
RuntimeError: shape '[-1, 1, 5, 5]' is invalid for input of size 480

my train_settings.json

{
  "project_name": "MBRS",
  "with_diffusion": false,
  "only_decoder": false,
  "epoch_number": 101,
  "batch_size": 16,
  "train_continue": false,
  "train_continue_path": "/",
  "train_continue_epoch": 0,
  "dataset_path": "/home/admin/code/Watermarking/data/",
  "save_images_number": 4,
  "H": 128,
  "W": 128,
  "message_length": 30,
  "lr": 1e-3,
  "noise_layers": [
    "Combined([JpegMask(50),Jpeg(50),Identity()])"
  ]
}

my conda

torch==1.5.0
torchvision==0.6.0
kornia 0.3.0
cuda10.1
python3.7

The extraction of watermarks has a high error rate

Hello, thanks for the code, but I'm having a problem.
For a photo that has been watermarked with your model, I save the watermark in advance, and then put the image into the decoder to extract, I tested a hundred photos, but the error rate of each is 0.4~0.5,and I also set only_decoder=True,is it a problem with my code?
image
image

The calculation formula of PSNR

Why is the value of mav_val not 255 but 2.

psnr = kornia.losses.psnr_loss(encoded_images.detach(), images, 2)

Acctually, since the channel obtained using DataLoader is RGB, with a value range of 0-1, the calculation formula of PSNR should be

psnr = kornia.losses.psnr_loss(encoded_images.detach()*255, images*255, 255)

This error causes the calculation result of PSNR to be larger than the correct one.

BUG in SENet.py

在BasicBlock中,第二个“nn.Conv2d(in_channels=out_channels, out_channels=out_channels // r, kernel_size=1, bias=False)”里面in_channels应该为out_channels // r, out_channels = out_channels,这个chennel数量好像有误

水印图像视觉质量

你好,读了你的论文,受益匪浅,非常感谢!
我用你本仓库的代码训练模型时遇到一些疑惑,想咨询一下作者

  1. 水印图像能看到明显的改动痕迹
    (1) 论文中生成的水印图像的PSNR和SSIM值都比较高,我在重新训练模型时也验证了这一点(使用学习率衰减训练策略后的PSNR值比论文中还高),虽然PSNR和SSIM值都比较高,但是观察生成的水印图像,还是能明显的看出改动痕迹,有明显的亮点,如下图。
    img1
    img2

(2) 为保证模型泛化和迁移性,作者在图像输入网络前做了数据增强,to_tensor()归一化后,采用Normalize([0.5, 0.5, 0.5], [0.5, 0.5, 0.5])进行正则化,此处我修改为Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225],不知为何,用后者Normalize,生成的水印图像除了包含不规则的改动,还会包含规则的网格状的亮点(如下图),而前者Normalize只有一些不规则的改动。想问作者是否遇到这个问题。
img1
Lena

(3) 代码中计算PSNR和SSIM,是在模型输出的图像和数据增强后的图像之间计算的,这样说不上错,但是个人认为直接计算 原始图像和水印图像的PSNR和SSIM更好,毕竟模型输出的图张量 还需要 reverse normalize 才能转换为 水印图像。

  1. 误码率 error_rate
    (1) 论文中的误码率,由代码判断采用的似乎是平均误码率,即将计算每一个message的误码率,然后加和求平均值。个人认为若换一种计算方式:用提取水印错误的图像的数量 除以 总水印图像的数量,这样的计算方式更具有说明性。想问一下作者,水印论文中计算误码率采用的方式都是前者吗?

感谢!:)

An error in ssim?

There might be an error in train.py:
"TypeError: ssim() got an unexpected keyword argument 'reduction', (line 98, in train.py), ssim = 1 - 2 * kornia.losses.ssim(encoded_images.detach(), images, window_size=5, reduction="mean"). "
It seems that "ssim" should be "ssim_loss". Is it right?

Crop attack

hello
For the crop attack, I trained the model by setting the parameter(0.0225) according to the paper and test (0.035). But the effect was not as good as the result in the paper, it was even worse. Could u tell me the reason? thx

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.