Split the dataset's train split into a train and test set with the [~datasets.Dataset.train_test_split] method:

food = food.train_test_split(test_size=0.2)

Then take a look at an example:

food["train"][0]
{'image': ,
 'label': 79}

Each example in the dataset has two fields:

image: a PIL image of the food item
label: the label class of the food item

To make it easier for the model to get the label name from the label id, create a dictionary that maps the label name
to an integer and vice versa: