ApX logoApX logo
ModelsCalculatorHardwareCoursesPricing
ApX logoApX logo
ModelsCalculatorHardwareCoursesPricing

All Courses

Advanced Adversarial Machine Learning
Chapter 1: Foundations of Adversarial ML Security
Review of Machine Learning Security Vulnerabilities
Threat Models in Machine Learning
Attack Surfaces: Training vs. Inference
Mathematical Formulation of Adversarial Examples
Taxonomy of Adversarial Attacks
Overview of Defense Strategies
Chapter 2: Advanced Evasion Attacks
Gradient-Based Attacks: FGSM, BIM, PGD Analysis
Optimization-Based Attacks: Carlini & Wagner Methods
Score-Based Attack Techniques
Decision-Based Attack Techniques
Transferability of Adversarial Examples
Attacking Ensemble Models
Implementing Evasion Attacks: Hands-on Practical
Chapter 3: Data Poisoning and Backdoor Attacks
Poisoning Attack Strategies: Availability vs Integrity
Targeted Data Poisoning Techniques
Backdoor Attack Mechanisms and Trigger Design
Clean-Label Poisoning Attacks
Analyzing Poisoning Impact on Model Training
Crafting Data Poisoning Attacks: Hands-on Practical
Chapter 4: Model Inference and Privacy Attacks
Membership Inference Attacks: Theory and Methods
Attribute Inference Techniques
Model Inversion and Reconstruction Attacks
Model Stealing: Functionality Extraction Methods
Relationship to Differential Privacy
Implementing Membership Inference: Hands-on Practical
Chapter 5: Robust Defense Mechanisms
Adversarial Training: Principles and Variations
Certified Defenses: Randomized Smoothing
Input Transformation Defenses
Gradient Masking and Obfuscation Issues
Defending Against Poisoning and Backdoors
Implementing Adversarial Training: Hands-on Practical
Chapter 6: Evaluating Model Robustness
Metrics for Adversarial Robustness
Benchmarking Tools and Frameworks
Adaptive Attacks: Evaluating Defenses Properly
Security Evaluations under Different Threat Models
Interpreting Robustness Evaluation Results
Setting up Robustness Benchmarks: Hands-on Practical
Chapter 7: Adversarial Examples in Specific Domains
Adversarial Attacks on Computer Vision Models
Generating Adversarial Text for NLP Models
Attacks on Reinforcement Learning Agents
Physical Adversarial Attacks
Domain-Specific Attack Considerations
Generating Adversarial Text: Practice

Attack Surfaces: Training vs. Inference

Understanding the security posture of a machine learning system requires analyzing when and how an attacker can interact with it. The lifecycle of an ML model is typically divided into two main phases: training and inference. Each phase presents distinct opportunities and constraints for an adversary, defining different attack surfaces.

Training Phase Attack Surface

The training phase is where the model learns patterns and relationships from a dataset. The primary goal is to optimize model parameters to minimize a loss function over the training data. Attacks during this phase aim to compromise the learning process itself, ultimately affecting the integrity or availability of the final trained model.

Attacker Goals During Training:

  • Model Degradation (Availability Attack): Reduce the model's overall performance on legitimate inputs.
  • Targeted Misbehavior (Integrity Attack): Cause the model to misclassify specific inputs or exhibit biased behavior.
  • Backdoor Insertion: Embed hidden malicious functionality within the model, activated by specific triggers presented during inference.

Attacker Capabilities:

The attacker's ability to influence the training process dictates the feasibility of these attacks. Common scenarios include:

  • Data Manipulation: The most studied vector involves modifying the training dataset. This could mean injecting malicious samples (data poisoning) or subtly altering existing ones.
  • Algorithm Manipulation: If the attacker has control over the learning algorithm (e.g., influencing hyperparameters, loss function, or optimization procedure), they can directly steer the model towards a compromised state. This is less common in typical deployment scenarios but possible in federated learning or MLaaS platforms if improperly secured.
  • Infrastructure Control: Compromising the underlying training infrastructure (hardware, software environment) grants extensive control but falls more into traditional cybersecurity domains.

Examples of Training-Phase Attacks:

  • Data Poisoning: Involves injecting carefully crafted malicious data points into the training set. These points can be designed to shift decision boundaries, reduce overall accuracy, or create targeted vulnerabilities. For instance, an attacker might add mislabeled images to degrade a classifier or introduce subtle artifacts designed to cause misclassification for specific inputs later on.
  • Backdoor (Trojan) Attacks: A more insidious form of poisoning where the injected data trains the model to respond normally to typical inputs but behave maliciously (e.g., misclassify) when a specific, attacker-defined trigger pattern is present in the input. This trigger could be a small patch in an image, a specific phrase in text, etc. The model appears functional during standard validation but contains a hidden vulnerability.

Attacks during training fundamentally alter the learned parameters θ\thetaθ of the model fθ(x)f_\theta(x)fθ​(x). The resulting model is intrinsically flawed, even before it encounters any potentially malicious inputs during inference.

The machine learning lifecycle involves distinct training and inference phases, each presenting unique attack surfaces. Training phase attacks (red) target the learning process, while inference phase attacks (blue) exploit the deployed model.

Inference Phase Attack Surface

The inference (or testing/deployment) phase is when the trained model is used to make predictions on new, previously unseen data. Attacks during this phase assume the model parameters θ\thetaθ are fixed and aim to exploit the deployed model fθ(x)f_\theta(x)fθ​(x) without modifying it directly.

Attacker Goals During Inference:

  • Evasion: Craft malicious inputs (adversarial examples) x′x'x′ that are similar to legitimate inputs xxx (e.g., small LpL_pLp​ distance, ∣∣x′−x∣∣p≤ϵ||x' - x||_p \leq \epsilon∣∣x′−x∣∣p​≤ϵ) but cause the model to produce incorrect outputs fθ(x′)≠fθ(x)f_\theta(x') \neq f_\theta(x)fθ​(x′)=fθ​(x).
  • Model Stealing (Extraction): Replicate the functionality of a black-box model by querying it and observing input-output pairs, effectively creating a surrogate model.
  • Information Extraction (Inference Attacks): Infer sensitive information about the training data or model properties by interacting with the model. Examples include Membership Inference (determining if a specific data point was used in training) and Attribute Inference (determining sensitive attributes of training data).

Attacker Capabilities:

  • Input Manipulation: The attacker can modify the inputs fed to the model. The degree of modification is often constrained (e.g., by LpL_pLp​ norms) to maintain resemblance to legitimate data or ensure perceptual similarity.
  • Query Access: The attacker can query the model with chosen inputs and observe the outputs. Access might be black-box (only input-output pairs available), gray-box (outputs include confidence scores), or white-box (full access to model architecture and parameters).
  • Observation: The attacker observes the model's predictions, potentially including confidence scores or other metadata.

Examples of Inference-Phase Attacks:

  • Evasion Attacks (Adversarial Examples): These are the most widely studied inference-time attacks. Techniques like the Fast Gradient Sign Method (FGSM), Projected Gradient Descent (PGD), and Carlini & Wagner (C&W) attacks compute small perturbations to inputs designed to cause misclassification. These attacks often rely on gradient information (white-box) but can also be performed with black-box access using transferability or query-based methods.
  • Membership Inference Attacks: By observing model outputs (e.g., confidence scores) for specific data points, an attacker attempts to determine if those points were part of the model's training set. This raises privacy concerns, especially for models trained on sensitive data.
  • Model Stealing: An attacker queries a target model (often an API) with diverse inputs and uses the responses to train their own copy of the model. This can undermine the intellectual property invested in the original model.

Inference-phase attacks target the application of the model, exploiting its learned decision boundaries or leaking information through its predictions. The model itself remains unchanged during these attacks.

Contrasting the Surfaces

The distinction between training and inference attack surfaces is significant for understanding and mitigating threats:

  • Impact: Training attacks compromise the model's integrity from the outset. Inference attacks compromise the reliability or confidentiality of its predictions for specific inputs or queries.
  • Timing: Training attacks occur before deployment, while inference attacks occur post-deployment.
  • Attacker Interaction: Training attacks often require influencing the data supply chain or training process. Inference attacks typically involve interacting with the deployed model endpoint.
  • Defenses: Defenses are often phase-specific. Data sanitization and training procedures (like adversarial training) primarily address training-phase threats. Input validation, gradient masking, and differential privacy are more relevant for inference-phase threats.

Understanding which surface an attacker is likely to target, based on their goals and capabilities within a given threat model, is essential for designing appropriate security measures for your machine learning systems. The following chapters will explore the specific techniques used to execute attacks within each of these phases in greater detail.

  • Poisoning Attacks against Support Vector Machines, Battista Biggio, Blaine Nelson, and Pavel Laskov, 2012 Proceedings of the 29th International Conference on Machine Learning (ICML) (Omnipress) DOI: arXiv:1206.6389 - This paper introduces early data poisoning attacks targeting support vector machines, demonstrating how an attacker can manipulate training data to degrade model performance.
  • Towards Deep Learning Models Resistant to Adversarial Attacks, Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu, 2018 International Conference on Learning Representations (ICLR) DOI: 10.48550/arXiv.1706.06083 - This paper presents Projected Gradient Descent (PGD) as a strong adversarial attack and a robust adversarial training method to improve model resilience.
  • Membership Inference Attacks Against Machine Learning Models, Reza Shokri, Marco Stronati, Congzheng Song, and Vitaly Shmatikov, 2017 IEEE Symposium on Security and Privacy (S&P) (IEEE) DOI: 10.1109/SP.2017.37 - This paper demonstrates a practical membership inference attack, allowing an attacker to determine if a data point was part of a model's training set.

© 2026 ApX Machine Learning