1.1.1. aijack.attack.backdoor package#
1.1.1.1. Submodules#
1.1.1.2. aijack.attack.backdoor.dba module#
- class aijack.attack.backdoor.dba.DistributedBackdoorAttackClientManager(*args, **kwargs)[source]#
Bases:
aijack.manager.base.BaseManager
Manager class for DistributedBackdoorAttack proposed in https://openreview.net/forum?id=rkgyS0VFvr.
- aijack.attack.backdoor.dba.attach_dba_to_client(cls, decomposed_trigger_rules, target_label, poison_ratio, scale)[source]#
Wraps the given class in DistributedBackdoorAttackClientWrapper.
- Parameters
cls – Server class
decomposed_trigger_rules ([function]) – list of functions that define the decomposed trigger rules for each client
target_label (int) – a label that the attacker want to make the victim model predict when the inupt contains the trigger
poison_ratio (float) – a ratio of poisoned samples
scale (_type_) – scale for the uploaded gradients
- Returns
a class wrapped in DistributedBackdoorAttackClientWrapper
- Return type
cls
1.1.1.3. aijack.attack.backdoor.modelreplacement module#
- class aijack.attack.backdoor.modelreplacement.ModelReplacementAttackClientManager(*args, **kwargs)[source]#
Bases:
aijack.manager.base.BaseManager
Manager class for DistributedBackdoorAttack proposed in https://proceedings.mlr.press/v108/bagdasaryan20a/bagdasaryan20a.pdf.
- aijack.attack.backdoor.modelreplacement.attach_modelreplacement_to_client(cls, alpha, gamma, criterion_anomaly_detection=<function l2norm_checker>, reference_dataloader=None, eps=1e-06)[source]#
Wraps the given class in ModelReplacementAttackClientWrapper.
- Parameters
cls – Client class
- Returns
a class wrapped in ModelReplacementAttackClientWrapper
- Return type
cls