Search code examples
machine-learningneural-networktorchconv-neural-network

Torch7 alternative to MultiLabelMarginCriterion


I have a multi class label problem to solve. Ie: each test image can be allocated 1-10 non-exclusive labels.

However, I am having problems with MultiLabelMarginCriterion because it's not supported by cunn. So, I am looking for alternative approaches. Would either of these be effective?

  1. Calculate each permutation of labels in the training set (about 150) and train a classifier to identify those 150 classes. However, I do not think that new permutations of labels in the test set (those not found in the training set) will not be recognised.

  2. Train 10 separate binary classifiers using BCECriterion. Ie: one classifier for each label. Run each test image through each classifier and combine the results. However, training lots of CNNs is time-consuming.


Solution

  • The best solution I found was to use MSECriterion where the targets and predictions are arrays of 1s and -1s, indicating the presence or absence of the label.