-1

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.

Hierarchy of class

Solution for any framework will work either Tensorflow or PyTorch. Thank You.

desertnaut
  • 57,590
  • 26
  • 140
  • 166
VittalAB
  • 7
  • 3
  • 1
    Look into multi-label classification, or you could run two submodels together, one doing binary classification on classes `0` and `1`, and the other multi-class on classes `1`, `2`, and `3`. – Djinn Sep 15 '22 at 04:35
  • yes, Djinn this would be better idea to go with really helped me a lot . But to be more precise do you mean having two or three models working in sequence one after the other? – VittalAB Sep 15 '22 at 13:16
  • If you go the second route, yes. – Djinn Sep 15 '22 at 14:24

1 Answers1

0

If you know your hierarchy tree, wouldn't it be ok for you to do multi-class classification on the leaves (the final classes), then check what are the parent classes in the tree, for a given prediction ?

PlainRavioli
  • 1,127
  • 1
  • 1
  • 10