Q-MALDetect: Quantum Image Malware Detection and Adversarial Robustness AnalysisQ-MALDetect: Quantum Image-Based Malware Detection and Adversarial Robustness Analysis
The authors evaluate Q-MALDetect: without defenses, compound feature-space ASR is 78.7%, and NOP-condition ASR is 32.9%.
Non-targeted evasion: starting from malware already classified as malicious, seek a benign prediction. The attacker has access to the trained model; FGSM/PGD require end-to-end gradients (marked as white-box in Figure 1). Executable-aware attacks are limited to semantically neutral NOP insertion and ELF repair, and candidate mutations are evaluated using model confidence. The victim system is Q-MALDetect.
- Static detection of ELF on Linux often turns bytes into images and then uses a CNN, but adversarial perturbations can cause misclassification, and image perturbations do not necessarily correspond to valid executable files. The authors consider it still unclear whether hybrid QML detectors are robust under feature-space attacks and executable-aware mutations.
- Q-MALDetect turns the first 50176 bytes of an x86-64 ELF into a 224×224 image, and a CNN performs 4-qubit amplitude encoding via a bridge. It evaluates white-box FGSM, PGD, compound, and Grad-CAM-guided NOP insertion; defenses are dynamic adversarial training and CAE.
- Balanced training-set accuracy 97.2%, malware recall 99.6%. On held-out malicious samples, without defenses compound ASR is 78.7%, and NOP-condition ASR is 32.9%. After dynamic adversarial training, compound is still 34.0%; CAE raises NOP-condition ASR to 39.7%.
- The paper has no separate limitations section. The conclusion states that FakeManilaV2 does not constitute hardware validation, and says that security conclusions require multi-layer threat models, reconstruction and functional accounting, adaptive testing against defenses, and matched comparisons with classical methods. The experiments do not report reconstruction coverage.
- Evaluated models
- Q-MALDetect
- Benchmarks
- Labeled-ELFsFakeManilaV2
- Metrics
- accuracyprecisionmalware recallfalse-positive rateASRASRexec
Q-MALDetect is a convolutional-variational quantum malware detector for x86-64 ELF byte images, with a strongest feature-space attack success rate of 78.7%. Among executable-aware attacks, Grad-CAM-guided NOP insertion has the highest conditional ASR (32.9%), and dynamic adversarial training can reduce feature-space ASR to 5.0%. Convolutional autoencoder preprocessing instead raises executable-aware ASR to 39.7%, and the number of qubits has no monotonic relationship with robustness.
Paper analysis
What problem does this paper attempt to solve?
The authors evaluate the robustness of a hybrid quantum ELF detector under feature-space and executable-aware evasion.
The core question is: whether a high-recall hybrid quantum ELF detector remains robust under feature-space perturbations and executable-aware mutations.
- Scenario: The authors state that Linux malware has become a critical security issue, with servers, embedded platforms, and IoT devices commonly relying on ELF. Byte-to-image static detection via CNN can avoid the cost of dynamic sandboxes, but small adversarial perturbations can cause high-confidence misclassification.
- Existing gaps: The authors state that arbitrary feature-space perturbations do not necessarily correspond to valid executable files. Existing QML robustness research mostly uses standard images, while adversarial malware research mainly targets classical models.
- Four questions: whether clean data can be fit to a high-recall operating point; which feature-space and executable-aware attacks are effective under what conditions; whether adversarial training and CAE provide consistent protection; how perturbation budget, number of qubits, encoding interface, and simulated hardware noise change the attack surface.
- Content of this paper: The authors present Q-MALDetect, based on an existing hybrid detector design, performing a joint robustness evaluation of the full pipeline against two classes of threats, and comparing dynamic adversarial training with a convolutional autoencoder (CAE).
- Threat model:
- Goal: non-targeted evasion. Starting from samples already correctly classified as malware, seek a benign prediction.
- Knowledge: all attacks assume access to the trained model. FGSM and PGD require end-to-end gradients, marked as white-box gradients in Figure 1. Grad-CAM attacks require attribution gradients and model confidence feedback for evaluating candidate mutations.
- Capability: feature-space attacks modify the normalized byte image, and the paper does not claim they correspond to valid executable files. Executable-aware attacks are limited to semantically neutral NOP insertion with ELF repair. Truncation means attacks and explanations involve only the first 50,176 bytes.
- Decision: label 1 is malware, threshold 0.5. ASR counts only initially correctly classified samples; executable-aware success additionally requires a structurally valid reconstructed file that is semantically neutral by design to be classified as benign.
What related research exists?
The authors define the gap as: hybrid QML malware detection lacks a unified evaluation of the two classes of attacks.
Byte images and classical evasion
- Nataraj et al. (2011) mapped executable bytes to images and performed automatic classification; this is the source of the byte-image approach in this paper.
- COPYCAT (Khormali et al., 2019) injects adversarial content into malware representations; Anderson et al. (2018) use reinforcement learning to search executable transformations to evade static PE machine-learning detectors.
- EvilELF (Kosikowski et al., 2023) studies structural modifications to Linux binaries; ADVeRL-ELF (Ravi et al., 2025) inserts semantic NOPs into the ELF code region to evade image-based ResNet detectors. The authors state that executable constraints usually reduce attacker degrees of freedom, but yield a threat model closer to operation.
Quantum methods in security analysis
- Barrué and Quertier (2023) study QML malware classification; Liu et al. (2023) discuss whether feature engineering helps QML malware detection.
- Wang et al. (2025) use a hybrid quantum-enhanced CNN to detect network attack traffic; Abreu et al. (2024) present a QML intrusion detection system. Similar citations also cover quantum clustering, side channels, and related security tasks.
- The paper only describes the tasks of these works and does not treat them as experimental baselines in this paper.
Adversarial quantum machine learning
- Liao et al. (2021) and subsequent work cover attacks on QML, training-based defenses, robustness verification, and universal perturbations; Ren et al. (2022) demonstrate experiments on programmable superconducting qubits. Du et al. (2021) report that quantum noise can protect quantum classifiers under specific assumptions.
- More recent work examines architectures, expressivity, transferability, circuit metrics, and federated robustness, including AdvQuNN, RobQuNNs, QFAL, RobQFL, and the scaled evaluation by West et al. (2023).
- The authors state that these results support attack-aware QML design, but do not establish robustness in executable malware scenarios.
Experimental comparisons and data
- Attack comparisons are FGSM, PGD, PGD initialized with FGSM, and Grad-CAM-guided random NOP and tabular Q-learning. Defense comparisons are dynamic adversarial training in the min-max form of Madry et al. (2018), and CAE preprocessing. The data is Labeled-ELFs (nimrodpar, 2019).
- The authors state that when comparing with prior ELF attacks, differences in models, architectures, mutation sets, budgets, denominators, and functional checks must be considered.
The authors position this paper as filling a gap: existing work has not uniformly evaluated differentiable feature-space attacks and attribution-guided executable mutations on hybrid QML malware detectors, nor examined whether a defense can block one class of threat while exposing another.
How does the paper address this problem?
The byte image is fed via a CNN into a variational circuit, then evaluated with white-box gradient attacks and Grad-CAM-guided NOP insertion.
Q-MALDetect turns the first 50,176 bytes of an x86-64 ELF into a grayscale image, passes it through a CNN and a fully connected bridge into a variational quantum circuit, and then compares, on the same pipeline, white-box feature-space attacks, Grad-CAM-guided NOP mutation, and two defenses.
Data and operating point
- Scale and split: Labeled-ELFs has 1,300 x86-64 ELFs in total, 600 benign and 700 malicious. The training pool is all 600 benign plus 600 malicious; the remaining 100 malicious samples do not participate in training and are used only for attack evaluation.
- Representation: Short files are zero-padded, long files are truncated, bytes are divided by 255, yielding a 224×224 image over x∈[0,1]. Attacks and explanations cover only this visible region.
- Operating point: Clean metrics are computed on the balanced training set, and each model's operating point is fixed. Each ASR is measured on the aforementioned unseen malicious samples, to match the threat model of malware escaping toward benign.
Hybrid detector
- Front end: Three stride-2 convolutions with ReLU, adaptive average pooling to 4×4, flattened to h∈R^1024.
- Default interface: Four qubits, one layer, amplitude encoding. The bridge is z=π tanh(W1 h), z∈[-π, π]^16. The circuit input divides z by max(‖z‖2, δ), with δ>0 a small constant. One PennyLane StronglyEntanglingLayers processes this state.
- Readout and training: Four Pauli-Z expectation values go through a linear layer and sigmoid to give the malware probability, with threshold 0.5. The learning rate is 0.001 for the CNN and bridge, and 0.01 for the quantum parameters and output head. The optimizer is Adam, the loss is binary cross-entropy, the batch size is 32, and training runs for 10 epochs.
Feature-space attacks
- FGSM: One step along the sign of the loss gradient, then clipped to [0,1]. The main experiment uses ε=0.01.
- PGD: 50 steps, step size α=0.001, with projection after each step onto the intersection of the ℓ∞ neighborhood and [0,1], ε=0.01.
- compound: FGSM first, then PGD from that intermediate point; the second projection is centered on the intermediate point. Both segments use the same nominal ε, and the displacement relative to the original input can reach 2ε before clipping. The authors call this a stronger sequential threat model, not a same-budget comparison with FGSM or PGD. None of the three attack types claims to generate valid executables.
Executable-aware attacks
- Localization: At the third convolutional layer, Grad-CAM ranks image positions, which are mapped back to byte offsets, restricted to .text, and aligned with Capstone to nearby instruction boundaries. Boundaries crossed by short relative jumps are rejected. All NOPs for the same sample accumulate at one accepted boundary.
- Repair: After insertion, .text is extended, and the relevant header fields, addresses, and references that cross the cut are updated; then LIEF re-parses. The authors state that multi-byte NOPs do not change architectural state and that the listed cross-cut references are all repaired, so the mutation is semantically neutral by design. Each rebuild checks structural validity and re-read consistency; smoke tests target the rebuilt benign tools.
- Random NOP: One NOP is chosen at random from 6 NOP encodings of length 6–11 bytes, inserted each round, and the first 50,176 bytes are re-read and the detector queried. Stops on label flip or at 200 rounds. Only evasions after rebuild, re-parse, and re-scoring count.
- Tabular Q-learning: Tests whether choosing a specific NOP encoding can beat random. The state is 10 confidence buckets; the actions are the 6 NOPs. The reward is 10 when the new confidence is below 0.5, otherwise a piecewise reward based on the confidence change. The Q-table learning rate is 0.1, discount 0.9; the exploration rate decays from 0.9 by 0.995 per round to 0.05. It is fit for 8 passes on development-set malicious samples, at most 200 rounds per pass, and then the frozen greedy policy is applied to the held-out set.
Defenses, ablations, and criteria
- Dynamic adversarial training: min-max per Madry et al. for 5 fine-tuning epochs. Each round generates new PGD samples against the current model, replaces 50% of the corresponding development samples, and adds static rebuilt NOP and RL samples generated from development-set malicious samples. Held-out attack samples do not participate in fine-tuning.
- CAE: A four-layer encoder reduces 224×224 to 14×14×128, then to 128 dimensions; a symmetric four-layer transposed-convolution decoder reconstructs with sigmoid. It is trained on clean development data with mean squared error and Adam (learning rate 0.001) for 20 epochs, then frozen, and the classifier is trained on reconstructed inputs. White-box feature-space attacks differentiate through the full CAE–classifier pipeline.
- Ablation variables: The number of qubits n ranges from 2 to 9; on four qubits, amplitude embedding is compared with four-feature angle embedding, with bridge dimensions 16 and 4 respectively. ε takes 10 log-spaced points from 10^{-3} to 10^{1}. The noise experiment evaluates adversarial inputs generated by the noiseless model on a 1,024-shot FakeManilaV2 local backend.
- Criteria: The feature-space success rate counts only initially correctly classified samples,
ASR = #{i : f(x_i)=1, f(x_i^{adv})=0} / #{i : f(x_i)=1} \times 100\%The denominator of the executable metric is the subset R for which a safe boundary was found and a structurally valid rebuild was completed,
ASR_{exec} = #{i \in R : f(x_i^{rebuilt})=0} / |R| \times 100\%The total success rate is ASRexec times |R|/|I|. The authors state that ASRexec is an upper bound at 100% rebuild coverage, and that the two ASR types measure different vulnerabilities and cannot be compared directly. Unless noted, 3 seeds are used, reporting mean±standard deviation.
What experiments did the paper conduct?
The compound ASR without defenses is 78.7%; after adversarial training it is still 34.0%, and under CAE the NOP-condition ASR is 39.7%.
Experimental Setup
- Detector: The system under test is Q-MALDetect. Default is 4 qubits, 1 layer, amplitude encoding; there is also an angle-encoding interface and a width sweep for n=2–9. There is no separate reviewer model; labels are given by the detector at threshold 0.5.
- Data: 1,300 x86-64 ELFs from Labeled-ELFs (600 benign, 700 malicious). The training pool is 1,200; Figure 1 labels 100 malicious samples as Test (Held out). The main text states that clean metrics are computed on the balanced training set, and ASR is measured on these unseen malicious samples.
- Attacks: The main experiments for FGSM and PGD use ε=0.01; PGD is 50 steps with α=0.001. The two stages of compound share a nominal ε, and displacement can reach 2ε before clipping. Domain attacks are Grad-CAM+NOP and Grad-CAM+RL, at most 200 rounds per sample.
- Defenses: Dynamic adversarial training for 5 epochs, with new PGD replacing 50% of development samples each round, plus NOP/RL reconstruction samples. CAE has latent dimension 128 and is frozen after 20 epochs of training.
- Clean operating point: The training-set means for the evaluated runs are accuracy 97.2%±1.0%, precision 95.1%±1.4%, malware recall 99.6%±0.8%, and false positive rate 5.2%±1.5%. Figure 3 is a single illustrative run: loss goes from 0.6815 to 0.0605, and training accuracy from 56.41% to 98.44%; it is not the above means.
- Repetition: 3 seeds unless noted. Figure 5 uses 5 seeds, and Figure 7 uses 10 seeds. The paper does not report how many of the 100 held-out samples were initially classified correctly.
Main Results
The table below uses the main-text readings of Figure 4 in Section IV. The bar labels in the figure round the means to integers. The first three columns are feature-space ASR, and the last two are conditional executable ASR; the paper states that the two cannot be directly compared.
Swipe horizontally to read the table
Condition FGSM PGD Compound NOP RL No defense 42.3% 52.3% 78.7% 32.9% 29.8% CAE 25.3% 27.3% 50.7% 39.7% 37.2% Dynamic adversarial training 5.0% 5.7% 34.0% 9.0% 7.7% - The authors state that dynamic adversarial training is the strongest of the defenses evaluated in Figure 4, with all five decreasing; the authors give feature-space reductions of 37.3, 46.6, and 44.7 percentage points. The authors state that the residual ordered attacks matter because PGD hardening does not fully cover compound, whose displacement can exceed the single-stage training budget. In Figure 6, these decreases appear on paired seeds, not as a single outlier run.
- The authors state that CAE produces results that reverse with the threat: it weakens additive image perturbations but is harmful against the two executable-aware attacks. Across 495 paired images, Grad-CAM activation quality within .text goes from 35.2% to 45.7%, with a mean shift of 10.5 percentage points given by the authors, and 60% of samples in the same direction. The authors state that this by itself does not prove causation, but is consistent with an increase in attacks targeting .text.
- The authors state that compound is strongest, consistent with its two-stage optimization and possibly doubled displacement budget. Random NOP and RL are close; the authors state that the mean difference in favor of random selection is 3.1 percentage points, falling within seed variation.
Fixed Insertion Amount and Action Selection
- What was measured: The total insertion amount is fixed at 2,520 bytes, comparing constant-action policies with NOP lengths 6–10, across five seeds (Figure 5).
- Results: The conditional executable ASR means are, in order, 35.1%, 44.8%, 26.5%, 40.5%, and 34.6%.
- Authors' interpretation: The authors state that the sequence is non-monotonic and that variation across seeds is larger than a stable length trend; total layout displacement at the early .text boundary matters more than the semantic identity of a particular NOP. The Q-table learns state-dependent preferences, with a mean within-state action value difference of 2.2 (1.6–3.0 across seeds), but the authors state that this does not improve ASR because the actions do not change the insertion location.
Encoding Interface
- What was measured: Amplitude embedding versus four-feature angle embedding on four qubits (Figure 9). The bridge dimension is 16 versus 4, and gradient flow and encoding gates change together.
- Results: Both have training accuracy 99.0%. The angle interface's FGSM, PGD, compound, NOP, and RL are 30.7%, 33.3%, 81.0%, 21.8%, and 15.4%, respectively; the amplitude interface matches the main-text Figure 4 values of 42.3%, 52.3%, 78.7%, 32.9%, and 29.8%.
- Authors' interpretation: The authors state that the angle interface is less vulnerable to four of the five attacks, but compound goes from 78.7% to 81.0%, so the encoding choice alone is insufficient to block that attack. The authors state that domain attack locations change with the classifier gradient, so the results characterize the full interface, not the effect of the encoding gates alone.
Noise Model Sensitivity
- What was measured: Adversarial inputs are generated against the noise-free model and then evaluated on 1,024-shot FakeManilaV2 (Figure 10). The caption states that this is a local simulator backend, not physical hardware execution.
- Results: FGSM goes from 42.0% to 48.0%, PGD from 52.0% to 56.0%, and compound from 79.0% to 81.0%. The caption states that mean shifts are at most 6.0 percentage points, with the ranking unchanged.
- Authors' interpretation: The authors state that no uniformly protective or uniformly harmful effect appeared. This noise-free starting set is not the same set of readings as the 42.3%, 52.3%, and 78.7% in Figure 4.
Other Ablations and Analyses
- Qubits: n∈{2,3,4,5,6,7,8,9} (Figure 8). The authors state that there is no monotonic relationship with robustness; FGSM and PGD have local lows near four qubits and eight qubits, and rise again at nine qubits. Compound is highest at every width, which the authors state is roughly from 60% to 87%; the domain attacks in this set are mostly 5%–20%. The paper does not give point-by-point readings, and this range does not correspond point by point to the 32.9% and 29.8% in Figure 4. When n changes, bridge weights go from 4,096 to 524,288, and rotation angles from 6 to 27.
- Perturbation budget: 10 logarithmically spaced ε from 10^{-3} to 10^{1}, 10 seeds (Figure 7). The authors state that ASR rises most steeply and uncertainty is widest roughly between 8×10^{-3} and 2×10^{-2}; PGD and compound approach saturation only roughly between 6×10^{-2} and 2×10^{-1}, rather than exactly at ε=0.02. When ε≥1, feasible inputs are determined by [0,1] clipping rather than the nominal ℓ∞ radius. The authors state that FGSM decreases slightly at the largest nominal budget, which is not evidence that very large perturbations restore robustness.
What are some points that can be further explored?
The conclusion states that simulated noise does not constitute hardware validation, and calls for multi-layer threat models and matched comparisons with classical methods.
Limitations and future directions noted by the authors
The paper has no separate Limitations or Future Work section. The limitations and requirements explicitly stated in the Conclusion are as follows.
- Hardware validation: The authors write that the FakeManilaV2 simulation preserves the attack ordering but does not constitute hardware validation (Conclusion). The Figure 10 caption also states that this backend is not physical hardware execution.
- Requirements for deployment: The authors state that robust QML malware detection requires an explicit multi-layer threat model, reconstruction and functional accounting, adaptive testing against specific defenses, and matched comparisons with classical methods (Conclusion).
- Evidence that cannot stand alone: The authors state that clean accuracy or generic denoising alone cannot support security conclusions (Conclusion).
Scope of experimental coverage
- Data: The experiments use 1,300 x86-64 ELFs from Labeled-ELFs, with a training pool of 1,200 and 100 malicious samples held out for attack; clean metrics are computed on the balanced training set (Section III-A, Figure 1).
- Attacks and defenses: FGSM, PGD, compound, Grad-CAM+NOP, Grad-CAM+RL, as well as dynamic adversarial training and CAE, are reported (Figure 4, Section IV-B).
- Ablations and noise: Coverage includes 10 ε values, 2–9 qubits, amplitude and angle encoding, NOP lengths 6–10 at a fixed 2,520 bytes, and 1,024-shot FakeManilaV2 (Section IV-C, Table I).
- Repetitions: 3 seeds unless noted; Figure 5 uses 5 seeds and Figure 7 uses 10 seeds (Table I, Section IV).
- Not reported in the paper: the number of samples initially classified correctly in the held-out set, the reconstructable subset |R|, and the overall success rate ASRexec×|R|/|I| defined in the main text; nor the clean accuracy and false positive rate after adversarial training or CAE. The Conclusion mentions the need for matched classical comparisons, but the experiments do not give numbers for that comparison.
Summarize the main content of the paper
Training set accuracy is 97.2%, and the no-defense compound ASR is 78.7%; defense effectiveness varies with threat type.
Q-MALDetect is a hybrid convolutional–variational quantum detector for x86-64 ELF byte images. The question the authors aim to answer is: can high recall on the training set simultaneously withstand white-box image perturbations and NOP mutations that preserve executability.
- Setup: Of 1,300 ELFs, 1,200 are used for development, and 100 malicious samples are used only for attacks. The first 50,176 bytes of each file are made into a 224×224 image. The default model is a three-layer CNN, amplitude encoding, 4 qubits, and a 1-layer variational circuit, with threshold 0.5.
- Attacks: FGSM, 50-step PGD, and compound, whose displacement can reach 2ε before clipping, are all white-box feature-space attacks and do not claim to produce valid executable files. Two other attacks use Grad-CAM on the third convolutional layer to accumulate semantically neutral NOPs at a single safe .text boundary, for at most 200 rounds; one selects encodings randomly, and one uses tabular Q-learning.
- Clean fit: On the balanced training set, accuracy is 97.2%±1.0%, malware recall 99.6%±0.8%, and false positive rate 5.2%±1.5%. This is the training-set operating point, not held-out accuracy.
- Undefended attack surface: On held-out malicious samples, compound's feature-space ASR is 78.7%, FGSM 42.3%, and PGD 52.3%. Grad-CAM+NOP and RL's conditional executable ASR are 32.9% and 29.8%; the authors state that the 3.1 percentage point gap between random and learned strategies falls within seed variation.
- Defenses are not symmetric: After dynamic adversarial training, the five ASRs are 5.0%, 5.7%, 34.0%, 9.0%, and 7.7%. CAE lowers feature-space ASR but raises the two conditional executable ASRs to 39.7% and 37.2%, while .text attribution quality goes from 35.2% to 45.7%. Angle encoding does not suppress compound (81.0%). Under 1,024-shot FakeManilaV2, the attack ranking is unchanged, with mean shifts of at most 6.0 percentage points.
The authors' conclusion is: whether attacks and defenses are effective depends strongly on the perturbation constraints and evaluation conditions. The authors state that looking only at clean accuracy or generic denoising cannot support security conclusions; FakeManilaV2 also does not constitute hardware validation.