Trust Assessment Method for Mobile Wireless Sensor Networks Based on Generative Adversarial Networks
Through the trust evaluation method of generating adversarial networks, combined with labeled and labelless data training, the trust evaluation problem of mobile wireless sensor networks in dynamic scenarios is solved, and accurate identification of malicious nodes and network security is achieved.
Patent Information
- Application Number
- CN202310501897.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-06
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2043-05-06
AI Technical Summary
The existing mobile wireless sensor network trust model is poor in the face of dynamic scenarios and node mobility changes, and relies on a large amount of data to train and fail to effectively utilize unlabeled data, resulting in insufficient effective data in actual applications, affecting network security.
The trust evaluation method based on the generative adversarial network is adopted, and the classification performance of the discriminator is improved by establishing a scenario model, collecting location, communication, energy and data trust evidence, and using the semi-supervised learning model of the generative adversarial network, combining labeled and labelless data.
It realizes accurate identification of malicious nodes under a small amount of labeled data, reduces dependence on labeled data, and improves the accuracy of trust evaluation and network security.
Smart Images

Figure CN116528240B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of mobile wireless sensor networks, and in particular relates to a mobile wireless sensor network trust evaluation method based on a generative adversarial network. Background Art
[0002] Mobile wireless sensor networks (MWSNs) have been widely used in fields such as pollution detection, disaster warning, and resource exploration. Due to their dynamic nature and volatile topology, unstable communication between sensor nodes, and limited computing and storage capabilities, MWSNs are vulnerable to internal attacks. Trust management mechanisms have become an important method for combating internal attacks. Researchers have proposed various trust models to improve the accuracy of malicious node detection and thus enhance network security.
[0003] In 2022, Jiaxin Du et al. proposed an anomaly-resilient trust model based on isolation forests (ITrust) in "ITrust: An Anomaly-Resilient Trust Model Based on Isolation Forest for Underwater Acoustic Sensor Networks." ITrust considers the impact of environmental noise on anomaly node detection, collects environmental trust, communication trust, data trust, and energy trust into a trust dataset, and uses the isolation forest algorithm to detect the trust dataset. This method effectively detects anomaly nodes in noisy environments with high accuracy. In "Controversy Adjudication-Based Trust Management Mechanism in the Internet of Underwater Things," Jinfang Jiang et al. proposed a dispute resolution-based trust management mechanism (CATM), which effectively addresses recommendation conflicts caused by dishonest and erroneous trust recommendations. This mechanism considers dishonest and erroneous recommendations, evaluates link and node reliability, and makes dispute resolution decisions. Furthermore, an incentive mechanism based on the prisoner's dilemma encourages more neighbors, improving the accuracy of trust assessment. However, CATM is only suitable for dense, homogeneous networks and cannot obtain sufficient trust evidence in dynamic networks.
[0004] ITrust considers the impact of environmental noise, but does not consider the dynamic movement of nodes; CATM solves the problem of recommendation conflicts, but is not suitable for dynamic networks with scarce trust evidence. Therefore, the trust model of wireless sensor networks still has some shortcomings, mainly manifested in: (1) It does not consider the universality of the scene. After the scene changes, the trust model cannot be directly applied. (2) It does not consider the dynamic movement of nodes. The change of node position will affect the stability of network communication. (3) Based on traditional machine learning methods, it is highly dependent on a large amount of underwater data to train the model. (4) It does not utilize unlabeled data, and the implicit information in the unlabeled data is wasted. These defects make the existing trust model based on machine learning face the challenges of poor universality and insufficient effective data in practical applications. Summary of the Invention
[0005] The purpose of the present invention is to propose a trust evaluation method for mobile wireless sensor networks based on generative adversarial networks to solve the above technical problems.
[0006] To achieve the above objectives, the technical solution of the present invention is as follows: a trust assessment method for a mobile wireless sensor network based on a generative adversarial network, comprising the following steps:
[0007] Step 1: Establish a scenario model; the scenario model includes a network model, a sensor node clustering model, and a sensor node mobility model;
[0008] Step 1.1) Establish a network model; randomly deploy N dynamically moving sensor nodes in the deployment area; the sensor nodes communicate with the sensor nodes within their own communication range and exchange collected sensor node data; each sensor node has the same initial energy and storage capacity; after clustering, the sensor nodes communicate with the base station through the cluster head; communication is carried out between base stations and between base stations and satellites;
[0009] Step 1.2) Establish a sensor node clustering model; based on the improved K-means clustering algorithm, divide the sensor nodes in the deployment area into k clusters, with the cluster center being the cluster head CH. The cluster head CH collects trust evidence from cluster members and regularly transmits the trust evidence to the base station;
[0010] The improved K-means clustering algorithm is specifically as follows:
[0011] From the dataset Randomly select a sample point as the first initial cluster center c i ;
[0012] Calculate the shortest distance Dist(x) between each sample and the current initial cluster center, then calculate the probability P(x) of each sample point being selected as the next cluster center, and finally select the sample point corresponding to the maximum probability value as the next cluster center; the calculation method is as follows:
[0013]
[0014] Repeatedly select sample points until k cluster centers are selected;
[0015] Step 1.3), establish the sensor node mobility model;
[0016] Mobile wireless sensor networks are deployed in dynamic environments. The movement of sensor nodes causes their own positions to change dynamically. Considering the impact of the position change of sensor nodes on trust evaluation, a sensor node mobility model is established. The maximum communication radius of the sensor node TN is maxCom. The coordinate system is established with point O as the origin. The angles between the sensor node TN and the Z axis and the X axis are α and β respectively. The sensor node TN i The moving speed at time t is v i (t), the moving direction is (dα i (t),dβ i (t)), α, β∈(0,2π), the position at time t is (x i (t),y i (t),z i (t)), then the sensor node TN i The position at time t+1 is expressed as follows:
[0017]
[0018] Sensor node TN at time t+1 i With sensor node TN j The distance is expressed as:
[0019] dist ij (t+1)=|loc i (t+1)-loc j (t+1)|;
[0020] Step 2: Collect trust evidence; trust evidence includes location trust, communication trust, energy trust, and data trust;
[0021] Step 2.1), location trust;
[0022] According to step 1.3), dist ij represents the change of the distance between two sensor nodes over time; location trust represents the impact of sensor node movement on location stability and is defined as follows;
[0023]
[0024] Among them, maxCom represents the maximum communication radius, Δdist ij Represents the sensor node TN i and sensor nodes TN j The distance between them changes;
[0025] Step 2.2), communication trust; the successful communication rate of the sensor node is used as an indicator of the communication behavior of the sensor node; the successful communication rate of the sensor node SCom is expressed as follows:
[0026]
[0027] Among them, c s Indicates the number of successful communication of sensor nodes, c f Indicates the number of times the sensor node fails to communicate;
[0028] The two-way communication of sensor nodes is used as the measure of interactive trust, and the communication status of each sensor node is stored in an n×n asymmetric matrix;
[0029] Among them, the diagonals of the asymmetric matrix are all 1, indicating that the sensor node trusts itself; the trust of the sensor node in the interaction process is divided into two types, the first is the trust of the current sensor node in other sensor nodes; the second is the trust of other sensor nodes in the current sensor node; based on these two trusts, the sensor node TN is comprehensively defined i The interactive trust is expressed as follows:
[0030]
[0031] Among them, λ and μ represent the weights of two trust levels, λ,μ∈(0,1), and λ+μ=1;
[0032] Step 2.3), energy trust;
[0033] The energy consumption rate of the sensor node is regarded as the energy trust, which is expressed as follows:
[0034]
[0035] Among them, E res represents the residual energy, and E0 represents the initial energy;
[0036] Step 2.4), data trust;
[0037] The value of the data packet is used to determine whether the sensor node is under malicious attack. The data trust definition is as follows:
[0038]
[0039] Among them, x d is the data value of the target node, is the mean value of the data in the data packet; x d and The larger the difference, the smaller the data trust value;
[0040] Step 3: Perform semi-supervised learning based on generative adversarial networks;
[0041] Step 3.1), data preprocessing;
[0042] Malicious nodes are identified using semi-supervised learning based on generative adversarial networks (GANs). The GAN generator and discriminator minimize the discriminator loss through a game, and the discriminator is optimized using both labeled and unlabeled data.
[0043] The game between the GAN generator G and the discriminator D is modeled as a two-party minimum-maximum game problem:
[0044]
[0045] Among them, x is the real data, and the distribution is p d ; z is noise data, distribution is p z ; represents the objective function when training with real data, represents the objective function when training with noise data; D(x) represents the probability that the discriminator judges whether the real data is real, and D(G(z)) is the probability that the discriminator judges whether the noise data generated by the generator is real;
[0046] When the global optimum p d =p G When p G Generate data distribution for the generator, fix the generator, and achieve the optimal effect for the discriminator;
[0047] Step 3.2) Training based on generative adversarial network;
[0048] The training data has K categories, and the output of the discriminator is K+1, where "1" is the class of the discriminant input as a false sample; the softmax classifier adds a neuron to generate the probability that the discriminant input is a false sample, that is, p n =(y=K+1|x), y is the label of x; under the premise that there is real data in the known input K categories, by maximizing logp n (y∈{1,…,K}|x) to achieve the use of unlabeled data; the dataset contains half real data and half pseudo data, and the loss of training the classifier is defined as:
[0049]
[0050] in, is the objective function for real labeled data training, The objective function when training with data generated by the generator, is the objective function when using real no-data training. The total cross entropy loss is the supervised loss function and unsupervised loss p n is the probability of being judged as a false sample; unsupervised classification outputs true or false, so let D(x) = 1-p n (y=K+1|x), substitute get:
[0051]
[0052] The specific training process of the generative adversarial network is as follows:
[0053] Fixed the generator and trained the discriminator using supervised and unsupervised methods; fixed the discriminator and updated the generator using pseudo samples generated by random noise; repeated the above process until the generative adversarial network model converged;
[0054] Step 4: Trust evaluation based on softmax;
[0055] The softmax classifier is used in the generative adversarial network to classify the sample data; the softmax classifier receives the input parameters T i energy They represent the location trust, communication trust, data trust and energy trust of the i-th sensor node respectively; the input parameters have two categories, namely normal node 0 and malicious node 1, also l i ∈{0,1}; then the softmax function estimates the input data The probability of belonging to a certain class is:
[0056]
[0057] Among them, θ0,θ1∈θ are the parameters of the generative adversarial network model, For probabilities in [[0,1] and the sum of probabilities is 1; softmax regression will input data T i The probability of belonging to category c is:
[0058]
[0059] Let max(p) belong to category li , then the final trust evaluation result is expressed as:
[0060] Node class =l i
[0061] When l i = 0, the sensor node is identified as a normal node. i =1, the sensor node is identified as a malicious node.
[0062] The generator of the generative adversarial network receives an input tensor of 128×1×4 through a fully connected layer, converts the tensor from 128×1×4 to 1×4×128 through a transposed convolution layer, and then performs batch normalization. The batch-normalized tensor is activated using a Leaky ReLU function and then transposed again to 1×4×64. After the same batch normalization and activation steps, the tensor is finally transposed and convolved to 1×4×1. The output layer uses a tanh activation function.
[0063] The discriminator network uses three convolutional layers to convert tensors into 1×4×32, 1×4×64 and 1×4×128 respectively; batch normalization and leaky ReLU activation are performed between every two convolutional layers; and Dropout is used for regularization at the end; the output layer of the discriminator model is replaced with a softmax classifier, and multivariate cross entropy loss is used for the supervised task of assigning labels to real samples; sigmoid and binary cross entropy are used for the unsupervised task of classifying real samples and fake samples.
[0064] Beneficial effects of the present invention: The present invention proposes a trust assessment method for mobile wireless sensor networks based on a generative adversarial network, collects the location, communication, data and energy information of sensor nodes as trust evidence, designs a semi-supervised learning model based on a generative adversarial network, trains the model by inputting a small amount of labeled trust evidence and a large amount of unlabeled trust evidence, and improves the classification performance of the discriminator through the game between the generator and the discriminator, thereby achieving accurate identification of malicious nodes and greatly reducing the dependence on labeled data. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 This is a scene diagram of the mobile wireless sensor network according to the present invention;
[0066] Figure 2 This is a flow chart of a trust assessment method for a mobile wireless sensor network based on a generative adversarial network according to an embodiment of the present invention;
[0067] Figure 3 This is a flowchart of a semi-supervised learning model training based on a generative adversarial network in an embodiment of the present invention. DETAILED DESCRIPTION
[0068] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the described embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0069] A trust assessment method for mobile wireless sensor networks based on generative adversarial networks is applied to malicious node detection scenarios when there is only a small amount of labeled data. Figure 1 As shown in Figure 1, a mobile wireless sensor network is deployed within a certain area, with randomly distributed sensor nodes. Sensor nodes collect information about other sensor nodes, including communication, energy, and data. Sensors move dynamically, so it is also necessary to collect location information as part of the trust evidence for sensor nodes.
[0070] The flow chart of the present invention is as follows Figure 2 As shown, an embodiment of the present invention provides a mobile wireless sensor network trust assessment method based on a generative adversarial network, comprising:
[0071] Step 101: cluster the sensor nodes using the improved K-means algorithm, and the cluster head collects the trust parameters and transmits them to the base station.
[0072] In step 102, the trust parameter is normalized so that its value is in [0, 1], and the dimension of the trust matrix is reconstructed to convert it into a four-dimensional matrix to match the input format of the generative adversarial network.
[0073] In step 103, a semi-supervised learning model is constructed using a generative adversarial network (GAN). Labeled data is input into the GAN training generator, and the trained generator generates a batch of pseudo samples that are close to real samples.
[0074] In step 104, the pseudo samples and unlabeled data are fed into the discriminator for training, thereby improving the classification performance of the discriminator in the confrontation between the generator and the discriminator.
[0075] Step 105: Input the test data into the trained discriminator for classification, and feed back the evaluation results to the cluster head.
[0076] In this embodiment of the present invention, trust parameters need to be collected. The trust parameter collection phase primarily focuses on the communication, data, and energy of sensor nodes. Analysis of sensor node behavior during internal attacks reveals that abnormal sensor node behavior primarily manifests as communication failures, data packet errors, and abnormal energy consumption. Furthermore, sensor node movement, resulting in changes in location, can also affect sensor node communication quality. Therefore, in step 101, four factors—location, communication, data, and energy consumption—are collected as trust parameters.
[0077] After receiving the trust parameters, the base station normalizes them and reconstructs the trust matrix into a four-dimensional matrix, which is suitable for the data input format of a generative adversarial network (GAN). A small number of preprocessed labeled samples and a large number of unlabeled samples are fed into the original model for training. The GAN generator generates a batch of pseudo samples that are close to real samples based on the characteristics of the labeled data. These are used together with the real data to train the discriminator, improving its classification performance. Test data is fed into the trained model to obtain the classification result, with "0" representing a normal node and "1" representing a malicious node.
[0078] This paper proposes a trust assessment method for mobile wireless sensor networks based on generative adversarial networks. First, a clustering model and a mobility model are constructed for sensor nodes in a mobile scenario. Taking into account their mobility, the sensor nodes are clustered. Second, the sensor performance after a malicious attack is analyzed, and the communication, energy, data, and location changes of the sensor nodes are collected as trust evidence. The cluster head collects the trust evidence of the target node and transmits it to the base station. The trust evidence is then preprocessed, separating labeled and unlabeled data. A semi-supervised learning method based on generative adversarial networks is used for training, and trust assessment of the nodes is performed using the softmax method. Finally, the assessment results are returned to the cluster head, which then makes a judgment on the target node based on the assessment results.
[0079] The specific steps are as follows:
[0080] Step 1: Establish a scenario model; the scenario model includes a network model, a sensor node clustering model, and a sensor node mobility model;
[0081] Step 1.1) Establish a network model; randomly distribute N dynamically moving sensor nodes within a certain range; sensor nodes communicate with sensor nodes within their own communication range and exchange collected sensor node data; each sensor node has the same initial energy and storage capacity; sensor nodes communicate with base stations through cluster heads, and communication is carried out between base stations and between base stations and satellites;
[0082] Step 1.2) Establish a sensor node clustering model; based on the improved K-means clustering algorithm, divide the sensor nodes in the sensor deployment area into k clusters, with the cluster center being the cluster head CH. The cluster head CH collects trust evidence from cluster members and regularly transmits the trust evidence to the base station;
[0083] The improved K-means clustering algorithm is specifically as follows:
[0084] From the dataset Randomly select a sample point as the first initial cluster center c i ;
[0085] Calculate the shortest distance Dist(x) between each sample and the current initial cluster center, then calculate the probability P(x) of each sample point being selected as the next cluster center, and finally select the sample point corresponding to the maximum probability value as the next cluster center; the calculation method is as follows:
[0086]
[0087] Repeatedly select sample points until k cluster centers are selected;
[0088] Step 1.3), establish the sensor node mobility model;
[0089] Mobile wireless sensor networks are deployed in dynamic environments. The movement of sensor nodes causes their own positions to change dynamically. Considering the impact of the position change of sensor nodes on trust evaluation, a sensor node mobility model is established. The maximum communication radius of the sensor node TN is maxCom. The coordinate system is established with point O as the origin. The angles between the sensor node TN and the Z axis and the X axis are α and β respectively. The sensor node TN i The moving speed at time t is v i (t), the moving direction is (dα i (t),dβ i (t)), α, β∈(0,2π), the position at time t is (x i (t),y i (t),z i (t)), then the sensor node TN i The position at time t+1 is expressed as follows:
[0090]
[0091] Sensor node TN at time t+1 i With sensor node TN j The distance is expressed as:
[0092] dist ij (t+1)=|loci (t+1)-loc j (t+1)|;
[0093] Step 2: Collect trust evidence; trust evidence includes location trust, communication trust, energy trust, and data trust;
[0094] Step 2.1), location trust;
[0095] According to step 1.3), dist ij represents the change of the distance between two sensor nodes over time; location trust represents the impact of sensor node movement on location stability and is defined as follows;
[0096]
[0097] Among them, maxCom represents the maximum communication radius, Δdist ij Represents the sensor node TN i and sensor nodes TN j The distance between
[0098] Step 2.2), communication trust; the successful communication rate of the sensor node is used as an indicator of the communication behavior of the sensor node; the successful communication rate of the sensor node SCom is expressed as follows:
[0099]
[0100] Among them, c s Indicates the number of successful communication of sensor nodes, c f Indicates the number of times the sensor node fails to communicate;
[0101] The two-way communication of sensor nodes is used as the measure of interactive trust, and the communication status of each sensor node is stored in an n×n asymmetric matrix;
[0102] Among them, the diagonals of the asymmetric matrix are all 1, indicating that the sensor node trusts itself; the trust of the sensor node in the interaction process is divided into two types, the first is the trust of the current sensor node in other sensor nodes; the second is the trust of other sensor nodes in the current sensor node; based on these two trusts, the sensor node TN is comprehensively defined i The interactive trust is expressed as follows:
[0103]
[0104] Among them, λ and μ represent the weights of two trust levels, λ,μ∈(0,1), and λ+μ=1;
[0105] Step 2.3, energy trust;
[0106] The energy consumption rate of the sensor node is regarded as the energy trust, which is expressed as follows:
[0107]
[0108] Among them, E res represents the residual energy, and E0 represents the initial energy;
[0109] Step 2.4), data trust;
[0110] The value of the data packet is used to determine whether the sensor node is under malicious attack. The data trust definition is as follows:
[0111]
[0112] Among them, x d is the data value of the target node, is the mean value of the data in the data packet; x d and The larger the difference, the smaller the data trust value;
[0113] Step 3: Perform semi-supervised learning based on generative adversarial networks;
[0114] Step 3.1), data preprocessing;
[0115] Malicious nodes are identified using semi-supervised learning based on generative adversarial networks (GANs). The GAN generator and discriminator minimize the discriminator loss through a game, and the discriminator is optimized using both labeled and unlabeled data.
[0116] The game between the GAN generator G and the discriminator D is modeled as a two-party minimum-maximum game problem:
[0117]
[0118] Among them, x is the real data, and the distribution is p d ; z is noise data, distribution is p z . represents the objective function when training with real data, represents the objective function when training with noisy data. D(x) represents the probability that the discriminator determines whether the real data is real, and D(G(z)) represents the probability that the discriminator determines whether the noisy data generated by the generator is real.
[0119] When the global optimum p d =p G When the generator is fixed, the discriminator achieves the optimal effect; p G The distribution that generates data for the generator.
[0120] The generator of the generative adversarial network used in this paper receives a 128×1×4 tensor as input through a fully connected layer. A transposed convolutional layer converts the tensor from 128×1×4 to 1×4×128, followed by batch normalization. After activation using a Leaky ReLU function, the convolutional layer is transposed again to 1×4×64. After the same batch normalization and activation steps, a final transposed convolution is performed to convert the tensor to 1×4×1. The output layer uses a tanh activation function.
[0121] The discriminator network uses three convolutional layers, transforming tensors to 1×4×32, 1×4×64, and 1×4×128, respectively. Batch normalization and leaky ReLU activation are performed between every two convolutional layers. Dropout regularization is applied to randomly drop neurons to prevent overfitting, with a value of 0.5 in this example. The output layer of the discriminator model is replaced with a softmax classifier, using a multivariate cross-entropy loss for the supervised task of assigning labels to real samples. Sigmoid and binary cross-entropy are used for the unsupervised task of classifying real and fake samples.
[0122] Step 3.2) Training based on generative adversarial network;
[0123] The training data has K categories, and the output of the discriminator is K+1, where "1" is the class of the discriminant input as a false sample; the softmax classifier adds a neuron to generate the probability that the discriminant input is a false sample, that is, p n =(y=K+1|x), y is the label of x; under the premise that there is real data in the known input K categories, by maximizing logp n (y∈{1,…,K}|x) to achieve the use of unlabeled data; the dataset contains half real data and half pseudo data, and the loss of training the classifier is defined as:
[0124]
[0125] in, is the objective function for real labeled data training, The objective function when training with data generated by the generator, is the objective function when using real no-data training. The total cross entropy loss is the supervised loss function and unsupervised loss p n is the probability of being judged as a false sample; unsupervised classification outputs true or false, so let D(x) = 1-p n (y=K+1|x), substitute get:
[0126]
[0127] The specific training process of the generative adversarial network is as follows:
[0128] Fixed the generator and trained the discriminator using supervised and unsupervised methods; fixed the discriminator and updated the generator using pseudo samples generated by random noise; repeated the above process until the generative adversarial network model converged;
[0129] Step 4: Trust evaluation based on the softmax classifier;
[0130] The softmax classifier is used in the generative adversarial network to classify the sample data; the softmax classifier receives the input parameters T i energy They represent the location trust, communication trust, data trust and energy trust of the i-th sensor node respectively. The input parameters have two categories, namely normal node 0 and malicious node 1. i ∈{0,1}; then the softmax function estimates the input data The probability of belonging to a certain class is:
[0131]
[0132] Among them, θ0,θ1∈θ are the parameters of the generative adversarial network model, For probabilities in ([0,1] and the sum of probabilities is 1; softmax regression will input data T i The probability of belonging to category c is:
[0133]
[0134] Let max(p) belong to category l i , then the final trust evaluation result is expressed as:
[0135] Node class =l i
[0136] When l i = 0, the sensor node is identified as a normal node. i =1, the sensor node is identified as a malicious node.
[0137] To summarize: sensor nodes are clustered using the K-means clustering algorithm, and the trust evidence collected by the sensor nodes is transmitted from the cluster head to the base station. The base station uses a semi-supervised learning method based on a generative adversarial network to evaluate the trust evidence and feeds the evaluation results back to the cluster head. The trust evaluation method based on a semi-supervised learning of a generative adversarial network can effectively reduce the detection model's dependence on labeled data, fully tap the information in unlabeled data, and use a small amount of labeled data and a large amount of unlabeled data to train a high-precision detection model, thereby achieving accurate trust evaluation and ensuring the security of mobile wireless sensor networks. The present invention uses a generative adversarial network and a semi-supervised learning method to fully utilize the implicit information in a large amount of unlabeled data, reduce the detection model's dependence on labeled data, and achieve accurate identification of malicious nodes using a small amount of labeled data, thereby ensuring the security of mobile wireless sensor networks.
Claims
1. A trust assessment method for mobile wireless sensor networks based on generative adversarial networks, characterized in that: Here are the steps: Step 1: Establish a scenario model; the scenario model includes a network model, a sensor node clustering model, and a sensor node mobility model; Step 1.1) Establish a network model; randomly deploy N dynamically moving sensor nodes in the deployment area; the sensor nodes communicate with the sensor nodes within their own communication range and exchange collected sensor node data; each sensor node has the same initial energy and storage capacity; after clustering, the sensor nodes communicate with the base station through the cluster head; communication is carried out between base stations and between base stations and satellites; Step 1.2) Establish a sensor node clustering model; based on the improved K-means clustering algorithm, divide the sensor nodes in the deployment area into k clusters, with the cluster center being the cluster head CH. The cluster head CH collects trust evidence from cluster members and regularly transmits the trust evidence to the base station; The improved K-means clustering algorithm is specifically as follows: Randomly select a sample point from the data set x as the first initial cluster center c i ; Calculate the shortest distance Dist(x) between each sample and the current initial cluster center, then calculate the probability P(x) of each sample point being selected as the next cluster center, and finally select the sample point corresponding to the maximum probability value as the next cluster center; the calculation method is as follows: Repeatedly select sample points until k cluster centers are selected; Step 1.3), establish the sensor node mobility model; Mobile wireless sensor networks are deployed in dynamic environments. The movement of sensor nodes causes their own positions to change dynamically. Considering the impact of the position change of sensor nodes on trust evaluation, a sensor node mobility model is established. The maximum communication radius of the sensor node TN is maxCom. The coordinate system is established with point O as the origin. The angles between the sensor node TN and the Z axis and the X axis are α and β respectively. The sensor node TN i The moving speed at time t is v i (t), the moving direction is (dα i (t),dβ i (t)), α, β∈(0,2π), the position at time t is (x i (t),y i (t),z i (t)), then the sensor node TN i The position at time t+1 is expressed as follows: Sensor node TN at time t+1 i With sensor node TN j The distance is expressed as: dist ij (t+1)=|loc i (t+1)-loc j (t+1)|; Step 2: Collect trust evidence; Trust evidence includes location trust, communication trust, energy trust and data trust; Step 2.1), location trust; According to step 1.3), dist ij represents the change of the distance between two sensor nodes over time; location trust represents the impact of sensor node movement on location stability and is defined as follows; Among them, maxCom represents the maximum communication radius, Δdist ij Represents the sensor node TN i and sensor nodes TN j The distance between them changes; Step 2.2), communication trust; the successful communication rate of the sensor node is used as an indicator of the communication behavior of the sensor node; the successful communication rate of the sensor node SCom is expressed as follows: Among them, c s Indicates the number of successful communication of sensor nodes, c f Indicates the number of times the sensor node fails to communicate; The two-way communication of sensor nodes is used as the measure of interactive trust, and the communication status of each sensor node is stored in an n×n asymmetric matrix; Among them, the diagonals of the asymmetric matrix are all 1, indicating that the sensor node trusts itself; the trust of the sensor node in the interaction process is divided into two types, the first is the trust of the current sensor node in other sensor nodes; the second is the trust of other sensor nodes in the current sensor node; based on these two trusts, the sensor node TN is comprehensively defined i The interactive trust is expressed as follows: Among them, λ and μ represent the weights of two trust levels, λ,μ∈(0,1), and λ+μ=1; Step 2.3), energy trust; The energy consumption rate of the sensor node is regarded as the energy trust, which is expressed as follows: Among them, E res represents the residual energy, and E0 represents the initial energy; Step 2.4), data trust; The value of the data packet is used to determine whether the sensor node is under malicious attack. The data trust definition is as follows: Among them, x d is the data value of the target node, is the mean value of the data in the data packet; x d and The larger the difference, the smaller the data trust value; Step 3: Perform semi-supervised learning based on generative adversarial networks; Step 3.1), data preprocessing; Malicious nodes are identified using semi-supervised learning based on generative adversarial networks (GANs). The GAN generator and discriminator minimize the discriminator loss through a game, and the discriminator is optimized using both labeled and unlabeled data. The game between the GAN generator G and the discriminator D is modeled as a two-party minimum-maximum game problem: Among them, x is the real data, and the distribution is p d ; z is noise data, distribution is p z ; represents the objective function when training with real data, represents the objective function when training with noise data; D(x) represents the probability that the discriminator judges whether the real data is real, and D(G(z)) is the probability that the discriminator judges whether the noise data generated by the generator is real; When the global optimum p d =p G When p G Generate data distribution for the generator, fix the generator, and achieve the optimal effect for the discriminator; Step 3.2) Training based on generative adversarial network; The training data has K categories, and the output of the discriminator is K+1, where "1" is the class of the discriminant input as a false sample; the softmax classifier adds a neuron to generate the probability that the discriminant input is a false sample, that is, p n =(y=K+1|x), y is the label of x; under the premise that there is real data in the known input K categories, by maximizing logp n (y∈{1,…,K}|x) to achieve the use of unlabeled data; the dataset contains half real data and half pseudo data, and the loss of training the classifier is defined as: in, is the objective function for real labeled data training, The objective function when training with data generated by the generator, is the objective function when using real no-data training; the total cross entropy loss is the supervised loss function and unsupervised loss p n is the probability of being judged as a false sample; unsupervised classification outputs true or false, so let D(x) = 1-p n (y=K+1|x), substitute get: The specific training process of the generative adversarial network is as follows: Fixed the generator and trained the discriminator using supervised and unsupervised methods; fixed the discriminator and updated the generator using pseudo samples generated by random noise; repeated the above process until the generative adversarial network model converged; Step 4: Trust evaluation based on softmax; The softmax classifier is used in the generative adversarial network to classify the sample data; the softmax classifier receives the input parameters They represent the location trust, communication trust, data trust and energy trust of the i-th sensor node respectively; the input parameters have two categories, namely normal node 0 and malicious node 1, l i ∈{0,1}; then the softmax function estimates the input data The probability of belonging to a certain class is: Among them, θ0, θ1 are the parameters of the generative adversarial network model, θ0∈θ, θ1∈θ, For probabilities in [0,1] and the sum of probabilities is 1; softmax regression will input data T i The probability of belonging to category c is: Let max(p) belong to category l i , then the final trust evaluation result is expressed as: Node class =l i When l i = 0, the sensor node is identified as a normal node. i =1, the sensor node is identified as a malicious node.
2. The mobile wireless sensor network trust assessment method based on generative adversarial network according to claim 1 is characterized in that: The generator of the generative adversarial network receives an input tensor of 128×1×4 through a fully connected layer, converts the tensor from 128×1×4 to 1×4×128 through a transposed convolution layer, and then performs batch normalization. The batch-normalized tensor is activated using a Leaky ReLU function and then transposed again to 1×4×64. After the same batch normalization and activation steps, the tensor is finally transposed and convolved to 1×4×1. The output layer uses a tanh activation function. The discriminator network uses three convolutional layers to convert tensors into 1×4×32, 1×4×64 and 1×4×128 respectively; batch normalization and leaky ReLU activation are performed between every two convolutional layers; and Dropout is used for regularization at the end; the output layer of the discriminator model is replaced with a softmax classifier, and multivariate cross entropy loss is used for the supervised task of assigning labels to real samples; sigmoid and binary cross entropy are used for the unsupervised task of classifying real samples and fake samples.