Input: the self training set , the radius of detectors , the number of needed detectors
Output: the detector set
Step . Initialize the self training set ;
Step . Randomly generate a candidate detector . Calculate the Euclidean distance between and all the selves in .
  If for at least one self antigen , execute Step ; if not, execute Step .
Step . Add into the detector set ;
Step . If the size of satisfies , return , and the process ends; if not, jump to Step .
Algorithm 1: The algorithm of RNSA.