Overview of TextAttack attack components
masterTextAttack defines the adversarial attack process using four interchangeable components. This modular design allows for the reuse of components across different research papers and facilitates data augmentation:
- Goal Function: Defines what the attack is trying to achieve (e.g., maximizing loss or minimizing prediction probability).
- Constraints: Ensures the adversarial examples remain within certain bounds (e.g., semantic or visual similarity).
- Transformation: The actual modification applied to the input (e.g., character swaps, synonym replacement).
- Search Method: The algorithm used to find the best perturbation (e.g., greedy search, genetic algorithms).