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. 3. The method of claim 1 , wherein the explanation includes features in the weapon that were discovered by at least one of the component detectors, and the method further comprises generating an explanation that explains why the weapon is considered a threat from a parse tree of the rules, where the explanation describes how those features are connected to one another.