We propose a probabilistic graphical model to represent weakly annotated images1 . This model is used to classify images and automatically extend existing annotations to new images by taking into account semantic relations between keywords. The proposed method has been evaluated in classification and automatic annotation of images. The experimental results, obtained from a database of more than 30000 images, by combining visual and textual information, show an improvement by 50.5% in terms of recognition rate against only visual information classication. Taking into account semantic relations between keywords improves the recognition rate by 10.5% and the mean rate of good annotations by 6.9%. The proposed method is experimentally competitive with the state-of-art classifiers.