# 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?

• Can you imagine a way to test it? Oct 6 '18 at 8:34
• I prepared everything to test. I tried to run it but my computer is old and the gpu is not supported. I am going to run the main code on a server. Hence, I do not want to pay to understand how keras commands work. Oct 6 '18 at 14:55