Three-dimensional indoor positioning method and system based on Wi-Fi signal and multi-graph convolutional network
By constructing a three-dimensional indoor positioning method based on Wi-Fi signals and multiple graph convolutional networks, a four-layer convolutional network model is used to solve the problem of inaccurate positioning in multi-story buildings, high-precision three-dimensional positioning is achieved, and overfitting self-correction ability is provided.
Patent Information
- Application Number
- CN202510700365.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-28
- Publication Date
- 2025-08-26
AI Technical Summary
The existing two-dimensional indoor positioning technology cannot effectively distinguish users on different floors in multi-story buildings, resulting in large errors in positioning results. Especially in large multi-story buildings, the signal from an access point will be received by users on multiple floors, resulting in multiple different RSSI features in the same two-dimensional coordinate, affecting the positioning accuracy.
A three-dimensional indoor positioning method based on Wi-Fi signals and multiple graph convolutional networks is constructed. A four-layer convolutional network model is adopted, including graph samples and aggregate networks, graph convolutional neural networks, and graph attention neural networks. By constructing a three-dimensional indoor positioning model, it uses residual connections and heterogeneous graphs to perform feature aggregation and positioning, and adds floor data to achieve three-dimensional positioning.
The positioning error in large multi-story buildings is about 0.5 meters, which is significantly better than the existing two-dimensional model, and has the ability to overfit self-correct, which improves the accuracy and stability of positioning.
Smart Images

Figure CN120547673A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of indoor positioning technology, and specifically relates to a three-dimensional indoor positioning method and system based on Wi-Fi signals and multiple graph convolutional networks. Background Art
[0002] Accurate indoor positioning can greatly facilitate people's lives. This is especially true in large, multi-story buildings, such as parking lots, hospitals, and shopping malls. Precise indoor positioning is crucial for navigation and emergency rescue. Although the Global Positioning System (GPS) performs excellently in outdoor environments, non-line-of-sight (NLOS) conditions indoors can cause unstable GPS signal transmission. Furthermore, signal attenuation and multipath effects caused by complex structures such as walls and obstacles can significantly reduce GPS positioning accuracy indoors. Current indoor positioning technologies are mostly based on a two-dimensional spatial model, assuming that all users are on the same plane. Such positioning methods cannot effectively distinguish between users on different floors with the same two-dimensional coordinates. Ignoring floor information or height can lead to significant errors in positioning results in critical scenarios such as navigation and emergency rescue. Furthermore, in large, multi-story buildings, the signal from a single access point (AP) can be received by users on many different floors, resulting in multiple different RSSI signatures for the same two-dimensional coordinate. This can lead to significant deviations in positioning results and affect subsequent activities based on the positioning results.
[0003] In recent years, machine learning has gradually permeated various industries, and its application in problem solving is widespread. Similarly, machine learning can be applied to indoor positioning. Indoor Wi-Fi signals attenuate nonlinearly with distance due to non-line-of-sight (NLOS) conditions and are difficult to represent. However, machine learning can continuously learn the changing patterns of Wi-Fi RSSI values through convolutional layers and activation functions. Using nonlinear activation functions and feature aggregation, it can derive the relationship between signal attenuation and distance, thereby helping us achieve better indoor positioning accuracy. Some existing technologies directly employ graph convolutional neural networks for indoor positioning. However, because existing technologies have a high probability of inaccurate inter-floor positioning in multi-story buildings, most rely on two-dimensional planes for positioning. Summary of the Invention
[0004] In response to the deficiencies in the prior art, the present invention provides a three-dimensional indoor positioning method and system based on Wi-Fi signals and multiple graph convolutional networks, which can achieve accurate positioning in multi-story building positioning environments.
[0005] The present invention provides the following technical solutions:
[0006] In a first aspect, a three-dimensional indoor positioning method based on Wi-Fi signals and multiple graph convolutional networks is provided, including:
[0007] Construct data and heterogeneous graphs, and build and train a 3D indoor positioning model based on the heterogeneous graphs. The 3D indoor positioning model uses a four-layer convolutional network, and the input features of each convolutional network are added to the output of the current layer using residual connections as the input of the next layer. The four-layer convolutional network is specifically composed of: the first layer is a graph sample and aggregation network, the second layer is a graph convolutional neural network, the third layer is a graph attention neural network, and the fourth layer is a graph sample and aggregation network.
[0008] Obtain the access point identifier and corresponding RSSI value of each WiFi connection between the node to be positioned and each WiFi connection, and use the trained three-dimensional indoor positioning model to perform three-dimensional positioning of the node to be positioned.
[0009] Optionally, constructing the data and the heterogeneous graph, and constructing and training the three-dimensional indoor positioning model based on the heterogeneous graph, including training the three-dimensional indoor positioning model, specifically includes:
[0010] Assign a unique integer identifier to each WiFi access point;
[0011] Obtain the 2D coordinates of several path points and their corresponding floor information to form a 3D position. Associate the 3D position, timestamp, access point identifiers of all Wi-Fi connections, and normalized RSSI values to construct a dataset. When constructing the training set, delete the 3D positions of some nodes as unknown path points.
[0012] Construct a heterogeneous graph G based on known path points, unknown path points and WiFi access points;
[0013] G=(V,e,F V ,F E )
[0014] V=(V WP ,V AP ,V inknownWP )
[0015] E=(E AP→WP ,E WP→AP ,E AP→unknownWP ,E unknownWP→AP )
[0016] Among them, V is the set of vertex types in the graph, E is the set of edge types in the graph, and F V Represents the set of features of the points in the graph, F E Represents the set of features of the edges in the graph, V WP Represents a known path point, which is characterized by its three-dimensional coordinates at the current timestamp; V APRepresents a WiFi access point, and its characteristic value is the unique identifier of the WiFi access point; V unknownWP Represents an unknown path point, set it to a full 1 vector; E AP→WP Represents the connection relationship between the Wi-Fi access point and the known path point, which is characterized by the received signal strength indicator value between the path point and the current Wi-Fi access point at the current timestamp, E WP→AP Represents the connection relationship between the Wi-Fi access point and the known path point, which is characterized by the received signal strength indicator value between the point and the current Wi-Fi access point at the current timestamp, E AP→unknownWP 、E unknownWP→AP Both represent the connection relationship between a Wi-Fi access point and an unknown path point, and their features are the received signal strength indicator value between the point and the current Wi-Fi access point at the current timestamp;
[0017] Using mean square error as the loss function, the heterogeneous image is input into the 3D indoor positioning model for model training.
[0018] Optionally, the constructing of data and heterogeneous graphs, and constructing and training a three-dimensional indoor positioning model based on the heterogeneous graphs, includes constructing a three-dimensional indoor positioning model, wherein, when constructing the three-dimensional indoor positioning model, the first layer graph samples and the aggregation network and the fourth layer graph samples and the aggregation network in the three-dimensional indoor positioning model are respectively used to perform mean aggregation on neighbor node features to update the node feature representation, specifically including the following steps:
[0019] Use the Top-k sampling method to select the k neighbor nodes with the highest weight for mean aggregation;
[0020]
[0021] The current node features and neighbor node features are respectively sent to the fully connected network and added to obtain the output results of the graph sample and the aggregation network;
[0022]
[0023] in, is the feature of neighbor node j of node i in layer l, For nodes After the graph sample and aggregation network update, the features at the l+1 layer, is the set of all neighbor nodes of node i, aggregate is the mean aggregation operation, W gsa It is the learnable weight matrix of the graph sample and the aggregation network of the first layer or the graph sample and the aggregation network of the fourth layer. concat represents the concatenation operation of the two feature matrices.
[0024] Optionally, the constructing of data and heterogeneous graphs, and constructing and training a three-dimensional indoor positioning model based on the heterogeneous graphs, includes constructing a three-dimensional indoor positioning model, wherein, when constructing the three-dimensional indoor positioning model, a graph convolutional neural network of the second layer in the three-dimensional indoor positioning model is used to perform weighted summation and normalized feature aggregation on neighbor nodes to update the node feature representation, specifically including:
[0025] Based on the topological relationship between each node in the heterogeneous graph G, the adjacency matrix A is constructed, and the adjacency matrix is normalized according to the adjacency matrix with self-connection added to obtain the normalized adjacency matrix
[0026] Normalized adjacency matrix Combining the node feature matrix and weight matrix, the update function of each node is obtained through a nonlinear activation function;
[0027]
[0028] in, is the feature of neighbor node j of node i in layer l, is the feature of node i in the l+1th layer of the graph convolutional neural network, σ represents the nonlinear activation function, and b (l) is the bias term of the lth layer, which adjusts the output of the node after linear change; c ji is the normalization factor of the node, which is the product of the square root of the degree of node i and node j; and They represent all neighboring nodes connected to node i and node j respectively; W (l) is the learnable weight matrix of layer l.
[0029] Optionally, constructing data and a heterogeneous graph, and constructing and training a three-dimensional indoor positioning model based on the heterogeneous graph includes constructing a three-dimensional indoor positioning model, wherein, when constructing the three-dimensional indoor positioning model, a graph attention neural network in the third layer of the three-dimensional indoor positioning model is used to dynamically assign a weight to each neighbor node to update the node feature representation, specifically including:
[0030] Input the edge features of the heterogeneous graph G, use a multi-layer perceptron to calculate the attention between node i and its neighbor node j, and activate it through the activation function;
[0031] e ij =LeakyReLU(a T [Wh i ‖Wh j ])
[0032] Among them, e ij is the attention between the activated node i and its neighbor node j; aT is the transpose of the attention weight matrix, Wh i is the result of linear transformation of the original feature vector of node i through the learnable weight matrix W, Wh j is the result of linear transformation of the original feature vector of node j through the learnable weight matrix W.
[0033] Normalize the attention of node i and its neighboring nodes;
[0034]
[0035] Among them, α ij is the normalized attention weight, is the transpose of the attention weight matrix, is the result of linear transformation of the original feature vector of node i through the learnable weight matrix W. is the result of linear transformation of the original feature vector of node j through the learnable weight matrix W;
[0036] The normalized attention weight α ij Perform weighted summation with neighbor node features to update node feature representation;
[0037]
[0038] in, is the feature representation after being updated by the graph attention neural network, and σ() is the activation function.
[0039] Optionally, the three-dimensional position, timestamp, access point identifiers of all WiFi connections, and normalized RSSI values are associated to construct a data set, and the RSSI values of each node connected to the WiFi are arranged in descending order. Only RSSI values whose strength exceeds a set threshold or the top N numbers are used for actual training, and the RSSI values actually used for training are normalized.
[0040] In the second aspect, a three-dimensional indoor positioning system based on Wi-Fi signals and multiple graph convolutional networks is provided, including:
[0041] The model training module is used to construct data and heterogeneous graphs, and to build and train a 3D indoor positioning model based on the heterogeneous graphs. The 3D indoor positioning model uses a four-layer convolutional network, and the input features of each convolutional network layer are added to the output of the current layer using a residual connection as the input of the next layer. The four-layer convolutional network is specifically composed of: the first layer is a graph sample and aggregation network, the second layer is a graph convolutional neural network, the third layer is a graph attention neural network, and the fourth layer is a graph sample and aggregation network.
[0042] The positioning module is used to obtain the access point identifier and corresponding RSSI value of the node to be positioned and each WiFi connection, and use the trained three-dimensional indoor positioning model to perform three-dimensional positioning of the node to be positioned.
[0043] In a third aspect, a computer device is provided, comprising a processor and a memory; wherein, when the processor executes a computer program stored in the memory, the steps of the three-dimensional indoor positioning method based on Wi-Fi signals and multiple graph convolutional networks as described in any one of the first aspects are implemented.
[0044] In a fourth aspect, a computer-readable storage medium is provided for storing a computer program; when the computer program is executed by a processor, the steps of the three-dimensional indoor positioning method based on Wi-Fi signals and multiple graph convolutional networks as described in any one of the first aspects are performed.
[0045] Compared with the prior art, the present invention has the following beneficial effects:
[0046] The 3D indoor positioning model used in this invention incorporates floor data into the input 2D coordinates, embeds 3D space into the model for training and learning, constructs a heterogeneous graph based on 3D space, varies the input and output dimensions between networks, integrates graph convolutional neural networks, graph sample and aggregation networks, and graph attention networks into the same model, and incorporates a residual network to prevent overfitting. The proposed 3D indoor positioning method achieves accurate 3D positioning, maintaining a positioning error of approximately 0.5 meters in large, multi-story buildings, significantly outperforming existing 2D models and single-layer graph convolutional neural networks.
[0047] In addition, when the model used in the present invention overfits during the training process, it can correct the overfitting phenomenon by continuing training, thereby ensuring the performance of the model in new data. Therefore, the three-dimensional indoor positioning model used in this application has the ability to self-correct overfitting. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 It is the heterogeneous graph construction result of the present invention;
[0049] Figure 2 It is a structural diagram of the three-dimensional indoor positioning model of the present invention;
[0050] Figure 3 It is a schematic diagram of the specific situation of the experimental data set of the present invention;
[0051] Figure 4 is a diagram showing the change in positioning error in Experiment 1 of Example 2 of the present invention;
[0052] Figure 5 This is a diagram showing the change in positioning error in Experiment 2 of Example 2 of the present invention. DETAILED DESCRIPTION
[0053] The present invention will be further described below with reference to the accompanying drawings. The following examples are only used to more clearly illustrate the technical solutions of the present invention and are not intended to limit the scope of protection of the present invention. It should be noted that the term "comprising" and any variations thereof in the specification and claims of the present invention and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0054] Example 1
[0055] A 3D indoor positioning method based on Wi-Fi signals and multiple graph convolutional networks is provided, comprising the following steps:
[0056] S1: Build data and heterogeneous graphs, and build and train a 3D indoor positioning model based on the heterogeneous graphs.
[0057] Step S1 can be divided into the following sub-steps:
[0058] S11: Build dataset.
[0059] Specifically, step S11 further includes:
[0060] S11-1: Filter the data set containing two-dimensional coordinates to extract the information required for training and remove other irrelevant information.
[0061] S11-2: Arrange the RSSI values of each path point and the WiFi connection from largest to smallest, and only use the values with the largest strength as the actual training data set. For example, only the RSSI values with strengths exceeding a set threshold or the top N values are used for actual training. At the same time, in order to eliminate the differences in numerical scales between different features, the RSSI needs to be normalized. The specific normalization formula is:
[0062]
[0063] Where z is the normalized result, x is the value of the original RSSI data, μ is the mean of the RSSI data, and σ is the standard deviation of the RSSI data.
[0064] S11-3: Data Supplementation: Assign a unique integer identifier to each WiFi access point; since the floor data of the data file is not directly represented in the data. It is necessary to add the corresponding floor information after each existing coordinate to expand the two-dimensional data set into a three-dimensional data set. Next, we will integrate the existing data, combine and associate the timestamp, location, and current location with the received signal strength value of each Wi-Fi access point, so as to facilitate the subsequent reading of the data. Since different Wi-Fi access points have different unique identifiers, in order to facilitate the calculation of the model, the unique identifier of each Wi-Fi access point will be converted into a continuous integer index.
[0065] S11-4: Data Processing and Segmentation: Delete the coordinates of 50% of the known nodes in the data as new nodes to be predicted, and update their connection relationships with Wi-Fi access points. Then, split all the data into training, test, and validation sets.
[0066] S12: Based on known path points, unknown path points and WiFi access points, a heterogeneous graph G is constructed, such as Figure 1 As shown, Figure 1 The middle AP node represents the Wi-Fi access point, the green WP node represents the known path point, and the red WP node represents the unknown path point to be predicted.
[0067] G=(V,E,F V ,F E )
[0068] V=(V WP ,V AP ,V unknownWP )
[0069] E=(E AP→WP ,E WP→AP ,E AP→unknownWP ,E unknownWP→AP )
[0070] Among them, V is the set of vertex types in the graph, there are three types of points, E is the set of edge types in the graph, F V Represents the set of features of the points in the graph, F E Represents the set of features of the edges in the graph, V WP Represents a known path point, the feature of which is the 3D coordinate at the current timestamp. A path point refers to a point where the continuous path of the user's movement is segmented according to the timestamp; V AP Represents a WiFi access point, and its characteristic value is the unique identifier of the WiFi access point; V unknownWP Represents an unknown path point, its features are erased, and for the convenience of prediction, it is set to a full 1 vector; EAP→WP Represents the connection relationship between the Wi-Fi access point and the known path point, which is characterized by the received signal strength indicator value between the path point and the current Wi-Fi access point at the current timestamp, E WP→AP Represents the connection relationship between the Wi-Fi access point and the known path point, which is characterized by the received signal strength indicator value between the point and the current Wi-Fi access point at the current timestamp, E WP→AP and E AP→WP It is divided into two categories, which can make graph convolutional network operations more portable; E AP→unknownWP 、E unknownWP→AP Both represent the connection relationship between the Wi-Fi access point and the unknown path point. The features are the received signal strength indicator value between the point and the current Wi-Fi access point at the current timestamp. Similarly, E AP→unknownWP 、E unknownWP→AP It is divided into two categories to facilitate the calculation of the three-dimensional indoor positioning model.
[0071] S13: Construction of three-dimensional indoor positioning model.
[0072] The 3D indoor positioning model uses a four-layer convolutional network, and the input features of each layer of the convolutional network are added to the output of the current layer using residual connections as the input of the next layer; the four-layer convolutional network is specifically as follows: the first layer is a graph sample and aggregation network, the second layer is a graph convolutional neural network, the third layer is a graph attention neural network, and the fourth layer is a graph sample and aggregation network.
[0073] Specific as Figure 2 As shown in the figure, the first layer is the graph sampling and aggregation network, which updates the node feature representation by aggregating neighbor node features by mean. The second layer is the graph convolutional neural network, which aggregates neighbor node features by weighted summation and normalization, thereby better capturing the feature relationships of the entire graph. The third layer is the graph attention neural network, which dynamically assigns weights to each neighbor node through an attention mechanism, allowing the model to focus more on neighbor nodes that have a greater impact on the node. The fourth layer is the graph sampling and aggregation network, which further fuses the node feature representations, enabling the model to integrate the learning results of the previous convolutional layers. Each convolutional layer is associated with a residual network. The features input to this layer are added to the results of the previous convolutional layer using residual connections as the input to the next convolutional layer. This not only preserves the results learned by the first convolutional layer but also provides richer features for subsequent convolutional layers.
[0074] Specifically, S13 includes:
[0075] S13-1: Graph samples and aggregation networks.
[0076] When building a 3D indoor positioning model, the first-layer graph sample and aggregation network and the fourth-layer graph sample and aggregation network in the 3D indoor positioning model are used to average the neighbor node features to update the node feature representation. Specifically, the following steps are included:
[0077] Use the Top-k sampling method to select the k neighbor nodes with the highest weights for mean aggregation. Specifically, you can choose to use the MEAN aggregator.
[0078]
[0079] The current node features and neighbor node features are respectively sent to the fully connected network and added to obtain the output results of the graph sample and the aggregation network;
[0080]
[0081] in, is the feature of neighbor node j of node i in layer l, For nodes After the graph sample and aggregation network update, the features at the l+1 layer, is the set of all neighbor nodes of node i, aggregate is the mean aggregation operation, W gsa It is the learnable weight matrix of the graph sample and the aggregation network of the first layer or the graph sample and the aggregation network of the fourth layer. concat represents the concatenation operation of the two feature matrices.
[0082] S13-2: Graph Convolutional Networks.
[0083] When building a 3D indoor positioning model, the second-layer graph convolutional neural network in the 3D indoor positioning model performs weighted summation and normalized feature aggregation on neighboring nodes to update the node feature representation. Specifically, the following steps are performed:
[0084] Based on the topological relationship between each node in the heterogeneous graph G, the adjacency matrix A is constructed, and the adjacency matrix is normalized according to the adjacency matrix with self-connection added to obtain the normalized adjacency matrix
[0085] Graph convolutional networks rely on an adjacency matrix to process the topological relationships between data. Assuming there are N nodes in the data, each with its own unique features, we combine these node features to obtain an N*D matrix X. The connections between each node also form an N*N matrix, where D represents the number of features per node and R represents the set of real numbers. This matrix is the adjacency matrix, which we denote as A. Next, we describe the propagation method between neural network layers in a graph convolutional neural network. The formula is:
[0086]
[0087] Among them H (l) Represents the node feature matrix of the lth layer. When l is 0, H (0) It represents the original node input feature; W (l) It represents the learnable weight matrix of the lth layer, and σ represents a nonlinear activation function. is the normalized adjacency matrix, and the normalized formula is:
[0088]
[0089] in, To add a self-connected adjacency matrix, it is obtained by adding the original adjacency matrix A to the identity matrix I. This enables the graph convolutional network to retain the node's own feature information during convolution operations. yes The degree matrix of .
[0090] Normalized adjacency matrix Combining the node feature matrix and weight matrix, the update function of each node is obtained through a nonlinear activation function;
[0091]
[0092] in, is the feature of neighbor node j of node i in layer l, is the feature of node i in the l+1th layer of the graph convolutional neural network, σ represents the nonlinear activation function, and b (l) is the bias term of the lth layer, which introduces additional degrees of freedom into the model by adjusting the output of the node after linear change, thereby improving the fitting ability of the model; c ji is the normalization factor of the node, which is the product of the square root of the degree of node i and node j; and They represent all neighboring nodes connected to node i and node j respectively; W (l) is the learnable weight matrix of layer l.
[0093] S13-3: Graph Attention Neural Network
[0094] When building a 3D indoor positioning model, the third-layer graph attention neural network in the 3D indoor positioning model is used to dynamically assign weights to each neighboring node to update the node feature representation. Specifically, the following steps are performed:
[0095] Calculate the attention e between node i and its neighbor node j ij , the formula is:
[0096] e ij =φ(Wh i ,Wh j )
[0097] The multilayer perceptron (MLP) is used as a function to calculate the attention score. The multilayer perceptron inputs the edge feature, that is, the RSSI value of the corresponding connection relationship, and then generates the edge weight parameter through the Sigmoid activation function and maps it to the range of (0,1). However, due to the obtained attention score e ij Before activation by the activation function, the node features mapped by the learnable weight matrix W are concatenated, and then dot product operation is performed with the transpose of the weight vector. Finally, the LeakyReLU activation function is used. The formula is as follows:
[0098] e ij =LeakyReLU(a T [Wh i ‖Wh j ])
[0099] Among them, e ij is the attention between the activated node i and its neighbor node j; a T is the transpose of the attention weight matrix, Wh i is the result of linear transformation of the original feature vector of node i through the learnable weight matrix W, Wh j is the result of linear transformation of the original feature vector of node j by the learnable weight matrix W.
[0100] In order to aggregate information and weight it, we also need to normalize the current attention score so that the sum of all weights is 1. The formula and expansion are as follows:
[0101]
[0102] Among them, α ij is the normalized attention weight, is the transpose of the attention weight matrix, is the result of linear transformation of the original feature vector of node i through the learnable weight matrix W. is the result of linear transformation of the original feature vector of node j by the learnable weight matrix W.
[0103] The normalized attention weight α ij Perform weighted summation with neighbor node features to update node feature representation;
[0104]
[0105] in, is the feature representation after being updated by the graph attention neural network, and σ() is the activation function.
[0106] S13-4: Residual Network.
[0107] The residual network uses skip connections to connect the input directly to the output through residual blocks. The residual features are obtained through two layers of neural network layers containing weight parameters and ReLU layers, and the input data is directly added to the residual. The specific formula is expressed as:
[0108]
[0109] Where W i is the i-th neural network layer containing weight parameters, x is the input feature, and y is the output feature. In the 3D indoor positioning model of this application, four residual connections are used to connect the input and output of the four convolutional layers respectively.
[0110] S14: Using mean square error as the loss function, the heterogeneous image is input into the 3D indoor positioning model for model training.
[0111] Specifically, the processed data is imported, and the model aggregates and infers features of path points at unknown locations, outputting their 3D coordinates for positioning. Based on the difference between the positioning result and the true position, the 3D positioning error distance and mean squared error loss are calculated. The mean squared error loss can be referenced in existing technologies.
[0112] S2: Obtain the access point identifier and the corresponding RSSI value of each WiFi connection between the node to be positioned and each WiFi connection, and use the trained three-dimensional indoor positioning model to perform three-dimensional positioning on the node to be positioned.
[0113] This application adds floor data to the input 2D coordinates, incorporates 3D space into the model for training and learning, constructs a heterogeneous graph based on 3D space, and changes the input and output dimensions between each network. This application uses less data, has low positioning costs, and provides accurate 3D positioning.
[0114] Example 2
[0115] Provide a specific example of using the method of this application to perform three-dimensional indoor positioning, the software used is Visual Studio Code, the CPU is 13th Gen Core TM i9-13900HX; GPU is NVIDIA GeForce RTX4060Laptop GPU. The dataset of this invention is the Microsoft Indoor Positioning Competition 2.0 dataset. A building was randomly selected from the dataset as the experimental dataset. The specific situation of each floor of the building is as shown in the attached figure. Figure 3 shown.
[0116] When constructing the dataset, surveyors continuously walked through the building, collecting the required information and their movement paths. This included timestamps, coordinate locations, unique Wi-Fi identifiers, Wi-Fi signal strength indicators (RSSIs), Bluetooth, and inertial sensors. The data was filtered to identify these information.
[0117] Arrange the RSSI values of each path point and the WiFi connection from largest to smallest, and only take the top 50 values as the actual training data set. At the same time, in order to eliminate the differences in numerical scales between different features, RSSI needs to be normalized. The specific normalization formula is:
[0118]
[0119] Where z is the normalized result, x is the value of the original RSSI data, μ is the mean of the RSSI data, and σ is the standard deviation of the RSSI data.
[0120] Since the dataset is classified according to the floors of the building, its floor data is not directly represented in the data. The corresponding floor information is added after each existing coordinate to expand the two-dimensional dataset into a three-dimensional dataset. Next, the existing data is integrated: the timestamp, current location, the unique identifier of the Wi-Fi access point connected to the current location, and the received signal strength indicator value are associated with each other to facilitate subsequent reading of the data. Since different Wi-Fi access points have different unique identifiers, in order to facilitate model calculations, the unique identifier of each Wi-Fi access point will be converted into a continuous integer index.
[0121] The coordinates of 50% of the known nodes in the data are deleted as new nodes to be predicted, and the connection relationship between them and the Wi-Fi access point is changed to establish a new connection relationship. 60% of the total data is used as the training set, 20% as the test set, and 20% as the validation set.
[0122] Heterogeneous graph construction and model construction are shown in Example 1.
[0123] Model training:
[0124] The model's learning rate was set to 0.001, the number of hidden layers was set to 8, and the Adam optimizer was selected. The mean squared error (MSE) loss function was chosen, and the 3D positioning error was calculated by calculating the Euclidean distance between the predicted point coordinates and the true coordinates. To confirm whether the model training process could correct for overfitting, two experiments were conducted.
[0125] Experiment 1: Set the number of model training times to 20,000 times.
[0126] Experiment 2: Set the number of model training times to 85,000 times.
[0127] Experiment 1 result analysis: Figure 4 As shown, Figure 4 (a) is a schematic diagram of the change of three-dimensional positioning error during the training process. Figure 4 Figure (b) shows the evolution of the mean squared error during training. It can be clearly seen that the model loss gradually decreases during training, ultimately converging to complete training. The training results show that in the training set, the mean squared error is 0.0853 and the 3D positioning error is 0.1714m. In the validation set, the mean squared error is 0.2068 and the 3D positioning error is 0.4758m. In the test set, the mean squared error is 0.1983 and the 3D positioning error is 0.4685m. All 3D positioning errors are expressed in meters.
[0128] Experiment 2 Results Analysis: As shown in the attached Figure 5 As shown, Figure 5 (a) is a schematic diagram of the change of three-dimensional positioning error during the training process. Figure 5 Figure (b) shows how the mean squared error changes during training. As can be seen, the model overfits after approximately 20,000, 40,000, and 60,000 training cycles. After approximately 1,000 to 2,000 training cycles, the model corrects itself to normal conditions.
[0129] That is to say, when the three-dimensional indoor positioning model used in this application has overfitting during the training process, the overfitting phenomenon can be corrected by continuing training, thereby ensuring the performance of the model in new data.
[0130] Example 3
[0131] A 3D indoor positioning system based on Wi-Fi signals and multiple graph convolutional networks, including:
[0132] The model training module is used to construct data and heterogeneous graphs, and to build and train a 3D indoor positioning model based on the heterogeneous graphs. The 3D indoor positioning model uses a four-layer convolutional network, and the input features of each convolutional network layer are added to the output of the current layer using a residual connection as the input of the next layer. The four-layer convolutional network is specifically composed of: the first layer is a graph sample and aggregation network, the second layer is a graph convolutional neural network, the third layer is a graph attention neural network, and the fourth layer is a graph sample and aggregation network.
[0133] The positioning module is used to obtain the access point identifier and corresponding RSSI value of the node to be positioned and each WiFi connection, and use the trained three-dimensional indoor positioning model to perform three-dimensional positioning of the node to be positioned.
[0134] For more specific details about the above method, please refer to the corresponding contents disclosed in the aforementioned embodiments, which will not be described again here.
[0135] Example 4
[0136] The present invention provides a computer device comprising a processor and a memory; wherein, when the processor executes a computer program stored in the memory, the steps of the above-mentioned three-dimensional indoor positioning method based on Wi-Fi signals and multiple graph convolutional networks are implemented.
[0137] For more specific details about the above method, please refer to the corresponding contents disclosed in the aforementioned embodiments, which will not be described again here.
[0138] Example 5
[0139] The present invention provides a computer-readable storage medium for storing a computer program; when the computer program is executed by a processor, the steps of the above-mentioned three-dimensional indoor positioning method based on Wi-Fi signals and multiple graph convolutional networks are implemented.
[0140] For more specific details about the above method, please refer to the corresponding contents disclosed in the aforementioned embodiments, which will not be described again here.
[0141] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. References to the same or similar parts between the various embodiments will be sufficient. The systems, devices, and storage media disclosed in the embodiments are described briefly because they correspond to the methods disclosed in the embodiments. For relevant details, refer to the method description.
[0142] Those skilled in the art will clearly understand that the techniques in the embodiments of the present invention can be implemented using software plus a necessary general-purpose hardware platform. Based on this understanding, the technical solutions in the embodiments of the present invention, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments of the present invention or certain portions of the embodiments.
[0143] The above are merely preferred embodiments of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions based on the principles of the present invention are within the scope of protection of the present invention. It should be noted that for those skilled in the art, various improvements and modifications that do not depart from the principles of the present invention should be considered within the scope of protection of the present invention.
Claims
1. A three-dimensional indoor positioning method based on Wi-Fi signals and multiple graph convolutional networks, characterized in that: include: Construct data and heterogeneous graphs, and build and train a 3D indoor positioning model based on the heterogeneous graphs. The 3D indoor positioning model uses a four-layer convolutional network, and the input features of each convolutional network are added to the output of the current layer using residual connections as the input of the next layer. The four-layer convolutional network is specifically composed of: the first layer is a graph sample and aggregation network, the second layer is a graph convolutional neural network, the third layer is a graph attention neural network, and the fourth layer is a graph sample and aggregation network. Obtain the access point identifier and corresponding RSSI value of each WiFi connection between the node to be positioned and each WiFi connection, and use the trained three-dimensional indoor positioning model to perform three-dimensional positioning of the node to be positioned.
2. The three-dimensional indoor positioning method based on Wi-Fi signals and multiple graph convolutional networks according to claim 1 is characterized in that: The constructing data and heterogeneous graph, and constructing and training a three-dimensional indoor positioning model based on the heterogeneous graph, including training the three-dimensional indoor positioning model, specifically includes: Assign a unique integer identifier to each WiFi access point; Obtain the 2D coordinates of several path points and their corresponding floor information to form a 3D position. Associate the 3D position, timestamp, access point identifiers of all Wi-Fi connections, and normalized RSSI values to construct a dataset. When constructing the training set, delete the 3D positions of some nodes as unknown path points. Construct a heterogeneous graph G based on known path points, unknown path points and WiFi access points; G=(V,E,F V ,F E ) V=(V WP ,V AP ,V unknownWP ) And=(And aP→WP ,AND WP→AP ,AND AP→unknownWP ,AND unknownWP→AP ) Among them, V is the set of vertex types in the graph, E is the set of edge types in the graph, and F V Represents the set of features of the points in the graph, F E Represents the set of features of the edges in the graph, V WP Represents a known path point, which is characterized by its three-dimensional coordinates at the current timestamp; V AP Represents a WiFi access point, and its characteristic value is the unique identifier of the WiFi access point; V unknownWP Represents an unknown path point, set it to a full 1 vector; E AP→WP Represents the connection relationship between the Wi-Fi access point and the known path point, which is characterized by the received signal strength indicator value between the path point and the current Wi-Fi access point at the current timestamp, E WP→AP Represents the connection relationship between the Wi-Fi access point and the known path point, which is characterized by the received signal strength indicator value between the point and the current Wi-Fi access point at the current timestamp, E AP→unknownWP 、E unknownWP→AP Both represent the connection relationship between a Wi-Fi access point and an unknown path point, and their features are the received signal strength indicator value between the point and the current Wi-Fi access point at the current timestamp; Using mean square error as the loss function, the heterogeneous image is input into the 3D indoor positioning model for model training.
3. The three-dimensional indoor positioning method based on Wi-Fi signals and multiple graph convolutional networks according to claim 1, characterized in that: The method of constructing data and heterogeneous graphs, and constructing and training a three-dimensional indoor positioning model based on the heterogeneous graphs, includes constructing a three-dimensional indoor positioning model, wherein when constructing the three-dimensional indoor positioning model, the first layer graph samples and aggregation network and the fourth layer graph samples and aggregation network in the three-dimensional indoor positioning model are used to perform mean aggregation on neighbor node features to update the node feature representation, specifically including the following steps: Use the Top-k sampling method to select the k neighbor nodes with the highest weight for mean aggregation; The current node features and neighbor node features are respectively sent to the fully connected network and added to obtain the output results of the graph sample and the aggregation network; in, is the feature of neighbor node j of node i in layer l, For nodes After the graph sample and aggregation network update, the features at the l+1 layer, is the set of all neighbor nodes of node i, aggregate is the mean aggregation operation, W gsa It is the learnable weight matrix of the graph sample and the aggregation network of the first layer or the graph sample and the aggregation network of the fourth layer. concat represents the concatenation operation of the two feature matrices.
4. The three-dimensional indoor positioning method based on Wi-Fi signals and multiple graph convolutional networks according to claim 1, characterized in that: The method of constructing data and heterogeneous graphs, and constructing and training a three-dimensional indoor positioning model based on the heterogeneous graphs, includes constructing a three-dimensional indoor positioning model. When constructing the three-dimensional indoor positioning model, a graph convolutional neural network in the second layer of the three-dimensional indoor positioning model is used to perform weighted summation and normalized feature aggregation on neighboring nodes to update node feature representation, specifically including: Based on the topological relationship between each node in the heterogeneous graph G, the adjacency matrix A is constructed, and the adjacency matrix is normalized according to the adjacency matrix with self-connection added to obtain the normalized adjacency matrix Normalized adjacency matrix Combining the node feature matrix and weight matrix, the update function of each node is obtained through a nonlinear activation function; in, is the feature of neighbor node j of node i in layer l, is the feature of node i in the l+1th layer of the graph convolutional neural network, σ represents the nonlinear activation function, and b (l) is the bias term of the lth layer, which adjusts the output of the node after linear change; c ji is the normalization factor of the node, which is the product of the square root of the degree of node i and node j; and They represent all neighboring nodes connected to node i and node j respectively; W (l) is the learnable weight matrix of layer l.
5. The three-dimensional indoor positioning method based on Wi-Fi signals and multiple graph convolutional networks according to claim 1, characterized in that: The data and heterogeneous graph are constructed, and a three-dimensional indoor positioning model is constructed and trained based on the heterogeneous graph, including constructing a three-dimensional indoor positioning model. When constructing the three-dimensional indoor positioning model, the weight of each neighbor node is dynamically assigned using the third-layer graph attention neural network in the three-dimensional indoor positioning model to update the node feature representation, specifically including: Input the edge features of the heterogeneous graph G, use a multi-layer perceptron to calculate the attention between node i and its neighbor node j, and activate it through the activation function; e ij =LeakyReLU(a T [Wh i ‖Wh j ]) Among them, e ij is the attention between the activated node i and its neighbor node j; a T is the transpose of the attention weight matrix, Wh i is the result of linear transformation of the original feature vector of node i through the learnable weight matrix W, Wh j is the result of linear transformation of the original feature vector of node j through the learnable weight matrix W; Normalize the attention of node i and its neighboring nodes; Among them, α ij is the normalized attention weight, is the transpose of the attention weight matrix, is the result of linear transformation of the original feature vector of node i through the learnable weight matrix W. is the result of linear transformation of the original feature vector of node j through the learnable weight matrix W; The normalized attention weight α ij Perform weighted summation with neighbor node features to update node feature representation; in, is the feature representation after being updated by the graph attention neural network, and σ() is the activation function.
6. The three-dimensional indoor positioning method based on Wi-Fi signals and multiple graph convolutional networks according to claim 2, characterized in that: The three-dimensional position, timestamp, access point identifiers of all WiFi connections, and normalized RSSI values are associated to construct a data set. The RSSI values of each node connected to the WiFi are arranged in descending order. Only RSSI values with strength exceeding a set threshold or the top N numbers are used for actual training, and the RSSI values actually used for training are normalized.
7. A three-dimensional indoor positioning system based on Wi-Fi signals and multiple graph convolutional networks, characterized by: include: The model training module is used to construct data and heterogeneous graphs, and to build and train a 3D indoor positioning model based on the heterogeneous graphs. The 3D indoor positioning model uses a four-layer convolutional network, and the input features of each convolutional network layer are added to the output of the current layer using a residual connection as the input of the next layer. The four-layer convolutional network is specifically composed of: the first layer is a graph sample and aggregation network, the second layer is a graph convolutional neural network, the third layer is a graph attention neural network, and the fourth layer is a graph sample and aggregation network. The positioning module is used to obtain the access point identifier and corresponding RSSI value of the node to be positioned and each WiFi connection, and use the trained three-dimensional indoor positioning model to perform three-dimensional positioning of the node to be positioned.
8. A computer device, characterized in that: The invention comprises a processor and a memory; wherein, when the processor executes the computer program stored in the memory, the steps of the three-dimensional indoor positioning method based on Wi-Fi signals and multiple graph convolutional networks according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium, characterized in that Used to store a computer program; when the computer program is executed by a processor, the steps of the three-dimensional indoor positioning method based on Wi-Fi signals and multiple graph convolutional networks according to any one of claims 1 to 6 are implemented.