Research Article

A Lightweight Intrusion Detection Method Based on Fuzzy Clustering Algorithm for Wireless Sensor Networks

Algorithm 1

Training Stage.
Input: Training set X=,q
Output: Normal clustering, noise clustering and one-class SVM model
(1)  use feature A of X
(2)  lc = storage local cluster center
(3)  gnorc = 0/global normal cluster center
(4)  gnosc = 0/ global noise clustering center
(5)  k = 0
(6)  calculate d = / calculate the distance between any two points
(7)   = cutoffdis(q)/ cutoff distance, equation (9)
(8)   / equation (9)
(9)   for  i = 1 to n  do
(10)find in the field of /the field is a circle with radius and center
(11)if   =   then
(12)lc.append()/   is a local cluster center and stored
(13)k = k+1
(14)end if
(15)  end for
(16)  for  i = 1 to k  do
(17)if   is min  then/   in lc
(18)gnorc =
(19)end if
(20)if   is max  then/   in lc
(21)gnosc =
(22)end if
(23)  end for
(24) initialize FCM with gnorc and gnosc
(25) X is divided into normal clustering data and noise clustering data by the FCM
(26) use feature B of normal clustering data
(27) input feature B of normal clustering data to SVMDS
(28) train one-class SVM by SVMDS
(29)  return normal clustering, noise clustering and one-class SVM model