A human intrusion detection method in a region based on DTW distance KNN in a slight motion disturbance scenario
By using a combination of DTW distance and KNN detection algorithm in the wireless sense intrusion detection system, the amplitude difference characteristics of the wireless signal channel state are extracted, and the false alarm and missed alarm problems of intrusion detection in a slight disturbance environment are solved, and the system is improved Accuracy and usability.
Patent Information
- Application Number
- CN202211046082.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-30
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2042-08-30
AI Technical Summary
The existing wireless sensing intrusion detection system is difficult to accurately distinguish between the intrusion of personnel and the slight movements of the on-duty person in a slight disturbance environment, resulting in a high false alarm rate and a high false alarm rate, affecting the accuracy of the system.
Using the KNN detection algorithm based on DTW distance, the training data set and verification data set are constructed by extracting the amplitude difference characteristics of the wireless signal channel state information, and the dynamic time regular distance is combined with the K nearest neighbor algorithm to perform multiple cross-validation to find the best Excellent K value and improve classification accuracy.
It significantly improves the classification accuracy of wireless sense intrusion detection systems, reduces false alarm rates and missed alarm rates, enhances system availability, and reduces deployment costs.
Smart Images

Figure CN115361077B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of wireless sensing detection technology, and in particular to a method for detecting human intrusion in an area based on DTW distance KNN in a slight motion disturbance scenario. Background Art
[0002] With the rapid development of wireless network technology, passive sensing technology based on wireless LAN has received widespread attention. The rise of WIFI technology and the large-scale deployment of routers have provided new ideas for passive sensing technology, which has a good user experience and high universality, and can achieve more extensive, more economical and more efficient non-contact human perception. At the same time, it will not be unable to obtain accurate perception results due to blind spots and overlapping objects, and there is no problem of privacy infringement.
[0003] Existing WIFI-based intrusion detection systems usually focus on identifying the presence of people, that is, indoor intrusion detection in an environment without active interference, such as APID WIFI-based adaptive indoor passive intrusion detection proposed by Professor Tian Zengshan of Chongqing University of Posts and Telecommunications, and a fine-grained indoor passive intrusion detection method based on WLAN from Harbin Engineering University. The above methods ignore other important factors such as whether there is a disturbance by a person on duty indoors. For indoor environments with people on duty, such as wards, warehouses, rooms for elderly people living alone, nursing homes, etc., intrusion detection systems should still be used as an important auxiliary means of security protection.
[0004] Since slight disturbances of the human body can cause significant fluctuations in the received CSI data, existing CSI intrusion detection methods face significant performance issues due to disturbances of the on-duty personnel in the detection area. The CSI waveforms of the on-duty personnel's activities and human intrusion are similar and partially overlapped, causing the intrusion detection system to "judge" the slight disturbances of the on-duty personnel as intrusions, resulting in false alarms.
[0005] The existing intrusion detection method extracts CSI variance as a feature value and uses the traditional KNN algorithm for data classification. When there is a slight disturbance by the on-duty personnel indoors, the false alarm rate of this intrusion detection method is as high as 40%, and the missed alarm rate is close to 15%. Therefore, slight disturbances by indoor on-duty personnel and slight activities of pets raised at home will affect the accuracy of the intrusion detection system and cause a high false alarm rate.
[0006] It can be seen that how to solve the problem of low classification accuracy caused by CSI waveform similarity fluctuations under the condition of active interference in the detection area while developing intrusion detection technology based on passive sensing is of great significance to improving the accuracy of passive sensing intrusion detection systems, reducing the false alarm rate and missed alarm rate of the system, and enhancing the availability of passive sensing intrusion detection systems. Summary of the invention
[0007] The purpose of the present invention is to solve the defect that it is difficult to detect human intrusion in the prior art under slight disturbance environment, and to provide a method for detecting human intrusion in the area based on DTW distance KNN under slight motion disturbance scenario to solve the above problem.
[0008] In order to achieve the above object, the technical solution of the present invention is as follows:
[0009] A method for detecting human intrusion in an area based on DTW distance KNN in a slight motion disturbance scenario includes the following steps:
[0010] 11) Collection of wifi data in the detection area: A pair of wireless signal transceivers supporting IEEE 802.11a / b / g / n wireless communication protocols are deployed in the detection area, and the ping-i 0.001 command is used to send and receive 1000 data packets per second to collect wireless signal channel status information (CSI) data of different targets in three human states: no activity and intrusion in the detection area, intrusion in the detection area, and slight activity in the detection area. The targets are people of different heights and weights;
[0011] 12) Data preprocessing: For each target, 6000 data packets in the intermediate stable state are collected in each action state, and the CSI amplitude information is extracted from the amplitude and phase information contained in the wireless signal channel state information CSI data; Daubechies wavelet is used as the wavelet function to perform two decomposition and reconstruction discrete wavelet transforms to preprocess the CSI amplitude information data for denoising;
[0012] 13) Constructing training data set, verification data set and test data set: constructing training data set, verification data set and test data set according to the CSI amplitude information data after denoising preprocessing;
[0013] 14) Extraction of CSI time domain features: Through the amplitude difference feature extraction algorithm, the amplitude difference between the wireless signal status information under different personnel states is obtained as the time domain feature of CSI;
[0014] 15) Detection of human intrusion in the area: Use the KNN detection algorithm based on dynamic time warping distance to classify the samples of the validation data set, and distinguish three human states from the validation data set data: no activity and intrusion in the detection area, human intrusion in the detection area, and slight human activity in the detection area. Through multiple cross-validations, find the optimal K value that makes the classification effect meet the detection accuracy requirements;
[0015] 16) Obtaining the classification results of the test data set: After finding the optimal K value of the KNN detection algorithm based on dynamic time warping distance, the test data set data is classified using the KNN detection algorithm based on dynamic time warping distance to obtain the classification results of the test data set.
[0016] The method for constructing the training data set, the validation data set, and the test data set is as follows:
[0017] From the CSI amplitude information data, 80% is used as the training data set, 10% is used as the validation data set, and 10% is used as the test data set, where:
[0018] The training dataset is represented as:
[0019] X={(x k , c k )|k=1,2,...n1},
[0020] is the kth training sample vector in the training data set, represents the value of the i-th feature component in the k-th training sample vector; c k Indicates the category corresponding to the kth sample, belonging to the category label; n1 represents the total number of training sample vectors in the training data set;
[0021] The validation dataset is represented as:
[0022] Y={(y l , c l )|l=1,2,...n2},
[0023] in, is the lth validation sample vector in the validation data set, represents the jth feature component value in the lth validation sample vector; c l It represents the category corresponding to the lth sample, which belongs to the category label and is used to judge the quality of classification effect during cross-validation; n2 represents the total number of validation sample vectors in the validation data set;
[0024] The test dataset is represented as:
[0025] Z={z p |p=1,2,...n3},
[0026] in, is the pth test sample vector in the test data set, It represents the rth feature component value in the pth test sample vector, and n3 represents the total number of test sample vectors in the test data set.
[0027] The extraction of the CSI time domain features comprises the following steps:
[0028] 31) A set of CSI amplitude information vectors when there is no activity and intrusion in the detection area is selected from the training data set as a stable reference sample vector group in the unmanned state for calculating the amplitude difference, which is recorded as the reference sample vector group O; since the number of subcarriers in the channel state information is 30 and the number of links of 2×3 MIM0 is 6, each group of reference sample vector group 0 includes 180 reference sample vectors o; at the same time, each sample vector o contains a total of i characteristic component values;
[0029] 32) In the training data set, validation data set and test data set, the CSI amplitude information sample vectors of all groups in the three personnel states of no activity and intrusion in the detection area, intrusion in the detection area, and slight activity in the detection area are subtracted from the stable reference sample vector group O in the no-person state.
[0030] That is, the amplitude difference between the wireless signal status information under different personnel states is obtained as the time domain feature of CSI. The specific formula of the CSI time domain feature amplitude difference extraction algorithm is as follows:
[0031]
[0032] Wherein, n=1, 2, ... 180 represents the number of CSI amplitude information sample vectors in each group, x represents the CSI amplitude information sample vectors under three personnel states in the training data set X, y represents the CSI amplitude information sample vectors under three personnel states in the verification data set Y, z represents the CSI amplitude information sample vectors under three personnel states in the test data set Z, and o represents the selected stable CSI amplitude information reference vector when no one is intruding;
[0033] Complete the extraction process of the CSI time domain feature amplitude difference.
[0034] The detection of human intrusion in the area includes the following steps:
[0035] 41) Calculate the dynamic time warping distance DTW between the training dataset samples and the validation dataset samples;
[0036] 411) Set the cumulative distance matrix D to be expressed as
[0037]
[0038] Where M(i, j) represents a training sample vector x=(x 1 , x 2 , …, x i) and a verification sample vector y in the verification data set Y after amplitude difference feature extraction = (y 1 ,y 2 , …, y j ) is the Euclidean distance between the j-th eigenvalues, that is,
[0039] 412) The recursive calculation formula for setting the DTW distance is as follows:
[0040] L min (i, j) = min{L min (i, j-1), L min (i-1, j), L min (i-1, j-1)}+M(i, j), (3)
[0041] Among them, L min (i, j) represents the shortest path length from the upper left corner M(1,1) of matrix D to any point M(i, j), and the initial condition is L min (0,0)=L min (0,1)=L min (1,0)=0,L min (i,j)=M(1,1);
[0042] 42) Combine DTW distance with KNN to construct an improved KNN classification algorithm:
[0043] Sort the obtained DTW distances in ascending order, and according to the set K value, take the K training samples closest to the verification sample to obtain the category labels of the K nearest neighbor training samples, and select the category label with the most occurrences in the K training samples as the classification result of the verification sample in this iteration;
[0044] 43) Cross-validation evaluation: Use cross-validation to determine whether the classification results of this iteration meet the requirements and whether the K value needs to be adjusted;
[0045] If adjustment is needed, set a new appropriate K value and perform the next iteration. When the iteration end condition is met, stop the iteration and obtain the K value with the best classification result.
[0046] The construction of the improved KNN classification algorithm includes the following steps:
[0047] 51) The n2 validation sample vectors in the validation data set Y and the n1 training sample vectors in the training data set X are calculated by the DTW distance recursion calculation formula to obtain the DTW distance between each validation sample vector in the validation data set Y and all the training sample vectors in the training data set; and the calculated DTW distance is saved in n2 2*n1 two-dimensional matrices, the first row of each two-dimensional matrix is used to store the label of the training sample vector, and the second row stores the DTW distance between the validation data set sample of the current matrix and all the training sample vectors;
[0048] 52) According to the size of the DTW distance, the column vectors in the two-dimensional matrix are sorted in ascending order, and according to the set K value, the first K columns of training sample vector labels and minimum DTW distance data in each two-dimensional matrix are selected to obtain n2 K nearest neighbor matrices with the minimum DTW distance;
[0049] 53) Count the number of times each training sample vector label appears in the K nearest neighbor matrix of each minimum DTW distance, and select the category label with the largest number of appearances in the current matrix as the classification result label of the current verification sample in this iteration, and obtain a total of n2 classification result labels, that is, each verification sample vector in the verification data set Y is classified.
[0050] The cross-validation evaluation method is to use a number of 9-fold cross-validation averaging methods to evaluate the effects of different K values on the regional intrusion detection method based on DTW distance KNN in a slight disturbance scenario, so as to select the hyperparameter K value with the best classification effect. The specific steps are as follows:
[0051] 61) Divide all samples in the training data set into eight equal parts, the same number of samples as in the validation data set.
[0052] The eight training sample vectors of the training data set X and the verification sample vectors in the verification data set Y are classified using the KNN detection algorithm based on dynamic time warping distance. The three human states of no activity and intrusion in the detection area, human intrusion in the detection area, and slight human activity in the detection area are distinguished from the samples of the verification data set, and the classification result based on the K value in the current iteration is obtained; the accuracy of the current round of classification results based on the K value in the current iteration is evaluated and recorded;
[0053] 62) Take one of the eight training sample vectors of the training data set X in turn as the validation data set sample for the new round of cross-validation, and take the remaining seven training sample vectors and the validation data set sample of the previous round of cross-validation as the training data set sample for the new round of cross-validation, repeat the above KNN detection algorithm classification steps, and evaluate and record the classification results of each round of cross-validation;
[0054] 63) After repeating the cross-validation for 9 rounds, the classification results obtained from the 9 rounds of cross-validation are averaged as an estimate of the accuracy of the DTW distance KNN classification algorithm based on the K value in the current iteration;
[0055] 64) The above 9-fold cross-validation process is repeated multiple times and the average is calculated to finally obtain a single estimate of the accuracy of the DTW distance KNN classification algorithm based on the K value in the current iteration.
[0056] Beneficial Effects
[0057] The present invention discloses a method for detecting intrusion of personnel in an area based on DTW distance KNN in a slight motion disturbance scenario. Compared with the prior art, the method can better distinguish the channel states of wireless signals in the detection area of different personnel states in the slight motion disturbance scenario by extracting the amplitude difference between the wireless signal state information in different personnel states as the time domain feature of CSI; by using the KNN detection algorithm based on dynamic time warping distance for data classification, the classification accuracy is high and it is more suitable for multi-classification problems in slight motion disturbance scenarios; while reducing the deployment cost of the intrusion detection function in the security system, the accuracy of passive sensing intrusion detection is improved.
[0058] The present invention can better distinguish the channel states of wireless signals in the detection area of different personnel states in the slight motion disturbance scenario, has high classification accuracy, and is more suitable for multi-classification problems in slight motion disturbance scenarios. It solves the problem of low classification accuracy caused by CSI waveform similarity fluctuations under active interference conditions in the detection area, improves the accuracy of the passive perception intrusion detection system, reduces the false alarm rate and missed alarm rate of the system, and enhances the availability of the passive perception intrusion detection system. It also has the advantages of low deployment cost, fast response speed, wide adaptability to scenarios, and privacy protection. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 is a method sequence diagram of the present invention;
[0060] Figure 2 This is an experimental layout diagram of the present invention in an office environment.
[0061] Figure 3 This is an experimental layout diagram of the present invention in a laboratory environment. DETAILED DESCRIPTION
[0062] In order to have a further understanding and recognition of the structural features and the effects achieved by the present invention, a preferred embodiment and accompanying drawings are used for detailed description as follows:
[0063] like Figure 1As shown, the method for detecting human intrusion in an area based on DTW distance KNN in a slight motion disturbance scenario according to the present invention comprises the following steps:
[0064] The first step is to collect Wi-Fi data in the detection area.
[0065] A pair of wireless signal transceivers supporting IEEE 802.11a / b / g / n wireless communication protocols are deployed in the detection area, and the ping-i 0.001 command is used to send and receive 1000 data packets per second to collect wireless signal channel state information (CSI) data of different targets in three human states: no activity and intrusion in the detection area, intrusion in the detection area, and slight activity in the detection area. The targets are people of different heights and weights.
[0066] The second step is data preprocessing.
[0067] For each target, 6000 data packets in the intermediate stable state are collected in each action state, and the CSI amplitude information is extracted from the amplitude and phase information contained in the wireless signal channel state information CSI data. Daubechies wavelet is used as the wavelet function to perform two decomposition and reconstruction discrete wavelet transforms to pre-process the CSI amplitude information data for denoising.
[0068] The third step is to construct training data sets, verification data sets and test data sets: construct training data sets, verification data sets and test data sets based on the CSI amplitude information data after denoising preprocessing.
[0069] From the CSI amplitude information data, 80% is used as the training data set, 10% is used as the validation data set, and 10% is used as the test data set, where:
[0070] The training dataset is represented as:
[0071] X={(x k , c k )|k=1,2,...n1},
[0072] is the kth training sample vector in the training data set, represents the value of the i-th feature component in the k-th training sample vector; c k It represents the category corresponding to the kth sample, belonging to the category label; n1 represents the total number of training sample vectors in the training data set.
[0073] The validation dataset is represented as:
[0074] Y={(yl,c l )|l=1,2,...n2},
[0075] in, is the lth validation sample vector in the validation data set, represents the jth feature component value in the lth validation sample vector; c l It represents the category corresponding to the lth sample, which belongs to the category label and is used to judge the classification effect during cross-validation; n2 represents the total number of validation sample vectors in the validation data set.
[0076] The test dataset is represented as:
[0077] Z={z p |p=1,2,...n3},
[0078] in, is the pth test sample vector in the test data set, It represents the rth feature component value in the pth test sample vector, and n3 represents the total number of test sample vectors in the test data set.
[0079] The fourth step is to extract the time domain features of CSI: through the amplitude difference feature extraction algorithm, the amplitude difference between the wireless signal status information under different personnel states is obtained as the time domain feature of CSI.
[0080] Compared with the existing mean feature extraction, variance feature extraction, wavelet coefficient feature extraction, and wavelet variance feature extraction technologies, the present invention extracts the amplitude difference between the wireless signal state information under different personnel states through an amplitude difference feature extraction algorithm as the time domain feature of CSI; it not only has the difference but also reduces the complexity and time of channel state information feature extraction, and can better distinguish the channel state of wireless signals in the detection area of different personnel states in the scenario of slight motion disturbance.
[0081] The specific steps are as follows:
[0082] (1) A set of CSI amplitude information vectors when there is no activity and intrusion in the detection area is selected from the training data set as a stable reference sample vector group in the unmanned state for calculating the amplitude difference, which is denoted as reference sample vector group O. Since the number of subcarriers in the channel state information is 30 and the number of links in 2×3 MIMO is 6, each reference sample vector group 0 includes 180 reference sample vectors o. At the same time, each sample vector o contains a total of i characteristic component values.
[0083] (2) The CSI amplitude information sample vectors of all groups in the training data set, validation data set, and test data set are subtracted from the stable reference sample vector group O in the unmanned state, respectively.
[0084] That is, the amplitude difference between the wireless signal status information under different personnel states is obtained as the time domain feature of CSI. The specific formula of the CSI time domain feature amplitude difference extraction algorithm is as follows:
[0085]
[0086] Wherein, n=1, 2, ... 180 represents the number of CSI amplitude information sample vectors in each group, x represents the CSI amplitude information sample vectors under three personnel states in the training data set X, y represents the CSI amplitude information sample vectors under three personnel states in the verification data set Y, z represents the CSI amplitude information sample vectors under three personnel states in the test data set Z, and o represents the selected stable CSI amplitude information reference vector when no one is intruding;
[0087] Complete the extraction process of the CSI time domain feature amplitude difference.
[0088] The fifth step is the detection of human intrusion in the area: the KNN detection algorithm based on dynamic time warping distance is used to classify the samples of the verification data set, and three human states are distinguished from the verification data set data: no activity and intrusion in the detection area, human intrusion in the detection area, and slight human activity in the detection area. Through multiple cross-validations, the optimal K value is found to make the classification effect meet the detection accuracy requirements.
[0089] Compared with the traditional KNN detection algorithm based on Euclidean distance, by using the dynamic time warping (DTW) distance that can better identify the similarity between time series and combining it with the idea of the KNN classification algorithm, a KNN detection algorithm based on dynamic time warping distance is obtained to classify data. It has high classification accuracy and is more suitable for multi-classification problems in scenarios with slight motion disturbances. It solves the problem of low classification accuracy caused by CSI waveform similarity fluctuations under the condition of active interference in the detection area, which is of great significance to improving the accuracy of passive sensing intrusion detection systems, reducing the false alarm rate and missed alarm rate of the system, and enhancing the availability of passive sensing intrusion detection systems.
[0090] The specific steps are as follows:
[0091] (1) Calculate the dynamic time warping distance DTW between the training dataset samples and the validation dataset samples. The DTW distance can not only measure the similarity between two time series of different lengths, but is also very suitable for classifying sequences with different frequencies or phases. Therefore, the DTW distance can better distinguish the wireless signal channel state information under different personnel states, which is more practical.
[0092] A1) Set the cumulative distance matrix D to be expressed as
[0093]
[0094] Where M(i, j) represents a training sample vector x=(x 1 , x 2 , …, x i ) and a verification sample vector y in the verification data set Y after amplitude difference feature extraction = (y 1 ,y 2 , …, y j ) is the Euclidean distance between the j-th eigenvalues, that is,
[0095] A2) The recursive calculation formula for setting the DTW distance is as follows:
[0096] L min (i, j) = min{L min (i, j=1), L min (i-1, j), L min (i-1, j-1)}+M(i, j), (3)
[0097] Among them, L min (i, j) represents the shortest path length from the upper left corner M(1, 1) of matrix D to any point M(i, j), and the initial condition is L min (0, 0) = L min (0, 1) = L min (1, 0) = 0, L min (i, j) = M(1, 1).
[0098] (2) Combining DTW distance with KNN to construct an improved KNN classification algorithm:
[0099] The obtained DTW distances are sorted in ascending order. According to the set K value, the K training samples closest to the verification sample are taken to obtain the category labels of the K nearest neighbor training samples. The category label that appears most frequently in the K training samples is selected as the classification result of the verification sample in this iteration.
[0100] B1) Calculate the n2 validation sample vectors in the validation data set Y and the n1 training sample vectors in the training data set X by using the DTW distance recursive calculation formula to obtain the DTW distance between each validation sample vector in the validation data set Y and all the training sample vectors in the training data set; and save the calculated DTW distance in n2 2*n1 two-dimensional matrices, where the first row of each two-dimensional matrix is used to store the label of the training sample vector, and the second row stores the DTW distance between the validation data set sample of the current matrix and all the training sample vectors;
[0101] B2) sorting the column vectors in the two-dimensional matrix in ascending order according to the size of the DTW distance, and selecting the first K columns of training sample vector labels and minimum DTW distance data in each two-dimensional matrix according to the set K value, to obtain n2 K nearest neighbor matrices with the minimum DTW distance;
[0102] B3) Count the number of times each training sample vector label appears in the K nearest neighbor matrix of each minimum DTW distance, and select the category label with the largest number of appearances in the current matrix as the classification result label of the current verification sample in this iteration, and obtain a total of n2 classification result labels, that is, each verification sample vector in the verification data set Y is classified.
[0103] (3) Cross-validation evaluation: Use cross-validation to determine whether the classification results of this iteration meet the requirements and whether the K value needs to be adjusted;
[0104] If adjustment is needed, set a new appropriate K value and perform the next iteration. When the iteration end condition is met, stop the iteration and obtain the K value with the best classification result.
[0105] The cross-validation evaluation method is to use a number of 9-fold cross-validation averaging methods to evaluate the effects of different K values on the regional intrusion detection method based on DTW distance KNN in a slight disturbance scenario, so as to select the hyperparameter K value with the best classification effect. The specific steps are as follows:
[0106] C1) Divide all samples in the training data set into eight equal parts, the same number of samples as in the validation data set.
[0107] The eight training sample vectors of the training data set X and the verification sample vectors in the verification data set Y are classified using the KNN detection algorithm based on dynamic time warping distance. The three human states of no activity and intrusion in the detection area, human intrusion in the detection area, and slight human activity in the detection area are distinguished from the samples of the verification data set, and the classification result based on the K value in the current iteration is obtained; the accuracy of the current round of classification results based on the K value in the current iteration is evaluated and recorded;
[0108] C2) Take one of the eight training sample vectors of the training data set X in turn as the validation data set sample for the new round of cross-validation, and take the remaining seven training sample vectors and the validation data set sample of the previous round of cross-validation as the training data set sample for the new round of cross-validation, repeat the above KNN detection algorithm classification steps, and evaluate and record the classification results of each round of cross-validation;
[0109] C3) After repeating the cross-validation for 9 rounds, the classification results obtained from the 9 rounds of cross-validation are averaged as an estimate of the accuracy of the DTW distance KNN classification algorithm based on the K value in the current iteration;
[0110] C4) Repeat the above 9-fold cross validation process multiple times and calculate the average, and finally obtain a single estimate of the accuracy of the DTW distance KNN classification algorithm based on the K value in the current iteration.
[0111] Step 6, obtain the classification results of the test data set: After finding the optimal K value of the KNN detection algorithm based on dynamic time warping distance, classify the test data set data using the KNN detection algorithm based on dynamic time warping distance to obtain the classification results of the test data set.
[0112] Here, Figure 2 and Figure 3 Take the detection process and effect as an example to explain it.
[0113] The first step is data collection. Figure 2 and Figure 3In the two experimental scenarios shown, the wireless signal channel state information CSI data of different targets in three states of people are collected: no activity and intrusion in the detection area, someone intruding the detection area from the door position, and the guard performing slight activities in the elliptical area; the targets are 20 experimenters of different heights and weights, and the wireless signal detection area is the entire office. The experimental platform uses a router as the transmitter, and the router is 80cm above the ground; a desktop computer equipped with an Intel 5300 network card and the open source tool CSI-Tools is used as the receiving end, and the desktop computer is 50cm above the ground. It is connected to the designated router in an unencrypted manner, and the ping-i 0.001 command is used to generate about 1000 data packets per second. In the two experimental scenarios, 6000 data packets in the intermediate stable state are collected as samples for each experimenter in each action state. Each CSI data packet contains 30 subcarrier information with different center frequencies. There are 2 transmitting antennas and 3 receiving antennas in the 2×3 MIMO link, so the total number of CSI data collected and analyzed is about 1.3 million. The channel state information contains two kinds of information: amplitude and phase. The CSI amplitude information is extracted, and the discrete wavelet transform with Daubechies wavelet as the wavelet function is used to perform two decompositions and reconstructions, and the CSI amplitude information data is preprocessed for denoising. 2 / 3 of the preprocessed data is used as the training data set, and 1 / 3 of the preprocessed data is used as the test data set. The training data set and the test data set are established, and the data in the data set are processed by the amplitude difference feature extraction algorithm to obtain the amplitude difference between the wireless signal state information under different personnel states as the time domain feature of CSI.
[0114] Table 1. Accuracy record of classification results of test data set
[0115]
[0116]
[0117] Table 1 is a comparison table of confusion matrix results of classification tests of three personnel states in two experimental environments after extracting the amplitude difference features of the data in the data set and using the amplitude difference features as the input of the KNN detection algorithm based on dynamic time warping distance, and after multiple iterations. The underlined data are the classification accuracy of each state, and the average classification accuracy reaches 99.3%.
[0118] Table 2 Accuracy record of classification results of test data sets under different experimental environments
[0119] Experimental environment Accuracy False Positive Rate False negative rate office 100% 0 0 laboratory 99.3% 0 2.05% average 99.65% 0 1.03%
[0120] In order to evaluate the classification accuracy of the method in different experimental environments, Table 2 summarizes the accuracy, false alarm rate, and missed alarm rate of the intrusion detection system experiment based on CSI amplitude difference and dynamic time warping distance KNN in a 4×7 square meter office and a 3×4 square meter laboratory. The office is a closed indoor environment, and the laboratory is a room with three glass walls. It can be seen that no matter what environment, the proposed method has a high accuracy rate, with an average accuracy rate of 99.65%, and the probability of no false alarms and missed alarms is 1.03%.
[0121] To sum up, the present invention can better distinguish the wireless signal channel states of different personnel statuses in the detection area under slight motion disturbance scenarios, has high classification accuracy, and is more suitable for multi-classification problems in slight motion disturbance scenarios. It solves the problem of low classification accuracy caused by CSI waveform similarity fluctuations under active interference conditions in the detection area, improves the accuracy of the passive sensing intrusion detection system, reduces the false alarm rate and missed alarm rate of the system, and enhances the availability of the passive sensing intrusion detection system. It also has the advantages of low deployment cost, fast response speed, wide adaptability to scenarios, and privacy protection.
[0122] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions only describe the principles of the present invention. The present invention may be subject to various changes and improvements without departing from the spirit and scope of the present invention. These changes and improvements fall within the scope of the present invention. The scope of protection claimed by the present invention is defined by the attached claims and their equivalents.
Claims
1. A method for detecting intruders in a region based on DTW distance KNN in a scenario with slight motion disturbance. It is characterized in that The following steps are involved: 11) Collection of wifi data in the detection area: A pair of wireless signal transceivers supporting IEEE 802.11a / b / g / n wireless communication protocols are deployed in the detection area, and the ping-i 0.001 command is used to send and receive 1000 data packets per second to collect wireless signal channel status information (CSI) data of different targets in three human states: no activity and intrusion in the detection area, intrusion in the detection area, and slight activity in the detection area. The targets are people of different heights and weights; 12) Data preprocessing: For each target, 6000 data packets in the intermediate stable state are collected in each action state, and the CSI amplitude information is extracted from the amplitude and phase information contained in the wireless signal channel state information CSI data; Daubechies wavelet is used as the wavelet function to perform two decomposition and reconstruction discrete wavelet transforms to preprocess the CSI amplitude information data for denoising; 13) Constructing training data set, verification data set and test data set: constructing training data set, verification data set and test data set according to the CSI amplitude information data after denoising preprocessing; 14) Extraction of CSI time domain features: Through the amplitude difference feature extraction algorithm, the amplitude difference between the wireless signal status information under different personnel states is obtained as the time domain feature of CSI; 15) Detection of human intrusion in the area: Use the KNN detection algorithm based on dynamic time warping distance to classify the samples of the validation data set, and distinguish three human states from the validation data set data: no activity and intrusion in the detection area, human intrusion in the detection area, and slight human activity in the detection area. Through multiple cross-validations, find the optimal K value that makes the classification effect meet the detection accuracy requirements; 16) Obtaining the classification results of the test data set: After finding the optimal K value of the KNN detection algorithm based on dynamic time warping distance, the test data set data is classified using the KNN detection algorithm based on dynamic time warping distance to obtain the classification results of the test data set.
2. According to the method for detecting intrusion of personnel in a region based on DTW distance KNN in a slight motion disturbance scenario according to claim 1, It is characterized in that The method for constructing the training data set, the validation data set, and the test data set is as follows: From the CSI amplitude information data, 80% is used as the training data set, 10% is used as the validation data set, and 10% is used as the test data set, where: The training dataset is represented as: X={(x k ,c k )|k=1,2,…n 1 }, is the kth training sample vector in the training data set, represents the value of the i-th feature component in the k-th training sample vector; c k Indicates the category corresponding to the kth sample, belonging to the category label; n 1 It represents the total number of training sample vectors in the training data set; The validation dataset is represented as: Y={(y l ,c l )|l=1,2,…n 2 }, in, is the lth validation sample vector in the validation data set, represents the jth feature component value in the lth validation sample vector; c l Indicates the category corresponding to the lth sample, which belongs to the category label and is used to judge the quality of classification effect during cross-validation; n 2 It represents the total number of validation sample vectors in the validation data set; The test dataset is represented as: Z={z p |p=1,2,…n 3 }, in, is the pth test sample vector in the test data set, represents the rth eigenvalue in the pth test sample vector, n 3 It represents the total number of test sample vectors in the test data set.
3. According to the method for detecting intrusion of personnel in a region based on DTW distance KNN in a slight motion disturbance scenario according to claim 1, It is characterized in that The extraction of the CSI time domain features comprises the following steps: 31) A set of CSI amplitude information vectors when there is no activity and intrusion in the detection area is selected from the training data set as a stable reference sample vector group in the unmanned state for calculating the amplitude difference, which is recorded as the reference sample vector group O; since the number of subcarriers in the channel state information is 30 and the number of links of 2×3 MIMO is 6, each reference sample vector group O includes 180 reference sample vectors o; at the same time, each sample vector o contains a total of i characteristic component values; 32) In the training data set, validation data set and test data set, the CSI amplitude information sample vectors of all groups in the three personnel states of no activity and intrusion in the detection area, intrusion in the detection area, and slight activity in the detection area are subtracted from the stable reference sample vector group O in the no-person state. That is, the amplitude difference between the wireless signal status information under different personnel states is obtained as the time domain feature of CSI. The specific formula of the CSI time domain feature amplitude difference extraction algorithm is as follows: Wherein, n=1, 2, ... 180 represents the number of CSI amplitude information sample vectors in each group, x represents the CSI amplitude information sample vectors under three personnel states in the training data set X, y represents the CSI amplitude information sample vectors under three personnel states in the verification data set Y, z represents the CSI amplitude information sample vectors under three personnel states in the test data set Z, and o represents the selected stable CSI amplitude information reference vector when no one is intruding; Complete the extraction process of the CSI time domain feature amplitude difference.
4. According to the method for detecting intrusion of personnel in a region based on DTW distance KNN in a slight motion disturbance scenario according to claim 1, It is characterized in that The detection of human intrusion in the area includes the following steps: 41) Calculate the dynamic time warping distance DTW between the training dataset samples and the validation dataset samples; 411) Set the cumulative distance matrix D to be expressed as Where M(i, j) represents a training sample vector x=(x 1 , x 2 , …, x i ) and a verification sample vector y in the verification data set Y after amplitude difference feature extraction = (y 1 ,y 2 , …, y j ), Right now 412) The recursive calculation formula for setting the DTW distance is as follows: L min (i,j)=min{L min (i,j-1),L min (i-1,j),L min (i-1,j-1)}+M(i,j),(3) Among them, L min (i, j) represents the shortest path length from the upper left corner M(1, 1) of matrix D to any point M(i, j), and the initial condition is L min (0, 0) = L min (0, 1) = L min (1, 0) = 0, L min (i, j) = M (1, 1); 42) Combine DTW distance with KNN to construct an improved KNN classification algorithm: Sort the obtained DTW distances in ascending order, and according to the set K value, take the K training samples closest to the verification sample to obtain the category labels of the K nearest neighbor training samples, and select the category label with the most occurrences in the K training samples as the classification result of the verification sample in this iteration; 43) Cross-validation evaluation: Use cross-validation to determine whether the classification results of this iteration meet the requirements and whether the K value needs to be adjusted; If adjustment is needed, set a new appropriate K value and perform the next iteration. When the iteration end condition is met, stop the iteration and obtain the K value with the best classification result.
5. According to the method for detecting intrusion of personnel in a region based on DTW distance KNN in a slight motion disturbance scenario according to claim 4, It is characterized in that The construction of the improved KNN classification algorithm includes the following steps: 51) Using the DTW distance recursive calculation formula, the n 2 validation sample vectors and n in the training dataset X 1 The DTW distance between each validation sample vector in the validation data set Y and all the training sample vectors in the training data set is calculated, and the calculated DTW distance is saved in n 2 2*n 1 In the two-dimensional matrix of , the first row of each two-dimensional matrix is used to store the label of the training sample vector, and the second row stores the DTW distance between the validation data set sample of the current matrix and all the training sample vectors; 52) According to the size of the DTW distance, the column vectors in the two-dimensional matrix are sorted in ascending order, and according to the set K value, the first K columns of training sample vector labels and the minimum DTW distance data in each two-dimensional matrix are selected to obtain n 2 K nearest neighbor matrices with minimum DTW distances; 53) Count the number of times each training sample vector label appears in each K nearest neighbor matrix with the minimum DTW distance, and select the category label with the largest number of appearances in the current matrix as the classification result label of the current verification sample in this iteration, and obtain a total of n 2 classification result labels, that is, each verification sample vector in the verification data set Y has been classified.
6. According to the method of detecting intrusion of personnel in a region based on DTW distance KNN in a slight motion disturbance scenario according to claim 4, It is characterized in that The cross-validation evaluation method is to use a number of 9-fold cross-validation averaging methods to evaluate the effects of different K values on the regional intrusion detection method based on DTW distance KNN in a slight disturbance scenario, so as to select the hyperparameter K value with the best classification effect. The specific steps are as follows: 61) Divide all samples in the training data set into eight equal parts, the same number of samples as in the validation data set. The eight training sample vectors of the training data set X and the verification sample vectors in the verification data set Y are classified using the KNN detection algorithm based on dynamic time warping distance. The three human states of no activity and intrusion in the detection area, human intrusion in the detection area, and slight human activity in the detection area are distinguished from the samples of the verification data set, and the classification result based on the K value in the current iteration is obtained; the accuracy of the current round of classification results based on the K value in the current iteration is evaluated and recorded; 62) Take one of the eight training sample vectors of the training data set X in turn as the validation data set sample for the new round of cross-validation, and take the remaining seven training sample vectors and the validation data set sample of the previous round of cross-validation as the training data set sample for the new round of cross-validation, repeat the above KNN detection algorithm classification steps, and evaluate and record the classification results of each round of cross-validation; 63) After repeating the cross-validation for 9 rounds, the classification results obtained from the 9 rounds of cross-validation are averaged as an estimate of the accuracy of the DTW distance KNN classification algorithm based on the K value in the current iteration; 64) The above 9-fold cross-validation process is repeated multiple times and the average is calculated to finally obtain a single estimate of the accuracy of the DTW distance KNN classification algorithm based on the K value in the current iteration.
