Kernel vulnerability factor and efficient hardening for histogram of oriented gradients