1. An image processing apparatus for outputting identification information to identify an object from an identification target image, comprising: a first feature vector extraction unit adapted to extract feature vectors from a learning image included in an image group to be used for learning; a first feature vector classification unit adapted to classify the feature vectors extracted by said first feature vector extraction unit into a first set based on a first classification method; a representative vector generation unit adapted to generate representative vectors of the feature vectors included in the first set classified by said first feature vector classification unit; a representative vector classification unit adapted to classify the representative vectors generated by said representative vector generation unit into a second set based on a second classification method; an association unit adapted to associate the representative vectors generated by said representative vector generation unit with the second set classified by said representative vector classification unit; a second feature vector extraction unit adapted to extract feature vectors from the input identification target image; a distance calculation unit adapted to calculate distances between the feature vectors extracted by said second feature vector extraction unit and the representative vectors generated by said representative vector generation unit; a representative vector allocation unit adapted to allocate the representative vectors to the feature vectors extracted by said second feature vector extraction unit using the distances calculated by said distance calculation unit; and an index allocation unit adapted to allocate, to each feature vector using the association, an index to specify a cluster to which the representative vector allocated to the feature vector is classified.