# Image classification with CNN Python

I'm working on image classification using CNN, my dataset contains more than 50 classes (50 folders) which represent the types of car parts, and in each folder we have vehicle brands, each vehicle folder contains the images of the part taken in different sides: front, back, left , right, top, bottom. For example: a folder 'door' wil contain different brand of cars, in each car we will have images of the door tooken by different sides.

I have to create a model to recognize the type of the car part and also the side that the picture was taken. Please, can anyone suggest how can I use all these folders for my training dataset and how to recognize those two things ( type and side).

• Can you draw some image to show the directory structure for the images Apr 7 '21 at 16:09
• I added a picture to show you the structure. I just gave you some parts of cars ( driverdoor, doorhandler...) I actually have 6 folders. inside the folders I can have almost 1000 folders of cars, and inside them there are 6 images of that part. I hope that it is clear enough for you, thank you for helping me. Infact, this is a solution that was given to me and then i don't know if there is a better solution to do it in order to create a model to recognize the type of cars parts. Apr 7 '21 at 23:44

You can try and use the tf.keras.preprocessing.image.ImageDataGenerator's flow-from_directory() method. Here are a few links for reference:
• Can't you concatenate all cars_1 and cars_2 subdirectories into one single ? That way you'll have only driverdoor/ and doorhandle/ with no subdirectories ? Apr 8 '21 at 14:53