Fig. 4: Classification results for unobscured chemical samples (pharmaceuticals and explosives).

a Representative input images, ground truth labels, model predictions before spatial majority voting, and refined predictions after spatial majority voting for DCP, MCC, IBU, MAN, KNO₃, PETN, RDX, and TNT. b Confusion matrix summarizing the classification performance across all the chemical classes. c Ground truth and model predictions for cracked, irregularly shaped pharmaceutical samples, demonstrating the models’ ability to generalize to new test samples despite being trained exclusively on intact, regular samples