Dynamic Programming for Instance Annotation in Multi-instance Multi-label Learning