Research Article

An Efficient Outlier Detection Approach for Streaming Sensor Data Based on Neighbor Difference and Clustering

Algorithm 1

Outlier detection based on neighbor difference (ODND).
Input: streaming sensor data, threshold
Output: outliers and their types
(01)calculate the curDiff
(02)if isAbnormal = true then
(03) count = count + 1
(04)end if
(05)if curDiff outside threshold then
(06)if isAbnormal = true the
(07)  if curAbnormal and abDiff has opposite sign then
(08)   if count = 1 then
(09)    current data are labeled as true point outlier
(10)   else
(11)    if count in threshold then
(12)     all data between current data and the data corresponding to abDiff are labeled as candidate collective outliers
(13)    else if count outside threshold then
(14)     the data corresponding to abDiff is labeled as a candidate jump outlier
(15)    end if
(16)   end if
(17)   reset the temporary variables
(18)  end if
(19)else
(20)  if count in threshold then
(21)   label the data corresponding to abDiff as a true jump outlier
(22)   reset the temporary variables
(23)  end if
(24)end if
(25)end if