The Mathematics of Perception: Statistical Models and Algorithms for Image Annotation and Retrieval