ain-soph / trojanzoo

TrojanZoo provides a universal pytorch platform to conduct security researches (especially backdoor attacks/defenses) of image classification in deep learning.

Home Page:https://ain-soph.github.io/trojanzoo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

STRIP implementation doesn't match original codebase

kshitijsachan opened this issue · comments

Your STRIP defense implementation seems reasonable (linearly mix benign and test inputs), but this is different from the official implementation from the STRIP repo, where they just add both images on top of each other. Not sure if this was intentional or not.

Trojanzoo implementation:

test_input = self.strip_alpha * (_input - benign_input) + benign_input

original STRIP implementation:

def superimpose(background, overlay):
  added_image = cv2.addWeighted(background,1,overlay,1,0)
  return (added_image.reshape(32,32,3))

According to opencv documents, I don't see any difference between the 2 implementations.