An Indoor Positioning Algorithm for Wearable Device Using Deep Learning Regression Prediction Model in IoT Applications

To solve the problem of low positioning accuracy and ease environmental impact of wearable devices in the Internet of things, a wearable device indoor positioning algorithm based on deep learning was proposed. Firstly, a basic model of deep learning composed of an input layer, hidden layer, and output layer is proposed to realize the continuous prediction and positioning with higher accuracy. Secondly, the automatic stacking encoder is trained with signal strength data, and features are extracted from a large number of signal strength samples with noise to build the location fingerprint database. Finally, the stacking automatic coding machine is used to obtain the signal strength characteristics of the points to be measured, which are matched with the signal strength characteristics in the fingerprint database, and the location of the points to be measured is estimated by the nearest neighbor algorithm.)e experimental results show that the indoor positioning algorithm based on the stacking automatic coding machine has higher positioning accuracy, and the average error of points on the complete path can reach within 3m in 93% cases.


Introduction
With the development of computer technology, smart phones and other smart wearable devices with a variety of sensors have been popularized in everyday life, and people's demand for indoor positioning services is increasingly strong. Indoor positioning is a position estimation technique for indoor environment [1][2][3][4]. Due to the influence of complex indoor radio transmission environment, indoor building layout, personnel mobility, and other factors, the indoor signal fading model cannot be established accurately, so its progress lags far behind the outdoor positioning technology. Outdoor Positioning technology based on GPS (Global Positioning System) and cellular base station has been very mature and has been widely deployed and applied [5]. Low-cost and high-precision indoor positioning solutions have become a research hotspot. Wi-Fi is a widely used wireless communication technology, which can effectively solve the blocking problem with GPS and base station buildings. A large number of wireless Access Points (APs) are deployed in indoor environments such as schools, shopping malls, and airports [6,7]. However, due to the indoor complex environment, the accuracy is affected by obstacles, non-line-of-sight propagation, noise, and other factors, and there is a certain positioning error [8,9] . erefore, it is of major practical significance and practical value to study indoor positioning algorithm of smart wearable devices.
Many domestic and foreign experts and scholars have conducted deep research on the indoor positioning algorithm of smart wearable devices. Literature [10] uses the k-nearest neighbor interpolation (KNN) method to search the most similar K location data from fingerprint database and average its location. Literature [11] improves it and uses the weighted KNN method. In [12], the random forest algorithm also achieves excellent positioning accuracy. In [13], deep learning algorithm is utilized to realize indoor positioning through Wi-Fi. Zhihua et al. [14] proposed an indoor fingerprint system for deep learning of Channel state information (CSI), which verified the broad prospect of deep learning in the field of indoor positioning. However, traditional machine learning methods are very sensitive to data and often require data normalization, filtering, and other preprocessing. Moreover, they are easy to overfit and lead to bland generalization ability, which will affect the prediction performance of the network over time. However, with the increasing demand for positioning accuracy and the increasing amount of data, meaningful learning is a promising solution. erefore, the above algorithms still have some room for innovation and improvement [15][16][17][18].
A wearable device indoor positioning algorithm based on arcane learning is proposed. By using deep learning and automatic encoder, the hidden structural features of data can be extracted by direct learning without preprocessing, and problems such as overfitting can be effectively avoided improving network generalization ability [19][20][21][22]. Its main innovations are as follows: (1) Most of the existing methods, continuous positioning, cannot achieve high accuracy, and the algorithm, using a basic deep learning model composed of input layer, hidden layer, and output layer, by setting the input-output approximately equal, learning the parameters of network weights, and then establishing the encoding mode, achieves a higher accuracy of continuous prediction location.
(2) Most of the existing methods, easy from the problem of fitting result in weak generalization ability, and the algorithm using the signal strength data of stacked automatic coding machine for training, and from a lot of signal with noise characteristics, strength of samples is taken to establish the position fingerprint database, which effectively solves the fitting result in weak generalization ability problem. (3) Most of the existing methods do not estimate the location of the point to be measured, but the proposed algorithm uses the stack automatic coding machine to obtain the signal strength characteristics of the point to be measured, matches the signal strength characteristics with the fingerprint database of the location, and estimates the location of the point to be measured by the nearest neighbor algorithm.
Experimental results show that the proposed indoor positioning algorithm of wearable devices based on subconscious learning has higher positioning accuracy, and the average error of points on the complete path can reach within 3 m in 93% of cases.

Framework of Proposed Algorithm
Based on deep learning indoor location algorithm for wearable devices, the location information of mobile devices in the environment is described by the signal strength of various signal sources (such as routers, iBeacon, and RFID). Firstly, based on the principle of deep learning, the autoencoder compresses data, extracts feature or reduces noise, and trains with the autoencoder to establish the position fingerprint database. Finally, it matches the signal intensity features in the fingerprint database, uses the nearest neighbor algorithm to estimate the location of the points to be measured, and chooses the best matching position. Figure 1 shows the overall flow chart of the proposed algorithm.

Deep Learning Models
e profound learning model is similar to the three-layer structure of the traditional neural network. It is a multilayer network composed of an input layer, hidden layer, and output layer. Concentrated learning enables gradient to be transmitted effectively through the layer-by-layer training method. erefore, deep neural network usually contains multiple hidden layers, which improve network expression ability. As shown in Figure 2, the adopted model is mainly divided into the following three parts: auto encoder, multilayer perceptron, and deep learning regression prediction model [23].

3.1.
Autoencoder. An autoencoder can be utilized to compress data, extract features, or reduce noise. e basic idea of deep learning and the characteristics of the network are utilized to directly construct a network structure that can express the original data. By setting the approximate equality of input and output, the parameters and weights of the network are drawn, and then the deep autoencoder model is constructed [24].

Multilayer Perceptron.
Multilayer perceptron (MLP), also known as concentrated prefeedback network, is a typical deep learning model [25]. MLP has multiple layers of nodes, where each layer is fully connected to the next layer. Each node in the hidden layer is operated with a nonlinear activation function, and the network is trained using a backpropagation model.

Activation Function.
Sigmoid function or S-type function is commonly used in neural networks. e Sigmoid function can compress the real number into the interval of [0, 1], which is under a strong explanatory power. However, when the neuron approaches 0 or 1, saturation will occur, leading to gradient dispersion. erefore, the weight should be initialized carefully: (1) Tanh function: this function has good data control ability and maps real numbers to the interval of [−1, 1], but there is still saturation problem. e formula of Tanh function is Relu function is a linear correction unit, which is 0 when x < 0 and 1 when x > 0. Relu converges faster, but Relu is also more fragile. Large gradient flow may lead to the permanent failure of neurons, which can be avoided by selecting an appropriate learning rate or interlayer batch regularization. e formula is as follows:

Backpropagation
Algorithm. e training sample set is (x (1) , y (1) ), . . . , (x (m) , y (m) ) , where m is the number of samples and the sample set is utilized to train the neural network. e loss function in the experiment is e key step of the gradient descent method is tantamount to calculate the partial derivatives, the weight W, and the bias item b of the network, and their iterative formulas are where a is the learning rate.

Deep Learning Regression Prediction Model.
Indoor fingerprint location scheme can only predict and estimate discrete fingerprint points [26]. In order to achieve more accurate continuous prediction location, a regression prediction model is built by using meaningful learning. e linear regression model can be expressed as where x represents the input, w represents the weight, and b represents deviation. w and b are trained as minimized objective functions. e model first processes input data and then performs pretraining. When the output layer is achieved, the model will propagate back. e algorithm stops when it converges.

Stack Automatic Coding Machine.
Stacking automatic coder is comprised of several autoencoders. An automatic encoder is an efficient encoding artificial neural network for unsupervised learning (as shown in Figure 3), which can extract features from high-dimensional data and reduce the data dimension, so as to improve the positioning accuracy of location fingerprint method and reduce the time required for positioning. e input layer of the automatic encoder to the hidden layer (encoding layer) is the encoding part, and the hidden layer to the output layer is the decoding part. e hidden layer h is calculated from input layer v and utilized to calculate reconstructed output layer u ′ . e calculation method is as follows: where w and w ′ are, respectively, the connection weights between the input layer and the hidden layer and between the hidden layer and reconstructed output layer. In order to decrease the number of parameters and control the complexity of the model, the weight matrix w ′ is limited to the Mathematical Problems in Engineering transpose of the weight matrix w, that is, w ′ � w T . b and b ′ are the bias units of the hidden layer and reconstructed output layer, respectively; h is the hidden layer unit data. e training of the automatic coding machine is to minimize the reconstruction error between u ′ and u obtained through the input layer v. e smaller the error is, the closer the reconstructed output layer is the input layer. e hidden layer can better express the information of the input layer to reach the purpose of feature extraction.
Multiple automatic encoders are stacked to form a stacked automatic encoder. Figure 4 shows the network with K-100-80-50 structure, which consists of three automatic encoders stacked on top of each other. e first automatic encoder has K-100-K structure, the subsequent automatic encoder has 100-80-100 structure, and the third automatic encoder has 80-50-80 structure. e input of the first automatic coding machine is the K-dimensional vector v � v i |i � 1, 2, . . . , K , and the input layer of the N automatic coder is the hidden layer of the N − 1 automatic coder (N � 2, 3 { }). e number of stacked automatic encoders is 3 and the number of hidden layer neurons of each automatic encoder is empirical values.
v offline � v ji |j � 1, 2, . . . , J; i � 1, 2, . . . , K is trained at the input of the stacking automatic coding machine of structure A in Figure 3. J is the amount of data strips collected in the offline phase, and each dimension of each piece of data corresponds to an RSS of fixed AP or iBeacon. After the training, the new fingerprint database data were obtained:DATA offline � h ji offline 3 |j � 1, 2, . . . , J; i � 1, 2, . . . , n} � data ji |j � 1, 2, . . . , J; i � 1, 2, . . . , n , where n represents the dimension of data processed by the automatic stacking encoder.

Nearest Neighbor Method.
Put online phase data v online � v i online |i � 1, 2, . . . , K as the input layer, and the structure in Figure 3(a) is used for a forward propagation, where the parameters w and b are the DATA trained in the offline phase, and DATA � h 3 i online |i � 1, 2, . . . , n � DATA i |i � 1, 2, . . . , n is the input data of the classifier nearest neighbor method. e AP and iBeacon corresponding to the RSS of each dimension of the original fingerprint database and the v online phase DATA online are the same, and the information expressed by each dimension of the new fingerprint database and the online DATA is also corresponding. In the new fingerprint database DATA offline and online DATA, the nearest neighbor method is used to calculate the online phase data and the Euclidean distance of the i data in the new fingerprint database [27]: where data ji represents the i dimension data of the j data in the new fingerprint database, data i represents the i dimension data in the online phase, and n represents the dimension of the data processed by the stack automatic encoder. Finally, depending on the order of Euclidean distance d j from small to large (the smaller the distance, the higher the similarity of the two kinds of data), the coordinate of the sampling point with the smallest distance is the positioning result.

Experimental Results and Analysis
In order to verify the indoor effect of the wearable equipment indoor location algorithm proposed in this paper, the location area includes corridors and offices, and the office is equipped with desks, chairs, bookcases, and other office items. Seven Moto 360s were selected as the research objects. e signal was collected by a New Pad S97 tablet computer for 30 consecutive times. Two groups were collected at a time interval of 0.5 seconds. As a result, there are six groups of data in each location and 180 times of signal acquisition.

Regression Predictions by Using Deep Learning Model.
Indoor location scene usually adopts the location method founded on fingerprint. 140 fingerprint points in indoor environment were collected and studied to estimate additional registration points. Fingerprint-based localization is a multiclassification problem. Traditional machine learning can achieve good results for binary classification problems but with the increase of data dimension of multiclassification problems. Machine learning becomes quite difficult. For better generalization, machine learning methods have a tendency to make strong task-specific assumptions. At the same time, the saturation of S function limits the number of hidden layers, so the expression ability of a neural network is insufficient. e core idea of deep learning is tantamount to assume that data are composed of factors or features. Meaningful learning aims to overcome a series of difficulties such as "dimensional disaster" and "gradient dispersion" in machine learning, so as to achieve better results in multiclassification problems.
A multilayered neural network classifier with five hidden layers is constructed based on the deep learning framework. In order to prevent gradient dispersion, Relu is adopted as the activation function of the hidden layer and Xavier is used to initialize the weight. e number of samples in the test set is 100, and the simulation results have shown that the positioning accuracy can reach 90%.

Comparison between Single Hidden Layer and ree
Hidden Layers. In both networks, the autoencoder is not used, and Relu is adopted as the activation function for the hidden layer. Regression fitting is carried out on the test set to predict the results of coordinate points, as shown in Table 1. It can be observed in the table that the prediction effect of multiple hidden layers is obviously better than that of single layer, but the positioning error is still large.

Autoencoder.
As can be observed in the data distribution, in order to improve the positioning accuracy, it is necessary to carry out feature extraction and noise reduction processing for the data. erefore, before the data are input into the profound learning regression network, the autoencoder processing is carried out to extract the highdimensional features of the data and reduce the impact of noise. Table 2 lists the comparison results of autoencoder positioning accuracy in the three hidden deep regression prediction networks using Tanh activation function.

Comparison of Activation Functions of Different
Hidden Layers. e selection of the activation function of the hidden layer will also largely complete action on the positioning accuracy. Relu function, which performs well in the classification task, is not so effective as Sigmoid and other functions in the case of uneven data distribution due to its weak ability to control data. Since Tanh is equivalent to the extended form of Sigmoid function, its center is symmetric about the zero point. Tanh tends to achieve better results than Sigmoid. e specific results are presented in Table 3.

Comparisons of Positioning Accuracy with Several Other
Algorithms. Under the same experimental conditions, the positioning algorithms in the literature [10,[12][13][14] are also implemented, which can be used to compare and verify the advantages of the proposed positioning algorithms in constructing the relationship between positioning features and positioning coordinates. e positioning effects of these algorithms are shown in Figure 5.
From Figure 5, we can see that the average positioning accuracies of algorithms in literature [13] and [14] and the algorithm based on deep learning are higher than those in literature [10] and [12], which reflects the advantages of deep learning in constructing positioning features and position relations. When the number of acquisitions is 60, the average positioning error of the proposed algorithm is 1.85 m, which is basically smaller than that of other algorithms when the number of samplings is 150. At this time, the average positioning errors of the algorithms in [6,9,10] and [8] are 1.87 m, 1.97 m, 1.99 m, and 2.29 m, respectively. Figure 6 shows the cumulative probability distribution curve of the average positioning errors of several positioning algorithms when the number of signal sampling is 120. When the average positioning error is less than or equal to 2 m, the cumulative probability of indoor positioning algorithm combined with deep learning is 76.34%. e cumulative probabilities in the literature [13], [14], [10], and [12] are 69.44%, 66.67%, 63.90%, and 54.13%, respectively. When the average positioning error is less than or equal to 3 m, the cumulative probability of each algorithm is 93.67%, 83.11%, 81.37%, 79.57%, and 76.78%, respectively. erefore, the proposed indoor positioning method can provide smaller errors and stable positioning results. Figure 4: Structure of the stacking automatic encoder.

Comparisons of Calculation Time with Several Other
Algorithms. In order to verify the real-time performance of the algorithm, the running time of several indoor location algorithms in references [10,[12][13][14] is tested. Table 1 shows the running time of these algorithms. From Table 4, we can see that the running time of the proposed algorithm and of algorithms in the literature [13] and [14] is longer than that in the traditional literature [10] and [12] and the algorithm in literature [12] is the shortest. However, the positioning accuracy of literature [12] algorithm is poor, which can be seen from Figures 5 and 6.
As can be seen from the comparison results of location accuracy and calculation time, the proposed algorithm can achieve the highest location accuracy while maintaining acceptable calculation time.
us, compared with other algorithms, the proposed algorithm has the best comprehensive performance.

Conclusion
A wearable device indoor positioning algorithm based on subconscious learning was proposed to achieve continuous predictive positioning with higher accuracy. e stacking automatic coding machine was used to obtain the signal strength characteristics of the points to be measured, which were matched with the signal strength characteristics in the fingerprint database of the position, and the position of the points to be measured was estimated by the nearest neighbor algorithm. Experimental results show that in 93% of cases, the average error of points on the complete path can reach within 3 m. e future research direction is to continue to study the problem of large maximum positioning error and other fusion methods of Wi-Fi and iBeacon to solve the problem of huge amount of computational data. Expand the richer positioning strategy to adapt to more diverse indoor Proposed algorithm Literature [13] Literature [14] Literature [10] Literature [12] [13] Literature [14] Literature [10] Literature [12] Number of samples (N) Average positioning error (m) application scenarios, and test and improve the proposed method to a wider range of practical environments.
Data Availability e data included in this paper are available from the corresponding author without any restriction.

Conflicts of Interest
e authors declare that they have no conflicts of interest regarding the study.