Summary
- CLIP과 같은 multimodal contrastive learning methods (MCL) 는 방대한 양의 data로부터 학습되어 여러 downstream task를 수행할 수 있는 foundation model로 작용

-
하지만 malicious attack에 취약함 = backdoor attacks
- 단점: malicious examples를 training data에 주입하여 test time에 특정 input에 대해 잘못된 예측을 수행함
- 장점: privacy/copyright protection에 있어 이점 + defense를 더 강화한다는 장점
-
backdoor attack은 backdoor defense 방법을 통해 충분히 방어 가능
- clean dataset으로 fine-tuning 하여 malicious effects를 제거
- pretrained MCL을 이용하여 encoder에 backdoor가 있는지 탐지
-
본 논문에서는, 위와 같은 defense 방법을 사용함에도 불구하고 여전히 효과적임을 보임
Method
Bayesian rule's analysis
Pre-training process
- Notation
- Initial model parameters distribution P(Θ)
- pre-trining dataset D0
P(Θ∣D0)∝P(D0∣Θ)P(Θ)
Poisoning process
- Notation
- pre-trained model Θ(0)
- poisoning training set D1: clean dataset에 약간의 perturbation을 추가한 것
- clean set: vi
- poisioned set: v^i=vi+δv
P(Θ(0)∣D1)∝P(D1∣Θ(0))P(Θ(0))
- 이때 backdoor를 주입한다는 것은 결국 pre-trained model을 poisoned dataset으로 fine-tuning 하는 것
Θ(1)=Θ(0)+ϵargmin−i=1∑N1log∑j=1N1g({vi(1),ti(1)};Θ(0)+ϵ)g({vi(1),ti(1)};Θ(0)+ϵ)
Defense process
- User/defender들은 third-party poisoned model Θ(1)을 사용
- Notation
- clean dataset D2
P(Θ(0)∣D2,D1)∝P(D2∣Θ(0),D1)(P(D1∣Θ(0))P(Θ(0)))
- 원래의 pre-trianed model과 clean dataset을 이용하여 fine-tuning 한 model은 서로 비슷해야함
- 즉, P(Θ(0)∣D2,D1)∼P(Θ(0))
- 이를 이용하여 위의 수식을 다시 작성해보면,
P(Θ(0))∝P(D2∣Θ(0),D1)(P(D1∣Θ(0))P(Θ(0)))
Motivation
Poisoned model parameters Θ(1)과 clean model parameter Θ(0)의 차이는 매우 작아야함
P(Θ(0)∣D1)∝P(D1∣Θ(0))P(Θ(0))
- 위의 수식을 볼 때, 기존 model parameter와 차이가 많이 나면 안됨
Poisoned dataset은 clean dataset과 매우 비슷해야함
P(Θ(0))∝P(D2∣Θ(0),D1)(P(D1∣Θ(0))P(Θ(0)))
- 위의 수식에서 D2과 D1 서로 반대의 의미를 내포하고 있기 때문에 D2를 이용하여 backdoor의 영향을 줄일 수 있는 것
BadCLIP Attack Design
Textual embedding consistency Optimization
Lt=−i=1∑N1log∑j=1N1g({v^i(1),tj(1)};Θ(0))g({v^i(1),Ti∗};Θ(0))
Visual embedding consistency Optimization
- backdoor forgetting을 방지하기 위해 D2와 D1 간의 충돌을 막아야 함 (매우 비슷해야 함)
- 하지만! D2는 attacker가 접근 불가
- 중요한 사실: D2는 original training dataset D0을 반영하고 있어야 함 (매우 비슷)
- 왜? model usability를 보존하고 clean performance를 보존하고 있어야 하고 있기 때문
- 즉, D1은 D0과 비슷해야 함
Lip=i=1∑N1d(fv(v^i(1);θv(0));fv(Ii∗;θv(0)))
- 이때 trigger가 담긴 sample이 anchor sample 이므로 해당 이미지가 다른 이미지와도 구별되도록 negative sample과의 connection도 추가
Lin=i=1∑N1d(fv(v^i(1);θv(0));fv(vi(1);θv(0)))
Overall Poisoning Process
Trigger pattern optimization
- patch-based visual trigger pattern δv∈Rw×h×c
- Total loss
L=Lt+λ1×max(0,Lip+λ2×Lin+η)
Experiments
Setup
-
Models & dataset
- CLIP model 사용
- CC3M dataset으로부터 500K의 image-text pairs 선택
- 1500개의 sample은 target label인 banana로 poisoning
-
Evaluation
- Clean Accuracy (CA)
- Attack success rate (ASR)
-
Backdoor attack
- 흔히 쓰이는 7개의 method
- unimodal: BadNet, Bleded, SIG, SSBA
- multimodel: TrojanVQA (visual question & answering)
- SSL: mmPosion, BadEncoder
-
Backdoor defense
- DECREE: backdoor detection on pre-trained encoders
- FT: fine-tuning with clean dataset
- CleanCLIP: CLIP에 특화된 defense method
-
Implementation Details
- λ1 = 500
- λ2 = 1
- η = 1
Results
Effectiveness of attacks


- DECREE defense 에서의 attack mehtod 비교
- BadCLIP: Clean Encoder의 양상과 값을 가장 일관적으로 가지고 있는 method
Attacks on the Linear Probe Task
- CLIP이 downstream task에서 사용된다는 상황에서 evaluation
- 50K의 dataset을 ImageNet로부터 random sampling
- 일종의 fine-tuning defense 방법이라고도 볼 수 있지만, feature extractor를 freeze 시키고 linear layer만 학습한다는 점에서 차이가 있음 (fine-tuning defense의 특이 케이스)

- CA는 대부분의 method가 64%에 머무는 것을 확인
- ASR 측면에서는 BadCLIP이 가장 좋은 성능을 보임
Attacks on More rigorous senarios

- Fine-tuning poisoned model on cross-domain data
: defender가 poisoned dataset의 domain/distribution을 알고 있음 + 다른 domain/distribution의 clean dataset으로 fine-tuning 했을 때
- Dataset
- poisoned dataset: CC3M subset
- CleanCLIP defense: SBU caption subset
- Result
- ASR이 많이 떨어지는 다른 attack method에 비해 BadCLIP은 robust한 편

Analysis

- Ablation study
- Poisoned Pairs Sampling Strategy (PPS) 와 최종 loss term을 함께 썼을 때 가장 높은 성능의 결과를 보여줌

-
Triger patch size
- Patch size가 커지면 커질수록 ASR도 높아지지만, 16 X 16 이후에는 유사
- 16 X 16 을 default size로 설정
-
Poisoned sample numbers
- 1500개의 sample에서 peak를 찍고 내려옴
- 1500개를 default numbers로 설정