Image_dataset_from_directory on regression task

Hi,
Can anyone tell how to use image_dataset_from_directory on a regression task;
the image folder has the structure bellow:

111

the name of each directory refers to 4 numerical numbers like this: [1,2,3,4]

Thank you

Hi @youb ,

Certainly! To use image_dataset_from_directory for a regression task, where each directory name refers to numerical values (such as [1,2,3,4]), you can follow these steps:

  1. Load the images using image_dataset_from_directory: Use this function to load the images from your directory structure. Since this function is typically used for classification tasks, we will initially load the data without using the labels.
  2. Extract and process the numerical labels: After loading the images, you need to extract the numerical values from the directory names and convert them into a suitable format for regression.
  3. Combine the images and the extracted labels: Create a new dataset that pairs the images with the corresponding numerical labels.

Thank You !