Research on indoor positioning algorithm based on BP neural network

The neural network positioning algorithm is an algorithm that uses the principle of electromagnetic induction to activate a short-range wireless tag wirelessly to achieve information reading. It has the advantages of small size, low cost, and reusability. This paper compares several neural network structures of DNN, CNN, and RNN, and selects BP neural network to optimize its training through theory and practice, combining the data to compare their average error and average time used in indoor positioning practice, the average error of the optimized BP neural network in this article is smaller, and the positioning time is shorter, and combined with the practical data to obtain the efficient use of the division value n, which meets the high-precision requirements of indoor positioning and is more convenient for practical applications.

IOP Publishing doi: 10.1088/1742-6596/1907/1/012007 2 parameters involved in the experiment, when used, is also a great number of matrix operations. The indoor positioning research based on CNN has the advantages of high abstraction, generality, low cost, easy deployment, and high precision. The main disadvantage of this model is that the backpropagation and translation invariance [7] .
To further study the development of indoor positioning combined with a neural network, this paper compares the structure of several neural network positioning algorithms such as DNN and CNN, and through experiments to optimize the training of the neural network algorithm, combined with the data to calculate the average error and average time for analysis, it is hoped that an efficient neural network indoor positioning algorithm and the division value used by the indoor positioning algorithm can be obtained.

2.Data
The article chooses a large enough open environment for the experiment. For the different space sizes between the pre-experiment and the formal experiment,8 and 10 RFID tags are selected to be distributed in the area for calculation,1 target tag is used as the target,1 reader is used to read the location of the tag, and then the location data is recorded and analyzed through a portable computer.
For each label multiple data acquisition, included in the database after the screening analysis in wait, to avoid the influence of experimental errors caused by manual records. Input the final data after screening into DNN, CNN, RNN, neural network algorithm before and after optimization to obtain the coordinate position predicted by the algorithm, and compare it with the actual coordinate position to calculate the error value and record the average calculation time.

3.1.Deep Neural Network
To overcome the disappearance of gradients, transfer functions such as ReLU and max out replace sigmoid, forming the basic form of DNN.In terms of structure alone, the fully connected DNN is equivalent to the multilayer perceptron. In the structure of fully connected DNN, the lower layer neurons and all upper layer neurons can form connections. The potential problem is the expansion of the number of parameters.

3.2.Convolutional Neural Network
CNN utilizes hierarchical patterns in the data and uses smaller and simpler patterns to combine more complex patterns. Compared with other image classification algorithms, CNN uses relatively little preprocessing. This independence, which has nothing to do with prior knowledge and labor in feature

3.3.Recurrent Neural Network
In an ordinary fully connected network or CNN, the signals of each layer of neurons can only propagate to the upper layer, and the processing of samples is independent at all times, so it is also called a forward neural network(Feed-forward Neural Network).In RNN, the output of the neuron can directly affect itself at the next timestamp.

3.4.BP Neural network
BP neural network is the most basic neural network. The network belongs to a feedforward neural network, including an input unit, an implicit unit, and an output unit [9] . After the function, the output signal of the hidden node is transmitted to the output node. Finally, the output result is given. The neural network hierarchical model is shown in the figure, in which the hidden layer can have 0 layers and n layer. Its structure also makes it have the advantages of nonlinear mapping ability, strong high self-learning and adaptive ability, strong generalization ability, and certain fault tolerance ability.

4.Experiment and algorithm optimization
For the four neural networks discussed in this paper, BP neural network, depth neural network, convolutional neural network, and recurrent neural network, to further understand their accuracy and required time in indoor positioning applications, we need to select a more effective neural network. Selecting a length of 2 m, width 2 m pre-test square open environment, using active RFID tags positioned practice. Space is divided into 16 square grids with a spacing of 0.5 meters, which is convenient for data statistics and mapping during the experiment. 8 RFID tags, 1 target tag, 1 reader,   Table 1 Comparison of precision and time consumption of four preset neural networks To sum up, compared with DNN, CNN, RNN, for indoor positioning applications, the use of BP neural network is not only simple in structure, can be quickly deduced, but also achieves better results in accuracy and positioning time, and has higher self-learning and adaptability. Therefore, this paper chooses the indoor positioning algorithm based on BP neural network to carry out experiments.
A rectangular open environment with a length of 6 meters and a width of 4 meters was further selected for formal testing. The entire rectangle was divided into 96 square grids with a spacing of 0.5 meters. Look at the picture below. Figure 6 Formal experimental environment deployment [10] To facilitate the statistics and process experimental data, the power value is set to 8,10,12, and 14 dm and the data value lost due to various reasons in the experiment is set to 16 dm. The following data are obtained through multiple experiments.  Figure 7 Neural network training flow chart Take the side 6 meters long as the x-axis and the side 4 meters long as the y axis, and n is the size of the spacing between adjacent reference points. Set three kinds of n values here, which are 0.1,0.2, and 0.3 respectively. Calculate the square sum of the distance difference and the square root sign to analyze the error as shown in the figure below. Table 3 Data graphs of 10 groups of data measured under different N values It can be seen from the data analysis that the average error of the algorithm increases with the increase of n. If you want higher precise positioning requirements, try to take smaller values for division, but when n is smaller, the data will be more and more. It increases the difficulty of data collection and analysis. Therefore, it is recommended to choose n = 0.1m, which not only meets the high accuracy of indoor positioning but also does not excessively improve the difficulty of data processing and improve the effectiveness of the overall algorithm. Figure 8 average error

5.Contrast experiment
To see the utility of the optimized BP neural network more intuitively, we will compare the optimized BP neural network, the original BP neural network, the depth neural network, the convolutional neural network, and the cyclic neural network again in the environment of formal experiments. Each neural network carries out 10 measurements and analysis of indoor positioning positions, and calculates their respective average error and average running time, as shown in the following figure. Through comparative experiments, it can be concluded that the optimized BP neural network has a small error and requires less running time for indoor positioning. The optimized algorithm improves the utility of positioning and has certain practical significance. Figure 9 Error comparison of N values

6.Conclusions
The rise of artificial intelligence and other technologies makes neural networks combine with indoor positioning algorithms. This paper compares several neural network structures such as DNN, CNN, and RNN, and concludes that the indoor positioning algorithm based on BP neural network has a strong fault tolerance rate, high self-learning and self-adaptation capabilities, and strong generalization capabilities, which are suitable for wide application. Therefore, the BP neural network is selected to train and optimize the neural network algorithm through theory and practice, and the average error and average time of the BP neural network, DNN, CNN, and RNN in indoor positioning practice before and after the data optimization are calculated. The average error of the BP neural network after optimization is smaller, the positioning time is shorter, and the partition value used by the efficient indoor positioning algorithm is obtained, which improves the overall performance of the algorithm and is more convenient to use in reality.
Compared with pure indoor positioning technology, the indoor positioning algorithm combined with the neural network has more potential to be explored in accuracy and scope of application.