# False Positive RFID Detection Using Classification Models
## 3 Dataset and Feature Extraction
### Local Outlier Factor  
The LOF detection method calculates the local density deviation for a given data point with respect to its neighbors to indicate the degree a data point is an outlier [48; 49]. The LOF score for acceptable data is expected to be close to 1, and increases for outliers. The algorithm first calculates the relative density, \(o\), for the dataset, \(D\), and the distance \(dist_{k}(o)\) between \(o\) and another object, \(p\in D\), such that  
* There are at least \(k\) objects \(o^{\prime}\in D\)-[\(o\)] such that \(dist(o,o^{\prime})\leq dist(o,p)\), and
* There are at most \(k-1\) objects \(o^{\prime\prime}\in D\)-[\(o\)] such that \(dist(o,o^{\prime\prime})\) < \(dist(o,p)\).  
The \(k\)-distance neighborhood of \(o\) contains all objects where distance to \(o\) < \(dist_{k}(o)\),  
\[N_{k}(o)=\left\{o^{\prime}\big{|}o^{\prime}\in D,\ dist\left(o,\ o^{\prime} \right)\leq dist_{k}(o)\right\} \tag{1}\]  
where \(N_{k}(o)\) may contain more than \(k\) objects. The reachability distance from \(o^{\prime}\) to \(o\) is  
\[reachdist_{k}\big{(}o\gets o^{\prime}\big{)}=max\big{\{}dist_{k}(o),dist \left(o,\ o^{\prime}\right)\big{\}} \tag{2}\]  
and the local reachability density, \(lrd\), of an object, \(o\), is  
\[lrd_{k}(o)=\frac{\|N_{k}(o)\|}{\sum_{o^{\prime}\in N_{k}(o)}reachdist_{k}(o^{ \prime}\gets o)} \tag{3}\]  
Thus, LOF for \(o\) is the average of the \(lrd\) ratio for the object and \(k\)-nearest neighbors,  
\[LOF_{k}(o)=\frac{\sum_{o^{\prime}\in N_{k}(o)}\frac{lrd_{k}(o^{\prime})}{lrd_{ k}(o)}}{\|N_{k}(o)\|} \tag{4}\]  
Thus, we could calculate \(LOF_{k}\) for all objects in the dataset. The approach takes the single parameter MinPts, the number of nearest neighbors defining the local neighborhood for an object. Previous study provided the guideline on picking the value of MinPts between MinPtsLB (lower bound) and MinPtsUB (upper bound) range [49]. In their experiment, mostly they utilized range value of MinPts between 10 and 50, which appeared to work well in general. We ran the experiment by using MinPtsLB and MinPtsUB as 10 and 40, respectively. The LOF score minimum, maximum, average, and standard deviation = 0.975, 5.064, 1.27, and 0.401, respectively.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Original Dataset** & **Outlier Factor** & **Outlier Data Points** & **Acceptable Data Points** \\ \hline
1624 & 1.5 & 266 & 1358 \\  & 3 & 135 & 1489 \\ \hline \hline \end{tabular}
\end{table}
Table 4: Optimal interquartile range outlier detection.  
A suitable LOF score threshold is required to classify a given data point as outlier or not. [PERSON] et al. (2000) showed that LOF \(\approx\) 1 should not be considered an outlier [48], and since the LOF distribution was approximately normal (see Figure 5a), 99.7% of the data points fell within \(\mu\pm 3\sigma\) (where \(\sigma\) and \(\mu\) are standard deviation and mean, respectively). Therefore, we set the LOF threshold = \(\mu+3\sigma\) = 2.473, as shown in Figure 5a. Table 5 shows the number of outliers identified, and Figure 5b shows where these outlier data occurred in terms of the RSS features defined above.