In order to bridge the semantic gap in automatic image labeling,and effectively leverage image features,two feature selection algorithms based on distance constraint sparse / group sparse coding (DCSC/DCGSC) were presented to solve the problem of image semantic labeling.Considering that feature atoms similarity may have different contribution to the semantic similarity between images,a distance constraint regularization was defined and integrated with sparse/group sparse coding for feature selection,which encourages the feature atoms with sparsity/group sparsity and more similar to the semantic discrimination to be enforced.Given a test image,the K Nearest Neighbors (KNN) can be found using the learned feature weights from the training images and labels can be transfered.Experimental results on Corel5K showed that DCGSC outperforms other related method with the average precision of 32%, average recall of 34%,and the numbers of total labels recalled of 151.For images represented with single type of feature,DCSC also helps to improve the annotation performance, which validates the effectivity of distance constraint for image labeling.