Semantic sparse learning in images and videos