Intrusion Detection in Wireless Sensor Networks with an Improved NSA Based on Space Division
Table 3
The detector generation process.
SD-RNSA(Train, ,) Input: training set Train, expected coverage Output: detector set : sampling times in non-self-space, : number of non-self-samples : number of non-self-samples covered by detectors CD: candidate detector set SubSpaces: subspace set
Step 1. Initialize the self-training set, ,,,. Step 2. Invoke GenerateSpaces(Train, SubSpaces) to divide the space, and several subspaces SubSpaces are got. Step 3. A candidate detector is randomly generated, and find the subspace where is located. Step 4. The Euclidean distance between and both contained-selves and half-contained-selves in the subspace is calculated. If can be identified by a self , discard it and perform step 3. Otherwise, increase . Step 5. The Euclidean distance between and detectors in the subspace is calculated. If is not be identified by any detector , add it to the candidate detector set CD. Otherwise, increase and determine whether the algorithm reaches the expected coverage . If it is, return and the procedure ends. Step 6. Determine whether reaches the sampling times . if , add the detector in the candidate detector set CD to the collection , and reset ,, and CD. Otherwise, perform step 3.