The detection ability of detector is the key to the high detection performance of anomaly detection system based on artificial immune. The correlation among attributes of feature vector, nearly the same radius and quite small recognition region of detector are the main factors that affect the detection ability of detector. To improve the detection ability, this paper proposes a principal components weighted real-valued negative selection algorithm. This algorithm transforms the shape-space from high dimensions to lower-dimensional principal component space and uses weighted Euclidean distance to measure the affinity of detectors in principal component space. Experimental results show that this algorithm can improve the overall performance of detector. The detection results are better and more exact, and time to generate detectors and to examine new samples is saved effectively.