Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crop attack #2

Open
SaltyFishhh opened this issue Oct 2, 2021 · 7 comments
Open

Crop attack #2

SaltyFishhh opened this issue Oct 2, 2021 · 7 comments

Comments

@SaltyFishhh
Copy link

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

@jzyustc
Copy link
Owner

jzyustc commented Oct 2, 2021

Hi, I don't know the exact settings of your training, so I will try to describe the details in my training.

I train the diffusion model with Combined noise layers, including Jpeg and Crop, as described in the paper. The message length is 30bits and after fully connection layer it's 256 dimension. The size of images is 128x128. Batch size is 16 and I use one NVIDIA 2080Ti to train. The logging file of training is uploaded in the /result folder, together with the pre-trained model.

The training is not stable so I apply early stopping by the validation result. In fact, the BER of validation varies from about 2% to 10%, and I use the best epoch for testing.

Wish these details can help you.

@jzyustc
Copy link
Owner

jzyustc commented Oct 3, 2021

Hi, to solve the instability of diffusion model training, I update the training process by adjusting the learning rate dynamically. You can find the detail in README. Wish it can help.

@jzyustc
Copy link
Owner

jzyustc commented Oct 3, 2021

This issue will keep open, because there might be better methods to solve the unstable problem. Glad to see more ideas.

@SaltyFishhh
Copy link
Author

嗨,我不知道你的训练的确切设置,所以我将尝试描述我训练中的细节。

我训练扩散模型与组合噪声层,包括Jpeg和作物,如本文所述。消息长度为 30 位,完全连接层后为 256 维度。图像的大小是 128x128。批量大小是 16, 我用一个 Nvidia 2080Ti 训练。培训记录文件与预先培训的模型一起上传到 /结果文件夹中。

培训不稳定,因此我申请提前停止验证结果。事实上,验证的 BER 从大约 2% 到 10% 不等,我使用最好的测试时代。

希望这些细节能帮助你。

Hi, I don't know the exact settings of your training, so I will try to describe the details in my training.

I train the diffusion model with Combined noise layers, including Jpeg and Crop, as described in the paper. The message length is 30bits and after fully connection layer it's 256 dimension. The size of images is 128x128. Batch size is 16 and I use one NVIDIA 2080Ti to train. The logging file of training is uploaded in the /result folder, together with the pre-trained model.

The training is not stable so I apply early stopping by the validation result. In fact, the BER of validation varies from about 2% to 10%, and I use the best epoch for testing.

Wish these details can help you.

I test the pre-trained model that you offered, and the result is same as the paper, but the model that i trained is not good. I don't know if the setting is identical to you, so you could tell me the accurate setting about training. Could you add the parameters into the results ?thx!!!

@jzyustc
Copy link
Owner

jzyustc commented Oct 5, 2021

Well, You can try our updated training method, and the setting of stage1 is like this :

{
  "project_name": "MBRS_Diffusion",
  "with_diffusion": true,
  "only_decoder": false,
  "epoch_number": 101,
  "batch_size": 16,
  "train_continue": false,
  "train_continue_path": "/",
  "train_continue_epoch": 0,
  "dataset_path": "YourDatasetPath/",
  "save_images_number": 4,
  "H": 128,
  "W": 128,
  "message_length": 30,
  "lr": 1e-3,
  "noise_layers": [
    "Combined([JpegMask(50),Jpeg(50),Identity(),Crop(0.15,0.15)])"
  ]
}

For the finetune stage, just set it as this:

{
  "project_name": "MBRS_Diffusion",
  "with_diffusion": true,
  "only_decoder": false,
  "epoch_number": 51,
  "batch_size": 16,
  "train_continue": true,
  "train_continue_path": "YourStage1Path/",
  "train_continue_epoch": your_epoch,
  "dataset_path": "YourDatasetPath/",
  "save_images_number": 4,
  "H": 128,
  "W": 128,
  "message_length": 30,
  "lr": 1e-4,
  "noise_layers": [
    "Combined([JpegMask(50),Jpeg(50),Identity(),Crop(0.15,0.15)])"
  ]
}

Good luck

@jzyustc
Copy link
Owner

jzyustc commented Oct 6, 2021

I have trained the model with combined noise layers that is consist of

{JpegTest(50),Jpeg(50),Identity(),Crop(0.15,0.15),GF(2),Cropout(p=0.3),Dropout(p=0.3)}. Is it same as to your combined noise layers?If not, what is the accurate combined noise layers?

Just look at my previous reply. I only use Crop and JPEG (real and simulated) to train, not with Cropout and Dropout, which is the same as what I describe in the paper.

And I have provided the train_settings.json file in the previous reply. Just try to use it.

And please notice that, 'JpegTest' is only used in testing because it use PIL to save .jpg image. For training, please use 'JpegMask' or 'JpegSS' for simulated JPEG, and use 'Jpeg' for real JPEG.

@jzyustc
Copy link
Owner

jzyustc commented Oct 6, 2021

Please be more careful of my reply and the paper, thanks

In previous reply :
image

In arxiv paper:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants