Adversarial Attack and Disturbance Detection by Hadamard-Coded Output Representations for Object Detection and Semantic Segmentation

2026-06-08Computer Vision and Pattern Recognition

Computer Vision and Pattern Recognition
AI summary

The authors found that traditional one-hot encoding makes models too sure of themselves, especially when facing attacks, causing detection methods to fail. They improved this by using special codes called Hadamard codes, which help models be more accurate and robust, especially in tasks like semantic segmentation and object detection. They developed a new way to decode these codes to get better class predictions and measure when the model is unsure or inconsistent. Their method, called HadamardNet, can detect attacks and disturbances effectively while still performing well on normal data.

one-hot encodingHadamard codessemantic segmentationobject detectionadversarial attacksmodel calibrationprobability simplexcodeword decodingperturbation detectionmean intersection-over-union
Authors
Lucas Görnhardt, Timo Bartels, Niklas Schwarz, Tim Fingscheidt
Abstract
Conventional one-hot encodings often yield poorly calibrated models, being overconfident under attack, and letting entropy-based detection algorithms fail. Previous image classification works have demonstrated that Hadamard-coded output representations can improve adversarial robustness. However, attempts to integrate Hadamard codes into semantic segmentation fall far behind state-of-the-art models in mean intersection-over-union performance. Regarding object detection, such output encodings have not yet been investigated at all. Further, no prior art addressed intrinsic codeword inconsistencies or actually exploited intrinsic codeword redundancy. Accordingly, we first derive a novel decoding procedure for Hadamard codewords towards optimal class-wise probabilities, solving the underlying optimization problem by using the projection onto the probability simplex. Second, our optimization delivers a measure of prediction inconsistency. Third, we are the first to show how to exploit these inconsistencies for adversarial attack and disturbance detection. Fourth, we introduce HadamardNet, a framework employing Hadamard codes as output representations for semantic segmentation and object detection models and tasks. We conduct a comprehensive evaluation both on disturbances and adversarial attacks, achieving state-of-the-art perturbation detection performance for both tasks in only a single detection pass, while delivering equivalent or close-by reference performance on clean data.