How does keras handle subfolders I am going to train a network to label a given image whether it belongs to category A or category B (a binary classifier). I use flow_from_directory to generate train, validation and test data. I keep all the images belong to category A in one folder. However, category B has sub folders. Lets say we have a folder which contains ship images (category A) and another folder which contains all the other images (cats, dogs, buildings, etc.) which are non ships (category B). In my application I keep all the non-ship images in different folders, according to their content, under non_ship folder. At the end I want a binary result (ship or non-ship). In this case I am actually not sure about how keras handles this. Does not it consider all the sub folders and just consider all the non-ship images are in one folder or consider that they belong to different subclasses?
The answer is it does not consider the sub folders. It assumes all the images available in the sub folders are belong to the same category. In this case all the non ship images are assumed they belong to category B.