advsecurenet.attacks.decision_based package
advsecurenet.attacks.decision_based.boundary module
- class advsecurenet.attacks.decision_based.boundary.DecisionBoundary(config: DecisionBoundaryAttackConfig)
Bases:
AdversarialAttack
Decision Boundary attack
Paper: https://arxiv.org/abs/1712.04248
- attack(model: BaseModel, x: Tensor, y: Tensor) Tensor
Generates adversarial examples using the Decision Boundary attack.
- Parameters:
model (BaseModel) – The model to attack.
x (torch.Tensor) – The original images to attack. Expected shape is (batch_size, channels, height, width).
y (torch.Tensor) – If the attack is untargeted, the true labels for the images. If the attack is targeted, the target labels for the images. Expected shape is (batch_size,).
- Returns:
The adversarial images.
- Return type:
torch.Tensor