Anomaly detection in X-ray cargo imagery is challenging due to complex scene structures, object overlap, and limited labeled abnormal data. Reconstruction-based methods address this problem by learning normal cargo patterns and identifying deviations during testing. This study investigates how feature-level reconstruction objective functions influence detection performance within the GANomaly framework. Five objective configurations are evaluated on the CargoX dataset: a pixel-based baseline and three perceptual loss variants using Visual Geometry Group 16-layer network (VGG16) feature supervision at different depths (i. e. , Rectified Linear Unit layers ReLU2₂, ReLU3₃, ReLU4₃, and multi-scale), and an encoder replacement using a ResNet50 with and without perceptual supervision. Performance is assessed using Receiver Operating Characteristic Area Under Curve (ROC-AUC), precision, recall, and F1-score, supported by qualitative analysis of reconstructions and residual maps. Results show that mid-level perceptual supervision (ReLU3₃) achieves the best performance. It improves ROC-AUC from 0. 7182 to 0. 7548 and demonstrates enhanced sensitivity to structural anomalies. Replacing the original GANomaly encoder with ResNet50 increases ROC-AUC to 0. 7312 and improves precision. Combining ResNet50 with perceptual supervision achieves a ROC-AUC of 0. 7517. However, it does not surpass the original ReLU3₃ configuration in recall or F1-score. Shallow features (ReLU2₂) and multi-scale aggregation do not improve detection. Failure analysis highlights challenges with low-contrast anomalies and structurally complex normal cargo scenes. These findings show that anomaly detection performance depends on both reconstruction supervision and encoder design. Therefore, loss selection and feature extraction should be analyzed together in reconstruction-based models.
Alotaibi et al. (Thu,) studied this question.