Abstract
Machine Learning (ML) has significantly advanced Android malware detection, yet these models remain vulnerable to evasion attacks. Attackers can subtly modify malware features—such as adding non-functional instructions—to bypass detection while maintaining malicious functionality. We propose MalPurifier, a model-agnostic defense framework that utilizes a Denoising AutoEncoder (DAE) to "purify" adversarial perturbations before they reach a malware detector. By integrating diversified perturbation training and a protective noise strategy, MalPurifier achieves over 90.91% robust accuracy against 37 different evasion attacks. Crucially, it functions as a preprocessing "plug," requiring no retraining of the underlying detector.
Introduction
The "glass jaw" of modern Android malware detection is its susceptibility to adversarial evasion. Existing defenses typically rely on adversarial training, which is computationally expensive and often degrades performance on clean data, or adversarial purification, which is traditionally difficult to apply to the discrete, high-dimensional feature spaces (e.g., binary bitstrings of API calls) characteristic of Android applications. MalPurifier addresses these challenges by providing a lightweight, robust preprocessing layer that preserves the integrity of legitimate apps while neutralizing malicious manipulations.
The MalPurifier Framework
MalPurifier acts as a security layer situated between feature extraction and the malware detector. Its architecture is built upon three primary innovations:
- Diversified Adversarial Perturbation: During training, the purifier is exposed to a wide spectrum of adversarial malware with varying perturbation depths. This enables the model to recognize and reverse diverse manipulation styles.
- Protective Noise Injection: To prevent "over-cleansing"—where benign apps are accidentally altered and misclassified—controlled random noise is injected into benign training data. This teaches the DAE to maintain the stability of legitimate feature patterns.
- DAE with Dual-Objective Loss: The Denoising AutoEncoder is optimized using a loss function that balances reconstruction loss (ensuring the output matches the clean feature vector) and prediction loss (ensuring the purified sample's internal representation remains consistent within the detector).
Experimental Evaluation
The framework was evaluated using two industry-standard datasets:
- Drebin: A dataset of 5,560 malicious and over 123,000 benign samples (tested on a balanced subset of ~20,000).
- Androzoo: A modern collection of 22,000 apps dated between 2013 and 2021. Apps were represented as 10,000-dimensional binary feature vectors capturing API calls, permissions, and hardware components.
Results and Discussion
MalPurifier was tested against 37 different perturbation-based evasion attacks, including gradient-based and ensemble methods.
- Robustness and Superiority: MalPurifier consistently achieved robust accuracies above 90.91% on Drebin and 99.41% on Androzoo. As shown in the comparative analysis, it significantly outperforms state-of-the-art defenses like AT-rFGSM and PAD-SMA, particularly against advanced structural attacks.
- Model Agnosticism: A key strength is its transferability. When applied to protect vulnerable models like standard RNNs or LSTMs—which often drop to 0% accuracy under attack—MalPurifier restored their performance to over 99%.
- Efficiency: The training overhead is minimal compared to ensemble adversarial training, making it highly practical for real-world deployment.
Conclusion
MalPurifier offers a robust "security plug" for Android malware detection. While highly effective, it faces challenges from sophisticated "mimicry attacks" and white-box adaptive adversaries with full knowledge of the purification layer. Future research will explore the application of Diffusion Models for purification and investigate defenses against data poisoning.
Summary updated