1. A method of detecting a weapon in image data, the method comprising: annotating sections of a plurality of training images to indicate whether each section is one of a plurality of different constituent parts of a weapon; encoding a pattern grammar describing the weapon using a plurality of first order logic based predicate rules; training a plurality of distinct component detectors, where each detector is trained to each identify a corresponding one of the weapon parts based on the annotated training images; processing image data with the component detectors to identify at least one of the weapon parts; and executing the rules to detect the weapon based on the identified weapon parts.
1. A method of detecting a weapon in image data, the method comprising: annotating sections of a plurality of training images to indicate whether each section is one of a plurality of different constituent parts of a weapon; encoding a pattern grammar describing the weapon using a plurality of first order logic based predicate rules; training a plurality of distinct component detectors, where each detector is trained to each identify a corresponding one of the weapon parts based on the annotated training images; processing image data with the component detectors to identify at least one of the weapon parts; and executing the rules to detect the weapon based on the identified weapon parts. 13. The method of claim 1 , wherein the training comprises: determining uncertainty values for each of the rules; converting the rules into a knowledge-based artificial neural network, where each uncertainty value corresponds to a weight of a link in the neural network; and using a back-propagation algorithm modified to allow local gradients over a bilattice specific inference operation to optimize the link weights.