VinAIResearch / Warping-based_Backdoor_Attack-release

WaNet - Imperceptible Warping-based Backdoor Attack (ICLR 2021)
GNU Affero General Public License v3.0
112 stars 17 forks source link

About cross-ratio and input_cross in the code #12

Closed Hibb-bb closed 2 years ago

Hibb-bb commented 2 years ago

Hi, thank you for the great work! I was trying to understand the functions in train.py, I was wondering what is the purpose of input_cross and the meaning of cross-ratio? It looks like images have been applied to different warping functions, Is the difference between input_cross and input_bd equal to "attack" and "noise" mode in the paper? Thanks again!

anhttran commented 2 years ago

Thanks for your question.

"cross" actually corresponds the "noise" mode in the paper, while "bd" (backdoor) corresponds to the "attack" mode. For each data batch (inputs), we split it into 3 parts: one for the attack mode (input_bd), one for the noise mode (input_cross), and the rest for the clean mode. The "cross_ratio" defines to the ratio of "noise" mode data over "attack" data.

I hope this clarification helps. Best regards, Anh

Hibb-bb commented 2 years ago

Yes, the clarification helps! Thank you very much for the response.