The proposed system will be very helpful, as the user can have a clear insight of the data it is shared and processed with the other third parties and also the proprietary. With such a system, users can be assured of privacy and they will have all the control over the data.
In Future Work, this system can be implemented for the banking system, where the valuable items stored in a smart vault can be secured, as the information is not shared without the acknowledgment of the owner and also it will be very easy for the user to maintain it and details of the items in the smart vault without opening the vault many times. As it will be very convenient to get the details like the total amount, weight, etc. of the items in the smart vault. In this same manner, it can apply to many other use-cases where privacy is the priority and the user should have transparency with the data or information shared with others.
Algorithm 1 ML Based Detection System Training Model
1: Dataframe=read_incomingdata(filepath,field name,separator,axes)
2: Dataset=pre_processing(input_data)
3: Training data, testing data= train_test_split(dataset, test_size , random_state)
4: Scaling(training_data)
5: Classifier=classification_algorithm()
6: Crossvalidation=(classifier,training data ,training data , crossvalidationfold,scoring)
7: Tuned_hyperparameters=GridsearchCV(classifier, cru- cialparameters,number_of_jobs,verbose)
8: Tuned_hyperparameters (training data)
9: Tuned_hyperparameters best_parameters
10: Scaler(testingdata)
11: Classifier_prediction = gridsearch.best_estima- tor.predict(testing_data)
12: <device>log_trained_classifier= Tuned_hyperparame- ters.best_estimator
13: Return <device>log_trained_classifier 14: Accuracy(predicted data, original data) 15: Return <device>log_trained_classifier
Algorithm 2 MLDS-Output functions & Execution
1: IoT_device1_data_trained_detection_logic
2: IoT_device1log_trained_classifier
3: IoT_device2_data_trained_detection_logic
4: IoT_device2log_trained_classifier
5: IoT_device3_data_trained_detection_logic
6: IoT_device3log_trained_classifier
7: input_data=clustering of each device logs separately
8: switch (device) do
9: Reading_data
10: Preprocessing(input_data)
11: case : IoT_device1
12: Call <IoT_device1>_data_trained_detection_- logic()
13: Classifier_prediction = <IoT_device1 >log_- trained_classifier.predict(input_data)
14: Return classifier_prediction
15: case :IoT_device2
16: Call <IoT_device2>_data_trained_detection_- logic()
17: Classifier_prediction = <IoT_device2>log_- trained_classifier.predict(input_data)
18: Return classifier_prediction
19: case :IoT_device3
20: Call <IoT_device3>_data_trained_detection_- logic()
21: Classifier_prediction = <IoT_device3>log_- trained_classifier.predict(input_data)
22: Return classifier_prediction
23: if (classifier_prediction=notpermissioned) then
24: Trigger alert system to user()
25: end if
Algorithm 3 Keyword Based Detection System
1: Read incoming data
2: Preprocessing(input data)
3: Fetching attributes
4: switch (device name) do
5: case : IoT device
6: Call keywords db of smart IoT device
7: for (i=0;i<= IoT device attributes count;i++) do
8: for (j=0;j<=fetched attributes count;j++) do
9: if (keywords of IoT device[i]=fetched at- tributes of inputdata[j]) then
10: Update and store matched at- tributes[]
11: Update and increment matched at- tributes count
12: else
13: Update and store unmatched at- tribute[]
14: Update and store unmatched at- tribute count
15: end if
16: end for
17: end for
18: total attribute count=matched attributes count + unmatched attribute count
19: if (total subattribute count device < total attribute count input) then
20: Update the input with not permissioned tag
21: Return unmatched attributes[]
22: Block the outgoing port on network
23: Trigger alert to user and update user con- sole
24: end if
Algorithm 4 Smart Contract Algorithm
1: Input1 Ethereum Address(EA)of the Device Owner 2: Input2 Ethereum Address(EA)of the Third-party user 3: if Valid(Third-party) then
4: Execute permissions() functions
5: if permission = = Read then
6: Send the respective IPFS hash value.
7: end if
8: if permission = = Store then
9: Send the respective IPFS hash value.
10: end if
11: if permission = = Process then
12: Send the respective IPFS hash value.
13: end if
14: else
15: Revert contract state and throw an error.
16: end if