Manuscript Offprint
arXiv:2610.26240Q-MALDetect: Quantum Image-Based Malware Detection and Adversarial Robustness Analysis
Walid El Maouaki†, Mohammad Izen†, Nouhaila Innan†§, Alberto Marchisio†§‡*, Muhammad Shafique†§
† eBrain Lab, Division of Engineering, New York University Abu Dhabi, PO Box 129188, Abu Dhabi, UAE
§ Center for Quantum and Topological Systems (CQTS), NYUAD Research Institute, NYUAD, Abu Dhabi, UAE
† SDU Microelectronics, Institute of Mechanical and Electrical Engineering, University of Southern Denmark, Odense, Denmark
Emails: {walid.el.maouaki, mi2527, nouhaila.innan, muhammad.shafique}@nyu.edu, chisio@sdu.dk
Abstract—Quantum machine-learning (QML) models are increasingly considered for security applications, yet their adversarial robustness in malware analysis remains insufficiently understood. This paper presents Q-MALDetect, a hybrid convolutional and variational-quantum detector for byte-image representations of x86-64 Executable and Linkable Format (ELF) binaries, and evaluates it under feature-space and a range of Grad-CAM-guided, executable-aware evasion attacks. The model achieves 97.2% training accuracy, but its robustness deteriorates as attack strength increases, with the strongest evaluated feature-space attack reaching a 78.7% attack success rate (ASR). Among executable-aware attacks, Grad-CAM-guided no-operation (NOP) insertion produces the highest conditional ASR of 32.9%. Dynamic adversarial training is the most effective evaluated defense, reducing feature-space ASR to as low as 5.0%, executable-aware ASR to 7.7%, and the sequential-attack ASR to 34.0%. In contrast, convolutional-autoencoder preprocessing increases executable-aware ASR to 39.7%, coinciding with a rise in Grad-CAM attribution mass within the mutable .text region from 35.2% to 45.7%. Ablation results reveal no monotonic relationship between qubit count and robustness, while the encoding interface modifies the learned attack surface without neutralizing the strongest attack. These findings demonstrate that the effectiveness of attacks and defenses depends strongly on the perturbation constraints and evaluation conditions. Reliable deployment of QML malware detectors therefore requires assessment against both feature-space and executable-aware attacks rather than reliance on clean accuracy or generic denoising alone.
Index Terms—Quantum machine learning, malware detection, ELF binaries, adversarial robustness, hybrid quantum-classical neural networks, adversarial training.
I. INTRODUCTION
Linux malware has become a critical security concern because servers, embedded platforms, and IoT devices commonly rely on Executable and Linkable Format (ELF) instances. Static malware detectors based on deep learning can process binaries quickly and can avoid the cost of dynamic sandbox execution. A widely adopted approach converts executable bytes into images and applies convolutional neural networks (CNNs), allowing models to learn discriminative byte-layout patterns without hand-crafted features [1]. However, CNNs are vulnerable to adversarial examples, i.e., small, carefully chosen perturbations can cause high-confidence misclassification [2], [3]. In malware detection, this threat is especially subtle because arbitrary feature-space perturbations may not correspond to a valid executable. Recent ELF-focused work, such as ADVeRL-ELF, has shifted toward problem-space attacks that maintain both executability and malicious behavior while evading detection [4].
Quantum machine learning (QML) offers a new design space for security analytics because parameterized quantum circuits can act as trainable feature maps with representations that differ from classical neural networks. Prior studies have investigated the robustness of quanvolutional and hybrid quantum-classical models [5]–[7]. Yet most QML robustness studies use canonical image data, while adversarial malware research focuses predominantly on classical models. Consequently, it remains unclear how a hybrid QML malware detector behaves when exposed to both unconstrained feature-space perturbations and executable-aware binary mutations.
This paper addresses that question through a vulnerability study of Q-MALDetect, a hybrid convolutional and variational-quantum ELF classifier built on established hybrid QML detector designs [8]–[10]; the contribution is a joint feature-space and executable-aware robustness evaluation of the complete pipeline. This study asks four questions: (i) whether the hybrid model fits the clean data to a high-recall operating point; (ii) which feature-space and executable-aware attacks are effective, and under what conditions; (iii) whether adversarial training and CAE preprocessing provide consistent protection; and (iv) how perturbation budget, qubit count, encoding interface, and simulated hardware noise affect the observed attack surface.
The main contributions are:
- We formulate a critical-domain robustness evaluation for a hybrid quantum-classical ELF malware detector and separate clean classification, feature-space sensitivity, and executable-aware evasion.
• We benchmark a spectrum of attacks that combines FGSM, PGD, and an FGSM-initialized PGD variant with two Grad-CAM-guided NOP-insertion attacks. The latter attacks use attribution to align a constrained mutation budget with model-sensitive executable regions; one selects NOP actions randomly and one tests whether tabular Q-learning improves on it.
This work has been carried out while at NYUAD.
- We compare two standard defenses, dynamic adversarial training and CAE preprocessing, and identify an asymmetric defense outcome: the CAE attenuates additive feature-space perturbations but can increase Grad-CAM-guided problem-space ASR by shifting attribution toward the mutable .text region.
• We evaluate adversarial training and ablations over perturbation budget, qubit count, and encoding strategy, showing that quantum-interface choices materially affect attack success.
Quantum methods have been studied for malware, intrusion, network-security, and side-channel analysis tasks [8]–[10], [14]–[18]. In parallel, adversarial QML research has established attacks, training-based defenses, robustness verification, universal perturbations, and experimental demonstrations on quantum hardware [19]–[25]. More recent studies investigate architecture, expressibility, transferability, circuit metrics, and federated robustness [5]–[7], [26]–[28]. These results motivate attack-aware QML design, but they do not establish robustness for executable malware.
Research gap. Existing work does not provide a unified evaluation of a hybrid QML malware detector under both differentiable feature-space attacks and attribution-guided executable mutations, nor does it examine whether defenses can protect against one threat class while exposing another. This paper focuses on that gap.
III. STUDY DESIGN AND METHODOLOGY
Figure 1 summarizes the complete protocol, from ELF preprocessing and hybrid inference through attacks, defenses, ablations, and evaluation. The protocol maintains separate model-development and held-out attack pools and distinguishes feature-space perturbations from reconstructed binary mutations.
A. Threat Model and Dataset
We study non-targeted evasion: an adversary starts from malware that the model classifies correctly and seeks a benign prediction. All attacks assume access to the trained model. FGSM and PGD require end-to-end gradients. The Grad-CAM-guided attacks require gradients for attribution and model-confidence feedback for evaluating candidate mutations, restricted to semantics-neutral NOP insertion with ELF repair.
The dataset contains 1,300 x86-64 ELF binaries from the Labeled-ELFs repository [29], including 600 benign and 700 malware samples. The training set contains all 600 benign samples and 600 malware samples. The remaining 100 malware samples are held out from training and reserved exclusively for adversarial attack evaluation. Clean metrics are computed on the balanced training set and fix each model's operating point; every ASR is measured on these unseen malware, matching the malware-to-benign evasion threat model.
Each file is represented by its first bytes. Short files are zero-padded and long files are truncated; byte values are divided by 255 to obtain . Truncation means that attacks and explanations concern only file regions visible within the first 50,176 bytes. Figure 2 illustrates both the resulting byte image in Figure 2(a) and a Grad-CAM map in Figure 2(b) used to guide domain-space attacks.
Clean performance is reported using accuracy, precision, malware recall, and false-positive rate. Attack success rate is defined over initially correct malware:
where label 1 denotes malware. Restricting the denominator to initially correct samples prevents clean-model errors from being counted as attack successes. Results are summarized as mean ± standard deviation across seeds.
B. Hybrid Quantum-Classical Model Detector
The CNN frontend contains three stride-2 convolutional layers with ReLU activations, followed by adaptive average pooling to and flattening to . For the default four-qubit amplitude-encoding model, the fully connected bridge produces
Amplitude embedding requires a unit-norm vector, so the circuit input is
with a small numerical constant . A single PennyLane StronglyEntanglingLayers block [30] processes the four-qubit state. Four Pauli-Z expectation values are passed to a linear layer and sigmoid to produce malware probability ; the decision threshold is 0.5. The CNN and bridge use learning rate 0.001, while the quantum parameters and output head use 0.01. Training uses Adam, binary cross-entropy, batch size 32, and 10 epochs.
C. Feature-Space Attacks
FGSM applies one loss-maximizing step and clips the result to the valid input range:

Fig. 1: Q-MALDetect evaluation workflow. ELF binaries are converted to normalized byte images and divided into a 1,200-sample model-development pool and a 100-malware attack holdout. A CNN bridge supplies normalized amplitudes to a variational quantum circuit. The evaluation covers three feature-space attacks and two Grad-CAM-guided, executable-aware NOP-insertion attacks; dynamic adversarial training and CAE preprocessing are then tested under the same attack families. Ablations vary perturbation budget, qubit count, encoding interface, and NOP length, while the final stage reports clean metrics, ASR, attribution behavior, and noise-model sensitivity.
a) Original Malware
Image
b) Base Model
GradCAM
c) CAE Model
GradCAM

Fig. 2: Representative attribution shift under CAE preprocessing. (a) Original malware byte image. (b) The base-model Grad-CAM map is spatially diffuse. (c) The CAE-model map concentrates high activation in a narrow horizontal band aligned with the analyzed .text region. The two numbered callouts mark segments of this same high-activation band, not separate processing stages. Across 495 paired maps, .text attribution mass increases from 35.2% to 45.7%.
with in the main experiment.
PGD applies 50 steps with and projects after every update:
The compound attack applies FGSM first and then runs PGD from the FGSM output. In the reported implementation, the second projection is centered on that intermediate point. Each stage uses the same nominal , so the final displacement from the original input can reach before clipping. The compound result is therefore a stronger sequential threat model, not a same-budget comparison with FGSM or PGD. These attacks modify normalized byte-image values and are not asserted to correspond to valid executable files.
D. Executable-Aware Grad-CAM Attacks
- Single-Point Insertion and Reconstruction: The two domain attacks use Grad-CAM [31] at the third convolutional layer to rank influential image locations. Candidate locations are mapped back to byte offsets, restricted to the ELF .text section, and snapped to a nearby instruction boundary identified through Capstone disassembly. Boundaries crossed by short relative branches are rejected. All NOPs for one sample accumulate at a single accepted boundary, reducing the repair problem to one cut position and one total shift.
After inserting a block of N bytes, the procedure expands .text, shifts subsequent section and program-header offsets and virtual addresses, updates relevant ELF header fields, and adjusts relative branches, calls, RIP-relative references, relocations, symbols, and dynamic-table addresses that cross the cut. LIEF is then used to reparse the rebuilt binary. Since multi-byte NOPs leave the architectural state unchanged and all listed cross-cut references are repaired, the mutation is semantics-neutral by design; every rebuild is verified for structural validity and re-read consistency, and smoke tests on rebuilt benign utilities confirm runnability. An executable-aware success is thus a structurally valid, semantics-neutral rebuild classified as benign.
Let I denote initially correct attack malware and the samples for which a safe boundary is found and a structurally valid rebuild is produced. The plotted domain metric is
The total success rate is . The executable rate () acts as the maximum possible overall rate, achieved at reconstruction coverage. Feature-space and executable-aware ASRs measure distinct vulnerabilities and are not directly comparable.
-
Grad-CAM-Guided Random NOP Insertion: The random baseline selects among six architecturally valid multi-byte x86-64 NOP encodings of length 6-11 bytes. At each turn, it inserts one randomly selected NOP at the accumulating Grad-CAM-guided boundary, re-reads the first 50,176 bytes, and queries the detector. The attack stops after a label flip or 200 turns. A successful image-level evasion is counted only after reconstruction, reparsing, and rescoring of the rebuilt ELF.
-
Grad-CAM-Guided Q-Learning: The learned variant tests whether selecting a particular NOP encoding improves on random choice. The state is one of 10 confidence buckets,
where is the current malware confidence. The six NOP encodings form the action space. With
the reward is
The Q-table update is
with and . Exploration uses -greedy selection, decaying from 0.9 to 0.05 by a factor of 0.995 per episode. Policy fitting uses eight passes over model-development malware, with at most 200 turns per episode. The frozen policy acts greedily on the attack holdout, and only reconstructed evasions contribute to Eq. (6).
E. Defenses, Ablations, and Noise-Model Evaluation
To improve Q-MALDetect robustness, we apply adversarial training (AT) following the min-max formulation of Madry et al. [3]. At each of five fine-tuning epochs, fresh PGD examples are generated against the current model and replace 50% of the corresponding development samples. Static reconstructed NOP and RL bypass examples generated from model-development malware are also included so that hardening covers both threat classes. The held-out attack malware remain excluded from fine-tuning.
As a second line of defense, we prepend a Convolutional Autoencoder (CAE) to the Q-MALDetect pipeline as a preprocessing stage. The CAE consists of a four-layer convolutional encoder that progressively downsamples the image to a representation, which is compressed into a 128-dimensional latent vector. A symmetric four-layer transposed-convolution decoder reconstructs the input with a sigmoid output. The CAE is trained for 20 epochs on clean model-development data using mean-squared error and Adam with a learning rate of 0.001. It is then frozen, and the classifier is trained on reconstructed inputs. All white-box feature-space attacks differentiate through the complete CAE-classifier pipeline.
TABLE I: Experimental configuration summary.
| Category | Configuration |
|---|---|
| Dataset | 1300 ELF (224 × 224) |
| Split | 600 benign, 700 malware |
| Training | 10 epochs, batch 32, Adam, BCE |
| Learning rate | CNN 0.001, quantum 0.01 |
| Architecture | CNN + FC + QNN + FC |
| Default circuit | 4 qubits, 1 layer, Amplitude |
| Gradient attacks | FGSM, PGD, Compound |
| FGSM | ε = 0.01 |
| PGD | ε = 0.01, α = 0.001, 50 iter |
| Domain attacks | GradCAM+NOP, GradCAM+RL |
| Insertion | single safe .text boundary |
| NOP set | 6 canonical NOPs, 6–11 bytes |
| Turns per sample | up to 200 |
| Reconstruction | Capstone + LIEF, structure-valid |
| Reported ASR | image (upper bound) + executable |
| RL agent | tabular Q-learning, 8 passes |
| RL state / action | 10 conf. buckets / 6 NOPs |
| Adv. training | dynamic PGD/epoch + NOP/RL aug., 5 ep. |
| CAE | 4-layer, latent 128, 20 epochs |
| Qubit ablation | n ∈ {2, 3, 4, 5, 6, 7, 8, 9} |
| Encoding ablation | Amplitude, Angle |
| Epsilon ablation | ε ∈ [10-3, 101], 10 pts |
| Seeds | 3 seeds for all experiments unless specified |
We also study the impact of three design variables on adversarial vulnerability. The qubit sweep uses . Because amplitude encoding requires inputs and the readout returns n expectation values, this sweep grows the bridge from 4,096 to 524,288 weights ( ) while the circuit grows from 6 to 27 rotation angles (3n). The encoding study compares amplitude embedding with four-feature angle embedding at four qubits; it therefore evaluates complete encoding interfaces, in which the bridge dimension (16 vs. 4), gradient flow, and encoding gates change jointly. The perturbation study evaluates 10 logarithmically spaced values from to . Since inputs are clipped to [0, 1], budgets at or above 1 are nominal values that primarily expose saturation behavior rather than progressively larger feasible regions.
A final transfer experiment evaluates adversarial inputs generated against the noiseless model under 1,024-shot FakeManilaV2 simulation, a local backend whose noise model is derived from a device snapshot; it thus measures sensitivity to stored device noise and finite-shot sampling. Table I consolidates the default settings across the main comparison and ablations.

Fig. 3: Training convergence for one illustrative run. Loss decreases from 0.6815 to 0.0605 while training accuracy increases from 56.41% to 98.44% over 10 epochs.
All classical components are implemented in PyTorch. PennyLane provides the differentiable quantum simulation, while LIEF and Capstone support ELF parsing and disassembly.
IV. RESULTS AND DISCUSSION
A. Clean Performance and Undefended Attack Surface
The illustrative run in Fig. 3 shows stable optimization: the training loss decreases from 0.6815 at epoch 1 to 0.0605 at epoch 10, while the training accuracy increases from 56.41% to 98.44%. Across the evaluated runs, the model achieves mean training-set accuracy of , precision of , malware recall of , and a false-positive rate of . These results confirm that the model fits the clean training data and provides a high-recall starting point for the robustness analysis.
In Figure 4, under the undefended model, FGSM reaches 42.3% ASR and PGD reaches 52.3%. The sequential compound attack is strongest at 78.7%, consistent with its two-stage optimization and potentially doubled displacement budget.
The executable-aware attacks attain conditional ASRs of 32.9% for Grad-CAM+NOP and 29.8% for Grad-CAM+RL. These rates are lower than the compound feature-space result but operationally more concrete: each counted success is a reparsed, semantics-neutral rebuild that the detector scores as benign. Comparisons with prior ELF attacks [4], [13], [32], [33] must account for different models, architectures, mutation sets, budgets, denominators, and functionality checks.
The random and learned NOP attacks perform similarly: the 3.1-point mean difference in favor of random selection lies within the seed variation, although the Q-tables learn state-dependent preferences (mean within-state action spread of 2.2 value units, 1.6–3.0 across seeds). These preferences cannot raise ASR because the actions change NOP form and length but not the insertion location or the dominant image-layout effect.
The fixed-volume diagnostic in Figure 5, an ablation over constant-action policies at matched volume, supports this interpretation. With total inserted volume held at 2,520 bytes, mean conditional executable ASR is 35.1%, 44.8%, 26.5%, 40.5%, and 34.6% for NOP lengths 6-10. The sequence is

Fig. 4: ASR under the undefended, CAE-defended, and adversarially trained conditions. FGSM, PGD, and Compound are feature-space ASRs; Grad-CAM+NOP and Grad-CAM+RL are conditional executable ASRs. Bar labels round the corresponding means to whole percentages. AT reduces all five attacks, whereas the CAE reduces feature-space ASR but increases both executable-aware rates.

Fig. 5: Conditional executable ASR versus NOP length with total inserted volume fixed at 2,520 bytes, averaged over five seeds. Faint lines show individual seeds and the bold line shows the mean. The absence of a monotonic length trend, together with large seed variation, indicates that total displacement and detector fragility dominate the identity of the selected NOP.
non-monotonic and the between-seed spread is larger than any consistent length trend. Inserting bytes at one early .text boundary shifts all subsequent visible bytes, so total layout displacement and the chosen boundary provide a stronger mechanism than the semantic identity of a particular NOP. An effective learned attacker should therefore control location, volume, or transformation family.
B. Defense Effectiveness
- Dynamic Adversarial Training: Dynamic AT is the strongest defense in Figure 4. FGSM drops from 42.3% to 5.0% (a 37.3-point reduction), PGD from 52.3% to 5.7% (46.6 points), and the compound attack from 78.7% to 34.0% (44.7 points). Grad-CAM+NOP falls from 32.9% to 9.0%, and Grad-CAM+RL from 29.8% to 7.7%. Figure 6 shows that these reductions occur across the paired seeds rather than being produced by one outlying run.
The result follows the composition of the fine-tuning data: fresh PGD examples harden the differentiable attack surface, while reconstructed NOP/RL examples expose the model to domain mutations. The residual 34.0% compound ASR remains important. PGD-based hardening does not fully cover a sequential attack whose feasible displacement can exceed the single-stage training budget. These gains quantify resistance to malware evasion, the objective of the threat model; the clean-accuracy and false-positive cost of hardening is the complementary deployment metric.
- Convolutional-Autoencoder Preprocessing: The CAE produces a threat-dependent reversal. Relative to the undefended model, FGSM falls from 42.3% to 25.3%, PGD from 52.3% to 27.3%, and the compound attack from 78.7% to 50.7%. The bottleneck removes part of the additive image-space perturbation, but it does not eliminate the sequential attack.
For executable-aware attacks, the same preprocessing is harmful: Grad-CAM+NOP rises from 32.9% to 39.7%, and Grad-CAM+RL rises from 29.8% to 37.2%. The attribution analysis provides a coherent mechanism. Across 495 paired maps, the fraction of Grad-CAM activation mass inside .text increases from 35.2% to 45.7%, a 10.5-point mean shift, and 60% of samples move in that direction. As Figure 2 illustrates, the CAE model exhibits pronounced activation confined to a narrow band that is spatially aligned with the mutable code region (in panel c), as indicated by circular markers 1 and 2 in the figure. This does not by itself prove causation, but it is consistent with the measured increase in attacks that deliberately target .text. The observation complements interpretation-based ELF defenses [34]: attribution can identify adversarial structure, but a defense that changes attribution can also expose a more concentrated mutation target.
C. Sensitivity and Ablation Studies
- Perturbation Budget: Figure 7 evaluates a ten-seed run over 10 logarithmically spaced budgets. In the transition between approximately and , ASR rises sharply and uncertainty is widest; the compound attack increases first, followed by PGD and FGSM. PGD and the compound attack approach saturation only over the subsequent points, roughly to , rather than at exactly. FGSM plateaus in the mid-80% range and declines slightly at the largest nominal budgets.
The high-budget regime must be read with input clipping. For , the cube, rather than the nominal radius, determines the feasible input. The curves therefore describe sign saturation and iterative clipping, not meaningful growth to a radius of 10 in normalized byte space. The slight FGSM decline is not evidence that very large perturbations restore robustness.
- Qubit Count: Figure 8 shows no monotonic relation between circuit width and adversarial robustness. FGSM and PGD fluctuate substantially across 2-9 qubits, with local lows around the four- and eight-qubit configurations and renewed increases at nine qubits. The compound attack remains the largest curve at every width, ranging approximately from 60% to 87%. The domain attacks remain lower in this cohort, mostly within 5-20%, but also vary non-monotonically.
The sweep therefore characterizes architecture width rather than quantum resources in isolation: changing n simultaneously changes the amplitude-input dimension from , the number of measured expectations, parameter count, and optimization geometry. Wide uncertainty bands further show that initialization and data partitioning are consequential. This architecture-coupled behavior is consistent with prior QML robustness studies in which circuit design and learned geometry, rather than qubit count alone, govern attackability [5], [7], [35].
- Encoding Interface: At four qubits, amplitude and angle encoding both attain 99.0% training accuracy, but they induce different attack surfaces (Figure 9). The angle-encoded interface lowers FGSM from 42.3% to 30.7% and PGD from 52.3% to 33.3%. It does not protect against the compound attack, which changes from 78.7% to 81.0%. Conditional executable ASR also falls, from 32.9% to 21.8% for NOP insertion and from 29.8% to 15.4% for RL.
The domain changes are model-dependent rather than independent of encoding: changing the bridge and circuit changes the classifier gradients and thus the Grad-CAM insertion site. Because amplitude encoding receives 16 bridge features and angle encoding four, feature dimensionality, gradient flow, and the optimization landscape change together with the gates; the result therefore characterizes the complete angle-encoded interface, which is less vulnerable to four of the five attacks. The compound result demonstrates that encoding choice alone is insufficient.
- Shot-Based Noise-Model Sensitivity: Figure 10 compares noiseless inference with FakeManilaV2 shot-based simulation. FGSM changes from 42.0% to 48.0%, PGD from 52.0% to 56.0%, and the compound attack from 79.0% to 81.0%. The largest mean shift is 6 points. The ranking is preserved: compound remains strongest, followed by PGD and FGSM.
The transferred adversarial examples therefore remain effective under device-derived noise and finite sampling. Prior work shows that noise can alter quantum-classifier robustness under specific assumptions [20]; here, no uniform protective or harmful effect appears, and the mean attack ranking is stable.
D. Interpretation
Three conclusions emerge from the combined results. First, threat-model validity changes the meaning of ASR. Feature-space attacks reveal differentiable sensitivity, but they do not produce executable malware. The Grad-CAM attacks operate under substantially tighter binary constraints, yet their conditional executable rates remain nontrivial. Recent ELF work similarly shows that effective evasion depends on where and how a binary can be transformed [4], [32], [33]. In Q-MALDetect, the fixed-volume experiment indicates that byte displacement at an influential boundary matters more than which NOP encoding is selected, explaining why the six-action RL policy does not outperform random choice.
Second, defense quality is threat-dependent. Dynamic AT performs best because its training distribution explicitly includes both gradient and reconstructed domain examples. The CAE is mismatched: it filters part of the additive perturbation

Fig. 6: Paired ASR before and after dynamic adversarial training. Faint lines show individual seeds, bold lines show means, and shaded regions show standard deviation. AT sharply reduces both feature-space and executable-aware attacks, although the sequential compound attack retains a 34.0% mean ASR.

Fig. 7: Feature-space ASR versus nominal perturbation budget for FGSM, PGD, and the sequential compound attack. Shaded bands denote standard deviation. The 10 values are logarithmically spaced from to ; values at or above 1 primarily reveal clipping-induced saturation.

Fig. 8: ASR across 2-9 qubits. Solid curves denote feature-space attacks and dashed curves denote conditional executable ASR. No attack exhibits a monotonic qubit trend; the compound attack remains highest at every width. Because the bridge and readout dimensions change with n, the plot is an architecture-width ablation rather than an isolated test of quantum resources.
but concentrates the classifier’s evidence in the same mutable section targeted by the executable-aware attacks. Robust preprocessing must therefore be evaluated against adaptive, problem-space mutations, not only against the perturbations it

Fig. 9: ASR for amplitude- and angle-encoded four-qubit models. The angle-encoded interface lowers FGSM, PGD, and both conditional executable rates, while the sequential compound attack remains approximately 80%. The bridge dimension changes with the encoding, so the comparison covers the complete interface rather than encoding gates alone.
was designed to remove.
Third, the quantum design variables do not yield a simple robustness law. Neither more qubits nor a different encoding guarantees protection, and the sequential attack remains strong across configurations. This agrees with the broader adversarial-QML literature: robustness is a property of the full data-encoding-circuit-optimizer system [5], [7], [19], [35].
V. CONCLUSION
Q-MALDetect demonstrates that a hybrid quantum-classical malware detector with high training accuracy can retain a broad adversarial attack surface. The undefended model reaches 78.7% ASR under the stronger sequential feature-space attack and conditional executable ASRs of 32.9% and 29.8% under Grad-CAM-guided NOP variants. Dynamic adversarial training reduces all five attacks, although the compound attack remains at 34.0%. CAE preprocessing lowers feature-space ASR but raises executable-aware ASR while shifting attribution toward .text, establishing a concrete defense mismatch. Qubit count has no monotonic robustness effect, angle encoding

Attack Type
Fig. 10: Feature-space ASR under noiseless simulation and 1,024-shot FakeManilaV2 noise-model simulation. Mean shifts are at most 6.0 percentage points, while the attack ranking is unchanged. FakeManilaV2 is a local simulator backend, not physical-hardware execution.
does not neutralize the compound attack, and FakeManilaV2 simulation preserves the attack ranking without constituting hardware validation. Robust QML malware detection therefore requires an explicit, multi-level threat model, reconstruction and functionality accounting, defense-specific adaptive testing, and matched classical comparisons; clean accuracy or generic denoising alone cannot support a security claim.
ACKNOWLEDGMENT
This work was supported in part by the NYUAD Center for Quantum and Topological Systems (CQTS), funded by Tamkeen under the NYUAD Research Institute grant CG008, and the Center for Cyber Security (CCS), funded by Tamkeen under the NYUAD Research Institute Award G1104.
REFERENCES
[1] L. Nataraj et al., “Malware images: Visualization and automatic classification,” in Proceedings of the 8th International Symposium on Visualization for Cyber Security (VizSec), 2011, pp. 1–7.
[2] I. J. Goodfellow, J. Shlens, and C. Szegedy, “Explaining and harnessing adversarial examples,” International Conference on Learning Representations (ICLR), 2015.
[3] A. Madry et al., “Towards deep learning models resistant to adversarial attacks,” in International Conference on Learning Representations (ICLR), 2018.
[4] A. Ravi, V. Chaturvedi, and M. Shafique, “ADVeRL-ELF: Adversarial elf malware generation using reinforcement learning,” in 2025 62nd ACM/IEEE Design Automation Conference (DAC). IEEE, 2025, pp. 1–7.
[5] W. El Maouaki, A. Marchisio, T. Said, M. Bennai, and M. Shafique, "AdvQuNN: A methodology for analyzing the adversarial robustness of quanvolutional neural networks," in 2024 IEEE International Conference on Quantum Software (QSW). IEEE, 2024, pp. 175–181.
[6] W. El Maouaki, A. Marchisio, T. Said, M. Shafique, and M. Bennai, "RobQuNNs: A methodology for robust quanvolutional neural networks against adversarial attacks," in 2024 IEEE International Conference on Image Processing Challenges and Workshops (ICIPCW). IEEE, 2024, pp. 4090–4095.
[7] W. El Maouaki, A. Marchisio, T. Said, M. Shafique, and M. Bennai, "Designing robust quantum neural networks via optimized circuit metrics," Advanced Quantum Technologies, p. 2400601, 2025.
[8] G. Barrué and T. Quertier, “Quantum machine learning for malware classification,” in Joint European Conference on Machine Learning and Knowledge Discovery in Databases. Springer, 2023, pp. 245–260.
[9] R. Liu, M. Eren, and C. Nicholas, “Can feature engineering help quantum machine learning for malware detection?” arXiv preprint arXiv:2305.02396, 2023.
[10] Z. Wang, K. W. Fok, and V. L. Thing, “Network attack traffic detection with hybrid quantum-enhanced convolution neural network,” Quantum Machine Intelligence, vol. 7, no. 1, p. 50, 2025.
[11] A. Khormali et al., “COPYCAT: Practical adversarial attacks on visualization-based malware detection,” in arXiv preprint arXiv:1909.09735, 2019.
[12] H. S. Anderson et al., “Learning to evade static pe machine learning malware models via reinforcement learning,” arXiv preprint arXiv:1801.08917, 2018.
[13] A. Kosikowski, D. Cho, M. Ninan, A. Ralescu, and B. Wang, “EvilELF: Evasion attacks on deep-learning malware detection over elf files,” in 2023 International Conference on Machine Learning and Applications (ICMLA). IEEE, 2023, pp. 1702–1709.
[14] D. Abreu, C. E. Rothenberg, and A. Abelém, “Qml-ids: Quantum machine learning intrusion detection system,” in 2024 IEEE Symposium on Computers and communications (ISCC). IEEE, 2024, pp. 1–6.
[15] W. El Maouaki, N. Innan, A. Marchisio, T. Said, M. Bennai, and M. Shafique, “Quantum clustering for cybersecurity,” in 2024 IEEE International Conference on Quantum Computing and Engineering (QCE). IEEE, 2024, pp. 5–10.
[16] R. Bhatnagar et al., “Meta-quantum ensemble framework for robust network intrusion detection,” arXiv preprint arXiv:2605.28879, 2026.
[17] W. El Maouaki, A. Marchisio, and M. Shafique, “Q-LEAK: Quantum-based LEAKage verification for side-channel countermeasures,” in 2026 IEEE International Conference on Quantum Computing and Engineering (QCE). IEEE, 2026.
[18] W. El Maouaki, A. Marchisio, and M. Shafique, “QGCL: Quantum-guided clause learning for cryptanalytic SAT,” arXiv preprint arXiv:2605.25756, 2026.
[19] H. Liao, I. Convy, W. J. Huggins, and K. B. Whaley, “Robust in practice: Adversarial attacks on quantum machine learning,” Physical Review A, vol. 103, no. 4, p. 042427, 2021.
[20] Y. Du et al., “Quantum noise protects quantum classifiers against adversaries,” Physical Review Research, vol. 3, no. 2, p. 023153, 2021.
[21] J. Guan, W. Fang, and M. Ying, “Robustness verification of quantum classifiers,” in International Conference on Computer Aided Verification. Springer, 2021, pp. 151–174.
[22] M. Weber et al., “Optimal provable robustness of quantum classification via quantum hypothesis testing,” npj Quantum Information, vol. 7, no. 1, p. 76, 2021.
[23] W. Gong and D.-L. Deng, “Universal adversarial examples and perturbations for quantum classifiers,” National Science Review, vol. 9, no. 6, p. nwab130, 2022.
[24] W. Ren et al., “Experimental quantum adversarial learning with programmable superconducting qubits,” Nature Computational Science, vol. 2, no. 11, pp. 711–717, 2022.
[25] N. Innan et al., “Quantum neural networks under threat: Modeling security risks and attack vectors,” in International Conference on Quantum Engineering Sciences and Technologies for Industry and Services. Springer, 2025, pp. 129–139.
[26] W. El Maouaki, N. Innan, A. Marchisio, T. Said, M. Bennai, and M. Shafique, “QFAL: Quantum federated adversarial learning,” arXiv preprint arXiv:2502.21171, 2025.
[27] W. El Maouaki, N. Innan, A. Marchisio, T. Said, M. Shafique, and M. Bennai, “RobQFL: Robust quantum federated learning in adversarial environment,” arXiv preprint arXiv:2509.04914, 2025.
[28] W. El Maouaki and M. Shafique, “Q-RAIL: A reliability-aware framework for quantum federated learning on heterogeneous noisy hardware,” in 2026 IEEE International Conference on Quantum Computing and Engineering (QCE). IEEE, 2026.
[29] nimrodpar, “Labeled-Elfs: A collection of well labeled elf binaries,” GitHub repository, 2019, available: https://github.com/nimrodpar/Labeled-Elfs.
[30] V. Bergholm et al., “PennyLane: Automatic differentiation of hybrid quantum-classical computations,” arXiv preprint arXiv:1811.04968, 2018.
[31] R. R. Selvaraju et al., “Grad-CAM: Visual explanations from deep networks via gradient-based localization,” in Proceedings of the IEEE International Conference on Computer Vision (ICCV), 2017, pp. 618–626.
[32] M. Xue et al., “A reinforcement learning-based ELF adversarial malicious sample generation method,” IEEE Journal on Emerging and Selected Topics in Circuits and Systems, vol. 14, no. 4, pp. 743–757, 2024.
[33] L. Hrdonka and M. Jureček, “Adversarial malware generation in linux elf binaries via semantic-preserving transformations,” arXiv preprint arXiv:2604.22639, 2026.
[34] Y. Qiao et al., “Adversarial ELF malware detection method using model interpretation,” IEEE Transactions on Industrial Informatics, vol. 19, no. 1, pp. 605–615, 2023.
[35] M. T. West et al., “Benchmarking adversarially robust quantum machine learning at scale,” Physical Review Research, vol. 5, no. 2, p. 023186, 2023.