I need to classify an object into multiple classes. Normally we are familiar with multi-class classification with a single hierarchy, but in my case I have two levels of hierarchy. See the below images to get a clear picture of what I am talking about. so that if I want to classify an image, it should give me all three classes: one is the main class and two subclasses. For example, Class-1-1-1, or Class-1-2-3.
Solution for any framework will work either Tensorflow or PyTorch. Thank You.