The invention discloses a defense method for resisting an
infrared detection confrontation sample
attack, and belongs to the technical field of calculation, reckoning or counting. The method comprises the following steps: firstly, partitioning an input
infrared image according to a fixed size, executing two-dimensional
discrete cosine transform, calculating the
mean square difference of the image on each color channel before / after recompression, then converging into a
frequency spectrum heat map, and binarizing to obtain a rough
mask for positioning an adversarial patch; inputting the original image into the
image segmentation model, calculating the intersection-union ratio of the segmentation
mask and the rough
mask, removing redundancy, and fusing to generate a final patch area mask; then, according to the patch area mask, original image pixels are removed, and a general image completion
algorithm is called to recover a removed area; and finally, sending the complemented image into a
deep learning target
detector to realize robust detection under the
infrared confrontation sample
attack. According to the method, defense is carried out on adversarial sample attacks under infrared detection for the first time, and adversarial samples are effectively defended by adopting adversarial sample positioning,
image segmentation and
image restoration.