WorksComputer Science
Validation-Guided Prompt Selection for Differential Morphing Attack Detection
Abstract
Differential morphing attack detection (D-MAD) compares a trusted live capture with a document image that may contain a facial morph. We investigate whether labelled validation data can improve a frozen-parameter vision-language evaluator through prompt selection rather than model fine-tuning. Version~1 generates 50 candidate prompts and selects the top-ranked instruction using a security-oriented loss that prioritises missed morph attacks (MACER) while accounting for bona fide classification errors (BSCER), response failures, parse failures, and decision inconsistency. Version~2 recursively revises prompts using aggregate validation feedback. On a subject-disjoint test set of 160 pairs spanning LMA, MIPGAN-2, and PIPE, the selected Version~1 prompt achieves a (19.17%) morph attack classification error rate (MACER), with (0.00%) observed bona fide sample classification error rate (BSCER), compared with (70.00%) MACER for a controlled manual prompt. The paired (50.83) percentage-point difference has a (95%) subject-bootstrap interval of ([43.33,58.33]). Recursive revision does not surpass the best Generation~0 validation loss; the reported revised descendant obtains (31.67%) test MACER. All 23 attacks missed by Version~1 are landmark-based (LMA) morphs. Overall, the results show that prompt formulation can substantially influence frozen-parameter VLM-based D-MAD performance, while also highlighting the challenge of recursive prompt refinement under a compact 10-subject validation setting.
00_WACV_DMAD_main_8page_final_V5_submission.pdf
Introduction
Face verification is central to Automated Border Control (ABC), where a live capture is compared with the face image stored in an electronic machine-readable travel document [13]. This process assumes that the document image represents one genuine identity. Face morphing attacks violate this assumption by combining information from two contributors, allowing both to resemble the document photograph during enrolment or later verification [4, 23]. Such attacks can be produced through landmark-based blending [12], GAN-based synthesis [25], and diffusion-based generation [26].
Single-image MAD examines a document image in isolation, whereas Differential MAD (D-MAD) compares it with a trusted live capture. The differential setting provides identity evidence that is unavailable in single-image inspection and therefore fits the ABC workflow. Most D-MAD methods nevertheless require labelled morph pairs to train a classifier or adapt a pretrained representation [2, 8]. Their development is constrained by limited biometric data and by the difficulty of covering morph generation and acquisition conditions that may arise after deployment.
A frozen-parameter Vision-Language Model (VLM) offers a complementary approach because it can compare two facial images without model fine-tuning. Existing studies demonstrate zero-shot MAD and related presentation attack detection with manually defined prompts [11, 19, 23, 27]. Prompt choice therefore remains an uncontrolled experimental factor. Within VLM-based MAD, no subject-disjoint validation rule has been studied for selecting among alternatives. Our procedure uses validation labels and is supervised prompt selection, although no model parameters are updated.
We treat prompt design as a controlled D-MAD variable. Version 1 generates 50 candidates, ranks them on a validation split with disjoint subjects, and fixes the top-ranked prompt before testing. Version 2 starts from 30 Generation 0 prompts and revises selected candidates using aggregate validation feedback. Both variants minimise the security loss , which prioritises missed attack reduction while accounting for bona fide errors and response reliability. The evaluator configuration is held constant within each comparison, and no test image, label, or metric contributes to prompt generation or selection.
The main contributions of this work are:
We instantiate prompt design as a validation-guided selection problem and compare a manual prompt, non-recursive selection, and recursive optimisation under the same frozen-parameter evaluator configuration and test
protocol.
We define a failure-aware evaluation protocol with MACER-oriented prompt ranking, OR decision fusion, maximum morph-risk-score fusion, and explicit handling of response and parse failures.
We evaluate subject-disjoint bona fide and morph pairs covering different morphing generation techniques such as LMA [7], MIPGAN-2 [25], and PIPE [26], with analyses of morph-specific errors, response budget, subject-level uncertainty, and recursive optimisation behaviour.
Related Work
Conventional D-MAD. Early differential approaches compare facial representations extracted from the document image and live capture. The resulting feature difference or similarity is evaluated directly or passed to a lightweight classifier such as an SVM [10, 13, 22]. These methods benefit from identity information in the trusted reference image, but their performance depends on the representation model, the training attacks, and the availability of labelled morph pairs. De-morphing methods instead estimate and remove the live capture contribution before testing whether the residual is compatible with another identity [6, 9]. Their behaviour can depend on assumptions about the blending process and the quality of the input images.
Foundation models for MAD. Pretrained foundation models reduce the need to learn representations from limited biometric data. MADation [3] and FoundPAD [18] adapt CLIP with LoRA for MAD/PAD, while DifFoundMAD [8] uses differential DINO features with a lightweight trainable component. These methods require labelled adaptation data. Training-free studies instead use image-text or multimodal language models with predefined prompts for MAD and related biometric attack detection [11, 19, 23, 27].
Prompt design in biometric security. Recent work explores prompting multimodal models for biometric tasks. Zhang et al. [27] use designed prompts for zero-shot MAD; Shekhawat et al. [23] extend this to D-MAD with chain-of-thought instructions; Patwardhan et al. [19] compare manually written prompts; and Narayan et al. [14] evaluate zero-shot, task-description, and chain-of-thought prompting across face tasks. These studies show prompt sensitivity but do not select an instruction using subject-disjoint labelled validation data. General prompt optimisation generates, selects, or iteratively refines instructions [20, 24, 28]. We instead treat prompt choice as a controlled D-MAD variable: candidates are ranked on subject-disjoint validation data and frozen before test evaluation. Thus, our contribution is supervised black-box prompt selection for D-MAD, not a new general prompt-optimisation algorithm.
Proposed Method
This section formulates the D-MAD task and introduces the evaluator schema and prompt-selection framework used throughout the study.
D-MAD Formulation and Evaluator Schema
A D-MAD sample is represented by an image pair , where is a trusted bona fide reference or live capture image and is a document image presented for verification. The ground truth label is , with denoting a bona fide pair and denoting a morphing attack. The objective is to predict whether is a morphing attack relative to . The morph generation method is not supplied to the evaluator or to any agent in the framework.
GPT-4o [16] serves as the D-MAD Evaluator VLM shown in Figure 1. Its multimodal input support and structured outputs allow prompt formulations to be compared under a common evaluator configuration. “Frozen” denotes that the authors perform no fine-tuning or parameter updates; it does not imply control over provider-side model updates. For a prompt , image pair , and response index , the evaluator produces

Figure 1. Agentic prompt generation framework for D-MAD. Version 1 and Version 2 Generation 0 follow the solid path from prompt generation to validation. Recursive Version 2 candidates follow the dashed path from the Scoring Module through the Prompt Optimizer and Prompt Critic before returning to the Candidate Pool. The selected prompt is fixed before test evaluation. Test responses are subsequently combined by deterministic decision and score fusion.
where denotes an evaluator that receives no author-controlled parameter updates. All evaluator queries use a temperature of zero. Prompt generation and recursive prompt revision use separate settings described in Sections 3.2 and 3.5.
The evaluator returns a structured JSON response containing a same-identity assessment, an identity confidence score, a binary morph detection decision, a morph risk score on a 0–100 scale, up to three items of observable evidence, an image-quality caveat, and a decision reliability level. The morph detection field defines the response decision , and the morph risk value is rescaled to . We refer to this value as a morph risk score because it is not a calibrated probability; it is used only for ranking, threshold analysis, and EER computation. The evidence is retained as a model-generated rationale, not as a verified causal explanation.
The experiments consider landmark-based morphing (LMA) [7, 12], MIPGAN-2 [25], and the diffusion-based PIPE method [26]. These technique labels are used only after inference to report performance by morphing method. They are not included in the task prompt, Candidate Pool, Frozen Prompt Bank, or Detection Output.
For a set of morphing attack pairs and bona fide pairs , the primary decision error rates are the Morphing Attack Classification Error Rate (MACER) and the Bona Fide Sample Classification Error Rate (BSCER). We use BSCER rather than the presentation-oriented BPCER, following morphing attack evaluations such as FVC-onGoing and NIST FATE MORPH [1] [15], because a D-MAD decision is taken on a stored document sample rather than on a live presentation at a capture device, which also keeps the terminology consistent with MACER. They are defined as
and
where denotes a pair for which no usable decision is returned; such a pair is counted as an error for its ground-truth class. We report
together with EER computed from the fused morph risk scores. The repeated response fusion rule, invalid response handling, reliability measures, and security loss used for validation are defined in § 2.0.3.
Prompt Generation and Selection Framework
Figure 1 separates the framework into an offline phase for prompt generation, validation, and selection and an online phase for test evaluation. Version 1 sends generated candidates directly to validation and stores the selected prompt in the Frozen Prompt Bank. Version 2 routes aggregate validation metrics to the Prompt Optimizer Agent; its revised candidates are screened by the Prompt Critic Agent before entering the next Candidate Pool. The framework therefore contains three role-conditioned VLM components—Prompt Generator, Prompt Critic, and Prompt Optimizer—together with the frozen-parameter D-MAD Evaluator VLM and deterministic scoring and fusion modules.
Prompt Generator Agent: The Prompt Generator Agent receives the task description, constraints, seed prompt, and output schema of Figure 1. The constraints prohibit protected attribute cues, require observable biometric and image-forensic evidence, and enforce a structured JSON response. It produces 50 candidates for Version 1 and 30 Generation 0 candidates for Version 2 at temperature 0.8. It never receives validation pairs, subject identities, or labels.
Prompt Critic Agent: The Prompt Critic Agent screens candidate text for protected attribute cues, assumptions about a known morph generator, requests for hidden reasoning, unsafe content, and omissions in the required JSON instruction. It is applied only to Version 2 candidates from Generation 1 onwards; Generation 0 and the Version 1 pool are produced directly from the common task specification and bypass this screen. The Critic Agent never receives facial images or class labels.
D-MAD Evaluator VLM and Scoring Module: The D-MAD Evaluator VLM receives a candidate prompt and a validation image pair . No model parameters are updated, and only the prompt text varies. Version 1 uses three responses per validation pair and applies the fusion rule in § 2.0.3; Version 2 uses one response per pair during recursive optimisation, as described in § 2.0.5. The Scoring Module converts the decisions and morph risk scores into MACER, BSCER, ACER, reliability measures, and . These quantities are used only for ranking and optimisation on the validation split.
Prompt Optimizer Agent: The Prompt Optimizer Agent is active only in Version 2. It receives selected prompt texts, aggregate validation metrics, and a summary of the largest error terms, but no test data, subject identities, image pairs, individual predictions, or labels for individual pairs. It uses this feedback to produce revised candidates targeting lower validation error, better response validity, or greater decision stability. The optimiser is the same underlying model under a different role instruction and emits revised candidates directly; no separate Prompt Generator call is made during recursive revision.
Frozen Prompt Bank and online evaluation: Prompts selected on the validation split are stored in the Frozen Prompt Bank before any test query. The online phase retrieves the predetermined Version 1 or Version 2 prompt and applies it to each test pair with the same evaluator, three responses per pair, and the fusion rules of § 2.0.3.
Repeated Response Fusion and Security Loss
The final evaluation uses three separate API calls for each image pair under the same prompt, evaluator configuration, and inference temperature of zero. Let denote the binary decision for pair in response , where denotes a morphing attack, and let denote the corresponding morph risk score after rescaling the returned value from 0–100. A response is decision-valid when it can be parsed into the required schema and contains a usable binary decision; the corresponding index set is . The subset that also contains a finite morph risk score is denoted by .
Binary decisions are combined using logical OR:
where denotes an evaluator failure. This rule gives priority to attack indications across repeated responses and is therefore aligned with the objective of reducing missed morphing attacks. The corresponding score is obtained by maximum fusion:
The fused scores support ranking, EER computation, and threshold analysis; they are not interpreted as calibrated probabilities. § 3.0.5 examines the effect of using one, two, and three responses through an ablation based on the saved test outputs.
Invalid responses are assigned to two mutually exclusive categories. A parse failure (PFR) occurs when non-empty returned text cannot be parsed into the required JSON structure. A failure to answer (FTA) occurs when no response is returned because of an empty output or API failure, or when a parseable response contains a refusal or no usable binary morph decision. FTA and PFR are computed as proportions of all requested responses. Fusion uses all decision-valid responses. If all responses for a pair are invalid, the pair is counted as an error for its ground-truth class, as formalised in Eqs. (2) and (3). No fused score is assigned, and the pair is excluded from score-based metrics. The inconsistency rate is the proportion of pairs with conflicting decision-valid responses among pairs containing at least two such responses.
Prompt ranking uses the following security loss:
where all terms are fractions in and lower values are better. The coefficients are fixed design parameters rather than learned quantities: MACER is weighted most heavily to reflect the security objective of reducing missed attacks, BSCER penalises false rejection of bona fide pairs, FTA and PFR penalise failures that prevent reliable operation, and the smaller inconsistency coefficient discourages unstable responses without dominating the classification errors. Their effect on the recursive Version 2 ranking is examined in § 3.0.7.
Version 1 applies this security loss after repeated validation responses and decision fusion. Version 2 uses one evaluator response per validation pair during recursive optimisation to limit the number of validation queries. Its inconsistency term is therefore zero during prompt evolution, while repeated response reliability is measured during the final test evaluation. This distinction separates the prompt generation temperature and validation protocol from the test protocol with three responses per pair.
Version 1: Non-Recursive Prompt Selection
Version 1 examines whether prompt selection based on validation performance can improve a frozen-parameter VLM evaluator without recursive prompt revision. The Prompt Generator Agent produces 50 complete candidate prompts from a common D-MAD task description, output schema, and set of content constraints. The candidates differ in their emphasis on facial geometry, local identity consistency, visible morphing artefacts, image quality, and final decision formulation. During evaluation, every candidate is combined with the same evaluator model, system instruction, image role description, JSON schema, and inference settings. This design isolates the effect of the candidate prompt while keeping the remaining components fixed.
Each candidate is evaluated on the validation split with disjoint subjects. The validation labels are used to compute MACER, BSCER, ACER, FTA, PFR, and the inconsistency rate. These measurements guide prompt selection but do not update the VLM parameters or alter individual predictions. Version 1 should therefore be understood as prompt selection using validation labels rather than a label-free procedure.
For each candidate prompt , the selection procedure first computes the security loss defined in Eq. (7). Candidates are then ordered using
where lower values are preferred. The ranking is lexicographic: provides the primary criterion, ACER resolves equal security loss values, and MACER provides the final tie-breaking criterion. This rule fixes the selection procedure on the validation split and prevents performance on the test set from influencing the reported Version 1 system.
The five highest-ranked prompts are frozen after validation. Prompt P033 occupies rank one and defines the Version 1 test condition. The remaining four are retained in the experiment records and do not influence the reported Version 1 performance.
The manually designed prompt is evaluated using the same test pairs, VLM, repeated response protocol, and fusion rules. It does not participate in candidate generation or validation ranking and serves only as the reference condition for measuring the effect of automatic prompt selection.
Version 2: Recursive Prompt Optimisation
Version 2 examines whether aggregate validation feedback can improve D-MAD prompts through successive revisions. The evaluator configuration is held constant throughout this process, and only the prompt text changes. The Prompt Optimizer Agent receives selected prompt texts, their aggregate validation metrics, and a summary of the largest observed error terms. It does not receive test data, subject identities, or validation outputs for individual pairs. Because the aggregate metrics are computed from validation labels, this stage uses supervised validation feedback for prompt optimisation and is not a label-free procedure.
Generation 0 contains 30 prompts produced by the Prompt Generator Agent. Each prompt is evaluated once per validation pair with the evaluator temperature set to zero. This single-response protocol limits the number of validation queries required during recursive optimisation. It also means that repeated response inconsistency is not informative at this stage. Reliability under repeated queries is therefore assessed separately during final test evaluation. Prompt generation and revision use a temperature of 0.8 to encourage variation, whereas prompt evaluation and critic screening use a temperature of zero. Repeated calls at temperature zero are treated as separate observations rather than assumed to be deterministic.
After each generation, prompts are ranked using the validation value of . The five prompts with the lowest security loss and the three prompts with the lowest ACER are retained, with duplicate selections removed. The Prompt Optimizer Agent receives the selected prompts, their aggregate metrics, and a summary of the principal validation weaknesses across the population. It then generates 15 revised prompts for the next generation. From Generation 1 onwards, the Critic Agent screens these candidates before evaluation. The optimiser consequently uses aggregate validation evidence without receiving individual predictions or test information.
The recursive procedure allows at most three refinement generations beyond Generation 0 and terminates when the best validation security loss fails to improve for two consecutive generations. The executed experiment evaluated 30 prompts in Generation 0, 15 prompts in Generation 1, and 15 prompts in Generation 2. The corresponding best values of were 1.10, 1.10, and 1.20. Generation 1 therefore matched, but did not improve upon, the best initial prompt, while Generation 2 produced a higher minimum loss. The stopping condition was reached after Generation 2, and Generation 3 was not evaluated.
For the revised-descendant comparison, G1_P014 is the reported Version 2 prompt. It attains the minimum validation security loss of 1.10 among the evaluated descendants and was fixed before test evaluation. Generation 0 prompts are excluded only from this descendant-specific condition because they have not undergone revision; the best retained Generation 0 candidate is reported separately in § 3.0.7. The final test evaluation applies the protocol with three responses and the fusion rules of § 2.0.3.
Experiments and Results
This section describes the dataset, evaluation protocol, comparison settings, and implementation details used to assess the proposed prompt-selection framework.
Dataset and Evaluation Protocol
We use the D-MAD dataset introduced in prior zero-shot VLM work [23]. Each sample contains a trusted bona fide reference image and a document image . The document image is either genuine or generated using one of three morphing methods: landmark-based morphing (LMA), MIPGAN-2, or PIPE. The morphing method is retained only as evaluation metadata and is not provided to the Prompt Generator Agent, Prompt Critic Agent, Prompt Optimizer Agent, D-MAD Evaluator VLM, or fusion procedure.
Following the 50-subject evaluation subset of [23], we use 50 subjects. Each selected subject contributes one bona fide pair and one attack pair for each morphing method. The subjects are divided into 10 for validation and 40 for testing, with no identity shared between the two partitions. The validation split therefore contains 10 bona fide and 30 attack pairs and is used only to evaluate candidate prompts, compute , and select the prompts stored in the Frozen Prompt Bank. No test image, label, or metric informs prompt generation, revision, ranking, or selection. The consequences of this validation sample size are analysed in § 3.0.7.
Evaluating a D-MAD prompt requires transmitting pairs of identifiable facial images to an external multimodal service. The licences and consent conditions of the other public benchmarks considered for this study did not authorise such external processing. We therefore restricted the evaluation to the collection for which participants had explicitly consented to the required processing of their facial images. The one-dataset scope follows this privacy and consent requirement rather than a convenience-based dataset choice.
The test partition therefore contains 160 image pairs: 40 bona fide, 40 LMA, 40 MIPGAN-2, and 40 PIPE. BSCER is computed over the 40 bona fide pairs, overall MACER over the 120 attack pairs, and MACER for each morphing method over 40 pairs per method. All prompt systems are evaluated on these same pairs under the fusion protocol of § 2.0.3.
Compared Methods and Implementation
We consider two reference settings. First, ViT [5], DINOv2 [17], and CLIP [21] serve as frozen visual representation references. Each embeds Images and independently, uses cosine distance as the comparison score, and applies a fixed threshold to obtain a binary decision. Like the prompt systems, they involve no model-parameter training or fine-tuning on morphing data. The prompt systems nevertheless use labelled validation pairs for instruction selection.
Let and denote the embeddings of Images and . For each frozen representation, the comparison score is the cosine distance , and a pair is classified as an attack when . The threshold is fixed a priori and is held constant across the three representations and all test pairs. Because cosine distance distributions are model-dependent, these rows are interpreted only as fixed-operating-point references rather than as calibrated or separately optimised baselines. Cross-row differences at this threshold are therefore descriptive and are not used to claim superiority over these representations. They are not combined with the proposed roles or prompts and are not presented as supervised D-MAD methods.
The selected instructions emphasize surface evidence rather than identity-level comparison: P033 directs the evaluator to “unnatural transitions, blending artefacts, and texture inconsistencies” and G1_P014 to “blending artefacts and skin texture uniformity”.
Second, a manually designed multi-step prompt provides the primary controlled VLM baseline. It follows the design of [23], namely the guided comparison of facial geometry, blending artefacts, identity consistency and non-facial cues, but omits that work’s introductory role-conditioning statement. It is placed in the identical task wrapper used by all generated candidates, which supplies the Image /Image role definition and required JSON schema. It is evaluated with the same evaluator, test pairs, temperature, and three-response fusion protocol. It differs from the generated prompts only in the task instruction text. This comparison isolates validation-guided prompt selection under a fixed protocol; it is not a reproduction of the configuration published in [23], whose results are computed over all 50 pairs per morphing technique, including the subjects reserved here for validation, and are therefore not directly comparable to the test results reported below.
All queries were issued against the mutable gpt-4o alias rather than a pinned snapshot. The exact model snapshot therefore cannot be reconstructed from the saved outputs, and later evaluations using the same alias may use different underlying weights. All prompt roles and the D-MAD evaluator use GPT-4o, with the Generator and Optimizer roles at temperature 0.8 and the Critic and evaluator roles at 0. Every candidate shares the same system instruction, image ordering, task wrapper, and JSON schema, so only the candidate prompt text changes; no model parameters are trained or updated by the proposed procedure.
The manual prompt, P033, and G1_P014 are each evaluated three times per test pair, and all reported metrics are computed from the saved structured outputs after the fusion of § 2.0.3, with no further VLM queries and without prompt selection on the test set. To support reproduction we will release the candidate prompts of both versions, the ranking and freezing scripts, and the saved structured outputs, excluding all facial images, image paths, and subject identifiers.
Overall D-MAD Performance
Table 1 reports overall performance for the prompts selected on the validation split, the manual prompt, and the frozen visual references. Among the prompt conditions, P033 attains the lowest error, with ACER = , MACER = , and EER = , an observed MACER difference of 50.83 percentage points relative to the manual prompt. Both conditions share the same evaluator configuration, test pairs, task wrapper, response schema, and fusion rule; the instruction condition is the controlled experimental variable.
Table 1. Overall test performance on 40 bona fide and 120 attack pairs. Version 1 and Version 2 prompts are selected using labelled validation pairs; no model parameters are updated. Lower values are better.
| Method | HTER (%) | MACER (%) | BSCER (%) | EER (%) |
| ViT [5] | 12.50 | 25.00 | 0.00 | 9.79 |
| DINOv2 [17] | 42.08 | 84.17 | 0.00 | 15.42 |
| CLIP [21] | 46.25 | 92.50 | 0.00 | 22.50 |
| Manual prompt (adapted from [23]) | 35.00 | 70.00 | 0.00 | 10.83 |
| V1: P033 | 9.58 | 19.17 | 0.00 | 6.67 |
| V2: G1_P014 | 15.83 | 31.67 | 0.00 | 7.50 |
Table 1.
All three prompt conditions yield BSCER after fusion of three responses, so ACER equals MACER/2. Two P033 responses on bona fide pairs are parse failures, but both pairs retain valid responses and are accepted after fusion. The zero observed BSCER on 40 pairs does not rule out false rejections in deployment; thresholding the uncalibrated fused scores instead provides a score level BSCER–MACER trade-off.
The recursively generated G1_P014 prompt improves on the manual prompt but does not surpass P033, reaching MACER. Because the frozen visual references use a common uncalibrated threshold, their decision-level rows provide context rather than a basis for an algorithmic superiority claim. Statistical comparisons between prompt conditions appear in § 3.0.6.
Morph Specific Analysis
Table 2 separates MACER by morphing method. P033 detects all 40 MIPGAN-2 and all 40 PIPE attacks but misses 23 of the 40 LMA attacks, so its overall MACER of is determined entirely by landmark-based morphing. G1_P014 follows the same pattern with 33 missed LMA and five missed PIPE attacks, while the manual prompt errs heavily on all three methods.
Table 2. Test MACER by morphing method, with missed attacks among 40 pairs in parentheses. Lower is better.
| Method | LMA MACER (%) | MIPGAN-2 MACER (%) | PIPE MACER (%) |
| Manual prompt | 85.00 (34) | 45.00 (18) | 80.00 (32) |
| V1: P033 | 57.50 (23) | 0.00 (0) | 0.00 (0) |
| V2: G1_P014 | 82.50 (33) | 0.00 (0) | 12.50 (5) |
Table 2.
The selected prompts achieve zero observed missed attacks on the tested MIPGAN-2 subsets and, for P033, on the PIPE subset, whereas LMA remains substantially more difficult. The zero observed error for a morphing method is limited to the 40 test pairs considered here and should not be interpreted as evidence of perfect detection beyond this evaluation.
Response Budget and Reliability
We evaluate the response budget using the three saved test responses per pair. For one or two responses, results are averaged over all subsets of that size; the three-response condition uses all outputs. Each subset applies the OR decision fusion of § 2.0.3. Table 3 reports the resulting MACER together with the reliability rates discussed below. This analysis reuses the fixed saved calls and is not an independently repeated experiment.
Table 3. Test response budget ablation. MACER averages all subsets; FTA and PFR are per response rates, and inconsistency is measured per eligible pair.
| Method | MACER (%) 1 resp. | MACER (%) 2 resp. | MACER (%) 3 resp. | Reliability (%) FTA | Reliability (%) PFR | Reliability (%) Incons. |
| Manual prompt | 72.50 | 71.11 | 70.00 | 0.00 | 0.00 | 3.13 |
| V1: P033 | 23.33 | 20.00 | 19.17 | 0.00 | 0.63 | 6.88 |
| V2: G1_P014 | 32.78 | 31.94 | 31.67 | 0.00 | 0.00 | 1.88 |
Table 3.
Across the saved calls, OR fusion reduces P033 MACER from 23.33% with one response to 19.17% with three, with most of the gain obtained at two responses. The corresponding reductions for the manual and Version 2 prompts are 2.50 and 1.11 percentage points. The one-response P033 condition has 1.67% average BSCER because two bona fide responses are parse failures; fusion recovers all affected pairs when multiple responses are available. P033 produces three parse failures among 480 responses (0.63%) and has the highest inconsistency rate (6.88%, compared with 3.13% and 1.88%). Repeated calls therefore improve attack sensitivity.
Statistical Analysis
Each subject contributes multiple test pairs, so observations for pairs are not independent. We therefore use a nonparametric bootstrap over the 40 test subjects as the primary uncertainty analysis. Subjects are sampled with replacement for 100,000 iterations, and MACER is recomputed from all attack pairs associated with each sampled subject. Relative to P033, the manual prompt increases MACER by 50.83 percentage points, with a 95% percentile interval of [43.33, 58.33]. G1_P014 increases MACER by 12.50 percentage points relative to P033, with an interval of [6.67, 18.33]. At the subject level, P033 has fewer missed attacks than the manual prompt for 37 of 40 subjects and ties it for the remaining three. It has fewer missed attacks than G1_P014 for 13 subjects and ties it for 27.
Because pairs from the same subject are dependent, we do not interpret pair-level significance tests as the primary inferential analysis. The paired subject bootstrap and the subject-level win/tie counts above provide the uncertainty evidence used for the prompt comparisons.
Prompt Optimisation Analysis
The best validation security losses were 1.10, 1.10, and 1.20 for Generations 0, 1, and 2, respectively. Generation 1 therefore matched, but did not improve upon, the best Generation 0 prompt, while Generation 2 produced a higher minimum loss.
With 30 validation attacks, one additional miss changes MACER by 3.33 percentage points and, when the other loss terms are zero, changes by 0.10. The difference between the best Generation 0 and Generation 2 losses therefore corresponds to one attack decision. Among the surviving lineages, the weakest ancestor improves from 1.50 to 1.10, whereas the strongest degrades from 1.10 to 1.20. On the test split, the retained Generation 0 seed obtains slightly lower post hoc MACER than the revised descendant (30.83% versus 31.67%); this comparison did not influence selection. Recursive revision therefore does not improve the best candidate under the available validation resolution, but this result does not preclude a benefit at a larger scale.
For the retained Version 2 candidates, BSCER, FTA, PFR, and inconsistency are zero, so . Consequently, all tested positive MACER weights, equal weighting, and ranking by MACER alone produce the same ordering (Kendall ). The additional loss terms are therefore inactive for this validation population.
Limitations and Future Work
The study uses one VLM configuration without parameter updates and one dataset with disjoint validation and test subjects. This scope follows the consent constraints of § 3.0.1; the other considered benchmarks did not authorise external processing of identifiable facial images. Transfer across models, datasets, demographics, morph generators, and acquisition conditions is therefore untested. The validation split of 10 subjects may overfit prompt selection, while the mutable API alias limits temporal reproducibility. No ablation removes or mismatches the trusted reference, so the use of differential rather than document image evidence remains unquantified. The visual references use a common uncalibrated threshold, and the VLM risk scores are also uncalibrated. For consequential D-MAD decisions, VLM outputs should only assist trained human review. External processing must follow applicable consent, access, retention, and jurisdictional requirements. We redistribute no images or subject identifiers.
Conclusion
The Version 1 prompt selected on validation data obtains 19.17% MACER, compared with 70.00% for the manual prompt, at 0.00% observed BSCER. It has fewer missed attacks for 37 of 40 test subjects, with no reverse outcome. Recursive optimisation does not improve the best Generation 0 validation loss; its reported descendant obtains 31.67% test MACER. Errors remain concentrated in LMA. These results show that prompt formulation can have a substantial effect on the behaviour of a frozen VLM in D-MAD and should therefore be treated as part of the evaluation protocol rather than as a minor implementation choice. At the same time, the remaining LMA errors suggest that relying mainly on visible blending and texture cues is not enough for more challenging morphs, and that stronger use of differential identity evidence may be needed. The findings are limited to the model and dataset studied here and should not be interpreted as general superiority across D-MAD systems. Future work should examine reference image use and transfer across models and datasets while retaining human oversight.
References
Validation-Guided Prompt Selection for Differential Morphing Attack Detection Supplementary Material
Raghavendra Ramachandra; Hailin Li
01_WACV_DMAD_Supplementary_Final_V3_submission.pdf
Overview
This supplement provides the material omitted from the main paper to satisfy its page limit. It expands the experimental protocol, reproduces the selected Version 1 and Version 2 task instructions, presents fused morph risk score distributions, and gives representative qualitative outputs. It also reports the response budget analysis, subject level uncertainty, recursive prompt optimisation diagnostics, and the scope of the planned reproducibility release. The numerical values in this document follow the same protocol as the main paper: decisions are fused once per image pair, failures are classified into mutually exclusive categories, and prompt selection uses only the validation split.
Extended Experimental Protocol
Dataset composition and split
The experiments use 50 subjects from the public D-MAD dataset introduced in prior zero-shot VLM work [1]. Each selected subject contributes one bona fide comparison and one attack comparison for each of three morphing methods: landmark based morphing (LMA), MIPGAN-2, and PIPE. Ten subjects form the validation split, giving 10 bona fide and 30 attack pairs. The remaining 40 subjects form the test split, giving 40 bona fide, 40 LMA, 40 MIPGAN-2, and 40 PIPE pairs. The split is disjoint by subject. Validation data are used for prompt ranking and recursive revision, whereas the 160 test pairs are used only after the selected prompts have been frozen.
The morphing method is retained as evaluation metadata but is not supplied to the Prompt Generator Agent, Prompt Critic Agent, Prompt Optimizer Agent, the D-MAD Evaluator VLM, or the fusion procedure. Identifiable facial images, image paths, and subject identifiers are excluded from the planned release.
Evaluator output schema
All reported prompt conditions use the same image ordering, system instruction, task wrapper, and structured response schema. Image is the trusted bona fide reference or live capture, and Image is the document image under evaluation. The experimental scripts retain the historical JSON field name morph_probability; throughout the paper and supplement, this value is called a morph risk score because it is not a calibrated probability.
{
"same_identity": "yes/no/uncertain",
"identity_confidence": 0-100,
"morph_detected": "yes/no",
"morph_probability": 0-100,
"main_evidence": [
"observable evidence 1",
"observable evidence 2",
"observable evidence 3"
],
"quality_caveat": "short note",
"decision_reliability": "low/medium/high"
}
The natural language evidence is retained as an audit rationale for the returned decision. It is not treated as a faithful causal explanation of the internal computation of the VLM.
Repeated response fusion and invalid outputs
For the final test evaluation, each prompt is queried three times per image pair at evaluator temperature zero. Let denote the decision-valid responses for pair , and those also containing a finite morph risk score . The pair level decision is
and the fused score is
No fused score is assigned when . The fused scores are used for ranking, threshold analysis, and EER, but are not interpreted as calibrated probabilities.
A parse failure rate (PFR) event is a non-empty response that cannot be parsed into the required JSON structure. A failure to answer (FTA) event is an empty output, an API failure, a refusal, or a parseable response without a usable binary decision. These categories are mutually exclusive. Decision fusion uses all decision-valid responses. If no such response exists, the pair is treated as an evaluator failure and charged as an error to its ground-truth class; it is excluded from score based measures when no fused score exists. Decision inconsistency is computed only for pairs with at least two decision-valid responses and records whether they disagree.
Security loss and prompt selection
Prompt ranking uses
where every term is represented as a fraction in . The coefficients are fixed design parameters. They express an operating preference that places the largest penalty on missed attacks while retaining penalties for bona fide errors, invalid outputs, and unstable decisions.
Version 1 generates 50 candidates from a common task specification. Each candidate is evaluated on the validation split using three responses per pair. Candidates are ordered lexicographically by . The five highest ranked candidates are frozen before test evaluation, and the rank-one prompt P033 defines the primary Version 1 condition.
Version 2 begins with 30 Generation 0 prompts and uses one evaluator response per validation pair during recursive optimisation. After each generation, the five prompts with the lowest security loss and the three with the lowest ACER are retained, with duplicate selections removed. The Prompt Optimizer Agent produces 15 descendants for the next generation, and the Prompt Critic Agent screens candidates from Generation 1 onwards. The executed experiment contains Generations 0, 1, and 2. Prompt G1_P014 is the highest ranked recursively generated descendant on the validation split and defines the reported Version 2 condition. No test metric contributes to either selection.
Selected Prompt Texts
The task instructions below are reproduced from the prompt records used to construct the qualitative figures. Both are inserted into the same fixed wrapper and evaluated with the schema of Section S2.
Version 1 prompt P033
Conduct a comprehensive review of artefacts in Image B compared with Image A. Focus on unnatural transitions, blending artefacts, and texture inconsistencies. Return a structured decision with identity confidence, morph decision, morph risk score, evidence, quality caveat, and reliability.
Version 2 prompt G1_P014
Assess Image A and Image B for identity by focusing on blending artefacts and skin texture uniformity. Avoid demographic considerations. Return JSON fields for identity decision, confidence, morph decision, morph risk score, evidence, quality caveat, and reliability.
Common fixed wrapper
Image A is the trusted bona fide reference or live capture image. Image B is the document or passport style image to evaluate. Determine whether Image B appears to be a morphing attack relative to Image A. The morph generation method is unknown. Do not assume a specific generator or morphing technique. Return only valid JSON and no text outside JSON. Do not reveal hidden chain of thought. Use concise observable evidence only and follow the required response schema.
The manually designed baseline follows the multi-step comparison structure of the preceding D-MAD study [1], covering facial geometry, identity consistency, blending artefacts, and non-facial cues. In the current experiment, that task instruction is placed in the same fixed wrapper and response schema as the generated prompts. Its exact adapted text will be released with the reproducibility material after the anonymous review process; the published results of the preceding study are not reused because its evaluation partition differs from the present test split.
Fused Morph Risk Score Distributions
Figure S1 presents kernel density estimates of the fused morph risk scores for the two selected prompts. The plots use one fused score per pair after maximum fusion over valid responses. The horizontal axis must be interpreted as an uncalibrated morph risk score rather than a probability. The embedded plots retain labels from the original analysis script: “Probability Score” denotes the fused morph risk score, “BPCER” denotes BSCER, and the “Agentic” run label denotes the Version 1 condition.

Figure S1. Kernel density estimates of fused morph risk scores for bona fide and morphed comparisons. The top row corresponds to the selected Version 1 prompt P033; the bottom row corresponds to the selected recursive descendant G1_P014. Greater overlap between the bona fide and attack distributions indicates weaker score separation. The scores are uncalibrated and are not probabilities; historical plot labels are mapped to the manuscript terminology in the accompanying text.
The score distributions explain the error pattern reported in the main paper. For P033, MIPGAN-2 and PIPE scores are separated from the bona fide region, consistent with zero missed attacks for these two methods. The LMA distribution overlaps substantially with the bona fide scores, explaining the 23 missed LMA attacks. The recursive prompt exhibits the same general pattern but has greater overlap for LMA and a broader PIPE distribution, consistent with 33 missed LMA attacks and five missed PIPE attacks.
| Prompt | LMA | MIPGAN-2 | PIPE |
| Manual | 85.00 (34) | 45.00 (18) | 80.00 (32) |
| P033 | 57.50 (23) | 0.00 (0) | 0.00 (0) |
| G1_P014 | 82.50 (33) | 0.00 (0) | 12.50 (5) |
Table S1. MACER by morphing method on the 40 attack pairs of each type. Values in parentheses are missed attacks. Lower is better.
The 23 LMA pairs missed by P033 form a strict subset of the 33 LMA pairs missed by G1_P014. This nested error pattern indicates that the recursive prompt does not recover an alternative group of difficult LMA pairs; instead, it misses all LMA cases missed by Version 1 and ten additional cases.
Qualitative Analysis
The qualitative examples are drawn from the held-out test partition. The applicable consent and publication conditions authorise reproduction of these examples. They illustrate how the selected prompts describe a correct bona fide decision and a false negative on an LMA pair. The returned text is presented as an audit rationale and not as a causal explanation of the model’s internal reasoning. No subject identifiers or image paths are reported.
The two prompts exhibit the same principal failure mode. Both accept LMA pairs when surface appearance remains natural and explicit blending artefacts are weak. For the Version 2 example, the response reports geometric differences but still rejects the attack hypothesis. This suggests that the selected instructions give substantial weight to visible artefact absence and insufficient weight to identity inconsistency. The observation is consistent with the quantitative LMA results, but it remains an interpretation of the reported audit rationale rather than a verified account of the model’s causal features.
Selected Version 1 task instruction (P033). Conduct a comprehensive review of artefacts in Image B compared with Image A. Focus on unnatural transitions, blending artefacts, and texture inconsistencies. Return a structured decision with identity confidence, morph decision, morph risk score, evidence, quality caveat, and reliability.
Figure S2. Representative outputs for the selected Version 1 prompt P033. The bona fide pair is accepted correctly, whereas the LMA pair is missed because the response identifies little visible blending or texture evidence.
Bona fide, correct. Fused morph risk score: 5/100. Audit rationale: The response reports consistent facial geometry and landmarks around the eyes, nose, and mouth, with no visible blending, ghosting, unnatural smoothing, or boundary artefacts. The reported reliability is high.
LMA, false negative. Fused morph risk score: 5/100. Audit rationale: The response identifies no clear texture discontinuity, local averaging, or boundary artefact and therefore predicts bona fide. The example illustrates how an LMA image can preserve a natural surface appearance and provide few visible artefacts for this prompt.
Selected Version 2 task instruction (G1 P014). Assess Image A and Image B for identity by focusing on blending artefacts and skin texture uniformity. Avoid demographic considerations. Return JSON fields for identity decision, confidence, morph decision, morph risk score, evidence, quality caveat, and reliability.
Figure S3. Representative outputs for the selected recursive prompt G1 P014. The LMA pair is missed despite reported geometric differences because the response gives greater decision weight to the absence of visible surface artefacts.
Bona fide, correct. Fused morph risk score: 10/100. Audit rationale: The response reports consistent facial geometry and landmarks around the eyes, nose, and mouth, uniform skin texture, and no visible blending, ghosting, local averaging, or boundary artefacts. The reported reliability is high.
LMA, false negative. Fused morph risk score: 5/100. Audit rationale: The response notes differences in eye shape and spacing, nose width, and nostril shape, but identifies no visible blending, ghosting, or boundary artefacts. It therefore predicts bona fide despite the reported geometric differences.
Response Budget and Reliability
The three saved responses per pair permit an offline response budget ablation. For a one-response or two-response budget, MACER is averaged over all subsets of the corresponding size. Each subset uses the OR decision rule. The full three-response condition uses all saved outputs.
Repeated responses provide the largest improvement for P033, reducing MACER from 23.33% with one response to 19.17% with three responses. Most of the gain is obtained with two responses. The manual and recursive prompts improve by 2.50 and 1.11 percentage points, respectively. No FTA occurs. Prompt P033 produces three parse failures among 480 calls, and each affected pair retains at least one valid response. Its higher inconsistency therefore coexists with a lower fused MACER: OR fusion converts occasional attack indications into an attack-sensitive final decision.
Subject Level Uncertainty and Paired Tests
Pair observations are clustered because each test subject contributes three attack pairs. The primary uncertainty analysis therefore resamples the 40 test subjects with replacement for 100,000 bootstrap iterations and recomputes MACER from all attack pairs associated with the sampled subjects.
Prompt P033 has fewer missed attacks than the manual prompt for 37 of 40 subjects and ties it for the remaining three. It has fewer missed attacks than G1_P014 for 13 subjects and ties it for 27; no subject favours the comparison prompt in either analysis. Exact McNemar tests on fused pair decisions provide supplementary pair level evidence. There are 61 discordant pairs favouring P033 over the manual prompt and none in the reverse direction (). There are 15 discordant pairs favouring P033 over G1_P014 and none in the reverse direction
| Prompt | 1 response | 2 responses | 3 responses | FTA | PFR | Inconsistency |
| Manual | 72.50 | 71.11 | 70.00 | 0.00 | 0.00 | 3.13 |
| P033 | 23.33 | 20.00 | 19.17 | 0.00 | 0.63 | 6.88 |
| G1_P014 | 32.78 | 31.94 | 31.67 | 0.00 | 0.00 | 1.88 |
Table S2. Response budget and reliability. MACER for one and two responses is averaged over all subsets of the stated size. FTA and PFR are response level rates over 480 responses per prompt; inconsistency is measured over pairs with at least two valid decisions. Lower is better.
| Comparison | Difference | 95% interval |
| Manual − P033 | 50.83 | [43.33, 58.33] |
| G1_P014 − P033 | 12.50 | [6.67, 18.33] |
Table S3. Paired MACER comparison with P033. Positive differences indicate higher error for the comparison prompt. Intervals resample subjects.
| Generation | Prompts | Best |
| G0 | 30 | 1.10 |
| G1 | 15 | 1.10 |
| G2 | 15 | 1.20 |
Table S4. Validation security loss across recursive generations. Lower is better.
. The subject bootstrap remains the primary analysis because it accounts directly for repeated observations from one identity.
Recursive Prompt Optimisation Diagnostics
The best validation security losses are 1.10, 1.10, and 1.20 for Generations 0, 1, and 2, respectively. Generation 1 therefore matches, but does not improve upon, the best Generation 0 prompt, while Generation 2 produces a higher minimum loss. The validation split contains 30 attack pairs, so one additional missed attack changes MACER by 3.33 percentage points and changes by 0.10. The difference between the best G0 and G2 values therefore corresponds to one attack decision. This coarse resolution limits the ability of recursive search to distinguish closely performing prompts.
The surviving lineages show regression towards the validation mode: a weaker G0 ancestor improves from a loss of 1.50 to 1.10, while the strongest G0 ancestor degrades from 1.10 to 1.20. In a post hoc test comparison, the retained seed G0_P026 obtains 30.83% MACER, slightly below the 31.67% of G1_P014. This diagnostic comparison did not influence prompt selection; G0 prompts are excluded from the reported Version 2 condition because they have not undergone recursive revision.
For the retained Version 2 validation populations, BSCER, FTA, PFR, and InconsistencyRate are zero. Consequently, the security loss reduces to a positive multiple of MACER for these candidates. Replacing the MACER coefficient by 1, 2, 5, or 10, using equal weights, or ranking by MACER alone leaves the ordering unchanged, with Kendall , and selects the same recursive descendant. This analysis does not establish that the coefficients are universally irrelevant; it shows only that the observed Version 2 selection is insensitive to them on the present validation split.
Reproducibility, Data Handling, and Scope
All roles use the mutable gpt-4o alias. The Generator and Optimizer Agents use temperature 0.8, while the Critic Agent and evaluator use temperature 0. Because the alias was not pinned and the query dates are not recoverable, the underlying weights cannot be reconstructed exactly. All analyses were computed offline from the saved outputs.
After the anonymous review process, the reproducibility package will contain the 50 Version 1 prompts and rankings; the Generation 0–2 populations and lineage fields; the frozen P033 and G1_P014 records; the manual instruction; parsing, fusion, metric, bootstrap, and ablation scripts; de-identified outputs; and a README specifying the response schema, split sizes, model alias, temperatures, and procedure.
The release excludes API credentials, raw facial images, image paths, and direct subject identifiers. External processing of identifiable facial images must comply with the consent, access, retention, and processing conditions of the source collection and deployment jurisdiction. The reported system is intended only to assist trained document inspection personnel and should not serve as the sole basis for a consequential identity decision.
References
- [1]Ria Shekhawat, Hailin Li, Raghavendra Ramachandra, and Sushma Venkatesh. Towards zero-shot differential morphing attack detection with multimodal large language models. In 2025 IEEE 19th International Conference on Automatic Face and Gesture Recognition (FG), pages 1–10, 2025.arxiv.org/abs/2505.15332

