Privacy Preserving Blockchain with Optimal Deep Learning Model for Smart Cities

: Recently, smart cities have emerged as an effective approach to deliver high-quality services to the people through adaptive optimization of the available resources. Despite the advantages of smart cities, security remains a huge challenge to be overcome. Simultaneously, Intrusion Detection System (IDS) is the most proficient tool to accomplish security in this scenario. Besides, blockchain exhibits significance in promoting smart city designing, due to its effective characteristics like immutability, transparency, and decen-tralization. In order to


Introduction
Globally, technological advancements has brought improvements in lifestyle while sensing technology has changed the way of life in particular. This next-gen technology helps the industries and economies to explore much more opportunities [1]. While the individuals are linked with one another via smartphones, laptops, and tabs, on the other hand, smart gadgets, meters, and appliances are commonly used in almost all the cities across the globe [2]. Motor vehicles and community systems, moreover services, are most probably associated thus forming a new paradigm called 'internet of things' (IoT). Additionally, researchers, scholars and institutions are enhancing their standards and IoT protocols to standardize their gadgets' associations [3]. Subsequently, cities are on expansion mode in terms of infrastructure, control systems, services, and monitoring systems so as to adopt the changes introduced recently. Location services, smart traffic, weather, and smart transportation are also linked among with each other [4]. But, this sort of uncontrolled development of the cities brings forth totally new circumstances and problems which should be taken into account by government officials as well as stakeholders. Smart city concepts are completely based on embedded structures, intelligent technologies, and sensing technology. Generally, smart cities use information technologies and fixed infrastructures to enhance the living standards. There exists two chief problems such as security and electrical crime concerns [5]. Smart city security is ensured by three elements such as governance, technology and society.
Intrusion Detection Systems (IDS) are highly efficient tools in terms of monitoring network activities, identification of unauthorized usage, detection of information system destruction, and system protection from interior and exterior intrusions (intrusions from inside or outside the network) [6,7]. Meanwhile, IDS is recommended as a highly important security solution for newly-developed online web-based applications in relation to smart cities and Internet of Things (IoT) atmosphere. In general, IDS-based systems commence a greater quantity of unsuitable and fake alarms, whenever abnormal performances are identified [8]. If the activated fake alarm rate is too high, I t tend to diminish the performance of IDS in contrast to cyber-attacks and makes the job of security analysts completely challenging. Further, it also incurs heavy cost for detection, management and computation of intrusions. In addition to these, the risks for failure are high when using traditional IDS-based methodology for IoT since the latter does not approve the speedy development of smart city applications [9]. Thus, a powerful information security system model is required to be specific that allows the fast development of smart city applications under IoT environment [10].
In literature [11], the researchers proposed a smart city intrusion detection architecture based Restricted Boltzmann Machines (RBM). RBM is employed owing to its capacity to learn highlevel features from original information in an unsupervised manner and the ability to depict the information generated by smart sensors and meters. Additionally, the extracted features and distinct classifications are trained in this method. In the study conducted earlier [12], the researchers proposed a video-based IDS with DL. Now, You YOLO approach is employed for object recognition whereas intrusion is detected using the presented method by shifting the centre of mass of the identified objects. Furthermore, Simple Online and Real-time Tracking (SORT) approach is utilized to track real-time intruders. Ramadan [13] proposed a simple and two light approaches for detection and prevention of intrusions in smart city-multipath-based IDS (MBIDS) and Threshold-based IDS (TBIDS). The researcher applied cross-layer method between network and the application layers for intrusion detection.
Gupta et al. [14] presented a hybrid optimization and DL-centric IDS to resolve the problem in IoT-assisted smart cities. Initially, the dataset endures pre-processing to obtain accurate and effective IDSs. Next, clustering and FS are implemented by MinK-means Algorithm and Hybrid Chicken Swarm Genetic Algorithm (HCSGA). Qureshi et al. [15] aimed at managing a minimum of three components in smart cities such as smart living, security provision, and smart mobility by designing three natural-inspired solutions. Daniel et al. [16] presented Cognitive Smart City Network (CSC-Net) structure that describes how information is gathered from the application of smart cities and it is examined through cognitive computation. The study forecasted Mobile Edge Computing solution (MEC) that allows node cooperation among IoT gadgets to ensure reliable and secure transmission between fog layer and smart device and equally between cloud and fog layers. In literature [17], an IDS was presented for detecting the injection attacks in IoT applications. Here, two kinds of FS approaches (recursive feature elimination and constant removal) were utilized and were validated using several ML classification methods such as Decision Tree, SVM, and Random Forest. Few other models based on blockchain are also available in the literature [18][19][20][21][22][23][24][25].
In this background, the current study designs Privacy Preserving Secure Framework using Blockchain with Optimal Deep Learning (PPSF-BODL) model for smart cities. The proposed PPSF-BODL model uses z-score normalization to transform the actual data into useful format. Also, Chameleon Swarm Optimization (CSO) with Attention-based Bidirectional Long Short Term Memory (ABiLSTM) model is engaged for detection and classification of intrusions. Moreover, Blockchain (BC) is utilized for secure transmission of the data to cloud server. A detailed experimentation of the proposed PPSF-BODL model was conducted on benchmark dataset.

The Proposed Model
In this study, a novel PPSF-BODL technique has been developed for both identification and classification of intrusions in smart city environment. The proposed PPSF-BODL model includes the collection of primary data using sensing tools. Also, z-score normalization is utilized to transform the actual data into useful format. Next, ABiLSTM model is employed for intrusion detection and classification. Finally, CSO is employed for optimal hyperparameter tuning of ABiLSTM model.

ABiLSTM Based Classification
Once the input data is pre-processed, ABiLSTM model is employed for intrusion detection and classification [26]. BiLSTM model is employed to enhance the learning abilities of conventional LSTM model by considering bidirectional relationship of the data. It helps in attaining more structural data via gating scheme which in turn improves the efficiency. Further, it also performs data encoding to obtain data features that enhance the generalization abilities. It begins with input series after which the inverse form of the input series is combined with LSTM model. BiLSTM approach is produced via forward h t and backward layers h t . At last, the end outcome can be a product at every instance via the integration of outcomes at the respective forward and backward layer moments. It is mathematically defined as follows Here, w 1 − w 6 denotes the respective weight coefficients; h t , h t , x t , and y t , represent the vectors for forward propagation, backward propagation, input and output layers respectively; b, b , and b y denote the biases.
ABiLSTM model enables the learning of related data in various representative sub-spaces. It processes the data concurrently to reduce computation complexity. Based on the final hidden layer h r i outcome of BiLSTM model, the present data can be defined by h t 1 , h t 2 ,. . ., h t N . Afterward, it is fed into multi-head self-attention, a new representation s t for data which is attained using the succeeding equations.
where head i h r N represents the i-th attention head value and W 0 denotes linearization mapping matrix. N), it is determined as follows.
where, K, and y represent the query, key, and value matrix respectively. The respective vectors q, k i and v i are defined below where W q , W k , and W v denote the weight matrix that vary in different attention heads. Fig. 1 illustrates the structure of BiLSTM.

CSO Based Hyperparameter Optimization
In the final stage, CSO is employed for optimal hyperparameter tuning of ABiLSTM model. In order to optimally determine the hyper-parameters, CSO technique is utilized which enhances the efficiency of the entire classifier. CSO [27] technique is a meta-heuristic approach that follows the initialization of population to determine the optimization process. Consider that the total number of populations is C which exists in the searching space of D. An initial population is generated from the dimension composed from arbitrary initialization in the searching space as given below.
An initial vector of i th chameleon is demonstrated as a i . The lower and upper limits of the searching area are denoted by L j and U j in j th dimension correspondingly. rand denotes the arbitrarily-produced number that decreases in the range of zero to one.
An improved capability of chameleons to search from the searching space is formulated as follows Now, ρ represents the parameter employed during iteration which diminishes with enhancing iterations. δ, α, and β illustrate the presenting parameters employed for accomplishing exploration as well as exploitation stages. The rotating-centred co-ordinate, employed for the upgradation of location of the chameleons in searching space is offered as follows.
arand i r signifies the rotating centered co-ordinate of chameleons. m is employed to denote the rotation matrix and ac i r is employed to represent the center co-ordinates at r th iteration. The inertia weight of the iterations is offered as given below.
At this point, W signifies the weight of inertias, λ indicates the arbitrary number used to control the exploitation capability. The value of λ corresponds to one. The acceleration rate of the chameleon is calculated as follows.
whereas y is used to define the acceleration of chameleons. It can be understood that the CSO initialized the optimization and the chameleon locations are upgraded using the formulas given below.
Here, G j r indicates the global optimal location of chameleons and v ij r signifies the novel velocity of r th chameleon. When some chameleon goes to the exterior of searching space, then it can be sent back for constraint defined earlier. Fitness Function (FF) is measured during every iteration to forecast the chameleon with optimum fitness. Though it may be frequent, it still fulfills the complete iteration cycles. Fig. 2

Blockchain Technology
Blockchain (BC) is used for secure transmission of the data to cloud server. This cloud server is a decentralized, distributed, and open digital ledger that is employed to store the transactions in different ways. BC is a set of blocks where each block is made up of timestamp, hash values of the existing and current blocks, and transaction details (bitcoin, ethereum). BC is a shared, decentralized and a public digital ledger which is employed to store the transaction details in a distinct manner. Therefore, an intruder record could not be modified for every block that is made up of cryptographic values of the current block. Fig. 3 demonstrates the structure of BC. BC provides the ability to distribute the ledger of information in a trusted, shared, safe, and decentralized manner. Decentralized storage is a kind of BC which is employed to store the maximum information that is interconnected with current and previous blocks through smart contract code. LitecoinDB, Swarm, SiacoinDB, MoneroDB, BigchainDB, IPFS, and so on, have been employed for decentralized data. Interplanetary File System (IPFS) is determined as shared, Point-to-Point, and decentralized dataset that is connected and transmits typical files. IPFS is employed with BC method for IoT function to gain maximal throughput.     6 exhibits the comprehensive classification results accomplished by PPSF-BODL model with 20% of TSS. The figure corresponds that the proposed PPSF-BODL model acknowledged normal class with accu y , prec n , reca l , and F score values such as 97.29%, 97.34%, 97.62%, and 97.48% respectively. Likewise, PPSF-BODL model recognized the anomaly class with accu y , prec n , reca l , and F score values such as 97.29%, 97.23%, 96.92%, and 97.08% respectively. Furthermore, the proposed PPSF-BODL model achieved average accu y , prec n , reca l , and F score values such as 97.29%, 97.29%, 97.27%, and 97.28% respectively.      of TSS. The figure shows that PPSF-BODL model recognized normal class with accu y , prec n , reca l , and F score values such as 97.46%, 97.87%, 97.38%, and 97.63% respectively. Also, PPSF-BODL model recognized anomaly class with accu y , prec n , reca l , and F score values such as 97.46%, 97.00%, 97.56%, and 97.28% respectively. Furthermore, PPSF-BODL model attained average accu y , prec n , reca l , and F score values such as 97.46%, 97.43%, 97.47%, and 97.45% respectively.  Fig. 11. The experimental outcomes infer that the proposed PPSF-BODL model gained the maximum TA and VA values. To be specific, VA seemed to be higher than TA.   Fig. 13 highlight the comparative analysis results accomplished by PPSF-BODL model and other recent models [20]. As per the results, CS-PSO and GB models achieved less accu y values such as 76.37% and 84.47%. At the same time, Gaussian model, DNN-SVM, and soft K-means models exhibited slightly improved accu y values. Though DBN, Cuckoo opt., BIDS, and genetic algorithm models reached moderately closer accu y values such as 96.89%, 96.56%, 96.13%, and 96.04% correspondingly, the proposed PPSF-BODL system outperformed other methodologies with a maximum accu y of 97.46%.  The above mentioned results and discussion ensured the superiority of the proposed PPSF-BODL model over other methods.

Conclusion
In this study, a novel PPSF-BODL approach has been developed for identification and classification of intrusions in smart city environment. The proposed PPSF-BODL model includes primary data collection with the help of sensing tools. Further, z-score normalization is also utilized to transform the actual data into useful format. Next, ABiLSTM model is employed for detection and classification of intrusions. Finally, CSO is employed for optimal hyperparameter tuning of ABiLSTM model. BC is utilized for secure transmission of the data to cloud server. This cloud server is a decentralized, distributed, and open digital ledger that is employed to store the transactions through different methods. A detailed experimentation of the proposed PPSF-BODL model was carried out on benchmark dataset and the outcomes established the supremacy of the proposed PPSF-BODL model over recent approaches with a maximum accuracy of 97.46%. In future, CSO algorithm can be applied to feature subset selection so as to enhance the intrusion detection results.

Funding Statement:
The authors received no specific funding for this study.

Conflicts of Interest:
The authors declare that they have no conflicts of interest to report regarding the present study.