Abstract
Beyond its highly publicized victories in Go, there have been numerous successful applications of deep learning in information retrieval, computer vision and speech recognition. In cybersecurity, an increasing number of companies have become excited about the potential of deep learning, and have started to use it for various security incidents, the most popular being malware detection. These companies assert that deep learning (DL) could help turn the tide in the battle against malware infections. However, deep neural networks (DNNs) are vulnerable to adversarial samples, a flaw that plagues most if not all statistical learning models. Recent research has demonstrated that those with malicious intent can easily circumvent deep learning-powered malware detection by exploiting this flaw. In order to address this problem, previous work has developed various defense mechanisms that either augmenting training data or enhance model's complexity. However, after a thorough analysis of the fundamental flaw in DNNs, we discover that the effectiveness of current defenses is limited and, more importantly, cannot provide theoretical guarantees as to their robustness against adversarial sampled-based attacks. As such, we propose a new adversary resistant technique that obstructs attackers from constructing impactful adversarial samples by randomly nullifying features within samples. In this work, we evaluate our proposed technique against a real world dataset with 14,679 malware variants and 17,399 benign programs. We theoretically validate the robustness of our technique, and empirically show that our technique significantly boosts DNN robustness to adversarial samples while maintaining high accuracy in classification. To demonstrate the general applicability of our proposed method, we also conduct experiments using the MNIST and CIFAR-10 datasets, generally used in image recognition research.
Introduction
Deep Neural Networks (DNNs) have become a cornerstone of modern cybersecurity, particularly in malware detection. However, their deterministic nature makes them vulnerable to adversarial samples—inputs specifically crafted with small perturbations to trigger misclassification. By calculating gradients, an attacker can identify which features most influence a model's decision and manipulate them to bypass security filters. This paper introduces Random Feature Nullification (RFN), a defense mechanism that introduces non-determinism into the network to break the attacker's ability to craft effective adversarial samples.
Methodology: Random Feature Nullification
The core of the RFN approach is the introduction of a stochastic layer between the raw input and the first hidden layer of the DNN. Unlike standard Dropout, which is typically used only during training to prevent overfitting, RFN remains active during both training and inference.
As shown in Figure 1, for every input sample $x_i$, the system generates a random binary mask $I_{p^i}$. This mask nullifies (sets to zero) a proportion of features determined by a hyperparameter $p$. Because the mask is generated randomly for each classification attempt, an attacker cannot predict which features will be active. This uncertainty prevents the precise gradient calculation required for gradient-based adversarial attacks, effectively turning the model into a "moving target."
Experimental Evaluation
The authors evaluated RFN using three datasets:
- Malware Dataset: 14,679 malware variants and 17,399 benign programs using binary features from Windows audit logs.
- MNIST: 70,000 grayscale images of handwritten digits.
- CIFAR-10: 60,000 color images across 10 categories.
In the malware domain, the sparsity of features allows the model to maintain high accuracy even at high nullification rates. For example, even when 80% of features are nullified, the model retains enough signal for classification while significantly increasing the likelihood that an attacker's malicious perturbations are neutralized.
Key Results
The experimental results demonstrate that RFN significantly enhances resistance to adversarial attacks compared to standard defense methods like Dropout or basic Adversarial Training.
As detailed in Figure 5, a standard DNN achieves 93.99% accuracy but only 30.00% resistance to adversarial samples. RFN alone improves resistance to 62.30%. The most robust results were achieved by a hybrid approach—combining Adversarial Training & RFN—which reached 94.81% accuracy and 68.77% resistance. Similar improvements were observed in image recognition; on MNIST, the hybrid model maintained 91.3% accuracy under strong attacks where a standard DNN's performance dropped to 8.2%.
Conclusion
Random Feature Nullification provides a theoretically grounded and empirically effective defense against adversarial samples. By embracing stochasticity at test time, RFN disrupts the mathematical link attackers use to exploit model vulnerabilities. While there is a trade-off between the nullification rate and clean accuracy, the method proves exceptionally robust for sparse data like malware and offers a generalizable framework for hardening deep architectures across various domains.
Summary updated