1. An apparatus for generating a model that can be used to perform object detection, the apparatus comprising: an input interface configured to receive training images; and a processor in communication with the input interface for receiving training images from the input interface, the processor being configured to perform a training algorithm, the training algorithm processing multiple training images received from the input interface to produce a Gaussian Mixture Model (GMM) comprising at least a first-layer GMM, the first-layer GMM describing spatial attributes of local features contained in an image, the first-layer GMM receiving local feature detection results from a local feature detection algorithm.