## 5 Validation and Data Analysis with ML
### Second Scenario: Experimentation with BCT  
Several research works consider both BC and ML-based solutions to protect their network against security attacks. For instance, the authors in [41] suggested classifying an attack on BC with the deep learning (DL) approach based on historical security data, SHA256 encryption to hash public key and a secret key to sign transaction. The authors in [42] proposed AES encryption to protect IoT-generated data and a BC-based solution to ensure the dataset and ML algorithms integrity for e-health applications. Furthermore, a DL approach was suggested by the authors in [43] to detect security attacks for Ethereum classic network-based BC. Likewise, the authors in [44] proposed the usage of BC for collaborated federated learning (CFL) in order to preserve the privacy of data edge devices. Indeed, a CFL is defined as a distributed implementation of centralized ML in which each edge device trains their local model and then sends their model parameters to the central controller in order to develop an aggregated ML model. In this section, a framework based on a hybrid solution in which a BC structure based on smart contract is used to store sensor access control information and an ML classifier is employed to detect DDoS, DoS, injection, MitM, brute force, XSS and scanning attacks. As depicted Figure 10, a BC access control data structure is now used to collect all assets needed for identity authentication, authorized persons to use sensors, location for the same command to detect DDoS attacks and number of tentative providing a wrong  
Figure 9: Average classifier measured metrics. password to detect brute forcing attacks. On the one hand, by considering a BC data structure and thanks to the inherent features of BCT such as immutability and transparency, the number of injection and XSS attacks could be reduced considerably. On the other hand, the data stored into the BC can be used as an input to create the dataset. To validate our model in this context, a five-step-based scenario is proposed as follows:  
1. Data sensing gathered from physical layer (including read/write of new sensor value and authentication request). 2. Data control and validation performed by the access control system in the transport layer level (i.e., the client process will prepare the sensorID, userID and userpwd to be sent to server process for an authentication request). 3. BC access control data structure will be used to save relevant data related to sensor authentication process (i.e., including authentication identity, authorized persons, location for the same command and the number of tentative with wrong password. All collected data are used to create a smart contract describing the sensor information asset performed by the application layer to provide sensor authentication service. 4. ML tools and optimization technique. This process is carried out by the advanced service layer based on the information provided by the BC access control data structure to detect DDoS and brute force attacks by using the gathered data (i.e., LocationFor-SameCommand and Numberofentativewithwrongpassword will serve as features). The optimization technique is employed through the usage of the SMO classifier (a kind of SVM classifier) by implementing [PERSON]'s sequential minimal optimization algorithm for training a support vector classifier. 5. Data analysis and performance metrics: this step is required to determine the performance evaluation of the proposed model in terms of the four introduced metrics (accuracy, precision, sensitivity and MCC). In the second scenario, the same classification process as in the first scenario (as described in Figure 7) was selected, considering extra features (authenticationIdentity, AuthorizedPersons, Numberofentativewithwrongpassword and CommandLocation) provided by the smart contract data structure. Figure 11 describes the data instance repartition for the various studied attacks.