1. A computer-implemented method, comprising: identifying a plurality of queries, each of the queries being a unique set of one or more query terms received by a search system as a query input; for each of the queries: selecting training images for training an image relevance model, the training images comprising: a first image having a first relevance measure, for the query, that satisfies a first relevance threshold; and a second image having a second relevance measure, for a different query in the plurality of queries, that satisfies a second relevance threshold; for each of the training images, identifying content feature values, each content feature value representing a characteristic of an aspect of the training image; and training the image relevance model to generate relevance measures of content feature values of images to the query based on the content feature values of the training images, wherein the image relevance model comprises a vector of weights corresponding to the content feature values, the training comprising: initializing the vector of weights to default values; generating a first training score based on the image relevance model and the content feature values of the first image; generating a second training score based on the image relevance model and the content feature values of the second image; comparing the first training score and the second training score; in response to a difference between the first training score and the second training score not satisfying a training score margin, adjusting values of the vector of weights; determining whether a training condition has occurred; and repeating the selecting training images, the generating the first training score, the generating the second training score and the comparing when the training condition has not occurred.