Particle SwarmOptimization in thePresence ofMaliciousUsers in Cognitive IoT Networks with Data

Department of Electrical Engineering, Faculty of Engineering and Technology, International Islamic University, Islamabad 44000, Pakistan Department of Electronics Engineering, Korea Polytechnic University, 237 Sangidaehak-ro, Siheung-si, Gyeonggi-do 15073, Republic of Korea School of Information Technology and Department of Systems and Computer Engineering Carleton University, Ottawa, ON, Canada Department of Computer Science Engineering, Korea University of Technology, Cheonan, Republic of Korea


Introduction
Wireless communication networks have gained tremendous progress in the last decade to meet the growth in application devices from 1G to 4G Long-Term Evolution (LTE) advanced wireless networks [1]. ese generations have played their roles in order to achieve improved data rate, high reliability, minimum latency and more things on the way. Wireless communication is facing the challenge of how to connect wireless devices with each other at anytime and anywhere. In the evolution process, 5G is expected to offer significant contributions towards spectrum management, public safety consideration, energy utilization efficiency, improved data rate, and low latency [2][3][4]. Since the 5G wireless communication technology is on the horizon in combination with IoT consideration as its center stage, IoT devices will perform a central role in the formation of a 5G network paradigm [5]. e term IoT introduced and mentioned by Ashton for the first time is a technological revolution that brings heterogeneous networks under the common umbrella of IoT [6]. is technological revolution represents the future of connectivity and reachability. Unlike the traditional networks of embedded systems, IoT is capable of interconnecting heterogeneous devices, having diverse functionalities, produced by different manufacturers [7]. IoT has changed the landscape of numerous industries tremendously ever since it has been introduced [8]. It is a promising subject of the social, technical, and economic implications that will hold a strong and meaningful impact on our daily life in the near future. IoT is going to help in the improvised logistic learning, automation, e-health-care units, and intelligent transportation systems [8,9]. e functionality of IoT is extended using mobile computing in the healthcare environment to bring massive healthcare in the form of mobile healthcare in [10]. Similarly, the fogbased IoT healthcare framework proposed to minimize energy consumption of the fog sensing nodes along with network delay in [11]. e major focus is this paradigm from a technological perspective is to enhance computation, communication, and connectivity procedures. However, connectivity and radio spectrum management are more crucial and challenging responsibilities in front of the research community. In the near future, over 50 billion wireless devices have to be interconnected that may demand for a large number of spectrum resources [12]. In [13], the authors argued on the importance and employment of cognitive capabilities in IoT with the objective that without implication of the cognitive capability, it is similar to an awkward stegosaurus with all brawn and no brains. A dozen of wireless communication technologies are already in use such as WiFi, Bluetooth, LTE, earlier 3G standards, ZigBee, Near Field Communication (NFC), and different satellite services. erefore, the rapid growth in wireless communications demands for the new wireless services in both the used and unused part of the radio spectrum [14]. Spectrum sharing in 5.4 GHz band has already been legalized by the federal communication commission (FCC), where devices sense the existence of military radars before accessing the channel [15]. Cognitive radio (CR) is an intelligent wireless communication technology with efficient radio spectrum utilization abilities trying to learn and adjust its internal states according to environment [16]. e primary users (PUs) are able to transmit any time with no restrictions while the secondary users (SUs) gain the benefit of the spectrum access only when it is declared to be free [17].
In CR networks (CRNs), an incorrect detection of the PU results in false alarm and reduces the SUs' opportunities to access the spectrum. Similarly, any misdetection of the occupied PU channel produces interference to the PU by the secondary access. Masking of the optimal interference subcarrier is obtained based on genetic algorithm (GA) to suppress intercarrier interference caused by the SUs to the PU channel [18]. In [19], a side-lobe reduction scheme using a generalized side-lobe canceller combined with GA and differential evolution is proposed to minimize the impact of the interference.
Spectrum sensing with single SU is facing a number of limitations such as the limitations with the energy constraints, shadowing, fading, and hidden terminal problems [20]. On the other hand, in the cooperative spectrum sensing (CSS), the sensing problems faced by the single user is mitigated by allowing the cooperation among the multiple SUs to share their sensing results to make a global decision on the existence of PU [21]. In the CSS, the SUs forward their local decisions to the fusion center (FC) to make a global decision to infer the absence or presence of the PU [21].
However, the existence of malicious users (MUs) in the CSS severely reduces effectiveness of cooperation. erefore, proper detection and exclusion of the MUs' information are extremely critical [22]. Significant investigations have been carried out to make the CSS robust to the attack of MUs. e MU transfers erroneous sensing reports to the FC, in order to create confusion about the spectrum conditions. Such attacks are referred to as spectrum sensing data falsification (SSDF) attack [23]. A systematic review is conducted in [24] to analyze the security problem of IoTdevices and to counter various security challenges using mobile computing.
Boosted trees algorithm (BTA) is proposed in [25] that uses the AdaBoost ensemble method to make results of the cooperative decision at the FC reliablity in the presence of abnormal sensing data. e work in [26] suggested the use of differential evolution (DE) to identify the weighting coefficient vector against user sensing reports. is strengthens the reports of normal sensing users with high weights compared to the abnormal sensing users. An enhanced CSS scheme is determined at the FC using flower pollination algorithm (FPA) in [27]. Similarly, performance comparison is made at the FC between different hard combination schemes in the presence of abnormal reports of the lazy MUs in [28]. e work in [29] reduces the effect of the false sensing reports before making the final decision at the FC using modified double-sided neighbor distance algorithm with a GA optimization scheme. A machine learning scheme such as support vector machine (SVM) in [30] effectively classified the normal sensing users and different categories of MUs to help FC decision. In [31], malicious sensing nodes with false sensing reports are quantified in the simulation environment of the Poisson point process. As the MUs do not share honest sensing reports with the FC, a contract theory approach with incentive design scheme is proposed in [32] to reward honest SUs and to strengthen their cooperation. e normal SUs discussed in [33] follow the FC recommendation as a final decision of the PU channel and use their local sensing decisions to guarantee the CSS reliability. A Bayesian-inference scheme is proposed in [34] to identify and countereffects of the individual and collaborative SSDF attackers using a sliding window trust model.
A robust scheme which deals with always yes malicious users (AYMUs) is implemented in [35]. An extended sequential cooperation scheme with reduced sensing reports and improved sensing performance is investigated in [36]. e soft fusion schemes such as maximum gain combining (MGC) and equal gain combining (EGC) combine the energy statistics reported from the SUs to make a decision [37][38][39]. All cooperating SUs in the hard decision scheme forward the binary values denoting the local decisions to the FC to make a global decision [40][41][42]. e works in [43,44] utilize GA for optimizing the detection and false alarm probabilities to minimize the error probability. A novel evolution-based CSS mechanism is discussed in [45] to select and optimize the weight coefficients of the SUs' sensing result.
e binary GA-(BGA-) based soft fusion scheme proposed in [46] is used to improve the detection performance and bandwidth utilization. Particle swarm optimization (PSO) is utilized as a tool for the optimization of the threshold point to enhance the spectral efficiency and detect the potential spectrum [47,48]. An energy-efficient PSO which provides high protection to the legitimate user is proposed in [49]. In our previous study in [50], FC determines the Kullback-Leibler (KL) divergence score based on the users' soft energy sensing reports. e KL divergence score is acknowledged to the users and stored in the FC local database to improve future decision. Similarly, in the proposed method in [51,52], a double-sided neighbor distance (DSND) and outlier detection schemes followed by the majority voting decision in GA is used to reduce global decision error probability of the centralized CSS.
In this paper, the PSO algorithm has been employed to search for the spectrum information representing the actual status of the PU's activity on behalf of all cooperative SUs. e spectrum selection of the PSO results in overcoming the effect of MUs in the CSS. In the proposed scheme, the SUs forward their sensing results to the FC at certain sensing intervals. e FC utilizes the PSO algorithm to determine the most suitable energy statistics among the information received from the SUs including the MUs. Please note that the MUs pretend to be normal SUs. e one-to-many Hamming distances and z-score is used as a composite outlier score and fitness function of the PSO algorithm. Out of the PSO population, the sensing report with minimum outlying is selected as the PU channel status on behalf of all SUs for a global decision. e global decision of the PU channel is made with EGC, MGC, and majority voting hard fusion schemes based on the selections of the PSO algorithm. e PSO algorithm selection contains less harmful effects from any MUs; thus, the FC's decision becomes more reliable which improves the overall CSS performance. e proposed scheme is verified in the false sensing of always no MU (ANMUs), AYMU, opposite MU (OMU), and random opposite MU (ROMU) in a cooperative environment. e AYMU sends an always high-energy statistics of the channel irrespective of the actual status; thus, it increases false alarm probability and reduces throughput of the SUs. e ANMU category of the MU forwards always low-energy statistics that result in misdetection and induce interference to the PU. e OMU, which is the most harmful type of the MU, forwards the opposite values of energy statistics against its actual sensing result. Finally, the ROMU acts like the OMU with probability P and like normal SU with probability 1 − P. e rest of the paper is organized as follows. In Section 2, the system model considered through this paper is presented. Section 3 describes the details that how the PSO algorithm is utilized to reduce the effects of abnormal SUs by identifying accurate sensing results before using EGC, MGC, and majority voting decision at the FC. Numerical evaluations and analysis are presented in Section 4. Finally, Section 5 concludes the paper.

System Model
As the probability of experiencing deep fading at all SUs is extremely low, the shared sensing results of the users to cooperatively decide the PU activity can reduce the sensing problems which may occur with single SU's sensing. e objective is to minimize the error probability P e � P f + P m , where P f and P m denote the false alarm and misdetection probabilities. erefore, in order to reduce P e , the detrimental effects of the misdetection P m � 1 − P d and false alarm P f probabilities must be minimized.
As in Figure 1, the SUs cooperate to sense the activity of the PU channel and inform the FC about their sensing information. e received information from the AYMU is an always high-energy signal representing busy status of the channel. Similarly, the ANMU provides with a low-energy signal to the FC. e OMU negates the actually sensed status of the PU and the ROMU acts like an OMU or a normal SU probabilistically. Hence, the ROMU's nature is more difficult to predict. Based on the received reports from the SUs, the FC makes global decision of the channel availability. e binary hypothesis test at the l th time slot with the j th SU received signal is as follows [35]: where the hypotheses H 0 denotes the idle status of the PU channel and H 1 represents the channel occupation by the PU, y j (l) is the received signal by the j th SU in the l th time slot, n j (l) is the additive white Gaussian noise (AWGN) at j th SU, h j is the channel gain between the PU channel and the j th SU, and s(l) is the signal transmitted by the PU in the l th time slot, respectively. e received signal energy of the PU channel by the j th SU at the i th sensing interval is where K is the number of samples in the i th sensing interval. According to the central limit theorem, the number of samples needs to be large enough so that the energy reported by each SU becomes similar to a Gaussian random variable under both H 0 and H 1 as [35,53].
In (3), η j is the signal to noise ratio (SNR) between the PU and j th SU. Similarly, (μ 0 , σ 2 0 ) and (μ 1 , σ 2 1 ) are the mean and variance values of the energies reported under the H 0 and H 1 hypotheses.

Proposed Particle Swarm Optimization Process at FC
PSO is derived from the bird flocking or fish swarming introduced by Eberhart and Kenedy in 1952 [54]. In PSO, individual intelligence, as well as collective intelligence, plays an important role in finding an enhanced solution. In GA, it Scientific Programming is likely that every novel group is flourishing better than the previous generations. Similarly, in the PSO, the same group is likely to become better and better. e individuals establish their intelligence and improve it with the passage of time.
e whole group is expected to improve its group intelligence. Particles in the PSO algorithm utilize its own and neighbor knowledge to update their position and velocity. e PSO particle exchanges information about their best position among each other during a number of iterations.
e proposed model of the CSS using the PSO is shown in Figure 2. In this model, the SUs sense the PU channel and forward their energy statistics to the FC for a number of observations to form the PSO population. en, the FC applies the PSO technique in identifying sensing reports which are closer to the actual status of the PU channel. e FC measures the fitness score under all sensing iterations and declares the minimum outlying particle as the actual channel information for a final decision. Fusion schemes are applied by the FC, based on the selected global best particle of the population to generate a more accurate and reliable final decision of the PU channel.
In the PSO algorithm, a particle represents a row of the population matrix and each particle element (soft energy report) has a certain position and velocity. Initially, we assume that the positions and velocities of the particles are set to zero. e overall process of the PSO algorithm to determine the sensing reports, on the basis of which global decision is taken by the FC, is by proceeding the following steps: Step 1: local spectrum decisions e FC receives the soft energy reports from the SUs to form a history reporting matrix consisting soft energy statistical observations in the N 0 sensing intervals representing all SUs such as where E ij denotes the energy information of the j th SU in the i th sensing interval. Spectrum sensing information is gathered at the FC database for the M SUs including the MUs in the N 0 intervals as in (3). e SSDF effect caused by the MUs can be minimized by utilizing the following steps.
Step 2: finding the fitness of the particles After the collection of energy information as in (4), the FC modifies the particle positions to observe the differences in each individual sensing report with the reports provided by the other SUs. A new population is  Scientific Programming formed for all SUs based on the information already collected in (4) as where which denotes the average of individual soft energy reports provided by all other SUs while taking out the report of the j th user in this averaging.
Step 2.1: outlying using one-to-many sensing distances Outlying factors are determined for the sensing reports from the SUs based on the one-to-many sensing distances d j (i) for the j th SU in the i th sensing particle as Based on the results in (6), the outlier score d j (i) of the normal SUs and MUs is added to discover the total one-to-many Hamming distance score under each sensing interval: where d i is the total outlier score representing absolute sum of the Hamming distances of the individual reports E ij with the average reports E ij ′ of all other SUs in the i th sensing interval.
e measurement in (7) is made for the N 0 intervals, and the results are collected as PU Local spectrum decisions by SUs, to forward soft energy reports to the FC Identification of accurate sensing results with PSO followed by global decision of the PU channel with soft and hard fusion schemes Step 1: Local spectrum decision Step 2: Fitness function of the particles Step 3: Finding the local best and global best results of the population Step 4: Updating velocity and position of the particles to generate a better population Updating the local best if required and search for a new global best Iteration criteria < Limit No Yes Global best particle Step 5: Global decision of the licensed user channel using soft/ hard fusion schemes H 0 /H 1 Figure 2: Proposed cooperative spectrum sensing scheme using PSO.
Scientific Programming where d is the outlier score results of the N 0 sensing intervals. is score is a measurement of how far the report of each SU is away from the average sensing reports provided by all other SUs by separating those sensing intervals during which the MUs and the imperfection of the normal SU were misguiding the FC final decision about the PU channel.
Step 2.2: outlying using z-score Similarly, the other outlier score measurement is made with the z-score measurement in comparison with the sensing reports received from each SU as where μ(i) � ( M j�1 E ij )/M is the mean and σ(i) is the standard deviation of the i th particle in the PSO population. o j (i) is the z-score outlying of the j th report in the i th interval of the history log. e result of o j (i) in (9) shows how much the local sensing observation of the j th user is detached away from the group observations provided by all other SUs. Now, for guaranteeing the authenticity of each of the i th reports, the sum of z-score measurements for all particles is made as e total z-score of the N 0 particles of PSO population is collected as As the fitness function is the representation for the suitability of each sensing reports, the final selection of the fitness of each sensing reports from both the normal SUs and MUs is determined, and the best selection of the sensing results having less abnormal behavior is calculated. e criteria for selection of the particles according to their fitness values are declared according to (6) and (9) as e result in (12) declares the minimum score for sensing reports with fewer abnormalities in comparison to those that are badly affected due to the abnormal behavior of the MUs.
Step 3: updating population e global best position g is the particle that results in minimum outlying score among all particles in E according to (12). Each particle may improve its own if its new version is better compared to the previous one. Local best particles of the population are selected as P � E. e positions and velocities are initially set to zero. e particle velocities are updated with the individual and collective intelligences as where C 1 and C 2 are the learning acceleration coefficients that describe the particles' individual and social contributions. Similarly,R 1 and R 2 are the uniformly distributed random numbers in the range 0 to 1 to present stochastic contribution to the algorithm. Next to the measurements of particles' velocities with the local and global intelligence, these velocities are rounded to the two extremes as e j th particle's position representing soft energy information at the (i + 1) th iteration is updated with the measured velocities as where E (i+1)j are the reports of the modified population, E ij is the initial report of the j th SU in the i th interval, and V (i+1)j are the velocities as in (14).
Step 4: updating local best and global best Fitness measurements of the new population in (15) are determined by following the same procedure as in (12). e novel particle fitness is compared with the earlier population fitness to search for any improvements in the local and global best positions in comparison with the earlier energy reports. Similarly, the local best positions of the population are updated as 6 Scientific Programming In (16), the results of the local best particles are updated by comparing the fitness of the new population (15) to that of the local best particles P fitness. e local best particles are updated and take values of the new particles if their outlying results in (12) are higher compared to the newly created population. Similarly, a search is made to identify new global best particle in the entire population by cross analysis of the fittest. Fitness of the updated local best particles in (16) is placed for comparison to search for any improvement in the selection of the global best particle as g � In (17), outlying score of each particle of the local best population is compared with the global best particle determined earlier. If any particle of the local best population has a fitness function found to be optimum in comparison with the global best particle with the minimum outlying score in (12), then the global best particle is replaced.
Here, the new global best particle is selected as g representing the particle with the best fitness function having minimum outlying results in the current and previous PSO population. e PSO production of the new population and search for the global best results continues until the stopping criterion is met. At the end of the desired number of iterations, the final global best particle containing reliable and trusted soft energy reports against M cooperating SUs is elected for a final decision by the FC.
Step 5: global decision combination schemes Based on the final selection of the global best particle g as the soft energy reports on behalf of all M cooperative SUs, FC utilizes soft and hard combination schemes in Section 2 for declaring a unanimous decision about the PU channel. e EGC, MGC, and majority voting hard fusion combination schemes are used as decision criteria in this section. e EGC is combining the individual statistical information of all SUs by giving equal weight to each individual SU decision and summed coherently. e combination is compared with the threshold by the EGC as e cooperative detection and false alarm probabilities P d EGC and P f EGC made by the EGC scheme based on the global decision made about the PU spectrum are In the MGC scheme, each receiving signal branch is multiplied with a weighed function proportional to the branch gain. e branches with a strong signal in the MGC are amplified more, while the weak signal components receive attenuations with the weights. e idea to boost the strong signal component and attenuate weak signal component in the MGC diversity is exactly the same as that of filtering and signal weighting in the matched filter receiver. Similarly, the MGC scheme at the FC is giving higher weights to the decision of the SUs with higher SNR values and low weights to the decisions of the SUs with low SNR values as where w j � η(j)/ M j�1 η(j). e cooperative detection and false alarm probabilities of the MGC scheme are measured based on the received soft energy statistics as In the majority voting schemes, the FC counts the total number of the SUs with their energy value greater than the threshold as e three commonly used hard combination schemes are the majority voting, OR, and AND fusion combination schemes. In the count hard decision, a global decision on the PU existence is made if k out of total M cooperative users provide PU detection information with their energies larger than a threshold. e FC concludes a final decision H 1 if k users' reports validate the PU existence. Similarly, the total number of cooperative users with PU detection information less than k lead the FC to conclude in favor of H 0 to declare an idle condition of the PU channel. e counting score k is taken as 1 for the OR fusion rule and M for the AND rule. In the proposed work, the majority voting scheme is selected with k � M/2. In case of majority voting, if half cooperative Scientific Programming SUs energies are passing the threshold, a global decision is made as H 1 ; otherwise, the decision is made in favor of H 0 . e detection and false alarm probabilities measurement of the majority voting hard decision schemes based on the best selection of the PSO at the FC are as follows: where P d MV and P f MV are cooperative detection and false alarm probabilities of the majority voting schemes when PSO is used as a detection mechanism at the FC.

Numerical Evaluation
For simulation purposes, parameter adjustment is made for the CRN with M � 11 SUs. Among the total SUs, 7 SUs are selected as normal and 4 SUs are randomly selected as AYMUs, ANMUs, OMUs, and ROMUs. e sensing time is kept as 1 ms which contains K � 270 sensing samples. e total number of sensing iterations N is selected as 100. e sensing interval in which the ROMU performs a malicious act is adjusted randomly from 1 to N. e system performance is verified in the presence of equal distributions of OMU, ROMU, AYMU, and ANMU users. e sensing reports of the SUs formed the PSO population of size N 0 × M with N 0 particles representing the sensing information of the M cooperating SUs.
In this part of the simulation, the MUs are first selected as AYMU, and then, its nature is changed to ANMU. In Figure 3, results are drawn to compare the performances of EGC, MGC, and majority voting schemes. From the simulation results in Figure 3, it is obvious to show an improvement in the detection results of the PSO-based EGC, MGC, and majority voting schemes against the conventional combination schemes. e cooperative scheme performance under the considerations of AYMU and ANMU is more optimized for the PSO based soft and hard combinations. It is shown that the detection response in both the cases when only AYMU and the one with only ANMU users' considerations are identical. e equal consideration of AYMU and ANMU cases are similarly treated in the CSS with almost identical probability of detection P d for a given false alarm P f . Figure 3 also shows better receiver operating characteristics (ROC) results for the PSO based-MGC scheme which is followed by the EGC scheme. e majority voting hard fusion combination illustrates minimum detection results compared with the other two schemes. It is also obvious that the PSO-based soft and hard fusion combination schemes are able to outperform the simple MGC, EGC, and hard fusion combinations for any given false alarm.
In the second part, authenticity of the system is verified by comparing results of the proposed PSO-based soft and hard combinations with conventional schemes. In this case, the MUs are first selected as OMU, and then, their nature changes to ROMU. e result illustrates that the MGC scheme shows better detection compared with the EGC and majority voting counterparts. e ROC collection of the three schemes under the proposed and the conventional schemes show the reliabilities of the PSO-based combination techniques. In Figure 4, the ROMUs affect the sensing environment more hazardously than the OMU. e proposed scheme is superseding the traditional fusion schemes in both the OMU and ROMU cases.
In the third part of the simulation, the performances of the conventional and the proposed PSO-based fusion combinations schemes are tested, when the MUs are distributed equally as AYMU, ANMU, OMU, and ROMU in Figure 5. e minimum ROC results in Figure 5 show the performance of the conventional fusion schemes under the consideration of all 4 MUs, while the upper three ROC curves show the PSO fusion combination scheme performance under the same parameter settings. is shows an improvement in the detection performance of the PSObased fusion combination schemes compared with the conventional combination schemes. It is noticeable that the MGC fusion combination scheme provides more sophisticated detection performance compared to the other schemes.
e proposed PSO-based fusion combination scheme is further verified by illustrating the error probability P e according to the SNR varying from −35 dB to 0 dB in It is clear that, by following the PSO-based algorithm, the proposed fusion combination schemes are more optimized and accurate in the presence of the MUs. e selections of the PSO following by the soft and hard fusion combinations make the CSS authentic and suitable against the MUs. e risk of considering the MUs in the CSS is significantly reduced with the proposed scheme. e results show that the SUs cooperation is more effective using the proposed scheme.
e proposed scheme is able to eliminate the considerations of MUs in making global decision at the FC and produce reliable sensing results.

Conclusions
e impact of the MUs on the CSS reduces the effectiveness of cooperation in CIoT. erefore, it is necessary to detect the MUs in order to avoid any confusion about the actual status of the PU channel. is paper focuses on improving the performance of the CSS by using the PSO algorithm. Based on the energy statistics reported by the SUs, the PSO is able to reduce the effect of the MUs in authenticating the global decision of the PU's existence. e FC combines the diversified sensing reports of the users using the proposed EGC, MGC, and majority voting decisions to acquire the global decision of the PU activity. e proposed PSO algorithm is able to overcome the effects of OMU, ROMU, AYMU, and ANMU categories of the MUs in the soft and hard combinations. Simulations verify the superiority and the authenticity of the proposed scheme in producing more accurate and reliable decisions for the soft and hard combination schemes at the FC.

Scientific Programming
Data Availability e data used to support the finding of this study are included within the article.

Conflicts of Interest
e authors declare that there are no conflicts of interest regarding the publication of this paper.