注意及流程
发布时间:2026/10/24 2:00:07 锦皓数字建站

开始新开终端可以检查echo $OMP_NUM_THREADSexport OMP_NUM_THREADS16 export MKL_NUM_THREADS16 echo $OMP_NUM_THREADS echo $MKL_NUM_THREADSexport HF_ENDPOINThttps://hf-mirror.com跑黑白盒aab.py调用过aa_test脚本对抗样本保存在同一个目录里面就是MI....的已经被覆盖了Before Attack不需要对抗样本目录 |跨数据集1. Mark → Duke 的 Before Attackpython test.py --name ft_ResNet50 --use_data duke --test_dir /root/autodl-tmp/data/duke/pytorch2. Duke → Mark 的 Before Attackpython test.py --name ft_ResNet50 --use_data Market-1501 --test_dir /root/autodl-tmp/data/Market-1501/pytorch3. Mark → MSMT 和 Duke → MSMT 的 Before Attackpython test.py --name ft_ResNet50 --use_data MSMT17_V1 --test_dir /root/autodl-tmp/data/MSMT17_V1/pytorchbefore attack看target模型 | 跨数据集跨模型(target)De-121python test.py --name ft_net_dense --use_dense --use_data duke --test_dir /root/autodl-tmp/data/duke/pytorchpython test.py --name ft_net_dense --use_dense --use_data Market-1501 --test_dir /root/autodl-tmp/data/Market-1501/pytorchpython test.py --name ft_net_dense --use_dense --use_data MSMT17_V1 --test_dir /root/autodl-tmp/data/MSMT17_V1/pytorch(target)Hr-18python test.py --name ft_net_hr --use_hr --use_data duke --test_dir /root/autodl-tmp/data/duke/pytorchpython test.py --name ft_net_hr --use_hr --use_data Market-1501 --test_dir /root/autodl-tmp/data/Market-1501/pytorchpython test.py --name ft_net_hr --use_hr --use_data MSMT17_V1 --test_dir /root/autodl-tmp/data/MSMT17_V1/pytorch跨数据集跨模型注意特征攻击odfa,lta,gaga去掉分类头再跑crossdata.pycrossdata.py换掉aa_test.py里面的cece.py可以使用aaaacross.py调用这个过程生成对抗、跑黑白盒详细改crossdata、改bai、hei测试里的相关使用的数据集名字看另一个博客文章。防御攻击a_defence_test.pya_defence.py defence.py其实应该先跑这个因为对抗样本被覆盖了运行a_gen.py分两批生成res-50的对抗样本改cece.py的分类头去然后使用a_defence_test.py直接调用运行各个方法的攻击防御模型即可。集成攻击具体攻击方法改adv_data_test.py / adv_data_black_test.py里面的数据集相关的路径然后jicheng.py要更根据是不是分类或者特征攻击的方法修改--feature所以最后分两步用aab.py调用aa_test.py里面的函数进行完成。before attackBefore attack不需要生成对抗样本也不管你是不是集成攻击。它就是干净 query 干净 gallery 正常测试每个 target 模型的 Rank-1 / mAP所以这行只用test.py跑正常测试。比如 Market 上这张表python test.py --name ft_ResNet50 --use_data Market-1501 --test_dir /root/autodl-tmp/data/Market-1501/pytorch解释得到Re-50*的 Before attack。python test.py --name ft_net_dense --use_dense --use_data Market-1501 --test_dir /root/autodl-tmp/data/Market-1501/pytorch解释得到De-121*的 Before attack。python test.py --name ft_net_hr --use_hr --use_data Market-1501 --test_dir /root/autodl-tmp/data/Market-1501/pytorch解释得到Hr-18*的 Before attack。python test.py --name ft_net_convnext --use_convnext --use_data Market-1501 --test_dir /root/autodl-tmp/data/Market-1501/pytorch解释得到Conv的 Before attack。python test.py --name ft_net_swin --use_swin --use_data Market-1501 --test_dir /root/autodl-tmp/data/Market-1501/pytorch解释得到Swin的 Before attack。python test.py --name ft_net_swinv2 --use_swinv2 --use_data Market-1501 --test_dir /root/autodl-tmp/data/Market-1501/pytorch解释得到Swinv2的 Before attack。
锦
锦皓数字建站
深耕本土企业品牌数字化升级,专注原创端正雅致商务官网,从视觉设计到稳定运维全程保驾护航。