Anomaly detection (AD) is an important application for target detection in remotely sensed hyperspectral data. Therefore, variety kinds of methods with different advantages and drawbacks have been proposed for past two decades. Recently, the kernelized support vector data description (SVDD) based anomaly detection approaches has become popular as these methods avoid prior assumptions about the distribution of data and provides better generalization to characterize the background. The global SVDD needs a training set for the background modeling; however, it is sensitive to outliers in the data; so the training set has to be generated with pure background spectra. In general, the training data is selected by random selection of the pixels spectra in entire image. In this study, we propose an approach for better selection of the training data based on principal component analysis (PCA). A valid assumption for remotely sensed images is that the principal components (PCs) with higher variance include substantial amount of background information. For this reason, a subspace composed of several of the highest variance PCs of cluttered data can be defined as background subspace. Thus, with the proposed algorithm, the selection of background pixels is achieved by projecting all pixels in the image into the background subspace and thresholding them with respect to the relative energy on the background subspace. Experimental results verify that the proposed algorithm has promising results in terms of accuracy and speed during the detection of anomalies.