A wifi fingerprint indoor floor identification and position estimation method
By preprocessing and optimizing WiFi fingerprint data, and combining convolutional neural networks and machine learning algorithms, the problems of low accuracy and large error in WiFi indoor positioning were solved, achieving high-precision floor identification and location estimation.
Patent Information
- Application Number
- CN202211175374.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-26
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2042-09-26
AI Technical Summary
In existing WiFi indoor positioning technologies, indoor positioning based on Received Signal Strength Indicator (RSSI) faces problems such as low positioning accuracy and large errors, especially in complex indoor environments where precise positioning is difficult to achieve.
By preprocessing WiFi fingerprint data, a convolutional neural network model and a machine learning regression model are built. Combined with VGG16 model transfer learning and spatial attention mechanism, and combined with decision tree, random forest and K-nearest neighbor regression algorithms, the floor identification and location estimation are optimized.
It improves the accuracy of indoor floor identification, reduces positioning errors, and achieves higher-precision location estimation, especially in complex indoor environments.
Smart Images

Figure CN115567871B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the field of wireless indoor positioning technology, and particularly relates to a WiFi fingerprint indoor floor identification and position estimation method BACKGROUND
[0002] With the rapid development of the Internet of Things technology, outdoor positioning technology has been mature, however, the positioning demand of personal users and new Internet of Things devices gradually turns to indoor, and the location service industry also gradually develops indoor, and real-time accurate positioning services from outdoor to indoor are provided, which gives birth to many software and hardware providers developing indoor positioning services to meet the growing market demand. Indoor scenes correspond to the application of various indoor positioning technologies according to different application requirements, such as UWB, RFID, ultrasonic wave, geomagnetic positioning, WiFi positioning, Bluetooth positioning and the like. WiFi is widely used in large or small buildings such as shopping malls, office buildings and underground parking lots, and can be simply and conveniently realized by a mobile device end, does not need to additionally deploy a signal source or a hardware device, can save a large amount of time and construction cost, and has obvious advantages compared with other positioning technologies. Generally, a WiFi system is composed of fixed access points AP, and mobile devices connected with WiFi can directly or indirectly communicate with each other through the AP, so that the positioning function can be realized on the basis of the communication function. The currently used WiFi signals mainly include received signal strength indication RSSI and channel state information CSI, wherein the RSSI is used for coarse-grained indoor positioning sensing tasks, and the CSI is used for fine-grained indoor positioning technology and requires special hardware devices for CSI acquisition. In order to save the cost, the RSSI positioning technology is mainly used in indoor positioning research, however, due to the complex indoor environment, wall shielding, personnel walking leading to path attenuation, multipath effect, the indoor positioning based on the RSSI faces the problems of low positioning accuracy and large error. SUMMARY
[0003] The application aims to provide a WiFi fingerprint indoor floor identification and position estimation method, which improves the problems of low indoor identification accuracy and high position estimation error rate in the background technology by pre-processing fingerprint data, building a convolutional neural network model and a machine learning regression model.
[0004] Technical content: A WiFi fingerprint indoor floor identification and position estimation method comprises the following steps:
[0005] Step one, divide WiFi fingerprint data into a training set trainingDataset and a validation set validationDataset, and perform data preprocessing on the WiFi fingerprint data, remove redundant fingerprint data and invalid AP nodes, and convert RSSI values into a matrix representing a gray-scale picture, and dividing the pre-processed training set trainingDataset into a training set split-train and a test set split-test;
[0006] Step two, build a convolutional neural network model, based on the VGG16 model pre-training network transfer learning and fine-tune, the network model mainly includes four parts of convolutional layer, pooling layer, attention mechanism and full connection layer, input the image into the network, the image is propagated forward through the network, and the final classification accuracy is obtained at the end of the network;
[0007] Step three, build a machine learning model framework, predict the position through three linear regression algorithms of decision tree, random forest and K nearest neighbor, predict the latitude and longitude coordinates of each reference node RP according to the WiFi fingerprint data, and evaluate and select the optimal machine learning model according to the mean square error MSE and R square value R2_score of the latitude and longitude of the validation set validationDataset and the test set split-test in step one, and calculate the average positioning error between the predicted value coordinates and the actual coordinates under the optimal regression model.
[0008] Further, in step one, the specific steps of data preprocessing are as follows:
[0009] S1.1. Use drop_duplicates to delete duplicate fingerprint data;
[0010] S1.2. Detect the building range of the AP node, calculate the frequency of occurrence in different buildings, and delete the AP node with the same frequency, which is considered as invalid node.
[0011] S1.3. All reference nodes RP receive signal strength at the jth AP node to form a matrix rssi, n AP nodes form n rssi matrices, and AP nodes with similarity higher than 90% and variance of 0 are deleted, and the number of AP nodes after screening is N.
[0012] S1.4. Take N adjacent square root number M, increase or decrease the signal AP node, that is, the signal strength received by all reference nodes RP is 110; At this time, there are M AP nodes, and the signal strength matrix r 1*M and floor ID, latitude and longitude coordinates constitute WiFi data fingerprint;
[0013] S1.5. Update the training set trainingDataset and the validation set validationDataset according to the above steps S1.1-S1.4, and the signal strength matrix r1*M Convert the size to a matrix and normalize each signal strength value according to the formula After conversion, the signal strength values collected by M AP nodes at one reference node RP can be represented by a matrix The converted signal strength values RSSI' are gray values of a gray-scale image with a size of The converted signal strength values RSSI' are gray values of a gray-scale image with a size of
[0014] S1.6. Convert the gray-scale images of the updated training set trainingDataset and validation set validationDataset in step S1.5 into RGB color images, and adjust the image size to i*j*3 to adapt to the convolutional neural network model, where i and j represent the width and height of the image, respectively.
[0015] S1.7. Divide the training set trainingDataset obtained in S1.6 into a training set split-train and a test set split-test in a ratio of 9:1.
[0016] Further, in step two, the specific building steps of the convolutional neural network model are as follows:
[0017] S2.1. The first 13 layers of VGG16 pre-trained on the ImageNet dataset are used as a feature extractor and the model parameters are frozen, and the first 13 layers block1-block5 are composed of convolutional layers and pooling layers. The input i*j*3 three-channel RGB image extracts features F.
[0018] S2.2. Add a channel attention mechanism module Spatial Attention Module after the convolutional layer and the pooling layer. The channel attention module takes the maximum value and the average value on each feature point channel, stacks the two results, adjusts the channel number with a convolution with a channel number of 1, takes the sigmoid, obtains the weight value of each feature point of the input feature layer, and finally multiplies the original input feature layer to further extract features F'.
[0019] S2.3. After the Spatial Attention Module, the features F' are passed to the Flatten layer and the Dense layer. The Dense layer uses the RELU activation function, adds a Dropout with a proportion of 0.2 to randomly delete neurons in the network to prevent overfitting, and the final output layer is a softmax layer with a class number equal to the number of floors.
[0020] S2.4. Train the convolutional neural network in batches for 20 rounds, where the input data is an RGB picture of i*j*3, and the label is the floor ID. Evaluate the floor classification accuracy and loss value of the test set split-test, and draw the accuracy and loss curve graph.
[0021] Further, in step three, the machine learning model evaluation selection step is as follows:
[0022] S3.1. Use the decision tree regression model, with a maximum tree depth max_depth of 27, a minimum sample size min_samples_leaf of 8 contained in each leaf node, and a random generator seed random_state of 42. Train and predict the latitude and longitude coordinates.
[0023] S3.2. Use the random forest regression model, with a decision tree number n_estimators of 23, a maximum feature number max_features of 24, a tree maximum depth max_depth of 84, and a random generator seed random_state of 42. Train and predict the latitude and longitude coordinates.
[0024] S3.3. Use the KNN nearest centroid regression model, with a K value of 3, and a neighbor sample weight weights of distance weight and distance inversely proportional. Train and predict the latitude and longitude coordinates.
[0025] S3.4. Summarize the coordinates trained and predicted by the three machine learning algorithms, and evaluate the machine learning model according to the mean square error MSE and R-square value R2_score. The calculation formulas of MSE and R2_score are as follows:
[0026]
[0027] where m is the sample size, y (i) is the true value of the i-th sample, is the predicted value of the i-th sample, is the sample mean, is the sample mean square error, and Var(y) is the sample variance.
[0028] Select the regression model with low mean square error MSE and high R-square value R2_score as the optimal positioning model.
[0029] S3.5. Draw the coordinate deviation graph of the training set split-train and the test set split-test under the optimal positioning model and calculate the positioning error value.
[0030] S3.6. Calculate the positioning error value under the optimal positioning model according to the Euclidean distance formula, which is as follows:
[0031]
[0032] Wherein, long_pred is the longitude predicted value, longitude is the longitude actual value, lat_pred is the latitude predicted value, and latitude is the latitude actual value.
[0033] Compared with the prior art, the present application has the beneficial effects that:
[0034] In the field of indoor positioning, WiFi fingerprint is used to effectively improve the problem of inaccurate positioning caused by the variability of indoor environment on the basis of reducing positioning cost and avoiding redundant deployment. The convolutional neural network model effectively reduces the learning model time through transfer learning and fine-tune fine-tuning, and further extracts features by adding a spatial attention mechanism, so that the overall network model improves the floor identification accuracy. Through the training and prediction of three kinds of machine learning regression algorithms, the random forest regression algorithm is selected as the optimal model to further reduce the positioning error. BRIEF DESCRIPTION OF DRAWINGS
[0035] Figure 1 It is a convolutional network model structure diagram;
[0036] Figure 2 It is a spatial attention mechanism architecture diagram;
[0037] Figure 3A It is an accuracy curve diagram of the training set and test set under 20 rounds;
[0038] Figure 3B It is a loss function loss curve diagram of the training set and test set under 20 rounds;
[0039] Figure 4A It is a 3-machine learning model MSE index evaluation curve diagram
[0040] Figure 4B It is a 3-machine learning model R2_score index evaluation curve diagram;
[0041] Figure 5A It is a distribution diagram of the actual position and the predicted position of the training set;
[0042] Figure 5B It is a distribution diagram of the actual position and the predicted position of the test set. DETAILED DESCRIPTION
[0043] The technical solutions of the present application will be described in detail below in combination with the drawings and specific implementation cases.
[0044] The present application discloses a WiFi fingerprint indoor floor identification and position estimation method, and the specific steps are as follows:
[0045] Step 1: divide the WiFi fingerprint data into training set trainingDataset and validation set validationDataset, and pre-process the WiFi fingerprint data, remove redundant fingerprint data and invalid AP nodes, and convert the RSSI value into a matrix represent a grayscale picture, and divide the pre-processed training set trainingDataset into training set split-train and test set split-test. In step 1, the specific steps of data preprocessing are as follows:
[0046] S1.1. Use drop_duplicates to delete duplicate fingerprint data;
[0047] S1.2. Detect the building range where the AP node is located, calculate the frequency of occurrence in different buildings, and delete the AP nodes with the same frequency, which means the AP nodes are in different buildings at the same time and are considered invalid nodes;
[0048] S1.3. The signal strength received by all reference nodes RP at the jth AP node forms a matrix rssi, and n AP nodes form n rssi matrices. Find the AP nodes with similarity higher than 90% and variance of 0 between the n rssi matrices and delete them. The number of AP nodes after screening is N;
[0049] S1.4. Take N adjacent square root numbers M, and increase or decrease the signal AP nodes by adding or subtracting the signal AP nodes, i.e. all reference nodes RP receive signal strength of 110; At this time, there are M AP nodes, and the signal strength matrix r 1*M and floor ID, latitude and longitude coordinates constitute the WiFi data fingerprint;
[0050] S1.5. Update the training set trainingDataset and the validation set validationDataset according to the above steps S1.1-S1.4, and convert the signal strength matrix r 1*M into a matrix with size and normalize each signal strength value according to the formula After conversion, the signal strength value collected by a reference node RP at M AP nodes can be represented by a matrix , which is a grayscale picture with a picture size of The converted signal strength value RSSI' is a grayscale value;
[0051] S1.6. Convert the grayscale pictures of the updated training set trainingDataset and validation set validationDataset in step S1.5 into RGB color pictures, and adjust the picture size to i*j*3 to adapt to the convolutional neural network model, where i and j represent the width and height of the picture, respectively;
[0052] S1.7. Divide the training set trainingDataset obtained in S1.6 into a training set split-train and a test set split-test at a ratio of 9:1.
[0053] Step two: build a convolutional neural network model, pre-train the network using the VGG16 model, and fine-tune the model, the network model mainly includes four parts: convolutional layer, pooling layer, attention mechanism and fully connected layer, input the image into the network, the image is propagated forward through the network, and the final classification accuracy is obtained at the end of the network.
[0054] In the step two, the specific steps of building the convolutional neural network model are as follows:
[0055] S2.1. The first 13 layers of VGG16 pre-trained on the ImageNet dataset are used as a feature extractor and the model parameters are frozen, as shown in Figure 1 The first 13 layers block1-block5 are composed of convolutional layers and pooling layers, and the input i*j*3 three-channel RGB picture extracts features F.
[0056] S2.2. Add a channel attention mechanism module Spatial AttentionModule after the convolutional layer and the pooling layer, the channel attention module takes the maximum value and the average value on each feature point channel, stacks the two results, adjusts the channel number using a convolution with a channel number of 1, takes the sigmoid, obtains the weight of each feature point of the input feature layer, and finally multiplies the original input feature layer to further extract features F';
[0057] S2.3. After the Spatial Attention Module, the features F' are passed to the Flatten layer, the Dense layer, the fully connected layer, the fully connected layer uses the RELU activation function, adds a Dropout with a proportion of 0.2 to randomly delete neurons in the network to prevent overfitting, and the final output layer is a softmax layer with a class number equal to the number of floors;
[0058] S2.4. Train the convolutional neural network in batches for 20 rounds, where the input data is an i*j*3 RGB picture, and the label is the floor ID. Evaluate the floor classification accuracy of the test set split-test, the loss value, and draw the accuracy and loss curve graphs as shown in Figure 3A and 3B Figure 3A and 3B Floor classification loss function curve and accuracy curve
[0059] Figure 3A The accuracy accuracy curve of the training set and test set for 20 rounds is shown in, with a final test set accuracy of 98.365% and a training set accuracy of 99.124%; Figure 3B The loss function loss curve of the training set and test set for 20 rounds is shown in, with a final test set loss value of 0.0028 and a training set loss value of 0.0021.
[0060] Step three: build a machine learning model framework, use three linear regression algorithms of decision tree, random forest, and K nearest neighbor to predict the position, predict the latitude and longitude coordinates of each reference node RP according to the WiFi fingerprint data, and evaluate and select the optimal machine learning model according to the latitude and longitude mean square error MSE and R square value R2_score indicators of the validation set validationDataset and test set split-test in step one, and calculate the average positioning error between the predicted value coordinates and the actual coordinates under the optimal regression model.
[0061] In step three, the machine learning model evaluation selection steps are as follows:
[0062] S3.1. Use the decision tree regression model, with a tree maximum depth max_depth of 27, a minimum sample number min_samples_leaf of 8 contained in each leaf node, and a random generator seed random_state of 42. Train and predict the latitude and longitude coordinates.
[0063] S3.2. Use the random forest regression model, with a decision tree number n_estimators of 23, a maximum feature number max_features of 24, a tree maximum depth max_depth of 84, and a random generator seed random_state of 42. Train and predict the latitude and longitude coordinates.
[0064] S3.3. Use the KNN nearest centroid regression model, with a K value of 3, and a distance weight weights of the neighbor sample selected as an inverse proportion of the distance. Train and predict the latitude and longitude coordinates.
[0065] S3.4. The coordinates of the three machine learning algorithms are summarized, and the machine learning model is evaluated according to the mean square error MSE and the R-square value R2_score. The calculation formulas of MSE and R2_score are as follows:
[0066]
[0067] Where m is the sample size, y (i) is the true value of the i-th sample, is the predicted value of the i-th sample, is the sample mean, is the sample mean square error, and Var(y) is the sample variance.
[0068] Select the regression model with low MSE and high R2_score as the optimal positioning model;
[0069] S3.5. Draw the coordinate deviation graph of the training set split-train and the test set split-test under the optimal positioning model and calculate the positioning error value, as shown in Figure 5A and 5B The more crosses cover the dots, the more accurate the positioning is.
[0070] S3.6. Calculate the positioning error value under the optimal positioning model according to the Euclidean distance formula, and the Euclidean distance formula is as follows:
[0071]
[0072] Where long_pred is the predicted longitude value, longitude is the actual longitude value, lat_pred is the predicted latitude value, and latitude is the actual latitude value.
[0073] According to the above WiFi fingerprint indoor floor identification and position estimation method, the embodiment of the application is as follows:
[0074] Using the UJIIndoorLoc dataset, the training set trainingDataset and the validation set validationDataset are preprocessed, and after deleting duplicate data, the training data is 19276, the validation data is 1111, the number of nodes is 446 after removing duplicate nodes, invalid nodes and high similarity nodes, the nearest square root number is 441, 5 signalless nodes are deleted, and a total of 441 AP nodes. The data set format is shown in Table 1, and each data is the signal strength r 1*441 matrix received by the reference node RP at the 441 AP nodes, and the longitude, latitude and floor ID of the reference node RP constitute the WiFi fingerprint data. The r 1*441The matrix is converted to a size of 21*21 r 21*21 The matrix, each signal strength value is converted to a size of 21*21 r The formula is normalized, the signal strength matrix is converted to a gray image, and each received signal strength value RSSI represents the gray value of the gray image. The training set trainingDataset data is divided into training set split-train and test set split-test in a ratio of 9:1, wherein the training sample is 17538 and the test sample is 1838.
[0075] Table 1, data set format
[0076]
[0077] A convolutional neural network model is built, and transfer learning and fine-tune fine-tuning are performed based on the VGG16 convolutional neural network, as shown in Figure 1 、 As shown in Figure 2 The VGG16 network has 16 layers, and the first 13 layers are divided into 5 blocks, each block consisting of a convolutional layer and a pooling layer. The network parameters of the first 13 layers are frozen for feature extraction, and the features are further extracted through the spatial attention module Spatial Attention Module. Then, the flattened layer Flatten layer, the fully connected layer with the activation function of RELU, the Dropout with the proportion of 0.4, and the Softmax function are used for floor classification.
[0078] The input picture size of the VGG16 network is not less than 32*32, and the channel number is 3, so the original 21*21 gray image is enlarged and converted into a color image with three channels of RGB. The optimizer is configured as Adam, the loss function is MSE, and the data is trained for 20 rounds in 80 batches until the data converges. The final test set loss function is as low as 0.0028, and the accuracy is 98.365%. The use of the spatial attention module Spatial Attention Module improves the accuracy by 2.751%. In the article “Low-Effort Place Recognition with WiFi Fingerprints Using Deep Learning”, the test set split-test sample accuracy of the deep neural network DNN used for floor identification and classification is 92%, and the accuracy of the convolutional neural network model of the present case is improved by 6.365%.
[0079] Three kinds of machine learning models are built: a decision tree regression model, the maximum depth of the tree max_depth is 27, the minimum sample number contained by each leaf node min_samples_leaf is 8, and the seed of the random generator random_state is 42; a random forest regression model, the number of decision trees n_estimators is 23, the maximum number of features max_features is 24, the maximum depth of the tree max_depth is 84, and the seed of the random generator random_state is 42; a KNN nearest neighbor regression model, the K value is 3, and the weight of the nearest neighbor sample is selected as the distance weight.
[0080] The three kinds of machine learning algorithms are trained respectively to predict the longitude long_pred and the latitude lat_pred of each reference node, and the mean square error MSE and the R square value R2-score are used for comprehensive evaluation, as shown in Figure 4A and Figure 4B As shown in the figures, the RFR random forest regression with the lowest MSE and the highest R2-score is used as the optimal model. The longitude true value of the reference node RP is longitude, and the latitude true value is latitude. The positioning error is calculated according to the Euclidean distance formula, and the positioning error of the random forest regression model is 2.27 m. The actual position and the predicted position distribution diagram is shown in Figure 5A and Figure 5B As shown in the figures, 5A is the actual position and the predicted position distribution diagram of the training set, 5B is the actual position and the predicted position distribution diagram of the test set, and CCpos: WiFi Fingerprint Indoor Positioning System Based on CDAE-CNN uses the CDAE-CNN network model to achieve an average positioning error of 12.4 m on the UJIIndoorLoc data set. Compared with the prior art, the positioning error is further reduced.
[0081] In the method of the application, the reference node RP receives a plurality of AP signal strengths RSS corresponding to floors and coordinates, synthesizes WiFi position fingerprint information, and proposes a convolutional neural network model and a machine learning regression algorithm to realize indoor floor identification and position estimation based on the position fingerprint information. The method mainly includes the following three parts: fingerprint data preprocessing, filtering of repeated and high-similarity data; the convolutional neural network uses transfer learning and spatial position attention mechanism to train the classifier; and the position is predicted by decision tree regression, random forest regression and KNN regression. The final floor identification accuracy is as high as 98.365%, the positioning error of the decision tree regression algorithm is the lowest, which is 2.27 m, the floor identification accuracy is improved by about 8% compared with the deep neural network DNN, the positioning error of the CDAE-CNN regression prediction model is reduced by about 10 m, and the problems of low indoor positioning floor identification accuracy and high position estimation error rate are solved.
Claims
1. A WiFi fingerprint indoor floor identification and position estimation method, characterized in that, Comprising the following steps: Step one, divide the WiFi fingerprint data into training set trainingDataset and validation set validationDataset, and preprocess the WiFi fingerprint data, remove redundant fingerprint data and invalid AP nodes, and convert the RSSI value into a matrix representing a grayscale picture, and divide the training set trainingDataset after data preprocessing into training set split-train and test set split-test; Step two, build a convolutional neural network model, based on VGG16 model pre-training network transfer learning and fine-tune, network model includes four parts of convolutional layer, pooling layer, attention mechanism and fully connected layer, input image network, image through the network forward propagation, get the final classification accuracy at the end of the network; Step three, build a machine learning model framework, predict the position by decision tree, random forest, K nearest neighbor three linear regression algorithm, predict the latitude and longitude coordinates of each reference node RP according to the WiFi fingerprint data, evaluate and select the optimal machine learning model according to the mean square error MSE and R square value R2_score of latitude and longitude of validation set validationDataset and test set split-test in step one, and calculate the average positioning error between the predicted value coordinates and the actual coordinates under the optimal regression model; In step one, the specific steps of data preprocessing are as follows: S1.
1. Use drop_duplicates to delete duplicate fingerprint data; S1.
2. Detect the building range of AP node, calculate the frequency of occurrence in different buildings, and delete the AP node with the same frequency, which is considered as invalid node; S1.
3. All reference nodes RP receive signal strength matrix rssi at j AP node, n AP nodes form n rssi matrix, find AP node with similarity higher than 90% and variance of 0 between n rssi matrix and delete, the number of AP nodes after screening is N; S1.
4. Take N adjacent square root number M, by increasing or decreasing the signal AP node, the signal strength received by all reference nodes RP is 110; At this time, there are M AP nodes, and the RP node collects the signal strength matrix r 1*M The WiFi data fingerprint is composed of floor ID, latitude and longitude coordinates. S1.
5. Update the training set (trainingDataset) and validation set (validationDataset) according to steps S1.1 to S1.4, and change the signal strength matrix r. 1*M Convert size to matrix And for each signal strength value, according to the formula After normalization and transformation, the signal strength values collected by a reference node RP from M AP nodes can be obtained through... The matrix is represented as a grayscale image, with a size of [missing information]. The converted signal strength value RSSI′ is a grayscale value; S1.
6. Convert the gray pictures of training set trainingDataset and validation set validationDataset updated in step S1.5 to RGB color pictures, and adjust the picture size to i*j*3 to adapt to the convolutional neural network model, wherein i and j represent the width and height of the picture respectively; S1.
7. Divide the training set trainingDataset obtained in S1.6 into training set split-train and test set split-test in the ratio of 9:1; In step two, the specific steps of building convolutional neural network model are as follows: S2.
1. The first 13 layers of VGG16 pre-trained on ImageNet dataset are used as feature extractor and the model parameters are frozen, the first 13 layers block1-block5 are composed of convolutional layer and pooling layer, and i*j*3 three channel RGB picture is input to extract feature F; S2.
2. Add channel attention mechanism module Spatial Attention Module after convolutional layer and pooling layer, take the maximum value and average value of each feature point in the channel, stack the two results, adjust the channel number by one convolution with channel number 1, take sigmoid, get the weight value of each feature point in the input feature layer, and finally multiply the original input feature layer to further extract feature F'; S2.
3. After the Spatial Attention Module, the feature F' is passed to the Flatten layer, Dense layer, the full connection layer uses the RELU activation function, and the Dropout is added with a ratio of 0.2 to randomly delete neurons in the network to prevent overfitting, and the final output layer is a softmax layer with a class number of the floor number; S2.
4. The convolutional neural network is trained in batches for 20 rounds, wherein the input data is an RGB picture of i*j*3, the label is the floor ID, the split-test floor classification accuracy and loss value are evaluated, and the accuracy and loss curve diagram are drawn.
2. The WiFi fingerprint indoor floor identification and position estimation method of claim 1, wherein, In step three, the machine learning model evaluation selection steps are as follows: S3.
1. Using the decision tree regression model, the maximum depth max_depth is 27, the minimum sample number min_samples_leaf contained in each leaf node is 8, the random generator seed random_state is 42, and the longitude and latitude coordinates are trained and predicted; S3.
2. Using the random forest regression model, the number of decision trees n_estimators is 23, the maximum feature number max_features is 24, the tree maximum depth max_depth is 84, the random generator seed random_state is 42, and the longitude and latitude coordinates are trained and predicted; S3.
3. Using the KNN nearest centroid regression model, the K value is 3, the weight weights of the nearest neighbor samples are selected as the distance weight and the distance is inversely proportional, and the longitude and latitude coordinates are trained and predicted; S3.
4. The coordinates trained and predicted by the three machine learning algorithms are summarized, and the machine learning model is evaluated according to the mean square error MSE and the R square value R2_score, and the calculation formula of MSE and R2_score is as follows: where m is the number of samples, y (i) is the true value of the i-th sample, is the predicted value of the i-th sample, is the sample mean, is the sample mean square error, and Var(y) is the sample variance. Select the regression model with low mean square error MSE and high R square value R2_score as the optimal positioning model; S3.
5. Draw the coordinate deviation diagram of the training set split-train and the test set split-test under the optimal positioning model and calculate the positioning error value; S3.
6. Calculate the positioning error value under the optimal positioning model according to the Euclidean distance formula, and the Euclidean distance formula is as follows: Wherein, long_pred is the longitude prediction value, longitude is the actual longitude value, lat_pred is the latitude prediction value, and latitude is the actual latitude value.
Citation Information
Patent Citations
Indoor positioning method and device based on WiFi signal, and storage medium
CN111044974A
WiFi fingerprint indoor positioning method based on random forest and auto-encoder
CN111461251A