Introduction
Deep Learning has transformed fields from computer vision to cybersecurity. However, Deep Neural Networks (DNNs) remain vulnerable to adversarial samples—inputs crafted with subtle perturbations to deceive models into high-confidence misclassifications. In malware detection, attackers can exploit these "blind spots" by identifying key features the model relies on and modifying malicious code to bypass detection. Traditional defenses like adversarial training or defensive distillation often struggle with high computational costs or can be circumvented by attackers who approximate the model's behavior.
Random Feature Nullification (RFN)
This paper introduces Random Feature Nullification (RFN), a defense mechanism that leverages stochasticity to protect DNNs. RFN inserts a random masking layer between the input and the first hidden layer. This layer nullifies a portion of input features based on a probability $p$.
Unlike standard dropout, which is typically disabled during inference to make the model deterministic, RFN remains active during both training and testing. During training, it encourages the network to learn robust, redundant representations that do not rely on any single feature. During testing, the persistent randomness makes the model non-deterministic.
Why it Defeats Attackers
To craft an effective adversarial sample, an attacker typically requires the gradient of the model's cost function with respect to the input. This gradient points toward the "blind spots" where small changes in input lead to large changes in output. By randomly masking features at every inference call, RFN introduces a random variable into the backpropagation chain. This ensures that the attacker cannot know which features will be "active" at any given moment. Consequently, the calculated adversarial direction becomes distorted and ineffective, making it nearly impossible for an attacker to hit a moving target with precision-engineered noise.
Experimental Evaluation
The researchers evaluated RFN across three distinct domains to test its versatility:
- Malware Detection: A dataset of Windows audit logs (14,679 malware, 17,399 benign) reduced to 10,000-dimensional binary feature vectors representing system events.
- MNIST: The standard benchmark for handwritten digit recognition.
- CIFAR-10: A more complex image classification task using Convolutional Neural Networks (CNNs).
Key Results
The primary metric for success was "Resistance"—the model's accuracy when subjected to direct adversarial attacks. RFN demonstrated significant improvements across all datasets while maintaining high baseline accuracy.
In malware detection, a standard DNN exhibited only 30% resistance. Implementing RFN increased this to 62.3%. A hybrid approach combining RFN with Adversarial Training (training on known attacks) further boosted resistance to 68.77%, while maintaining a high baseline accuracy of approximately 94.81%.
For image datasets, the impact was even more pronounced. On MNIST, under a strong attack ($\phi = 0.15$), standard DNN accuracy dropped to 8.19%, whereas the RFN-protected model maintained 83.69%. Similarly, on CIFAR-10, resistance improved from 19.48% to 67.85%.
Discussion and Conclusion
The core insight of this work is that non-determinism serves as a powerful shield. By turning the model into a "moving target," RFN prevents attackers from finding stable adversarial directions. The method is particularly effective in sparse data domains like malware detection, where the authors found they could nullify up to 80-90% of features with minimal impact on standard accuracy but massive gains in robustness.
While there is an inherent trade-off between extreme robustness and baseline accuracy, RFN provides a simple, computationally efficient, and highly effective layer of defense. Future research may explore applying similar stochasticity to internal network layers to further harden models against increasingly sophisticated, iterative attacks.
Summary updated