1. A computer-implemented method of classifying an image into a food class comprising: for each of a plurality of labels that each designate a respective food class of a plurality of food classes, wherein each food class represents a different food item: determining a respective measure of importance of the label of the plurality of labels, and determining a respective sample size for the label of the plurality of labels, wherein the sample size is based on the respective measure of importance of the label; determining, for each label of a subset of labels having smallest respective measures of importance, that a collection of labeled images includes fewer images having the label than a respective determined sample size for the label; selecting, from the collection of labeled images, for each respective label of the plurality of labels, a number of training images according to the determined sample size for the label, including selecting, for each label of the subset of labels having the smallest respective measures of importance, multiple instances of at least one image having the label; and training a predictive model using the selected training images as training data.