Static machine-learning malware detectors that achieve more than 98% accuracy on Windows PE files can still be evaded by small, tightly bounded shifts in feature space, according to an adversarial evaluation study by Manju Dhull and colleagues published in Discover Artificial Intelligence. The researchers developed CR-AdvGAN, a contrastive-reinforced generative adversarial framework that combines self-supervised representation learning, perturbation generation, and detector-ensemble reinforcement to evaluate static PE malware classifiers under strict perturbation limits. Tested on the labeled Kaggle Minimal PE Malware dataset under a fixed mean L2 perturbation budget of 0.125 in embedding space, CR-AdvGAN achieved attack success rates (ASR) of 6.91% against Random Forest, 5.32% against XGBoost, 5.59% against LightGBM, and 3.99% against a Multi-layer Perceptron (MLP). The authors emphasize that these figures provide evidence of non-zero vulnerability within a highly constrained static-feature benchmark rather than a claim of unrestricted real-world evasion.
The study addresses a persistent tension in automated Windows malware defense. Telemetry cited by the authors suggests roughly 300,000 new malware samples appear daily, malicious intrusions occur every 39 seconds, and nearly 83% of newly observed malware families target the PE format. Because automation-assisted attackers rapidly repack binaries and re-inject obfuscations hours after detection, traditional signature-based antivirus systems struggle to keep pace, prompting research into static machine-learning detectors that inspect PE headers, sections, import tables, and raw bytes without executing code. Ensemble models such as Random Forest, XGBoost, and LightGBM achieve up to 99% accuracy with millisecond-range inference latency on public benchmarks, while byte-level neural networks like MalConv learn patterns directly from raw byte sequences.
To examine low-budget evasion in a reproducible static-feature setting, the team used the publicly available PE Files Malwares dataset published on Kaggle by Amauricio. It contains two files: dataset_malwares.csv, with 24 numeric static attributes—including SizeOfHeapCommit, LoaderFlags, and per-section entropy and size metrics—plus a binary Malware label, and dataset_test.csv, with 79 attributes covering DOS and Optional Header fields, alignment values, and checksums but no ground-truth labels. To prevent feature-dimension mismatch and unlabeled evaluation, all supervised detector training, contrastive pre-training, adversarial generation, ASR reporting, and statistical testing used only dataset_malwares.csv, retaining dataset_test.csv strictly for feature-space compatibility inspection. Using pandas and scikit-learn in Python, preprocessing dropped non-numeric columns except the label, imputed missing values with column medians, standardized features to zero mean and unit variance via StandardScaler, and stratified the labeled data into 70% training, 15% validation, and 15% held-out test splits.
Rather than perturbing raw features directly, CR-AdvGAN first learns a semantically structured latent space through a SimCLR-style contrastive warm-up stage. The team built a masked-view encoder in PyTorch that maps each standardized 24-dimensional PE vector into an L2-normalized 128-dimensional embedding. On the training split, every sample generated two correlated views by independently zero-masking each feature with probability 0.12, encouraging the encoder to recover global structure from partial evidence. The backbone uses two Linear-GELU-BatchNorm blocks (hidden size 256) followed by a 128-dimensional linear projection. Trained for 100 epochs with batch size 512 using AdamW at an initial learning rate of 0.0003, the encoder minimized normalized temperature-scaled cross-entropy (NT-Xent) loss with temperature 0.2, pulling paired views together while pushing apart other batch views. Once converged, the encoder was frozen to compute 128-dimensional embeddings for all training, validation, and test samples, serving both downstream classifiers and the adversarial generator.
Inside this frozen embedding manifold, CR-AdvGAN trains a noise-conditioned generator guided by two orthogonal critics. The generator is a lightweight multilayer perceptron that concatenates 128-dimensional Gaussian noise with a clean malicious embedding and outputs a bounded perturbation mask in [-1, 1]^128 via a tanh activation, which is scaled by 0.2, added to the embedding, and clipped within [-3, 3]. A GAN discriminator with a 256-unit LeakyReLU backbone enforces semantic realism through a hinge-loss objective separating real benign embeddings from perturbed malicious ones. Simultaneously, a reinforcement-learning critic formed by the frozen detector ensemble rewards lower mean malware probability while penalizing perturbation size with a validation-tuned coefficient of 0.25. Alternating generator and discriminator updates ran for 300 epochs with batch size 512 using Adam (learning rates 0.0001 and 0.0002, RL weight 1, L2 weight 0.25) across three noise seeds on an Ubuntu 20.04 server with an NVIDIA RTX A1000 GPU and 128 GB RAM.
To link continuous latent perturbations to discrete file edits, CR-AdvGAN includes a deterministic action realiser built with the pefile Python library. The realiser binarizes each mask coordinate at a threshold of 0.5 into -1, 0, or 1, mapping nonzero entries to three atomic structural edits: import thunk insertion, section renaming, or overlay padding. These rules avoid altering executable code bytes, preserve Import Directory alignment and size consistency, respect the 8-byte section name field without reserved names, and leave in-memory mapped sections untouched. After each edit, the realiser re-parses the PE structure to verify header offsets, directory sizes, and section boundaries, recomputes the Optional Header checksum via the PE/COFF checksum procedure, and checks DOS stub relocation and entropy bounds. Because the Kaggle benchmark supplies labeled feature vectors rather than raw binaries and sandbox traces, the authors clarify that reported ASR values measure embedding-space and static-feature-space robustness, while behavioral equivalence under runtime execution remains future work.
Before launching adversarial attacks, the study verified that all four victim detectors—Random Forest, XGBoost, LightGBM, and the MLP—established strong baseline classification performance on the frozen contrastive embeddings. On the validation split, the three tree-based classifiers consistently exceeded 98% accuracy and achieved area under the ROC curve (AUC) values above 0.9946. XGBoost attained the highest validation accuracy and F1-score at 98.40%, balancing 98.45% precision and 98.35% recall, while Random Forest reached 98.20% accuracy alongside the highest AUC at 0.9951. The narrow F1-score range across classical learners, from 98.20% to 98.40%, indicated that the learned contrastive embeddings drove classification quality rather than model-specific tuning. On the held-out test set of 2,942 samples—comprising 752 benign and 2,190 malicious files—the MLP detector achieved 98.20% accuracy, closely matching its 98.19% validation accuracy, with an ROC AUC of 0.987, a 4.1% false-positive rate (31 of 752 benign samples), and a 1.0% false-negative rate (22 of 2,190 malware samples).
Against these high-performing detectors under the strict mean L2 budget of 0.125, CR-AdvGAN produced higher evasion rates on tree-based ensembles than on the neural classifier, reaching 6.91% ASR on Random Forest, 5.59% on LightGBM, 5.32% on XGBoost, and 3.99% on the MLP. To test whether evasion stemmed merely from the restricted edit space, the team evaluated a Random Valid Action baseline that rescaled random perturbation masks to the same mean L2 budget of 0.125 and passed them through the identical action realiser; it reached only 0.82% to 1.28% ASR, showing that learned perturbation selection added clear value within the feasible palette. An ablation study further replaced the contrastive encoder with an identity mapping so the generator operated directly on raw features. Under the same 0.1250 mean L2 budget against Random Forest, removing contrastive pre-training cut ASR from 6.91% to 1.80%—a 73.9% relative drop—confirming the pre-trained semantic manifold’s central role.
Cross-model transferability tests, where perturbations optimized against one frozen source detector were evaluated unmodified against the other three, showed partial, detector-family-dependent transfer. Random Forest-targeted samples transferred to XGBoost at 4.11% ASR and LightGBM at 4.35%, but fell to 2.46% against the MLP; XGBoost- and LightGBM-targeted attacks followed a similar pattern, while MLP-targeted samples had the weakest off-diagonal transfer. Plotting ASR against mean L2 budget produced the Robustness-Perturbation Frontier benchmark, placing Random Forest at the most vulnerable apex (6.9%) and the MLP at the most resilient point (4.0%), consistent with smoother neural decision surfaces resisting small shifts better than sharp, axis-aligned tree partitions. Although CR-AdvGAN reached 4% to 7% ASR where an FGSM baseline stayed below 3% at L2 = 0.125, a paired Wilcoxon signed-rank test across the four detector pairs gave p = 0.125, with Cliff’s delta (-1.00) reported only descriptively—supporting a consistent empirical trend rather than formal statistical superiority.
For malware defense, the authors suggest combining heterogeneous ensembles of tree-based and neural detectors, adversarial retraining with CR-AdvGAN samples, and complementary dynamic behavioral cues such as API call patterns or sandbox traces. At the same time, they highlight clear limits on generalization: the 24-attribute Kaggle Minimal PE dataset does not mirror high-dimensional industrial feature sets such as EMBER byte histograms or imported-function vocabularies, nor does it reflect the full diversity of real-world packers, runtime obfuscation, or commercial antivirus platforms. Because CR-AdvGAN targets only static header and import features and requires GPU-based iterative tuning, future work will need to extend the pipeline to raw-binary editing, feature re-extraction, sandbox execution, streaming contrastive encoders for concept drift, Control-Flow Graph or Code Property Graph embeddings, and minimax co-training of defenders alongside the generator.
Subject of Research: Adversarial robustness evaluation of static machine-learning malware detectors for Windows PE files using contrastive-reinforced perturbation generation.
Article Title: CR-AdvGAN: contrastive-reinforced adversarial generation and robustness-perturbation frontier benchmarking for windows PE malware detection
Article References: Dhull, M., Rana, C., Wani, N. A., & Kumar, P. (2026). CR-AdvGAN: contrastive-reinforced adversarial generation and robustness-perturbation frontier benchmarking for windows PE malware detection. Discover Artificial Intelligence, 6(1), Article 2019. https://doi.org/10.1007/s44163-026-02770-3
Image Credits: AI Generated
DOI: 10.1007/s44163-026-02770-3
Keywords: CR-AdvGAN, Windows PE malware, static malware detection, adversarial machine learning, contrastive representation learning, generative adversarial networks, reinforcement learning, Robustness-Perturbation Frontier, Random Forest, XGBoost, LightGBM, Multi-layer Perceptron, NT-Xent loss, cross-model transferability, Random Valid Action baseline, ablation analysis, Kaggle Minimal PE dataset
News Source: Denise Maddox. (December 2, 2026). Tightly Bounded Perturbations Evade Static Windows PE Malware Detectors in Benchmark. Scienmag.



