[Paper Review] Stateful Detection of Model Extraction Attacks
This paper proposes VarDetect, a stateful anomaly detection system that monitors query distributions from users of Machine-Learning-as-a-Service (MLaaS) platforms to detect model extraction attacks. By leveraging a modified variational autoencoder (VAE) to model normal query distributions, VarDetect identifies malicious query patterns from three attacker types—synthetic, adversarial perturbation, and non-problem domain attackers—while remaining effective even against adaptive attackers with white-box knowledge, significantly degrading extracted model performance and transferability.
Machine-Learning-as-a-Service providers expose machine learning (ML) models through application programming interfaces (APIs) to developers. Recent work has shown that attackers can exploit these APIs to extract good approximations of such ML models, by querying them with samples of their choosing. We propose VarDetect, a stateful monitor that tracks the distribution of queries made by users of such a service, to detect model extraction attacks. Harnessing the latent distributions learned by a modified variational autoencoder, VarDetect robustly separates three types of attacker samples from benign samples, and successfully raises an alarm for each. Further, with VarDetect deployed as an automated defense mechanism, the extracted substitute models are found to exhibit poor performance and transferability, as intended. Finally, we demonstrate that even adaptive attackers with prior knowledge of the deployment of VarDetect, are detected by it.
Motivation & Objective
- To address the growing threat of model extraction attacks in Machine-Learning-as-a-Service (MLaaS) platforms, where attackers extract proprietary models via black-box API queries.
- To design a detection mechanism that does not require access to attacker data or model weights, enabling practical deployment in production environments.
- To ensure robust detection across diverse attacker strategies, including those using synthetic, adversarially perturbed, or out-of-domain inputs.
- To evaluate resilience against adaptive attackers who modify queries to evade detection, particularly those with white-box access to the detection system.
- To demonstrate that deploying VarDetect as a defense reduces the accuracy and transferability of extracted substitute models, thereby protecting model confidentiality and business models.
Proposed method
- VarDetect employs a modified variational autoencoder (VAE) to learn the latent distribution of legitimate user queries, modeling normal behavior per user.
- It continuously monitors the distribution of incoming queries using a stateful mechanism that tracks query sequences and computes the Maximum Mean Discrepancy (MMD) between observed and expected query distributions.
- The system uses MMD as a statistical divergence metric to detect deviations from normal query patterns, triggering alarms when the discrepancy exceeds a configurable threshold.
- The VAE is fine-tuned on a representative sample of benign queries to learn the underlying data manifold, enabling it to distinguish between normal and malicious query distributions.
- Detection thresholds are tunable, allowing security teams to balance sensitivity and false positives, with higher thresholds detecting only high-dilution or high-impact attacks.
- For adaptive attackers, VarDetect remains effective even when attackers use iterative FGSM-based perturbations to make malicious queries appear more like benign ones.
Experimental results
Research questions
- RQ1Can a stateful, query-distribution-based monitoring system detect all three major classes of model extraction attackers—synthetic, adversarial perturbation, and non-problem domain—without requiring access to attacker data?
- RQ2How effective is VarDetect in reducing the performance and transferability of extracted substitute models when deployed as a defense?
- RQ3Can VarDetect detect adaptive attackers who use white-box knowledge to craft queries that evade detection by mimicking normal behavior?
- RQ4What is the impact of query dilution (i.e., inserting benign queries between malicious ones) on detection effectiveness, and how does VarDetect respond to such evasion tactics?
- RQ5How does the system maintain detection robustness when attackers iteratively perturb queries using gradient-based methods to reduce MMD scores?
Key findings
- VarDetect successfully detects all three attacker types—synthetic, adversarial perturbation, and non-problem domain—across three image classification benchmarks: F-MNIST, GTSR, and SVHN.
- When VarDetect is deployed as a defense, the accuracy of extracted substitute models drops significantly: on F-MNIST, it falls from 78.74% (undefended) to 55.79% (defended) for the non-problem domain attacker.
- For the GTSR dataset, the accuracy of the extracted model drops from 94.56% (undefended) to 37.94% (defended) under the non-problem domain attacker, demonstrating strong performance degradation.
- Even with a dilution factor of 15%, VarDetect detects attackers with a threshold of δ = 0.25, while a 5% dilution is only detectable at lower thresholds, showing tunable sensitivity.
- Adaptive attackers using iterative FGSM to perturb queries fail to evade detection; their perturbed samples remain detectable at δ = 0.25, as confirmed by 3D PCA projections of latent vectors.
- The system remains effective against white-box attackers with full knowledge of the VAE encoder and statistical parameters (µC, σC), as no successful evasion was observed across multiple FGSM iterations and step sizes.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.