<jupyter_start><jupyter_text>DescriptionIn this notebook we run an optimized whitebox attack with regularization to remove the watermark.<jupyter_code>surr_model, all_history = usenix_whitebox(
     load_dataset_func=load_cifar_images,
     dataset_label="CIFAR",
     load_wm_model_func=get_deep_cnn_for_cifar,
     owner_data_size=25000,
     total_owner_data_size=100000,
     key_length=35,
     wm_boost_factor=100,
     attacker_data_size=25000,
     total_attacker_data_size=100000,
     attacker_data_size_reg=5000,
     epochs_embed=20,
     epochs_reg=30,
     epochs_surr=20,
     freeze_first_layers=0,
     patience_reg=3,
     early_stopping_wm_reg=0.2,  
     lr_surr=0.001,  
     reg_whitebox=0.005,
     reg_surr=0,
     batchsize_reg=64,
     batchsize_surr=64,
     cache_embed_wm="usenix_cifar",
     cache_reg_model=None,
     cache_surr_model=None,
     verbose=True
)
plot_whitebox(all_history, blackbox_surr_val_acc=0.803)
for history in all_history:
    print(sum(history.history["time"])/60)
blackbox_surr_val_acc=0.798
ctr =0
for time, acc in zip(all_history[2].history["time"], all_history[2].history["val_acc"]):
    if acc > blackbox_surr_val_acc:
        print("Time: {}, Acc: {}".format(sum(all_history[1].history["time"])/60+sum(all_history[2].history["time"][:ctr+1])/60, acc))
        break
    ctr += 1<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11176040905770636, 'fraction_numerical': 0.0547845142439737, 'mean_word_length': 4.591836734693878, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '346363', 'license': 'MIT', 'n_tokens_mistral': 569, 'n_tokens_neox': 527, 'n_words': 68, 'path': 'notebooks/backdoor_watermark/CIFAR-10/usenix_whitebox_cifar.ipynb', 'repo_name': 'CodeSubmission642/WatermarkRobustness', 'size': '1369'}