Submitted by 1kay7 t3_zqpkc0 in deeplearning

I have a big dataset of images of food. I would like to able to train a model that predict if a new (unseen) image is 'food' or 'not food'. Note that the model can only be trained on the available dataset of food images.

What approach would you guys recommend for this task? I would like to use Tensorflow Keras but this is not mandatory. I've heard that an autoencoder might be a good option?

8

Comments

You must log in or register to comment.

PredictorX1 t1_j0z7qtr wrote

This is known as one-class learning or one-class classification. You could try obtaining "background class" images (images similar to yours in resolution, overall brightness, ...) and training an ordinary classifier on the combination of the two. Obviously, the background class images cannot contain food, but searches for things unrelated to food ("nail", "dancer", "floor", "statue", ...) followed up by quick visual inspection should serve.

11

[deleted] t1_j11ae9i wrote

come back to this planet in 10 years and everybody will be screaming 1s and 0s at each other.

1

danja t1_j121q19 wrote

You're a bit stuck, surely..? As far as the model is concerned, there is no class 'B'. Would mashing up images in 'A' be allowed? Random images? Noise?

1

GrumpyGeologist t1_j12yawz wrote

Train a GAN on the images of class A. The generator will draw samples from the distribution outlined by the images in class A. The discriminator measures the distance between given sample and this distribution. So once you finish training on class A, the critic will tell you whether or not a given image belongs to class A.

An alternative approach is to do self-supervised representation learning (like BYOL) and compare the projection distance between a pair of A and B images.

1