Improving Adversarial Robustness in Android Malware Detection by Reducing the Impact of Spurious Correlations

Hamid Bostani, Zhengyu Zhao, Veelasha Moonsamy

Introduction

Machine Learning (ML) has become a cornerstone of Android Malware Detection (AMD), yet these models often suffer from a fundamental flaw: they are prone to learning "spurious correlations." These are statistical shortcuts within a dataset—such as specific app store tags or non-essential API calls—that happen to correlate with malware labels in the training set but do not represent actual malicious functionality.

Adversaries exploit these fragile associations through evasion attacks. By injecting "adversarial payloads"—dead code or benign-looking features—attackers can trigger these spurious shortcuts, shifting the distribution of the malware sample until it is misclassified as benign. This research introduces a domain adaptation technique designed to harden detectors by forcing them to ignore these shortcuts in favor of robust, functional domain constraints.

Methodology: Constructing a Robust Feature Space

The core of the proposed defense is the creation of a Robust Feature Space ($\mathcal{H}$). Instead of training models on raw, individual features that are easily manipulated, the system maps inputs into a representation governed by real-world functional dependencies.

Figure 1: Overview of the proposed pipeline for transforming the initial feature space into a robust feature space.

1. Capturing Domain Constraints

The researchers utilize an Optimum-path Forest (OPF) algorithm to identify dependencies between features. In the Android ecosystem, features are rarely independent; for example, certain intent filters require specific permissions to function. The OPF algorithm clusters these features, distinguishing between "primary" features (the functional drivers) and "secondary" features (the dependent elements).

2. Feature Transformation and Smoothing

Once dependencies are mapped, a transformation function $\lambda$ is applied. This function uses a sigmoid activation to map clusters of interdependent features from the initial space into single representative features in the robust space.

Figure 4: The process of partitioning the initial feature vector into subsets and transforming them into the robust space.

As illustrated in Figure 4, the input vector $x$ is partitioned into subsets $\mathcal{A}_1, \mathcal{A}_2, \dots, \mathcal{A}_m$ based on the OPF clustering. The sigmoid function serves a dual purpose: it aggregates the signal from a functional group and provides a "smoothing" effect. Because the sigmoid curve saturates at high values, it effectively dampens the impact of adversarial perturbations. An attacker attempting to flood an app with redundant features to flip a classification will find their efforts "smoothed out" by the transformation, as the model remains focused on the underlying functional pattern.

Experimental Evaluation

The defense was evaluated using a dataset of approximately 170,000 Android applications from AndroZoo. Apps were categorized using VirusTotal, with "malware" defined by four or more engine detections. Features were extracted using the DREBIN framework, focusing on the 10,000 most frequent attributes.

To test robustness, the researchers employed two sophisticated attack frameworks:

  • PK-Greedy: A white-box/gray-box attack that iteratively adds features to minimize the malware score.
  • EvadeDroid: A black-box, query-based attack that mimics realistic constraints by only adding "benign" payloads.

Key Results and Insights

The proposed "DREBIN-Robust" model demonstrated significant improvements over existing defenses, most notably the state-of-the-art Sec-SVM.

  • Adversarial Robustness: Against the EvadeDroid attack, the robust model achieved a 94.6% accuracy, vastly outperforming Sec-SVM's 72.1%. In various direct-attack scenarios, the defense provided up to a 55% improvement in robustness.
  • Distribution Alignment: Conceptual analysis indicates that while malware and adversarial examples occupy distinct regions in the original feature space, they overlap significantly in the robust space. This alignment ensures the model recognizes malicious functionality regardless of adversarial "noise."
  • Computational Efficiency: The transformation is remarkably lightweight. The robust model trained in just 1.7 seconds, compared to 25.4 seconds for Sec-SVM—a 15x speedup that makes it suitable for large-scale deployment.
  • Preservation of Clean Accuracy: The defense maintains a low False Positive Rate (FPR) of 1.3%, ensuring that legitimate apps are not incorrectly flagged.

Conclusion and Future Directions

By shifting the focus from individual features to functional clusters, this research provides a scalable way to mitigate the impact of spurious correlations in malware detection. However, the authors note that these domain constraints are data-driven and must be updated as the Android platform evolves. Future work will explore the generalizability of this transformation across different neural network architectures and its resilience against evolving evasion techniques.

Summary updated

BibTeX
@inproceedings{bostani2024improving,
  author = {Hamid Bostani and Zhengyu Zhao and Veelasha Moonsamy},
  title = {{Improving Adversarial Robustness in Android Malware Detection by Reducing the Impact of Spurious Correlations}},
  booktitle = {ESORICS Workshops},
  year = {2024},
  doi = {10.1007/978-3-031-82362-6\_13},
}
Figure