1
$\begingroup$

I need to classify pictures into 2 categories: approved and rejected. Rejected category has different type of images which are not allowed (subcategories), for example nude or gore or anime etc.

What approach in training the CNN will be better or they are equal for the CNN:

  1. To have output final layer with 2 categories (neurons) - approved and rejected

  2. To have a lot of neurons in the final layer, one for each "subcategory" (and feed NN with corresponding labels), and later when doing actual inference just manually aggregate them to rejected category?

I'm not sure if using the first approach CNN can easily apply OR operation for such a different subcategories, thus that training will be effective. Just feel that multi-categories approach is easier for NN. Is there any approved science behind it?

$\endgroup$

1 Answer 1

0
$\begingroup$

Okay, so I used the custom loss function to optimize both ways simultaneously: - binary rejected vs approved - multiple categories And using the coefficient argument to balance between two losses. Thats it

$\endgroup$
1
  • $\begingroup$ That is what I was going to suggest. The other thing I've seen is similar to your point 2: They will take the output layers and train something like a SVM on the sub problem. I think it's unnecessary though if you just create a more complex loss function as you did. $\endgroup$ Mar 21 at 21:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.