1. A method for object detection, the method comprising: obtaining images of an object; defining a plurality of sequential feature layers of a multi-layer feature learning network; providing an aggregator layer receiving features from multiple layers of the multi-layer feature learning network; optimizing, jointly and by a processor, the multi-layer feature learning network and the aggregator layer using the images of the object; and outputting, by the processor, a set of learned features represented by the optimized multi-layer feature learning network and a detector that makes use of the generated features by the optimized aggregator layer, the set of learned features being for distinguishing the object and the detector being for classifying the object.