Indoor positioning based-on images aided by Artificial Neural Networks

: Indoor positioning has attracted much attention in recent years due to the trend of Internet of Things (IoT), which is capable of providing numerous applications such as personal tracking, vehicle locator, and Location-Based Service (LBS). To put LBS into practice, positioning and navigation are one of the necessary techniques. Using the smartphone to process indoor positioning also become more and more usual. The most common algorithm in the inertial navigation system is Pedestrian Dead Reckoning (PDR), utilizing sensors built-in the smartphones to conquer the strait of GNSS-denied environment. However, for the purpose of eliminating the error accumulated with time, PDR combining with other algorithms, for instance, updating some geospatial information steadily is a better way to solve this problem. Therefore, this research proposes the imaged based aided algorithm. Moreover, in this study, a novel Artificial Neural Networks (ANN) embedded the system is proposed. The self-designed georeferenced markers and the indoor floor plan will be produced by an Indoor Mobile Mapping System (IMMS) in advance. This research proposed using Cascade-Correlation neural Network (CCN) to estimate the distance between the marker and the smartphone camera. The accuracy using this method can achieve to 0.27 meter. As if at least three coordinates and the distance can be obtained simultaneously, the position of the user can be calculated by the trilateration method. From the experiment, the accuracy of the positioning is about 0.5 meter. This way seems to have the high


INTRODUCTION
As the development of Global Navigation Satellite System (GNSS) from the 1970s, the performance of outdoor positioning and navigation is outstanding.The accuracy can achieve to meter-level.However, many market applications are desired to having the ability of seamless positioning nowadays.As a result, there is a surge in demand for indoor positioning in recent years.That is, indoor positioning systems with different algorithms are highly paid attention, which have been developed over decades (Rainer, 2012).Pedestrian dead reckoning (PDR) is the most common algorithm among them by using built-in sensors in smartphones.One of the main problems is about the error accumulated with time.In order to solve this problem, combining with other indoor positioning technologies to update the position of the user seems a good resolution.For instance, Wi-Fi based and Bluetooth beacons technologies based were popular in the past.Nevertheless, the common disadvantage is that both of the technologies need to install external devices.For Wi-Fi based, measuring the signal strength from different wireless access points (WAP), the user's position can be strained to a relatively small area within a large indoor environment.The defect is about its accuracy critically depends on the number of the WAP.For Bluetooth beacons based, it's capable of achieving up to 1-meter level accuracy.Although the devices are cheap, they experience high latency during the discovery phase (Liang, 2013).So, this study proposes using the image-based technique to do the localization, whose advantages include no additional devices and only need an off-the-shelf smartphone with a built-in camera.In general, the algorithms of using image-based technology can be separated into two categories, feature points tracking and * Corresponding author marker recognition (Davison, 2003).The accuracy of the former may be affected by the lighting condition.Aside from that, it needs a more computational resource to do the image matching.In order to avoid those challenges, this study is applied to using the self-designed marker to do positioning.This method can speed up the processing time by detecting certain points.Kim et al. (2010) perform a method to conduct Artificial Neural Networks (ANN) to aid image recognition.In this study, Cascade-Correlation neural Networks (CCNs) is adapted to estimate the distance between the marker and the camera.The benefit of CCNs is that the algorithm can adjust the architecture automatically, that is CCNs will find the most suitable topology by itself.As the data become more numerous, the number of neuron increases sequently (Chang, 2009).When a user obtains at least three coordinates of the markers and the distances between the marker and the camera at the same time, utilizing the trilateration algorithm can calculate the position of the user.In this study, the error of the user's position in X-axis and Y-axis are about 0.4 and 0.3 meters respectively.The accuracy of the result can achieve 0.5 meter, which is available for indoor positioning.

METHODOLOGY
This section introduces three part of the methods proposed in this study.First is about the process to detect the self-designed marker in the image.Second is explain how to apply CCN to estimate the distance between the marker and the camera.The final part is using at least three coordinates and distances from three different markers to calculate the position of the user by the trilateration algorithm.

Image recognition
Generally speaking, the algorithm of image recognition can be separated into two categories, feature points matching, and fiducial markers recognizing.The main merit of the former is that no additional devices need to be distributed.However, it requires more computational resources and time as if the environment is complicated.In order to save the resources, this paper is applied to the marker recognition method.The size of the self-designed marker is 18 × 18(cm), which is shown as Figure1.
Figure1.The self-designed marker A database is constructed to record the attribute of the markers in advanced.As soon as the marker is detected by the proposed image recognition algorithm, the interrelated attribute will be obtained including the coordinates.Figure2 shows the process of marker detection.

Figure2. The flow chart of the image recognition algorithm
In the beginning, the raw image transforms into a grey scale, which formula is shown as equation ( 1), and then do the binarization.
Where R, G, and B represent the pixel size of three channels respectively.Next step is extracting the edge by Sobel and the equations are shown below.
Where   and   is the two-dimensional convolution edge extractions respectively.And G is the gradient magnitude.Afterward, the morphology is employed to fulfill the area, which might be the marker.By the method of 45° corner detection, whose concept is shown in Figure3, the corners of the marker can be got.Affine transform helps the marker convert to original size.After decoding, the corresponding attribute of the marker will be obtained.
Figure3.The concept of corner detection

Distance estimation
After acquiring the coordinate of the marker, this study proposes utilizing CCN to estimate the distance between the marker and the camera.This part will explain how to estimate the distance.
The concept is represented as Figure4.According to the theory of similar triangles, when the focal length of the camera (f), detected and the real size of the marker (W and w) are known, the distance between the marker and the camera can be calculated by the formula shown as below: Figure4.The concept of distance estimation However, this method faces a main challenge of the distance is not accurate as if the image space is not parallel to the object space.In other words, if there is an angle θ between two space, shown in figure 5, the true distance is the hypotenuse.To improve accuracy, this study proposes using the deformational parameters as the input of CCN to evaluate the distance.Once the true distance and θ are known, the coordinate of the camera can be calculated.
Figure5.The error of the distance estimation method Up to today, ANN is widely applied to many fields, such as speech recognition, video image recognition and assistance in navigation for a long time.Different architectures of ANN are suitable for different application.That is a user can choose the one or more depending on their demand.In this paper, CCN is applied to estimate the distance, the scheme is shown as Figure6.
It's a kind of supervised ANN.Its main advantage is that the number of neurons and the hidden layers can be decided automatically by the unique algorithm.That is user might not waste time to find the most suitable relationship of topology.In general, CCN starts from an input layer and an output layer, which is the easiest architecture.After that, the weight will be adjusted in order to make the correlation coefficient achieve to the maximum.The weights of the original layers won't be changed anymore even adding new hidden layers or neurons.In Figure6, the crosses represent the training-completed neurons, whose weight wouldn't be adjusted anymore.Conversely, the circle means the neuron still need to be trained.As if the network can't satisfy the accuracy, CCN will generate new neurons with stochastic weights, until it meets the demand.
Figure 6.The scheme of the CCN

Trilateration
In an outdoor environment, using the Global Positioning System (GPS) can know the position of the user.The algorithm of the positioning applied to this system is trilateration.The concept is that assume there are one unknown point and three known points.
As if knowing the distances between the known points and the unknown points respectively, regarding the distances as the radiuses, the circles can be obtained.Afterward, the intersection of the circles is the position of the unknown point, which show as below.
Figure7.The concept of the trilateration This paper proposes using a trilateration algorithm to calculate the user's position.The position of the camera is unknown and the coordinates of the markers are known.When the distance between the marker and the camera can be evaluated by CCN, the position of the user will be calculated by the trilateration algorithm.

THE EXPERIMENT AND THE RESULT
In this study, the experiment is executed by the HTC M8.Table1 displays the specification of the smartphone.Table 1.The specification of smartphone

The experiment setting
This experiment can be separated into two parts.At first, the data of taking pictures of the pre-decorated self-designed markers on the wall is collected.At the same time, the distance between the marker and the camera will be measured by the Electronic Distance Measuring instrument (EDM), which will be regarded as the true value.The second part chooses a better-trained model from the previous part in order to carry out the trilateration algorithm.14 points are selected randomly in the experiment field.The images of the markers are taken on each selected points.Afterward, the images are processed by the proposed image recognition algorithm.Next, distances are obtained by the trained model so as to do the trilateration.In order to evaluate the accuracy of the trilateration, the selected points are measured by the total station.The result will be presented in the following parts.

Image recognition
This study proposed an image recognition algorithm, which can be applied to the complicated environment.Worth to say that the result is highly related to the resolution of the camera.As the distance is larger than a certain value, the image might be blurry.
In other words, a suitable resolution of a camera can meet the requirement.Figure9 shows the result of image recognition.

Figure9. The result of the image recognition
Upon the vertices of the marker can be detected, the action of decoding will start.If the marker is matching with the data in the database, the corresponding attribute of the marker including the coordinates can be obtained.

CCN model for distance estimation
As mention above, in order to avoid the error coming from deformation of the marker in the image, a CCN model is trained to estimate the distance.In this experiment, 211 images are taken by HTC M8. 169 images of them are randomly selected as the training data.The model is tested by the remained 42 images and the average error is about 0.27 meter.The result is shown in Figure10.
Figure10.the accuracy of the testing data Sorting the distances, the red arrow shows that the error trend of the distance estimated by the CCN model becomes larger when the distance is longer.However, there is still some lager error in the shorter distance as the yellow circles.The reason might be caused by the angle of shot.If the θ is larger, the deformation is more severe.The reason might lead to the distance estimated by the CCN model might not be accurate.Nevertheless, the average error is suitable for indoor positioning.So, the model of CCN is used to do the trilateration.

Trilateration
After training a suitable model for distance estimation, as if at least three coordinates and the distance of the markers can be obtained, the position of the camera can be calculated by the trilateration algorithm.In this experiment, there are five markers in the experiment field.14 points are selected randomly.The user stands at those points to take the pictures and utilizes EDM to estimate the distance simultaneously.The distance from DEM can be considered as the true values to compare with the distances evaluated by CCN.Figure11 shows the error of the distances from CCN.For every marker, the average error of the distance from CCN is shown in Table3.
Figure11.The accuracy of the distance from CCN From Table3, the mean error of the distance estimated by the CCN model is about 0.5 meter, which means the model is not only suitable for the testing data.After that, the position of the camera can be calculated by the trilateration method.Assuming the z-axis' values of the marker and the camera are the same, this experiment only calculates the 2-dimensional position of the camera.The result is shown as Figuare12.And the differences of every point in x-axis and y-axis are shown in Table4.
Figure12.From Table4, the mean error of x-axis and y-axis are 0.4 and 0.3 respectively.The mean error of the position is about 0.5 meter.
The result proves that this method can be used in indoor positioning.

CONCLUSION
In this research, there are some objects to explore.One is to use the proposed algorithm to process the image recognition.The result shows that even in a complicated environment, the marker still can be detected successfully.Another one is using CCN model to estimate the distance.Because of the unique algorithm of CCN, adjusting the architecture is automatic.Moreover, the accuracy is enough for indoor positioning.After obtaining at least three distance and the coordinate of the marker, the coordinate of the user can be obtained.To sum up, this algorithm can update the location.The proposed methods can improve the accuracy of indoor positioning.

Figure8
Figure8.The schematic diagram of the experiment Table2.The amount of data