Skip to main content
. 2025 Oct 27;11(11):378. doi: 10.3390/jimaging11110378
Algorithm 1: GADP Adversarial Attack Algorithm
Input: Original input sample images: x1, x2, , xN, The target infrared object detection
            model D, number of iterations E, batch size B, initial patch patch0
Output: Optimized adversarial patch

Initialize the value of patch as patch0
For e[0,E) do:
       Input the batch of original infrared images into model D, obtaining the target
        bounding box positions and confidence scores;
       Identify the neural network attention regions corresponding to the target in the
        infrared image;
       Apply the transformed adversarial patch to the original infrared image, incorporating
        the attention regions, generating the adversarial sample xadv;
       Apply Bernoulli random dropout to the backbone network of model D;
        Obtain the target bounding box confidence and location information for the adversarial
       sample xadv in model D;
       Compute the loss function value;
       Update the adversarial patch using the Adam optimizer based on the gradient of
       the loss function: patchAdam(patch,patchL)
       Perform affine transformation and random erasing on the adversarial patch;
       Obtain the transformed adversarial patch;
End for
Obtain the transformed adversarial patch.