Abnormal nodes sensing model in regional wireless networks based on convolutional neural network

There are some problems in abnormal node sensing in regional wireless networks, such as low sensing accuracy and poor judgment results of abnormal states of sensing nodes. Therefore, this paper develops a method for abnormal node sensing in regional wireless networks based on convolutional neural network. In addition, we will analyze the structure of regional wireless network nodes and determine the distribution mode of wireless network nodes. The regional wireless network node data are extracted and the pivot quantity and two-dimensional Gaussian distribution state are constructed using the median to build the regional wireless network node deployment model according to the confidence interval of the data characteristics; analyze the basic principle of convolution neural network, determine the operation mode of convolution kernel, classify the regional wireless network node data using Bayesian network, set a safety distance to determine the abnormal node of the regional wireless network, train the determined abnormal data as the input data of convolutional neural network and input it into the constructed perception model of the abnormal node of the regional wireless network, the loss function is set to continuously update the iterative results to realize the perception of abnormal node in the regional wireless network. The simulation results show that the sensing range of this method is relatively consistent with the range set by the sample, and the sensing accuracy reaches more than 95%, and the abnormal state error of abnormal nodes in the evaluation sample area is always less than 2%, which verifies that this method improves the sensing accuracy, reduces the error, and has higher application value.


Introduction
Thanks to the rapid development of information technology such as microcomputer technology, electronic technology, and advanced network and wireless communication technology, modern wireless sensor network (WSN) was born under this background [1,2].A wireless sensor network [3,4] is a self-organizing distributed network system consisting of a large number of sensor nodes with low power consumption and wireless communication.Sensor networks are characterized by selforganization, distribution, decentralization, strong concealment, and high fault tolerance, and the cost of setting up the system is low, flexible, and fast.These advantages make it ideal for many fields, such as ecological environment detection, regional target positioning, disaster prediction and early warning, intelligent urban traffic system, health data collection and so on.The most important and basic unit of wireless sensor networks are sensors.The number of nodes in sensor networks is huge and can be distributed anywhere in the deployment environment.The sensor nodes are usually deployed directly in the external environment for data collection.The nodes are fully exposed to the uncontrollable environment; therefore, the sensor nodes are extremely vulnerable to interference from environmental factors and malicious data destruction by humans.These threats lead to abnormal data collected by sensor networks, i.e., unreliability of data in sensor networks [5].Therefore, the perception and detection of abnormal nodes in regional wireless networks has become a research focus.
Lu et al. [6] proposed an abnormal node detection method for wireless sensor networks based on graph signal processing.Considering the problems of abnormal data collected from nodes in wireless sensor networks (WSNs) caused by low sensor security, poor detection range, and limited resources, this method proposes an abnormal node detection algorithm in WSNs based on graph signal processing.First, the signal model of nearest neighbor (NN) graph is constructed according to the position features of the sensor; Then, the statistical test is constructed based on the ratio of the smoothness of the graph signal before and after low-pass filtering.Finally, the presence of abnormal nodes is evaluated based on the statistical test size and the decision threshold by the open temperature dataset and PM2 5.The simulation results of the dataset show that the detection rate of the proposed algorithm is improved by 7% under the same abnormal conditions of a single node; however, under the same conditions of multiple nodes, the detection rate cannot be determined, which imposes some limitations.Lin et al. [7] proposed an algorithm for locating abnormal WSN nodes based on the random matrix theory.A novel abnormal node localization algorithm for wireless sensor networks is developed by introducing random matrix theory (RMT).A large data matrix is created according to the temporal and spatial characteristics of the original data, and a random matrix is used to reduce its dimension; the abnormal nodes are located by combining the spectral distribution theorem in RMT and the singular value decomposition property of the covariance matrix.The algorithm has high accuracy in detecting anomalies and localizing nodes, but fewer confounding factors are considered in localization, so it is necessary to expand the data scope of the research.
Peng et al. [8] proposed an osfl-tlbo location algorithm for wireless sensor network nodes.Looking at the problem of low location accuracy of the non-ranging DV-hop algorithm, this algorithm proposed a new location algorithm based on reverse leapfrog teaching optimization (osfl-tlbo) to improve DV-hop, the problem of cumulative error when the average jump distance is used to replace the Euclidean distance, and the problem, the least square method is sensitive to the initial value when solving nonlinear equations, and is greatly affected by measurement errors.The problem of node location in wireless sensor networks is transformed into the problem of solving the optimal solution; the positioning accuracy of the proposed algorithm is improved by about 10-25%, which effectively improves the positioning accuracy.However, the design process of the algorithm is complex and has a large time cost, which needs to be further improved.Li et al. [9] proposed an improved trilateral centroid localization algorithm for wireless sensor networks.The received signal strength indicator (RSSI) signals transmitted from the anchor node to the unknown node are clustered using the fuzzy C-means clustering method to eliminate the noise signal with low probability and large interference.The distance between the unknown node and the anchor node is calculated using the relatively accurate RSSI value, and then the reference point is found by the reference point weighted centroid positioning algorithm to locate the unknown node accurately.The simulation results show that the improved algorithm reduces the RSSI ranging error and improves the node positioning accuracy of wireless sensor networks, but the abnormal nodes are not distinguished in detail, so further improvement is needed.
This paper develops a method for abnormal node sensing in a regional wireless network based on convolutional neural network to address the shortcomings of the above methods.The technical contribution of this paper is as follows: 1. We analyze the structure of regional wireless network nodes and determine the distribution mode of wireless network nodes.2. We extract the regional wireless network node data according to the confidence interval of the data characteristics, and use the median to construct the pivot quantity and the two-dimensional Gaussian function distribution state to construct the regional wireless network node deployment model.3. We analyze the basic principle of convolution neural network, determine the operation of convolution kernel, classify the data of the regional wireless network nodes using Bayesian network, set the safety distance to determine the abnormal nodes of the regional wireless network, and train the determined abnormal data as the input data of the convolution neural network.4. We build a model for abnormal node perception in regional wireless networks and set the loss function to continuously update the iterative results to realize abnormal node perception in regional wireless networks.
2 Abnormal node sensing method in regional wireless network based on convolutional neural network 2.1 Analysis of node structure of regional wireless network Wireless sensor networks consist of a large number of sensor nodes randomly distributed in the environment.For example, nodes collect various types of data in the environment in environmental monitoring, such as temperature, humidity, air pressure, etc.The wireless network is formed by self-organization.Data is transmitted through several sensor nodes and finally reaches the transmission terminal.The terminal manages and configures the network according to the data information.The network includes two types of nodes: ordinary sensor nodes and gateway nodes [10,11].The distributed sensor nodes can communicate with each other and connect to the gateway node via multi-hop data.The gateway node collects and transmits data.It can access the Internet through the gateway node's network and then complete communication with the data control center.The whole system can be managed and controlled by the control center.The typical model of a communication system for a regional wireless sensor network is shown in Fig. 1.
The sensor network consists of four main parts: Information acquisition module, data processing module, data transmission module and power supply module.The information acquisition module consists of two subunits: the sensing element and the analog-to-digital converter (AD/DC).The sensing element senses the environment and collects the analog signal in the environment, then converts the collected analog signal into digital signal through the analog-to-digital converter, and then transmits the digital output signal to the data processing module.The data processing module distributes the data collected by the node to the network according to the results of program execution.The data transmission module is responsible for sending data to the destination node and receiving and forwarding data sent by other sensor nodes.The power supply module is responsible for supplying power to each sensor module, usually using the battery as the power supply for the device.When designing the hardware composition of sensors, it is necessary to use as many lowpower components as possible in order to save the power supply of the device and extend the life of the device.At the same time, the sensor should turn off some communication functions when there is no need for communication.The internal structure of regional sensor network nodes is shown in Fig. 2.

Data extraction and deployment model of regional wireless network nodes
How to determine whether the data of regional wireless sensor network nodes is abnormal is very important.The traditional threshold method has the problem that it is difficult to determine the threshold range.The selection of threshold directly affects the effect of the algorithm and may lead to false positives or missing positives.Data collected by sensor networks have different characteristics in different deployment environments.For example, even large data fluctuates greatly in some environments with large temperature changes, it is not an abnormal phenomenon; in some stable environments, small data jumps are abnormal.Depending on the characteristics of the data, the confidence interval is used to judge the abnormal value.The confidence interval is the interval used to estimate the parameters of a population, obtained by calculation based on the distribution of samples.It is necessary to take into account the standard deviation associated with an estimate to obtain this value, called the standard error (SE).SE describes the errors associated with the estimation.It reflects the variability of the statistical data.If the value of the whole population is not known, but only the sample value of this population, it can be obtained by the quotient of sample standard deviation and sample size [12].As can be seen in Fig. 3, the normal curve of the Z-score table is -1.96 * ?1.96 standard deviations with 95% confidence.Therefore, this paper extracts the regional wireless network node data using the confidence interval and effectively classifies them according to the confidence degree of the network node data.The confidence interval method is used to create an algorithm that describes the concept of credibility.The result of this method is that it can provide a confidence level for the information exchanged by WSN at any time.The average risk of the formula and the parameters of the confidence interval are calculated as follows: Mobile communication network Data control center Gateway Regional wireless network Gode Fig. 1 Regional wireless sensor network communication system model where a is the mean, a is the confidence of n À 1, # is the mean risk, # is the root mean square deviation, n is the sample size, and g a is the constant obtained from the student distribution table.This formula is used to estimate the node survival time, limit the error value measured by the sensor, determine the energy level of the sensor and the uncertainty interval of the parameters.
The confidence interval is used to represent the reliability of the generated data.By finding the average of each value and then determining the standard deviation of all the data of each distance, we can obtain that: where A is the mean of the data at a certain location, S is the confidence coefficient, it is a fixed value of the percent confidence ratio used, and z is the standard deviation.We assume that normal data fluctuate within range ½c; d under natural conditions, and abnormal data are often greatly different from normal data, generally reflected as the extreme value of samples, they will bring bad effects on statistical inference and the median of the sample can well resist the interference of outliers, the closer the median, the stronger its resistance of, so the median is used to construct the pivot size.
Set x 1 ; x 2 ; :::x n is the overall X À U½c; d of the wireless network nodes, and the median of the set regional wireless network nodes is: When the computational variance is not known, the sampling variance is used to calculate the confidence interval of the median of wireless network node data [13,14], and the following is obtained: where N represents the number of samples of the regional wireless network nodes, x i represents the sample value of the data from each wireless network node, and med represents the median of the sample node data.
Based on the data of regional wireless network nodes determined according to the above confidence interval, put the data extracted above by creating a deployment model.It is very common to deploy a node around a deployment point in practical application, and the probability distribution of each group of nodes around a deployment point is the same.Creating a group-based distribution model can be divided into the following steps: STEP 1: Divide the N sensor nodes evenly into n groups, and the group H i ði ¼ 1; 2:::nÞ represents the group deployed at the i-th deployment point.Also, H i ði ¼ 1; 2:::nÞ represents the deployment point ith by g and the coordinate value is ðx i ; y i Þ. STEP 2: The distribution of the deployment points of each group is shown in Fig. 4. The model used in this paper, which is based on a quadratic grouping, can be extended to other models.For example, each group of Internal structure of regional sensor network nodes The probability distribution function of each set of regional wireless network nodes is assumed to be a 2-dimensional Gaussian distribution.The coordinates of the deployment point are the center of the deployment rectangle, where the mean of the 2 D Gaussian distribution is ðx i ; y i Þ, and the probability distribution function [15] for node k in group H i ði ¼ 1; 2:::nÞ is: The deployment model of the constructed regional wireless network node is shown in Fig. 4.

Detection of abnormal nodes in regional
wireless networks based on convolutional neural network

Convolution neural network
The Convolutional Neural Network (CNN) [16,17], one of the most widely used deep learning network models, belongs to the feedforward neural networks.The general structure of a CNN is shown in Fig. 5.The hierarchical structure is connected in series and the whole consists of one or more convolutional layers and the full connection layer at the back end.The original input is convolved by the convolutional kernel of the convolutional layer to obtain the multi-channel feature slices, which are collected by the pooling layer, activate the neurons throughout the network model by the appropriate activation function to make them work, and finally output the confidence vector of the fault tag after the full connection layer.
The most important core of the neural network is the convolutional layer.The exploration of the research object is realized by the convolutional layer.The implementation process of the convolutional layer is shown in Fig. 6.
The two-dimensional convolution kernel (also known as the discrete two-dimensional filter) is used as the kernel for the convolution operation throughout the convolution process.The original input matrix generates a feature map after a convolution process.The whole process is often convoluted by several two-dimensional convolution cores.Therefore, the entire convolution process generates a multichannel feature map to complete the extraction of the convolution features from the original input matrix.The primary convolution is the convolution kernel that traverses and drives all positions of the two-dimensional matrix in sequence.The sliding process must take the design step as the sliding step and perform the inner product operation between the convolution kernel and the pixels on the position at each position.One of the convolution operations is the discrete convolution [18], which is defined as follows: where pðmÞ/gðnÞ are the two discrete functions for the convolution operation, and the length of gðnÞ is M. Correspondingly, in convolutional neural networks, the discrete convolutional formulation is described below: where f is the convolutional kernel, ðG; HÞ is the number of row column sizes of the convolutional core and g k the coincidence region ðg k Þ i;j to which the convolutional core slides during the input convolution layer is the numerical value of the elements of the convolutional core at position ði; jÞ.

Development of abnormal node awareness in regional wireless networks
The algorithm is designed and realized by means of the convolution algorithm based on the principle of wireless sensor network.These node data should be classified first based on the above collected regional wireless network data.Regional wireless network data has a large scale, and there are normal general data and abnormal node data in nodes.These data cannot be directly input into the convolutional neural network.Therefore, it is necessary to 4 Deployment model of regional wireless network nodes classify the data in the regional and then perceive the abnormal nodes according to different categories to determine the perception of different abnormal nodes.In the data classification of regional wireless network nodes, this paper is realized with the help of Bayesian classification and statistics method.Bayesian classification term statistical classification method is characterized by using probability to represent all forms of uncertainty, which can be used to detect the probability of samples belonging to each category, and learning or reasoning can be represented by probability rules, the Bayesian formula is specifically expressed as that, for n mutually incompatible events F 1 ; F 2 ; :::F n .The possibility is QðF 1 Þ; QðF 2 Þ; QðF n Þ. Events were observed during the trial, with a posterior probability is QðF j Þ: Bayesian basic classification formula is defined as: where QðXÞ represents the sample data of regional wireless network nodes, and F represents the category in the classification.
The regional wireless network node data classification process is shown as follows: STEP 1: Each data sample is represented by a ndimensional feature vector, D ¼ fd 1 ; d 2 ; :::d n g, which separately describes the n measures of the n feature, R 1 ; R 2 ; :::R n , of the sample.STEP 2: Calculate QðF X j Þ and the prior probability of class attributes according to QðF j Þ ¼ f i f , where f i is the number of samples belonging to class C in the training sample, and f is the total number of training samples.If R k is a categorical property, then QðF j Þ ¼ f i f , where f is the number of training samples of the class C with a value x on the attribute R, and the number of samples belonging to C in the training sample.If R is a continuous-value attribute, it is usually assumed to obey a Gaussian distribution, that is.
STEP 3: Classify the unknown data sample x, and calculate the probability of belonging QðF X j Þ to each category C for x.
The classified data of regional wireless network nodes is considered as a safe distance in all data by calculating the center distance based on the above classification of the data of regional wireless network nodes.If the data is within a reasonable distance, the regional wireless network node data is considered as normal data, otherwise it is considered as abnormal data, which is obtained by: where disðx i ; y i Þ represents the secure distance of the data center of the regional wireless network node.According to the above preliminarily determined abnormal data state of the regional wireless network nodes, the further abnormal perception is performed using a convolutional neural network.The convolution computation process completes the linear feature mapping and provides the multi-channel feature map slices, but only with this, the expression capability of the whole network, especially the approximation capability of the network for some edge features, it is limited.Therefore, a nonlinear activation function is added to the network to activate the neurons, so that the convolutional neural network has complex approximation capability and network resolution, and it is no longer a simple linear superposition of each layer.Therefore, the abnormal node data of the regional wireless network is activated using the sigmoid function, and the calculation formula is: The convolution layer extracts the multichannel features of the original input according to the number of convolution cores by the convolution kernel, but the adjacent elements often have similar feature tendencies.Therefore, the convolution results often have some redundancy.The pooling layer differs from this.The pooling layer scales the output feature map of the convolution layer in a certain ratio by different pooling rules, which reduces the feature dimension, the amount of feature operations and calculation.Therefore, the pooling layer is usually added after the convolutional layer.At the same time, experiments show that pooling can inhibit the matrix noise, which is mainly reflected in the whole training process of the model.The addition of pooling reduces the degree of overfitting of the model to some extent.Pooling rules generally include maximum-pooling, minimum-pooling, and mean-pooling.Let us take maximum pooling as an example: the pooling step is 2 and the pooling window is 2*2.As shown in Fig. 7, the calculation diagram of the pooling process is as follows: As the top of the CNN, it mainly realizes the mapping of the features and marks of the original input after training operations such as convolutional pool activation, and outputs the model recognition token and confidence at the end of the model.In CNNs, it is necessary to define a loss function for model training to correct the training accuracy in order to preserve the iterative update of the convolution kernel and bias.Targeting the problem of abnormal node perception in wireless networks in this work, the softmax classifier is used at the back end of the full connection layer, which utilizes the cross entropy loss function: The abnormal data perception model of regional wireless network nodes is constructed to realize the abnormal node perception of regional wireless network as follows on this basis: Among them, v represents the representative of regional wireless network anomalous node type data, n i represents the wireless network abnormal node weight, x i represents perceived sample data and w represents all anomalies after perception.
Analyze the basic principle of the convolutional neural network in the perception of abnormal nodes of the regional wireless network, determine the operation mode of the convolutional kernel, classify the data of the nodes of the regional wireless network using Bayesian a safety distance to determine the abnormal nodes of the regional wireless network, and train the determined abnormal data as the input data of the convolutional neural network.Input them into the constructed abnormal node perception model of the regional wireless network and set the loss function to continuously update the iterative results and realize the abnormal node perception of the regional wireless network.
3 Experimental analysis

Environment settings
An experimental analysis is performed to verify the effectiveness of the proposed method.The proposed method in the experiment, the graph signal processing based node detection method from literature [6], the random matrix theory based abnormal WSN node localization algorithm from literature [7] and the wireless sensor network node localization algorithm from literature [8] are compared and analyzed.In the experiments, a regional wireless communication network is selected as the research object.The topology of the network is shown in Fig. 8.
Set the distribution status of some wireless network nodes in the region according to the regional wireless network topology, as shown in Fig. 9.
The specific design of convolutional neural network is set in the experiment, which is shown in Table 1.

Experimental index design
According to the experimental environment and parameters of the convolutional neural network established above, the main experimental indicators analyzed in this experimental study are the perceptual accuracy of abnormal nodes and

Analysis of experimental results
To verify the effectiveness of the design method in this paper, the proposed method, the node detection method based on graph signal processing in reference [6], the abnormal WSN node location algorithm based on random matrix theory in reference [7], and the osfl-tlbo wireless sensor network node localization algorithm in reference [8] are experimentally studied to analyze the sensing accuracy of abnormal nodes in the example area.The obtained results are shown in Fig. 10.
By analyzing the experimental results in Fig. 10, it can be seen that there are some differences in the accuracy of   sensing abnormal nodes in the sample using the proposed method, the node detection method based on graph signal processing [6], the algorithm for locating abnormal WSN nodes based on random matrix theory in Reference [7], and the algorithm for locating nodes in wireless sensor networks [8].In terms of perceived range, the method for detecting nodes based on graph signal processing [6], the algorithm for locating abnormal WSN nodes based on random matrix theory [7], and the algorithm for locating osfl-tlbo nodes in wireless sensor networks [8] have the problem of being too large and too small.The perceived range of this method is relatively consistent with the range of the sample setting; it can be seen that the effect of perception is better with this method.The sensing accuracy of abnormal nodes in regional wireless networks is analyzed using different methods based on data in the experiment.The results are shown in Fig. 11.
By analyzing the experimental results in Fig. 11, as can be seen from the overall curve trend, the sensing accuracy of the proposed method for abnormal nodes in the wireless network in the corresponding sample area is always higher than that of the other three methods, and the fluctuation degree is low, reaching about 95%.while the perceptual accuracy of the other three methods varies greatly, which affects the perceptual accuracy.Among other methods, only the node detection method based on graph signal processing has the highest perception accuracy of 89%, while other literature methods have the highest perception accuracy of 84% and 73%.Compared with the four methods, the proposed method has the highest perception accuracy, the feasibility of the proposed method is verified.
The experiment is further divided into the proposed method, the node detection method based on graph signal processing [6], the algorithm for locating anomalous WSN nodes based on random matrix theory [7], and the algorithm for locating nodes in wireless sensor networks [8].The error in determining the abnormal state of abnormal nodes in the sample area is analyzed.The results are shown in Fig. 12.
The experimental results is analyzed in Fig. 12 that it can be seen that there are some differences in the judgment error of the abnormal state of abnormal nodes in the sample area when using the proposed method, the node detection method based on graph signal processing [6], the algorithm for locating abnormal WSN nodes based on random matrix theory [7], and the algorithm for locating nodes in wireless sensor networks osfl-tlbo [8].Among them, the error in assessing the abnormal state of the abnormal nodes in the sample area using this method is the lowest and is always less than 2%.Although the error curve has some changes, it is still lower than the other three methods.It is proved that the proposed method can effectively detect the abnormal nodes of the regional wireless network.

Conclusion
The performance of a regional network affects the quality of communications [19,20].When it is attacked, the nodes in it must be analyzed.To improve the performance of a regional wireless network, a method for sensing abnormal nodes in a regional wireless network based on convolutional neural network has been developed.The distribution mode of wireless network nodes is determined by analyzing the structure of regional wireless network nodes; Build the deployment model of regional wireless network nodes; Analyze the basic principle of convolutional neural network, determine the operation mode of convolutional kernel, classify the regional wireless network node data using Bayesian network, a safety distance is set to determine the abnormal node in the regional wireless network, Training the determined abnormal data as input data of convolutional neural network and input to the constructed abnormal node perception model in the regional wireless network, the loss function is set to continuously update the iterative results to realize the abnormal node perception in the regional wireless network.The experimental results show that the proposed method can effectively perceive the abnormal nodes in the regional wireless network, the sensing accuracy is high, and the abnormal state judgment result of the sensing nodes is good.

Fig. 6
Fig.5Deployment model of regional wireless network nodes

Fig. 7
Fig. 7 Schematic diagram of maximum pool structure

Fig. 8 Fig. 9
Fig. 8 Wireless network topology of sample area (a) Node detection method based on graph signal processing (b) WSN abnormal node location algorithm based on random matrix theory (c) Osfl-tlbo localization algorithm for Wireless Sensor Networks

Fig. 10
Fig. 10 Analysis of sensing accuracy of abnormal nodes in wireless networks in sample areas of different methods based on graph signal processing WSN abnormal node location algorithm based on random matrix theory Osfl-tlbo localization algorithm for Wireless Sensor Networks

Fig. 11
Fig. 11 Comparison of sensing accuracy of abnormal nodes in wireless networks in different methods

Table 1
(d) Proposed method