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; selecting, from a 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; and training a predictive model using the selected training images as training data.