Understanding Regression in Continual Learning for Malware Detection

Daniele Ghiani, Daniele Angioni, Angelo Sotgiu, Maura Pintor, Battista BiggioITASEC/SERICS 2025

Introduction

Machine learning models deployed for malware detection face a constant battle against evolving threats. As software and malicious tactics change—a phenomenon known as concept drift—detectors must be updated frequently. However, traditional updating methods often suffer from "catastrophic forgetting," where learning new information causes the model to lose accuracy on previously learned data. While Continual Learning (CL) aims to mitigate this, it often overlooks a critical sample-level issue: security regression.

Security regression, or "negative flips," occurs when a model update causes a previously correctly identified sample to be misclassified. In a cybersecurity context, this is catastrophic: a model might learn to detect a new ransomware strain but suddenly stop detecting an older, still-active trojan, or start flagging legitimate business software as malicious. This paper introduces PCT-replay, the first regression-aware CL algorithm designed specifically for the malware detection domain.

The Challenge of Security Regression

In production environments, retraining a model from scratch on all historical data (cumulative training) is often computationally prohibitive. Incremental updates are necessary, but they introduce instability. Standard CL metrics focus on average performance (e.g., mean F1 score), which can mask significant regressions. A model's average accuracy might improve while it simultaneously "un-patches" previously secured vulnerabilities.

The authors formally adapt the Negative Flip Rate (NFR) to the CL setting. NFR measures the percentage of samples that were correctly classified by the model at time $t-1$ but are misclassified after the update at time $t$. Minimizing NFR is essential for maintaining user trust and ensuring consistent security coverage.

Methodology: PCT-replay

The proposed solution, PCT-replay, adapts Positive Congruent Training (PCT) to a domain-incremental CL framework. It employs three primary mechanisms:

  1. Rehearsal Memory: The system maintains a small, fixed-size buffer of representative samples from past "experiences" (time windows). These samples are replayed during the training of new data to provide a structural anchor for the model's decision boundaries.
  2. Focal Distillation Loss: Instead of just minimizing classification error on new data, PCT-replay introduces a penalty term based on Euclidean distance. This term forces the updated model's output probabilities to remain close to the previous model's outputs, but crucially, this constraint is only applied to samples that the previous model classified correctly. This "focal" approach ensures stability where it matters most.
  3. CL-Adapted Metrics: The evaluation framework uses sequential NFR calculations across multiple training experiences to track the cumulative impact of updates on model reliability.

Experimental Setup

The authors evaluated PCT-replay using the ELSA dataset, which comprises 75,000 Android applications (67,500 benign and 7,500 malware) collected between 2017 and 2019. Features were extracted using the Drebin framework, resulting in 4,681 binary indicators of app characteristics. To simulate a real-world deployment, the data was partitioned into 12 chronological three-month windows.

Results and Analysis

The experimental results highlight a significant breakthrough in managing security regression. PCT-replay achieved a mean NFR of 1.18% on malware, a dramatic improvement over the 15.8% NFR seen with naive retraining. Notably, it even outperformed the "Learning without Forgetting" (LwF) method, which recorded a 3.26% NFR.

Negative Flip Rate (NFR) heatmaps for goodware and malware across different CL methods. PCT-replay (bottom row) shows the lowest mean regression rates.

As shown in the heatmaps above, PCT-replay consistently maintains low regression rates across nearly all experience transitions. On the goodware class, regression was negligible (0.15%), ensuring that legitimate applications are rarely "flipped" to a malicious status after an update.

The Stability-Plasticity Trade-off

Continual Learning involves a fundamental tension between stability (retaining old knowledge) and plasticity (learning new information). While PCT-replay excels at stability, the authors noted a slight trade-off in recall. By forcing the model to respect past correct decisions, it may become slightly more conservative when encountering radically new malware variants.

Backward evaluation of Precision, Recall, and F1 score over 12 experiences. PCT-replay maintains high stability compared to naive approaches.

The backward evaluation metrics demonstrate that PCT-replay maintains highly competitive F1 scores. Although there is a minor drop in recall compared to standard replay methods, the gain in reliability (reduced NFR) makes it a superior choice for security-critical applications where a "silent" regression is more dangerous than a slightly slower adaptation to novel threats.

Conclusion and Future Work

PCT-replay represents a significant step toward reliable, long-term malware detection. By explicitly penalizing negative flips, it bridges the gap between the efficiency of incremental updates and the reliability of full retraining.

Future research will address current limitations, such as the reliance on perfectly labeled data and the challenges of class imbalance in the replay buffer. Extending regression-aware training to semi-supervised settings—where only a fraction of new samples are labeled—will be crucial for scaling these systems to the massive volumes of data encountered in the wild.

Summary updated

BibTeX
@inproceedings{ghiani2025understanding,
  author = {Daniele Ghiani and Daniele Angioni and Angelo Sotgiu and Maura Pintor and Battista Biggio},
  title = {{Understanding Regression in Continual Learning for Malware Detection}},
  booktitle = {ITASEC/SERICS},
  year = {2025},
}
Figure