0
$\begingroup$

I am training a model to place labels in image data. Some labels are learnt very quickly by the model while others take a long time to perfect. I cannot simply add more labeled data with only the labels I am looking to improve on since most of the image data contains a combination of the easy labels and the more difficult ones. Are there any smart ways to get the model to focus on the hard labels? I am just looking for some leads. Of course I can just train for longer but that seems inefficient as half the labels are already predicted almost perfectly.

$\endgroup$
4
  • $\begingroup$ are we talking about low represented classes or balanced classes but some of them are not classified properly for unknown reasons? If it's the latter case it would be helpful to provide more information about the data and some examples. $\endgroup$ Jan 26 at 14:29
  • $\begingroup$ The label set is balanced. Some labels are harder to place correctly on the image because they are simply more difficult to identify (since some features I am trying to label have more variance in shape/perspective, lighting conditions and motion). $\endgroup$
    – Tetraquark
    Jan 26 at 14:38
  • $\begingroup$ if those are the main issues sounds like you need just some extra prerocessing steps to standardize your images and remove that variance. But again, hard to give suggestions without concrete examples. $\endgroup$ Jan 26 at 14:47
  • $\begingroup$ Well I am tracking animals frame by frame. Some bodyparts are easy to identify (eg: all the points along spine from head to tail) whereas limbs are harder because they can obscure each other and move quickly. A left front paw and right front paw can look very different depending on where is it seen from whereas the neck or top of the tail is trivial to find. $\endgroup$
    – Tetraquark
    Jan 26 at 15:43

1 Answer 1

0
$\begingroup$

The easiest approach to give more importance to a group of specific training instances is simply using a weight to increase the error loss computed on those specific instances during training. Libraries like sklearn have implemented off the shelf the sample_weight parameter to perform precisely this. The obvious downside of this approach is that you need to know before hand which training instances are hard to learn for the model, and you need a metric to translate that difficulty level into a loss weight.

More fancy approaches try to boost accuracy for instances hard to tackle by trying to better approximate this "hardness level" and then ranking the training instances from the easiest to the hardest, logic being that this order will facilitate gradient descent convergence. The main two approaches are:

  • Self-Paced learning, the core idea is to replace the classic loss with an objective function that can learn both, model weights and a parameter (usually indicated with $v$) indicating the difficulty of each training instance.
  • Hard Examples Mining, similar to active learning, a model is trained on a set of known easy examples, and then used to harvest miss classified data that are used to perform a focused retraining of the same model.

Honestly though, these ideas are pretty old, and the fact that they're not widely used today to me suggests that the benefits are way less than the difficulties they introduce. So an in depth analysis of your data to boost standardization in term of quality (brightness/contrast adjustment, histogram equalization and so on) will probably be less of a rabbit hole and most likely still lead to better performance of your model.

$\endgroup$
2
  • $\begingroup$ I don't think I can standardize the quality of individual features in the image since I have both the "easy" labels and the "hard" labels in the same image. I can't alter one without the other and at that point I could just use more data augmentation on top of the basic mirroring I currently do, but I don't think this solves the problem of trying to get the model to focus on the hard labels. Will check out your other suggestions, thanks! $\endgroup$
    – Tetraquark
    Jan 26 at 16:03
  • $\begingroup$ you could split the task tough. Use normal rgb for body parts easy to detect and train another model on enhanced images to compensate for dark parts to detect limbs. My point is: machine learning is data driven, if the data is crap, the model will be crap, no debate around it, and no matter what fancy approaches you try to compensate for what the data lack. So personally I live by trying to improve the data first, and leave the rest as final resource. But of curse that's just my philosophy. $\endgroup$ Jan 26 at 16:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .