Wireless Sensor Networks (WSNs) are vulnerable to faults because of their deployment in unpredictable and hazardous environments. This makes WSN prone to failure such as software, hardware, and communication failures. Due to the sensor’s limited resources and diverse deployment fields, fault detection in WSNs has become a daunting task. To solve this problem, Support Vector Machine (SVM), Probabilistic Neural Network (PNN), Stochastic Gradient Descent (SGD), Multilayer Perceptron (MLP), Random Forest (RF), and Convolutional Neural Network (CNN) classifiers are used for classification of gain, offset, spike, data loss, out of bounds, and stuck-at faults at the sensor level. Out of six faults, two of them are induced in the datasets, i.e., spike and data loss faults. Likewise, sensors embedded mobile phones are used for the collection of data for some specific task which can effectively save cost and time in Crowd Sensing Network (CSN). The quality of collected data depends on the participation level from all entities of CSN, i.e., service provider, service consumers and data collectors. In comparison with the centralized traditional incentive and reputation mechanisms, we propose a blockchain based incentive and reputation mechanism for CSNs, which mainly consists of three smart contracts. The incentives are used to stimulate the involvement of data collectors and motivate the participants to join the network. Also, the issue of privacy leakage is tackled by using Advanced Encryption Standard (AES128) technique. In addition to that, a reputation system is implemented to
tackle the issues like untrustworthiness, fake reviews, and conflicts among entities. Through registering reviews, the system encourages data utilization by providing correct, consistent and reliable data. Furthermore, the results of first scenario are compared on the basis of their Detection Accuracy (DA), True Positive Rate (TPR), Matthews Correlation Coefficients (MCC), and F1-score. In this thesis, a comparative analysis is performed among the classifiers mentioned previously on real-world datasets and simulations demonstrate that the RF algorithm secures a better rate of fault detection than the rest of the classifiers. Similarly, the second scenario is evaluated through analyzing the gas consumption of all the smart contracts, whereas, the encryption technique is validated through comparing the execution time with base paper technique. Lastly, the reputation system is inspected through analyzing the gas consumption and mining time of input string length.