You can use function tf.keras.utils.image_dataset_from_directory() to read images from directory and map the labels as integer value.
main_directory/
...cat/
......cat_image_1.jpg
......cat_image_2.jpg
...dog/
......dog_image_1.jpg
......dog_image_2.jpg
...neg/
......neg_image_1.jpg
......neg_image_2.jpg

Calling image_dataset_from_directory(main_directory, labels='inferred') will return a tf.data.Dataset that yields batches of images from the subdirectories cat and dog and neg , together with labels 0 ,1 and 2 (0 corresponding to cat and 1 corresponding to dog, 2 corresponding to neg ).
Specify the label_mode as int to get int value.
label_mode
- 'int': means that the labels are encoded as integers(e.g. for `sparse_categorical_crossentropy` loss).

For more information on the library please refer here