What is image_dataset_from_directory ?

In simple words, it creates a different datatype object unlike ImageDataGenerator and most importantly it is faster than ImageDataGenerator and give us alot of methods to tweak our data.

image_dataset_from_directory = ImageDataGenerator + flow_from_directory

The great thing about using an image_dataset_from_directory is, it offers us alot of methods and attributes we could use on them.

When we use image_dataset_from_directory it returns out a BatchDataset a kind of datatype. It turns our data into batches of tensors.

Start small figure out what works and what doesn't and scale up as you need.

Comparing Sequential API and Functional API

While writing Sequential API we pass the layers in a list / sequential order.

On the next step we should build a Feature Extraction model with the Keras Functional API

Above the base_model holds all the pre-trained weights and layers of the Efficientnet-b0, and over that we build our layers to make it use for our problem.

Then the model_0 is the model where we stack our pre-trained base_model with out x (our layers / ouputs) to make it as a whole complete model.