Wireless sensor network intrusion detection method

By adopting the initial data set division based on density perception and fuzzy clustering algorithm DKFCM in wireless sensor network, combined with the fuzzy support vector machine model FSVM, the DKFCM-FSVM intrusion detection model is constructed, which solves the problem of detecting unknown attacks and complex scenarios. It improves detection accuracy and resource efficiency, and is suitable for resource-constrained scenarios.

CN118921668APending Publication Date: 2024-11-08ZHANGZHOU POWER SUPPLY COMPANY STATE GRID FUJIANELECTRIC POWER +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411302750.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-18
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

The existing wireless sensor network intrusion detection technology is not effective in detecting unknown types of attacks and complex application scenarios, and because the computational complexity is not suitable for resource-constrained scenarios, there is a problem of high false alarm rate.

Method used

DKFCM-FSVM intrusion detection model is constructed by using the initial data set division method based on density perception and the fuzzy clustering algorithm DKFCM based on fuzzy support vector machine model FSVM. The DKFCM-FSVM intrusion detection model is constructed through data density and feature distance, which reduces the influence of noise points and improves the Classification accuracy.

Benefits of technology

It significantly improves the effect and resource efficiency of wireless sensor network intrusion detection, reduces energy consumption, is suitable for resource-constrained scenarios, and improves its resistance to internal attacks in the network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118921668A_ABST
    Figure CN118921668A_ABST
Patent Text Reader

Abstract

The invention provides a wireless sensor network intrusion detection method, which is based on a three-layer WSNs network, sensor nodes of the three-layer WSNs network are deployed in a monitoring area, and a cluster is formed according to a clustering algorithm in the early stage of networking and is responsible for collecting state information of the monitoring area, forming sensing data and sending the sensing data to a cluster head node; the cluster head node is a manager of each cluster and is responsible for aggregating sensing data acquired by the sensor node and sending the sensing data to the transmission node; the transmission node transmits the data to the sink node in a wireless multi-hop mode; the sink node is responsible for further processing the data and presenting the data to the user; the problem that an optimal classification hyperplane is converted into quadratic programming based on inequality constraints is solved through a fuzzy support vector machine model FSVM, and an intrusion detection model DKFCM-FSVM based on machine learning applied to WSNs is proposed on the basis of a fuzzy clustering algorithm DKFCM based on density perception and the fuzzy support vector machine model FSVM. By applying the technical scheme, common attack behaviors of the WSNs can be resisted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of wireless sensors, in particular to an intrusion detection method for a wireless sensor network. Background Art

[0002] In recent years, with the rapid development of related technologies such as sensors, radio frequency identification tags (RFID), and machine-to-machine (M2M), and the increasing demand for application fields such as wearable devices, the Internet of Things (IoT) has become a hot technology in today's academic research and industrial manufacturing fields, and occupies an important position in the future new Internet world. Since the International Telecommunication Union officially proposed the concept of IoT in 2005, the IoT industry has developed rapidly and is currently widely used in many fields such as environmental monitoring and protection, intelligent transportation, mobile medical care, food safety, and logistics supply chain management.

[0003] WSNs play an increasingly important role as an important part of the Internet of Things participating in information perception. WSNs are a distributed wireless network composed of a large number of low-power sensor nodes deployed in the sensing area communicating through wireless communication links. Sensor nodes are micro-computing units with small storage capacity, limited computing power and battery power. Due to the openness of wireless networks and the limitations of sensor nodes themselves, WSNs face a variety of security threats. Introducing key management and identity authentication mechanisms as the first line of defense to protect WSNs can effectively defend against attacks from outside WSNs. However, attackers can obtain secret messages inside nodes by capturing nodes and then launch internal attacks. The first line of defense cannot resist internal attacks on WSNs. Intrusion detection technology, as the second line of defense for security defense, can detect security threats from the root and reduce the losses caused by attacks. Due to the limitations of WSNs, traditional intrusion detection technology cannot be directly applied to WSNs environments. Researching an intrusion detection technology suitable for WSNs has become a research hotspot and has attracted widespread attention from experts and scholars at home and abroad.

[0004] According to the implementation details of intrusion detection, intrusion detection systems can be divided into feature-based intrusion detection technology and anomaly-based feature detection technology. Feature-based intrusion detection technology uses a set of predefined malicious behavior patterns and attack features for intrusion detection, while anomaly-based intrusion detection systems use abnormal behaviors as features to detect intrusion behaviors. WSNs have a variety of application scenarios, and intrusion detection based on predefined attack features is impractical. Anomaly-based intrusion detection systems can detect unknown attacks in the absence of predefined attack features. Anomaly-based intrusion detection systems mainly include: statistics-based intrusion detection technology and machine learning-based intrusion detection technology.

[0005] While existing intrusion detection methods have achieved certain results, there are still certain problems: the detection rate for known attack types is high, but the effect on unknown types of attacks is poor; due to the complexity and variability of application scenarios, intrusion detection schemes in actual applications are affected by harsh environments and have a high false alarm rate; in order to improve the detection rate, some intrusion detection algorithms introduce complex mathematical models, which increases the computational complexity and is not suitable for resource-constrained application scenarios. Summary of the invention

[0006] In view of this, an object of the present invention is to provide a wireless sensor network intrusion detection method for resisting common attacks on WSNs.

[0007] To achieve the above-mentioned purpose, the present invention adopts the following technical scheme: a wireless sensor network intrusion detection method, based on a three-layer WSNs network, the three-layer WSNs network includes multiple node types: sensor nodes are deployed in the monitoring area, and clusters are formed according to the clustering algorithm at the initial stage of networking, which are responsible for collecting the status information of the monitoring area, forming perception data and sending it to the cluster head node; the cluster head node is the manager of each cluster and is responsible for aggregating the perception data collected by the sensor nodes and sending it to the transmission node; the transmission node transmits the data to the aggregation node in the form of wireless multi-hop; the aggregation node is responsible for further processing the data and presenting it to the user; it also includes an initial data set partitioning method based on density perception and a fuzzy clustering algorithm DKFCM based on density perception, and converts the optimal classification hyperplane into a quadratic programming problem based on inequality constraints through the fuzzy support vector machine model FSVM, and proposes an intrusion detection model DKFCM-FSVM based on machine learning for WSNs on the basis of the fuzzy clustering algorithm DKFCM based on density perception and the fuzzy support vector machine model FSVM.

[0008] In a preferred embodiment, the density-aware initial data set division method is specifically as follows:

[0009] Assume that the data set is X = {x1, x2, ..., xN}, and each data point in the data set is represented as Where M represents the number of data sample attributes;

[0010] Definition 1 Sample data x i The local density is denoted as p i , as shown in formula (1);

[0011]

[0012] Select the continuous Gaussian kernel to calculate the local density of sample data to avoid the same local density values ​​of different sample data;

[0013] ||x i -x j || represents x i and x j The Euclidean distance between them, dc is the predefined cutoff distance, which is the first 1% to 2% of the cutoff distance of all samples; the local density p i Indicates the number of data points whose distance between sample data xi is less than dc; i The more data points whose distance is less than dc, the higher the density value p. i The bigger;

[0014] Definition 2: Feature distance represents sample data x i The minimum distance between the sample data with higher local density, as shown in formula (2);

[0015]

[0016] δ i Represents sample data x i The shortest distance to other high-density sample data; sample data with larger local density and larger feature distance are more likely to become cluster centers;

[0017] Definition 3 Direct neighbor q represents the direct neighbor of sample data p is defined as formula (3);

[0018]

[0019] The sample data x with the maximum density s There are no direct neighbors. The characteristic distance of this type of sample data is calculated by formula (4)

[0020]

[0021] Construct a directed acyclic graph (DAG) to divide the data set according to the feature distance; the vertices of the directed acyclic graph (DAG) represent data points, and the directed edges of the directed acyclic graph (DAG) represent the neighbor relationship between data points; if the direct neighbor of data point p is data point q, then the direct neighbor of data point q is not data point p; use the feature distance as the weight of the DAG directed edge; the feature distance describes the data distribution density, and the data sample with a smaller feature distance is in the same class as its direct neighbor, and the feature point with a larger feature distance is not in the same class as its direct neighbor; after several iterations, the data set is divided into several temporary classes;

[0022] Using points with both large local density and feature distance as potential cluster centers can avoid d c Improper selection results in feature distance greater than d cThe problem that high local density data cannot be clustered correctly is solved; taking into account the advantages of both local density and feature distance, the product of the two is selected as the final value to determine the cluster center, denoted as Y, where Y i =p i δ i ;

[0023] Assume that the number of temporary classes generated by DAG-based temporary class partitioning is M, and the temporary class is represented by: tClust k ∩tClust q =, where k and n k They represent the index number of the temporary class and the number of sample data contained in the kth temporary class respectively; the cluster center of the temporary class is expressed as: According to the final number of clusters C of the fuzzy clustering algorithm, the M temporary clusters generated are fused to form the initial density-based division of the data set.

[0024] In a preferred embodiment, the temporary class merging algorithm is specifically described as follows:

[0025] (1) According to formula Y i =p i δ i Calculate the temporary cluster center Y and sort the M temporary cluster centers in descending order according to Y;

[0026] (2) According to Y, the cluster centers of the first C temporary clusters are selected as the initial cluster centers of fuzzy clustering;

[0027] (3) Merge the samples in the remaining temporary classes into the first C temporary classes where their direct neighbors are located, complete the merging of temporary classes, and form the initial division of the data set;

[0028] The initial partition of the data set means that the sample data is formed by the temporary class merging algorithm to form the initial partition of the data set. The initial partition of the data set is defined as FC×N=[f1,1,f2,1,...,fC,1;...;f1,N,f2,N,...,fC,N];

[0029] Where C represents the number of temporary classes, and N represents the total number of data samples; suppose the initial partition of the data set contains C subclasses in total, and the function f satisfies formula (5)

[0030]

[0031] The cluster center is usually located in an area with high data point density. Data points in a high-density area should have a greater weight when the cluster center is updated. The local data density is introduced into the center calculation of fuzzy clustering, and the cluster center calculation formula is updated to (6)

[0032]

[0033] In a preferred embodiment, the density-aware fuzzy clustering algorithm DKFCM is specifically: The objective function of DK FCM is defined as shown in formula (7):

[0034]

[0035] where x j ∈R d (j=1,2,...,n) represents the training sample, Φ(x j ) is the sample x j Mapping in high-dimensional feature space; v i Φ is the cluster center of the i-th category in the high-dimensional feature space; where T represents the absolute degree matrix, t ij represents the absolute degree that the jth sample belongs to the ith class; U represents the fuzzy membership matrix, u ij represents the relative degree that the jth sample belongs to the ith class; V is the matrix of cluster centers in the high-dimensional feature space; m and p represent the typical values ​​of fuzzy membership and probability membership, respectively; R is 1, η i Calculate according to formula (8)

[0036]

[0037] To achieve the optimal objective function of the DKFCM algorithm, the absolute degree matrix T and the relative degree matrix U need to satisfy formulas (9) and (10) respectively.

[0038]

[0039] The membership matrix in formula (10) satisfies:

[0040]

[0041] The local density of data and the initial partitioning of the data set are introduced into the fuzzy clustering algorithm, and the calculation formula for updating the cluster center is (11)

[0042]

[0043] Data sample x j and cluster center v i In the feature space, they are mapped to Φ(x j ) and v i Φ ,Φ(x j ) and v i Φ The distance is calculated according to formula (12) to formula (15)

[0044]

[0045] Description of the DKFCM algorithm: Points far from the cluster center are considered outliers, and outliers are given a smaller absolute degree, such as t ij <ε, ε is a positive number very close to 0; the algorithm is described as follows: 1) Calculate the local density and feature distance of each data sample, and according to the cutoff distance d c 1) Perform temporary clustering based on DAG on the data set; 2) Perform temporary clustering merging algorithm to obtain the initial clustering center tCen of fuzzy clustering and the relationship between sample data and temporary clustering FC×N=[f1,1,f2,1,...,fC,1;...;f1,N,f2,N,...,fC,N]; 3) Introduce the local data density and relationship matrix of data samples into the center calculation of fuzzy clustering and update the clustering center calculation formula; 4) Use tCen as the clustering center V (0) , run the DKFCM algorithm, obtain the fuzzy membership matrix, the absolute degree matrix, and initialize the kernel function; 5) determine the values ​​of c, m, and p, and the maximum number of iterations is r max , stop threshold ε, and continuously update the cluster center, fuzzy membership matrix and absolute degree matrix according to formulas (12) to (15) until convergence.

[0046] In a preferred embodiment, assume that there are l pairs of data points The data points are classified into two categories, where x i ∈R n ,y i ∈{+1,-1} is the class label corresponding to the data point, s i ∈(0,1] is the fuzzy membership, indicating that sample x i Belong to y i tendency;

[0047] The fuzzy support vector machine model FSVM solves the optimal classification hyperplane and transforms it into a quadratic programming problem based on inequality constraints, as shown in formula (16):

[0048]

[0049] Satisfy the constraints:

[0050]

[0051] Among them, w is the classification hyperplane vector, b is the offset, is to convert the sample x i The nonlinear kernel function mapped to the high-dimensional space, ξi is the classification error rate, C is the regularization constant controlling the relationship between the classification margin and the classification error rate; s iAfter clustering by DKFCM algorithm, the fuzzy membership u ij Sure;

[0052] Construct Lagrange multipliers to optimize formula (16):

[0053]

[0054] Use the SMO optimization algorithm to solve formula (17) to obtain the optimal discriminant formula (18)

[0055]

[0056] In a preferred embodiment, the machine learning-based intrusion detection model DKFCM-FSVM applied to WSNs includes a sink node, a detection node, and a common node.

[0057] In a preferred embodiment, the function of the sink node is to train the detector, including three functions: data preprocessing, training the classifier, and distributing the classifier;

[0058] Data preprocessing: Different from ordinary nodes, the dataset WSN-DS designed for intrusion detection in wireless sensor networks is selected as the training set to train the DKFCM-FSVM model;

[0059] Training detector: First, the gateway node preprocesses the training set; calculates the data density and feature distance of the sample data, uses the temporary class merging algorithm to form the initial division of the data set, and mines the potential distribution characteristics of the data points in the training set; uses the DKFCM algorithm to calculate the fuzzy membership matrix U (r) ; According to formula (18), train the fuzzy support vector machine and calculate the parameters α and b; According to formula (18), predict the sample and verify the accuracy of the proposed method; The detection result is output in the form of normal or abnormal;

[0060] Release detectors: The base station sends the verified detectors to each detection node for the detection node to detect intrusion behavior.

[0061] In a preferred embodiment, the detection node runs the detector released by the base station, detects the network behavior according to formula (18), and the results are normal and abnormal; once the detection node finds abnormal behavior, it sends an alarm message to the base station; the detection node sends new samples to the base station and updates the base station sample database, notifying the base station to retrain the detector to ensure the effectiveness of the detector.

[0062] In a preferred embodiment, the common node runs the monitoring agent MA to obtain the perception data obtained by the perception nodes in the perception layer network, and sends it to the detection node for intrusion detection.

[0063] Compared with the prior art, the present invention has the following beneficial effects:

[0064] 1) The present invention proposes an intrusion detection algorithm DKFCM-FSVM based on machine learning for resource-constrained WSNs scenarios: DKFCM introduces data density and feature distance to improve fuzzy clustering, which reduces the influence of noise points and outliers on the clustering algorithm while accelerating the convergence speed of the clustering algorithm; FSVM uses the fuzzy membership obtained by DKFCM as the fuzzy factor, enhances the objectivity of fuzzy factor selection, improves classification accuracy, and significantly improves the effect of intrusion detection in WSNs scenarios.

[0065] 2) Experimental results show that, under the WSN-DS dataset, the DKFCM-FSVM intrusion detection algorithm has the best performance in all evaluation indicators compared with the control algorithm, and its energy consumption is only slightly higher than that of SVM. Therefore, DKFCM-FSVM can be applied to actual WSNs scenarios to enhance the ability of WSNs to resist internal network attacks.

[0066] 3) Traditional machine learning has problems such as low detection accuracy and slow detection speed when processing large-scale data. Deep learning has achieved remarkable success in pattern recognition, image processing, and malicious traffic analysis, providing a new approach to the field of intrusion detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figure 1 A schematic diagram of a hierarchical WSNs network model according to a preferred embodiment of the present invention;

[0068] Figure 2 A schematic diagram of temporary class division based on DAG in a preferred embodiment of the present invention;

[0069] Figure 3 A schematic diagram of an intrusion detection model according to a preferred embodiment of the present invention;

[0070] Figure 4 A schematic diagram showing the comparison of the accuracy of five classification algorithms in a preferred embodiment of the present invention;

[0071] Figure 5 A schematic diagram showing a comparison of false alarm rates of five classification algorithms in a preferred embodiment of the present invention;

[0072] Figure 6 A schematic diagram showing a comparison of the false negative rates of five classification algorithms in a preferred embodiment of the present invention;

[0073] Figure 7 Schematic diagram of overall detection accuracy comparison of five classification algorithms in the preferred embodiment of the present invention. DETAILED DESCRIPTION

[0074] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0075] It should be noted that the following detailed descriptions are illustrative and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used in the present invention have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.

[0076] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application; as used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or their combinations.

[0077] The intrusion detection method proposed in the present invention is based on a three-layer WSNs network. The network contains four types of nodes: sensor nodes are deployed in the monitoring area, and clusters are formed according to the clustering algorithm at the beginning of the network. They are responsible for collecting the status information of the monitoring area, forming perception data and sending it to the cluster head node; the cluster head node is the manager of each cluster and is responsible for aggregating the perception data collected by the sensor nodes and sending it to the transmission node; the transmission node transmits the data to the aggregation node in the form of wireless multi-hop; the aggregation node is responsible for further processing the data and presenting it to the user. The network structure is as follows Figure 1 shown.

[0078] The intrusion detection method proposed in the present invention is mainly aimed at active attack behaviors such as black hole attack, gray hole attack, flooding attack and scheduling attack, as shown below.

[0079] Black hole attack: At the beginning of each working cycle, the attacking node broadcasts the message that it is the cluster head node to other nodes. As a result, some nodes will mistakenly join the pseudo cluster head node and send data packets to the pseudo cluster head node. The real cluster head node will forward the data packets to the base station, and the pseudo cluster head node that initiates the black hole attack will continuously discard data packets and will not forward them to the base station.

[0080] Gray hole attack: Similar to black hole attack, the attacking node broadcasts the message that it is the cluster head node to other nodes at the beginning of each working cycle. Some nodes will mistakenly join the pseudo cluster head node and send data packets to the pseudo cluster head node. Different from black hole attack, the pseudo cluster head node that initiates gray hole attack randomly discards data packets or discards specific types of data packets and prevents data packets from being forwarded to the base station.

[0081] Flooding attack: Flooding attack mainly sends a large number of cluster head broadcast messages to occupy a large amount of network bandwidth resources. The perception nodes receive a large number of cluster head broadcast messages, which not only consumes the energy supply of the perception layer nodes, but also causes the perception nodes to spend a lot of time deciding to join a specific cluster head node. In addition, the attacking node will try to deceive the perception node and disguise itself as a pseudo cluster head, so that the distant perception node joins itself, resulting in serious energy consumption.

[0082] Scheduling attack: Scheduling attack occurs during the initialization phase of the LEACH protocol. The cluster head node implements the time-division multiplexing scheduling strategy to determine the data transmission timestamp for the sensing nodes. The attacker pretends to be the cluster head node and gives all sensing nodes the same data transmission timestamp. The attacker modifies the broadcast scheduling behavior into a unicast scheduling behavior, which eventually leads to data conflicts and data loss.

[0083] 1. Density-aware initial data set partitioning algorithm

[0084] Assume that the data set is X = {x1, x2, ..., xN}, and each data point in the data set is represented as Where M represents the number of data sample attributes. The data point cluster center is usually surrounded by neighboring sample points with low local density, and the data points with high local density maintain a large distance between them.

[0085] Definition 1 Sample data x i The local density is denoted as p i , as shown in formula (1).

[0086]

[0087] The present invention selects a continuous Gaussian kernel to calculate the local density of sample data to avoid having the same local density values ​​for different sample data.

[0088] ||x i -x j || represents x i and x j The Euclidean distance between them, dc is a predefined cutoff distance, usually the first 1% to 2% of all sample cutoff distances. The local density p i Indicates the number of data points whose distance between sample data xi is less than dc. i The more data points whose distance is less than dc, the higher the density value p. i The bigger.

[0089] Definition 2: Feature distance represents sample data x i The minimum distance between the sample data with higher local density is shown in formula (2).

[0090]

[0091] δ i Represents sample data x i The shortest distance to other high-density sample data. Sample data with larger local density and larger feature distance are more likely to become cluster centers.

[0092] Definition 3: Direct neighbor q represents the direct neighbor of sample data p and is defined as formula (3).

[0093]

[0094] The sample data x with the maximum density s There are no direct neighbors. The characteristic distance of this type of sample data is calculated using formula (4).

[0095]

[0096] Construct a directed acyclic graph (DAG) to divide the data set according to the feature distance. The vertices of DAG represent data points, and the directed edges of DAG represent the neighbor relationship between data points. It should be noted that the direct neighbor relationship is irreversible. If the direct neighbor of data point p is data point q, then the direct neighbor of data point q is not data point p. Use feature distance as the weight of the directed edge of DAG. Feature distance can effectively describe the data distribution density. Data samples with smaller feature distance are in the same class as their direct neighbors, and feature points with larger feature distance are not in the same class as their direct neighbors. Therefore, after several iterations, the data set is divided into several temporary classes, such as Figure 2 shown.

[0097] Using points with both large local density and feature distance as potential cluster centers can avoid d c Improper selection results in feature distance greater than d c The problem that high local density data cannot be clustered correctly. Taking into account the advantages of both local density and feature distance, the product of the two is selected as the final value to determine the cluster center, denoted as Y, where Y i =p i δ i .

[0098] Assume that the number of temporary classes generated by DAG-based temporary class division is M, and the temporary class is expressed as: where k and n k They represent the index number of the temporary class and the number of sample data contained in the kth temporary class. The cluster center of the temporary class is expressed as: According to the final number of clusters C of the fuzzy clustering algorithm, the M temporary clusters generated are merged to form the initial density-based division of the data set. The specific description of the temporary cluster merging algorithm is as follows:

[0099] 1) According to formula Y i =p i δ i Calculate the temporary cluster center Y and sort the M temporary cluster centers in descending order according to Y;

[0100] 2) According to Y, select the cluster centers of the first C temporary clusters as the initial cluster centers of fuzzy clustering;

[0101] 3) Merge the samples in the remaining temporary classes into the first C temporary classes where their direct neighbors are located, complete the merging of temporary classes, and form the initial division of the data set.

[0102] The initial partitioning of the data set means that the sample data is partitioned into the initial data set after a temporary class merging algorithm. The initial partitioning of the data set is defined as FC×N=[f1,1,f2,1,...,fC,1;...;f1,N,f2,N,...,fC,N].

[0103] Where C represents the number of temporary classes, and N represents the total number of data samples. Assume that the initial partition of the data set contains C subclasses in total, and the function f satisfies formula (5).

[0104]

[0105] The cluster center is usually located in an area with high data point density. Data points in a high-density area should have a greater weight when the cluster center is updated. The local data density is introduced into the center calculation of fuzzy clustering, and the cluster center calculation formula is updated to (6).

[0106]

[0107] Applying local density to update cluster centers and using only data points related to cluster centers to calculate cluster center updates can ensure that cluster centers are always near high-density areas rather than moving randomly. Since cluster centers are always in high-density areas, the objective function converges after fewer iterations, improving the efficiency of the algorithm.

[0108] 2. Density-aware fuzzy clustering algorithm

[0109] Based on the initial data set partitioning algorithm, the present invention proposes a density-awared kernel based fuzzy c-means clustering algorithm DKFCM (DKFC M). The input samples are mapped to a high-dimensional feature space through a kernel function to solve the problem of linear inseparability in low-dimensional space. The objective function of DKFCM is defined as shown in formula (7).

[0110]

[0111] where x j ∈R d (j=1,2,...,n) represents the training sample, Φ(x j ) is the sample x j Mapping in high-dimensional feature space. i Φ is the cluster center of the i-th class in the high-dimensional feature space. Where T represents the absolute degree matrix, t ij represents the absolute degree that the jth sample belongs to the ith class; U represents the fuzzy membership matrix, u ij represents the relative degree that the jth sample belongs to the ith class. V is the matrix of cluster centers in the high-dimensional feature space. m and p represent the typical values ​​of fuzzy membership and probability membership, respectively. R is generally taken as 1, η i Calculate according to formula (8).

[0112]

[0113] To achieve the optimal objective function of the DKFCM algorithm, the absolute degree matrix T and the relative degree matrix U need to satisfy formulas (9) and (10) respectively.

[0114]

[0115] The membership matrix in formula (10) satisfies:

[0116]

[0117] The local density of data and the initial partitioning of the data set are introduced into the fuzzy clustering algorithm, and the calculation formula for updating the cluster center is (11).

[0118]

[0119] Data sample x j and cluster center v i In the feature space, they are mapped to Φ(x j ) and v i Φ ,Φ(xj ) and v i Φ The distance is calculated according to formula (12) to formula (15).

[0120]

[0121] Description of the DKFCM algorithm: Points far from the cluster center are considered outliers, and outliers are given a smaller absolute degree, such as t ij <ε, ε is a positive number very close to 0. The algorithm is described as follows:

[0122] 1) Calculate the local density and feature distance of each data sample, according to the cutoff distance d c Perform temporary classification of the data set based on DAG;

[0123] 2) Execute the temporary cluster merging algorithm to obtain the initial cluster center tCen of the fuzzy clustering and the relationship between the sample data and the temporary clustering FC×N=[f1,1,f2,1,...,fC,1;...;f1,N,f2,N,...,fC,N];

[0124] 3) Introduce the local data density and relationship matrix of the data sample into the center calculation of fuzzy clustering, and update the cluster center calculation formula;

[0125] 4) Take tCen as the cluster center V (0) The initial value of , run the KFCM algorithm, obtain the fuzzy membership matrix, the absolute degree matrix, and initialize the kernel function;

[0126] 5) Determine the values ​​of c, m, and p, and the maximum number of iterations is r max , stop threshold ε, and continuously update the cluster center, fuzzy membership matrix and absolute degree matrix according to formulas (12) to (15) until convergence.

[0127] 3. Fuzzy Support Vector Machine

[0128] In practical applications, the sample data in the training set contributes differently to the training of the model, and some sample data are more important than others. Meaningful sample data is expected to be correctly classified, while meaningless sample data such as noise has little effect on whether it is correctly classified. This means that some sample data may belong to not only one class but also multiple classes: 90% of the sample data may belong to a certain class, 10% may be meaningless, or 20% may belong to one class and 80% may be meaningless. In other words, each sample data has a fuzzy membership of 0 i ≤1.s i It can represent the tendency of a training point to belong to a class, 1-s i ​Indicates a tendency for training points to have no real meaning.

[0129] Assume there are l pairs of data points The data points are classified into two categories, where x i ∈R n ,y i ∈{+1,-1} is the class label corresponding to the data point, s i ∈(0,1] is the fuzzy membership, indicating that sample x i Belong to y i tendency.

[0130] The fuzzy support vector machine (FSVM) model converts the optimal classification hyperplane into a quadratic programming problem based on inequality constraints, as shown in formula (16).

[0131]

[0132] Satisfy the constraints:

[0133]

[0134] Among them, w is the classification hyperplane vector, b is the offset, is to convert the sample x i The nonlinear kernel function mapped to the high-dimensional space, ξi is the classification error rate, and C is the regularization constant that controls the relationship between the classification margin and the classification error rate. i After clustering by DKFCM algorithm, the fuzzy membership u ij It is determined that the impact of classification error rate on the objective function can be reduced, and the influence of noise and isolated points can be reduced.

[0135] Construct Lagrange multipliers to optimize formula (16):

[0136]

[0137] The SMO optimization algorithm is used to solve formula (17) to obtain the optimal discriminant formula (18).

[0138]

[0139] 4. Fuzzy Support Vector Machine

[0140] Based on DKFCM and FSVM, the present invention proposes a machine learning-based intrusion detection model DKFCM-FSVM for WSNs. Figure 3 The entities included in the model include aggregation nodes, detection nodes and common nodes, and the specific division of labor is shown below.

[0141] 1) Aggregation Node

[0142] The main function of the sink node is to train the detector, which mainly includes three functions: data preprocessing, training classifiers, and distributing classifiers.

[0143] Data preprocessing: Unlike ordinary nodes, gateway nodes have sufficient energy supply and powerful computing power, and can process large-scale sample databases. The base station selects WSN-DS (a data set designed for wireless sensor network intrusion detection) as the training set to train the DKFCM-FSVM model. The two important processes of data preprocessing are normalization and feature dimensionality reduction.

[0144] Training detectors: Detector training is a key part of the intrusion detection model. First, the gateway node preprocesses the training set; calculates the data density and feature distance of the sample data, uses the temporary class merging algorithm to form the initial division of the data set, and mines the potential distribution characteristics of the data points in the training set; uses the DKFCM algorithm to calculate the fuzzy membership matrix U (r) ; According to formula (18), train the fuzzy support vector machine and calculate the parameters α and b. According to formula (18), predict the sample and verify the accuracy of the proposed method. The detection result is output in the form of normal or abnormal.

[0145] Release detectors: The base station sends the verified detectors to each detection node for the detection node to detect intrusion behavior.

[0146] 2) Detection Node

[0147] A certain number of detection nodes are assigned to the network to detect test samples extracted from ordinary nodes in order to detect intrusion behavior. Compared with ordinary nodes, detection nodes have larger storage space and powerful computing power, and can store detection models and run intrusion detection algorithms. The main function of detection nodes is to detect intrusion behavior in real time:

[0148] The detection node runs the detector released by the base station, mainly based on formula (18) to detect the network behavior, and the results are normal and abnormal; once the detection node finds abnormal behavior, it sends an alarm message to the base station; the detection node sends new samples to the base station and updates the base station sample database, notifying the base station to retrain the detector to ensure the effectiveness of the detector.

[0149] 3) Ordinary nodes

[0150] Ordinary nodes run monitoring agents (MA) to obtain the perception data obtained by the perception nodes in the perception layer network, and send them to the detection nodes for intrusion detection.

[0151] In the intrusion detection experiment, the coverage of the perception layer network is 100m*100m, with 100 perception nodes: a laptop is used as a gateway node, 10 detection nodes, and 90 ordinary nodes. The simulation parameters are shown in Table 1. The duration of each simulation is set to 200s, and the experimental results are the average of 20 simulation results.

[0152] Table 1 Parameters and values ​​of the simulation model

[0153]

[0154]

[0155] The present invention uses NS-2 to conduct simulation experiments to verify the effectiveness of the intrusion detection algorithm proposed in the present invention. In order to verify the effect of the proposed method on intrusion detection in the perception layer network environment, this subsection uses the dataset WSN-DS. The WSN-DS dataset is specially designed for WSNs intrusion detection. Data is collected and formed in the perception layer network environment using the Low Energy Aware Cluster Hierarchy (LEACH) routing protocol. The WSN-DS dataset contains 374,661 records, and each sample in the dataset contains 23 attributes. 60% and 40% of the WSN-DS dataset are used as training sets and test sets, respectively, and each type of attack is shown in Table 2.

[0156] Table 2 The dataset is randomly allocated to the training set (60%) and the test set (40%).

[0157]

[0158]

[0159] The detection results of the intrusion detection system include the following four types: true positive (TP) indicates the proportion of abnormal behaviors correctly identified as abnormal behaviors; false positive (FP) indicates the proportion of normal behaviors incorrectly identified as abnormal behaviors; true negative (TN) indicates the proportion of normal behaviors correctly identified as normal behaviors; false negative (FN) indicates the proportion of abnormal behaviors incorrectly identified as normal behaviors. Based on the above four detection results, the accuracy rate, false alarm rate, false negative rate and area under the receiver operating characteristic curve are further evolved as the evaluation indicators adopted by the intrusion detection technology of the present invention.

[0160] 1) Accuracy refers to the ratio of correctly identified abnormal behaviors to normal behaviors. The calculation formula is shown in formula (19).

[0161]

[0162] 2) The false positive rate (FPR) indicates the proportion of normal behaviors identified as abnormal behaviors. The calculation formula is shown in formula (20).

[0163]

[0164] 3) The false negative rate (FNR) indicates the proportion of abnormal behaviors identified as normal behaviors. The calculation formula is shown in formula (21).

[0165]

[0166] Experimental results analysis

[0167] In order to verify the effectiveness of the proposed method, the present invention selects SVM, FCM-SVM, FCM-FSVM and KFCM-FSVM algorithms as comparison algorithms for comparison. The kernel function of the algorithm adopts Gaussian kernel function, the parameter m of FCM-FSVM, KFCM-FSVM and DKFCM-FSVM takes the typical value of 2, ε takes the typical value of 0.01, uses a random matrix as the initial matrix, sets the fuzzy membership, wherein the parameter σ of the kernel function takes the value of 0.01, and the regularization constant C takes the value of 2. The algorithm proposed by the present invention and the control group algorithm are trained on the training set, and the algorithm verification is completed on the test set after the training is completed. The 10-fold cross validation method is adopted, and the average value of the experimental results is taken for comparison.

[0168] Figure 4 The comparison results of the accuracy between DKFCM-FSVM and the control algorithm are shown. Compared with the control algorithm, the average accuracy of the DKFCM-FSVM algorithm proposed in the present invention in detecting five behaviors is 0.998, 0.993, 0.905, 0.997 and 0.947 respectively, and the accuracy in detecting different behaviors is optimal. The SVM algorithm takes a short time and has the worst detection rate, followed by the FCM-SVM algorithm, which is better than the SVM algorithm. The detection rates of FCM-FSVM and KFCM-FSVM are similar, and DKFCM-FSVM is slightly better than KFCM-FSVM.

[0169] Figure 5The comparison results of the false alarm rate between DKFCM-FSVM and the control algorithm are shown. Compared with the control algorithm, the average false alarm rates of the DKFCM-FSVM algorithm proposed in the present invention for detecting five behaviors are 0.004, 0.004, 0.01, 0.002 and 0.006 respectively, achieving the lowest false alarm rate in the detection of different behaviors. The SVM algorithm has the highest false alarm rate, followed by the FCM-SVM algorithm, which is better than the SVM algorithm. The false alarm rates of FCM-FSVM and KFCM-FSVM are similar, and DKFCM-FSVM is better than KFCM-FSVM.

[0170] Figure 6 The comparison results of the false negative rate between DKFCM-FSVM and the control algorithm are shown. Compared with the control algorithm, the average false negative rates of the DKFCM-FSVM algorithm proposed in the present invention for detecting five behaviors are 0.004, 0.003, 0.002, 0.007 and 0.006 respectively, achieving the lowest false negative rate in the detection of different behaviors. The false negative rate of the SVM algorithm is higher, followed by the FCM-SVM algorithm, which is better than the SVM algorithm. The false negative rates of FCM-FSVM and KFCM-FSVM are similar, and DKFCM-FSVM is better than KFCM-FSVM.

[0171] Figure 7 The comparison results of the overall detection accuracy between DKFCM-FSVM and the control algorithm are shown, and the overall detection accuracy of each algorithm is 0.8208, 0.8596, 0.9236, 0.9332 and 0.968 respectively. Therefore, the DKFCM-FSVM proposed in the present invention is better than the control algorithm.

[0172] Analysis of experimental results: In the WSNs environment, the ratio of normal data to intrusion data is unbalanced. Most behaviors are normal behaviors, and the abnormal data generated by intrusion attacks accounts for a very small number. In addition, normal behaviors and intrusion behaviors are linearly inseparable in most cases, and need to be mapped to high-dimensional space using kernel functions. The detection effect of SVM is not good. FCM is sensitive to the selection of initial clustering and unbalanced data sets, and the effect is also poor. Even if the kernel function is used to map the samples to high-dimensional space, the impact of noise data and outliers on clustering cannot be ignored. The introduction of data density and feature distance can effectively avoid the impact of noise data and outliers on classification results and achieve the optimal classification results. The low false alarm rate and false negative rate also show that the algorithm proposed in the present invention is more suitable for unbalanced data sets and can effectively deal with outliers and noise data.

Claims

1. A wireless sensor network intrusion detection method, It is characterized in that Based on the three-layer WSNs network, the three-layer WSNs network contains multiple node types: sensor nodes are deployed in the monitoring area, and clusters are formed according to the clustering algorithm at the initial stage of networking. They are responsible for collecting the status information of the monitoring area, forming perception data and sending it to the cluster head node; the cluster head node is the manager of each cluster and is responsible for aggregating the perception data collected by the sensor nodes and sending it to the transmission node; the transmission node transmits the data to the aggregation node in the form of wireless multi-hop; the aggregation node is responsible for further processing the data and presenting it to the user; it also includes the initial data set partitioning method based on density perception and the fuzzy clustering algorithm DKFCM based on density perception, and the fuzzy support vector machine model FSVM is used to solve the optimal classification hyperplane and convert it into a quadratic programming problem based on inequality constraints. On the basis of the fuzzy clustering algorithm DKFCM based on density perception and the fuzzy support vector machine model FSVM, a machine learning-based intrusion detection model DKFCM-FSVM applied to WSNs is proposed.

2. A wireless sensor network intrusion detection method according to claim 1, It is characterized in that The initial data set division method based on density perception is as follows: Assume that the data set is X = {x1, x2, ..., xN}, and each data point in the data set is represented by xi = Where M represents the number of data sample attributes; Definition 1: Sample data x i The local density is denoted as p i , as shown in formula (1); Select the continuous Gaussian kernel to calculate the local density of sample data to avoid the same local density values ​​of different sample data; ||xi-xj|| represents x i and x j The Euclidean distance between the sample data xi and the sample data x is the Euclidean distance between the sample data xi and the sample data x. i The more data points whose distance is less than dc, the higher the density value p. i The bigger; Definition 2: Feature distance represents sample data x i The minimum distance between the sample data with higher local density, as shown in formula (2); δ i Represents sample data x i The shortest distance to other high-density sample data; sample data with larger local density and larger feature distance are more likely to become cluster centers; Definition 3 Direct neighbor q represents the direct neighbor of sample data p is defined as formula (3); The sample data x with the maximum density s There are no direct neighbors. The characteristic distance of this type of sample data is calculated by formula (4) Construct a directed acyclic graph (DAG) to divide the data set according to the feature distance; the vertices of the directed acyclic graph (DAG) represent data points, and the directed edges of the directed acyclic graph (DAG) represent the neighbor relationship between data points; if the direct neighbor of data point p is data point q, then the direct neighbor of data point q is not data point p; use the feature distance as the weight of the DAG directed edge; the feature distance describes the data distribution density, and the data sample with a smaller feature distance is in the same class as its direct neighbor, and the feature point with a larger feature distance is not in the same class as its direct neighbor; after several iterations, the data set is divided into several temporary classes; Using points with both large local density and feature distance as potential cluster centers can avoid d c Improper selection results in feature distance greater than d c The problem that high local density data cannot be clustered correctly is solved; taking into account the advantages of both local density and feature distance, the product of the two is selected as the final value to determine the cluster center, denoted as Y, where Y i =p i δ i ; Assume that the number of temporary classes generated by DAG-based temporary class partitioning is M, and the temporary class is expressed as: tClustk∩tClustq=, where k and n k They represent the index number of the temporary class and the number of sample data contained in the kth temporary class respectively; the cluster center of the temporary class is expressed as: According to the final number of clusters C of the fuzzy clustering algorithm, the M temporary clusters generated are fused to form the initial density-based division of the data set.

3. A wireless sensor network intrusion detection method according to claim 2, It is characterized in that The specific description of the temporary class merging algorithm is as follows: (1) Calculate the temporary cluster center Y according to the formula Yi=piδi, and arrange the M temporary cluster centers in descending order according to Y; (2) According to Y, the cluster centers of the first C temporary clusters are selected as the initial cluster centers of fuzzy clustering; (3) Merge the samples in the remaining temporary classes into the first C temporary classes where their direct neighbors are located, complete the merging of temporary classes, and form the initial division of the data set; The initial partition of the data set means that the sample data is formed by the temporary class merging algorithm to form the initial partition of the data set. The initial partition of the data set is defined as FC×N=[f1,1,f2,1,...,fC,1;...;f1,N,f2,N,...,fC,N]; Where C represents the number of temporary classes, and N represents the total number of data samples; suppose the initial partition of the data set contains C subclasses in total, and the function f satisfies formula (5) The cluster center is usually located in an area with high data point density. Data points in a high-density area should have a greater weight when the cluster center is updated. The local data density is introduced into the center calculation of fuzzy clustering, and the cluster center calculation formula is updated to (6) 4. A wireless sensor network intrusion detection method according to claim 1, It is characterized in that The density-aware fuzzy clustering algorithm DKFCM is specifically defined as follows: where xj∈Rd(j=1,2,...,n) represents the training sample, Φ(xj) is the sample x j Mapping in high-dimensional feature space; v i Φ is the cluster center of the i-th category in the high-dimensional feature space; where T represents the absolute degree matrix, t ij represents the absolute degree that the jth sample belongs to the ith class; U represents the fuzzy membership matrix, u ij represents the relative degree that the jth sample belongs to the ith class; V is the matrix of cluster centers in the high-dimensional feature space; m and p represent the typical values ​​of fuzzy membership and probability membership, respectively; R takes the value of 1, and ηi is calculated according to formula (8) To achieve the optimal objective function of the DKFCM algorithm, the absolute degree matrix T and the relative degree matrix U need to satisfy formulas (9) and (10) respectively. The membership matrix in formula (10) satisfies: The local density of data and the initial partitioning of the data set are introduced into the fuzzy clustering algorithm, and the calculation formula for updating the cluster center is (11) Data sample x j and cluster center v i In the feature space, they are mapped to Φ(xj) and viΦ respectively. The distance between Φ(xj) and viΦ is calculated according to formula (12) to formula (15): The description of the DKFCM algorithm is that points far away from the cluster center are regarded as outliers, and a smaller absolute degree is given to the outliers, for example, tij<ε, where ε is a positive number very close to 0; the algorithm is described as follows: 1) Calculate the local density and feature distance of each data sample, and according to the cutoff distance d c 1) Perform temporary clustering based on DAG on the data set; 2) Perform temporary clustering merging algorithm to obtain the initial clustering center tCen of fuzzy clustering and the relationship between sample data and temporary clustering FC×N=[f1,1,f2,1,...,fC,1;...;f1,N,f2,N,...,fC,N]; 3) Introduce the local data density and relationship matrix of data samples into the center calculation of fuzzy clustering and update the clustering center calculation formula; 4) Use tCen as the clustering center V (0) , run the DKFCM algorithm, obtain the fuzzy membership matrix, the absolute degree matrix, and initialize the kernel function; 5) determine the values ​​of c, m, and p, and the maximum number of iterations is r max , stop threshold ε, and continuously update the cluster center, fuzzy membership matrix and absolute degree matrix according to formulas (12) to (15) until convergence.

5. A wireless sensor network intrusion detection method according to claim 1, It is characterized in that Assume there are l pairs of data points The data points are classified into two categories, where xi∈Rn, yi∈{+1,-1} is the class label corresponding to the data point, si∈(0,1] is the fuzzy membership, indicating that the sample x i Belong to y i tendency; The fuzzy support vector machine model FSVM solves the optimal classification hyperplane and transforms it into a quadratic programming problem based on inequality constraints, as shown in formula (16): Satisfy the constraints: Among them, w is the classification hyperplane vector, b is the offset, is to convert the sample x i The nonlinear kernel function mapped to the high-dimensional space, ξi is the classification error rate, C is the regularization constant controlling the relationship between the classification margin and the classification error rate; s i After clustering by DKFCM algorithm, the fuzzy membership u ij Sure; Construct Lagrange multipliers to optimize formula (16): Use the SMO optimization algorithm to solve formula (17) to obtain the optimal discriminant formula (18) 6. A wireless sensor network intrusion detection method according to claim 1, It is characterized in that The machine learning-based intrusion detection model DKFCM-FSVM applied to WSNs includes sink nodes, detection nodes and common nodes.

7. A wireless sensor network intrusion detection method according to claim 6, It is characterized in that The function of the sink node is to train the detector, which includes three functions: data preprocessing, training classifiers, and distributing classifiers; Data preprocessing: Different from ordinary nodes, the dataset WSN-DS designed for intrusion detection in wireless sensor networks is selected as the training set to train the DKFCM-FSVM model; Training detector: First, the gateway node preprocesses the training set; calculates the data density and feature distance of the sample data, uses the temporary class merging algorithm to form the initial division of the data set, and mines the potential distribution characteristics of the data points in the training set; uses the DKFCM algorithm to calculate the fuzzy membership matrix U (r) ; According to formula (18), train the fuzzy support vector machine and calculate the parameters α and b; According to formula (18), predict the sample and verify the accuracy of the proposed method; The test results are output as normal or abnormal; Release detectors: The base station sends the verified detectors to each detection node for the detection node to detect intrusion behavior.

8. A wireless sensor network intrusion detection method according to claim 6, It is characterized in that The detection node runs the detector released by the base station and detects the network behavior according to formula (18), and the results are normal or abnormal; Once the detection node finds abnormal behavior, it sends an alarm message to the base station; The detection node sends new samples to the base station and updates the base station sample database, notifying the base station to retrain the detector to ensure the effectiveness of the detector.

9. A wireless sensor network intrusion detection method according to claim 6, It is characterized in that Ordinary nodes run monitoring agents MA to obtain the perception data obtained by the perception nodes in the perception layer network, and send them to the detection nodes for intrusion detection.