# Analysis of Fault Classifiers to Detect the Faults and Node Failures in a Wireless Sensor Network
## 5 Simulations and Results
### Results--Scenario II  
The performances of the classifiers are evaluated fault-wise for better understanding and recommendations for the classifier selection process in the WSN implementation.  
The Offset fault is detected with higher accuracy by the RF classifier, as shown in Figure 9. It has been detected as 96.8% by RF, 94.8% by MLP, 94.5% by SVM, 79.2% by CNN, 74.6% by PNN and 71.6% by SGP. It is evident that RF outperforms all other classifiers in this fault as shown in Table 1.  
Figure 8: Percentage of fault detection accuracy of PNN.  
Figure 9: Offset fault detection accuracy.  
The Gain fault has been detected with higher accuracy by the RF classifier, as shown in Figure 10. It has been detected as 96.6% by RF, 91.1% by MLP, 80.3% by SVM, 76.4% by CNN, 73% by PNN and 70.7% by SGP. It is evident that RF outperforms all other classifiers in this fault.  
The Stuck-at fault has been detected with higher accuracy by the RF classifier, as shown in Figure 11, and it has been detected as 95.8% by RF, 91.6% by MLP, 81.2% by CNN, 80% by SVM, 73.6% by PNN and 71.4% by SGP. It is evident that RF outperforms all other classifiers in this fault.  
The Out-of-Bounds fault has been detected with higher accuracy by the RF classifier, as shown in Figure 12. The RF has detected 97.4%, whereas it is detected as 91.7% by MLP, 78.4% by SVM, 75.6% by CNN, 75.3% by PNN and 71.4% by SGP. It is evident that RF outperforms all other classifiers in this fault.  
The Spike fault has been detected with higher accuracy by the RF classifier, as shown in Figure 13. It has been detected as 85% by RF, 78.6% by MLP, 76.8% by SVM, 73.8% by CNN, 72.4% by PNN and 67% by SGP. It is evident that RF outperforms all other classifiers in this fault.  
The Data loss fault has been detected with higher accuracy by the MLP classifier, as shown in Figure 14. It has been detected as 99.2% by MLP, 96.3% by PNN, 94.5% by SVM, 90% by RF, 81.6% by SGP and 75.6% by CNN. It is evident that MLP outperforms all other classifiers in this fault.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Fault**} & \multicolumn{6}{c}{**Fault Detection Accuracy in \%**} \\ \cline{2-7}  & **PNN** & **RF** & **CNN** & **SGP** & **MLP** & **SVM** \\ \hline
0.1 & 64 & 98 & 87 & 92 & 93 & 92 \\
0.2 & 76 & 100 & 72 & 82 & 94 & 93 \\
0.3 & 78 & 98 & 86 & 73 & 93 & 98 \\
0.4 & 76 & 95 & 90 & 63 & 96 & 94 \\
0.5 & 79 & 93 & 61 & 48 & 98 & 96 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Offset fault detection accuracy.  
Figure 10: Gain fault detection accuracy.  
Figure 11: Stuck-at fault detection accuracy.  
Figure 12: Out-of-Bounds fault detection accuracy.  
Figure 13: Spike fault detection accuracy.  
This chapter explains the different types of faults (Offset fault, Gain fault, Stuck-at fault, Out-of-Bounds, Spike fault and Data loss) that occur in WSN with their mathematical model. This gives the details of the classifiers (Support Vector Machine (SVM), Convolutional Neural Network (CNN), Multilayer Perceptron (MLP), Stochastic Gradient Descent (SGD), Random Forest (RF) and Probabilistic Neural Network (PNN)) used to detect faults. The simulation results show that the RF classifier outperforms all other classifiers in this category.