Margin is another metric that is used as an active learning heuristic. Like any other heuristic, Margin is also used to select the most important unlabeled data to be labeled. To do so, it does the following calculation:
The formula looks complicated, but it's a simple and intuitive calculation. The unlabeled image is given as an input to the model that predicts the image's score for different classes. Then, the top two maximum scores are subtracted from each other. The image that generates the lowest difference of the two maximum scores is taken as the new image to be labeled.
Here, the difference between the maximum scores for Image-A is 0.9 - 0.09 = 0.81, whereas for Image-B it is 0.5 - 0.3 = 0.2 => 0.2 < 0.81
Hence Image-B will be taken for the labeling. It is intuitive to label Image-B because the model is uncertain about it, whereas, for Image-A, the model is much more confident about the class.
Learn more about the other heuristics:
Only 13% of vision AI projects make it to production, with Hasty we boost that number to 100%.