Abstract

With the convenience brought by Location-based service (LBS), users’ requirements for indoor positioning accuracy are getting higher than ever. However, many traditional indoor WiFi positioning methods may result in limited positioning accuracy because of the limited information of Received Signal Strength (RSS) of WiFi signal. This paper proposed a context-aware assisted WiFi positioning method (CAA-PM), which uses context information (i.e., light and sound) to assist WiFi-RSS for indoor positioning and uses an improved variable weight dynamic KNN fingerprint identification algorithm (VWD-KNN). Finally, experiments are carried out by using the dataset collected in both a closed laboratory and an open long corridor, and it is shown that the proposed algorithm substantially improves the localization accuracy comparing with other three classical algorithms.

1. Introduction

In recent decades, based on the country to develop the relevant preferential policies such as computer and smartphone industry under the background of mobile devices and wireless network technology industry in our country to grow rapidly, to bring to people’s life, the most intuitive experience is popularization, and popularization of the portable mobile devices thus indirectly contributed to the people the widespread demand for mobile location services (LBS) and constantly improved the location accuracy requirements on it. It can be seen that the field of location service technology is ushering in a vigorous new atmosphere, and the field of indoor positioning is even more so.

As is known to all, as the satellite signals of GPS (Global Positioning System), BeiDou navigation and other positioning systems are affected by the limitation of line-of-sight transmission, mature outdoor positioning technology is not applicable to indoor scenes. Therefore, it is necessary to study the indoor positioning technology, especially the accurate positioning in the complex indoor environment.

For indoor positioning research, there have been indoor positioning technologies based on Wi-Fi, UWB, ultrasonic, and infrared. Compared with other positioning technologies, WiFi-based positioning technology does not need to deploy additional hardware devices to support the implementation of positioning system, and most indoor environments have wireless signals, which is a very convenient and cost-saving method. Not limited to indoor positioning, many WiFi-based positioning studies [13] have achieved satisfactory results.

WiFi indoor localization technology mainly includes fingerprint localization based on location (finger-based localization) and range-based localization (range-based localization). Compared with range-and-location method, a location-based fingerprint method does not need to know the location information of the signal transmitting point. Therefore, this method has better conditions and can be less restricted when collecting data. Common core algorithms for location fingerprint location include -nearest neighbor (KNN) algorithm, Bayesian Information Criterion (BIC), Support Vector Machine (SVM) algorithm, decision tree, and -means. Among them, the KNN algorithm has been widely applied to such aspects as location [4], transportation [5], medical treatment [6, 7], network [810], energy [11], and operations research [12]. At the same time, it is also quite advantageous to performance. In recent years, researchers have used -means, which is very similar to KNN, to achieve some beneficial results [13, 14]. However, considering that the former is more stable and more suitable for the application of locating scenes, this paper proposes an improved locating algorithm based on KNN.

The fingerprint localization method based on KNN calculates the adjacent fingerprints with the highest similarity to complete the localization. The algorithm does not distinguish them and has the same weight for the final result. On the other hand, the value selection strategy of the traditional KNN algorithm is fixed, which limits the classification performance of the algorithm, so the classification effect is often unsatisfactory. Therefore, the context-aware assisted WiFi positioning Method (CAA-PM) proposed in this paper introduces variable weights and dynamic values into the traditional KNN algorithm and mainly introduces dynamic value to the traditional KNN algorithm.

The fingerprint localization method based on KNN calculates the adjacent fingerprints with the highest similarity to complete the localization. The algorithm does not distinguish them and has the same weight for the final result. On the other hand, the value selection strategy of the traditional KNN algorithm is fixed, which limits the classification performance of the algorithm, so the classification effect is often unsatisfactory. Therefore, the context-aware assisted WiFi positioning method (CAA-PM) proposed in this paper introduces variable weights and dynamic values into the traditional KNN algorithm and mainly introduces dynamic value to the traditional KNN algorithm.

In addition to the above, the most important factor influencing indoor location is the location information source that is based on what to locate. The positioning basis of traditional indoor positioning method is Received Signal Strength (RSS). However, in fact, RSS is very sensitive to environmental changes and is susceptible to many interferences of complex indoor environment, such as multipath effect caused by different propagation paths and shadow fading caused by obstacles, which cause actual RSS attenuation. Therefore, many researchers have made a lot of efforts to study how to make better use of RSS, with fruitful results. In References [1521], some of them optimize RSS itself and some optimize the postprocessing process of RSS. Researchers have a deep understanding of the anti-interference processing of RSS.

In today’s modern world, which is gradually moving towards the vision of “the Internet of everything,” the combination of different types of things has achieved quite good results [22, 23]. Therefore, in order to further improve the performance of indoor positioning, it is necessary to introduce richer data features as descriptions of different locations from another perspective. With the development and progress of human society, modern social life has produced a wealth of available light information (such as the light emitted by indoor lighting equipment and household appliances and natural light entering the indoor environment) and sound information (such as the sound generated by human activities, from the nature of sound). At the same time, the information has the characteristics of good position discrimination ability and minimum propagation loss, especially in the narrow space. In addition, some researchers have done some research [2426] in this field, respectively, trying to use the information of vision, Bluetooth, and sensor to assist positioning and obtaining some beneficial results. At the same time, sound and visual signals are increasingly being used in industries [2729] that play a leading role in the contemporary world economy. Therefore, the positioning method proposed in this paper uses the introduction of light and sound as new data features to describe different location features to assist positioning, so as to improve the positioning accuracy and performance. The main contributions of this paper are as follows: (i)In terms of positioning signals, this paper introduces the context information (i.e., light information and sound information) into the original RSS as the new feature data for indoor positioning(ii)In terms of positioning algorithm, this paper improves the traditional KNN algorithm by combining variable weight value and dynamic value, and the dynamic value is mainly introduced to improve this algorithm

In the second part, this paper briefly reviews the schemes proposed by existing researchers to improve localization performance. In Section 3, a content-aware assisted WiFi positioning method (CAA-PM) is described in this paper. It combines a variable weight dynamic KNN fingerprint identification algorithm (VWD-KNN) and fingerprint database adding context auxiliary information. In Section 4, this paper studies the positioning effect of CAA-PM in two typical scenarios and makes a comparative analysis of the positioning performance. Finally, Section 5 summarizes the whole paper and point out the research direction of the next step.

The positioning technology based on WiFi has the problem that positioning signals are easily interfered, resulting in poor accuracy of positioning results. In recent years, researchers have proposed many solutions to this problem. Generally speaking, these schemes can be divided into two categories: one is to obtain high-quality and abundant positioning signals as far as possible, optimize the acquired positioning signals in terms of anti-interference, or introduce new positioning signal sources; the other is to adopt more reasonable and efficient localization algorithm, that is, to optimize and improve the existing localization algorithm or adopt new localization algorithm.

At present, many references have proposed the processing scheme of positioning signal. Reference [30, 31] starts from the existing model of RSS to build a better performance location fingerprint database. Among them, the existing “path-loss” model of RSS is modified to obtain a satisfactory estimate of user location, which is the result of Reference [30]. Reference [31] focuses on the correlation between RSS of wireless access points. It adopts a multi-Gaussian mixture model to build the fingerprint database of the positioning system by modeling the signal intensity distribution at the reference points, so as to improve the positioning accuracy. From the point of view of multiscale localization of signal processing, other localization information (visual information) is introduced on the basis of RSS information to extend the localization signal source, which improves the localization performance to some extent. These are mentioned in Reference [24]. Based on the research results of the above scholars, this paper introduces context information to enrich the positioning scale while referring to the optimization and processing of RSS information. In this way, this paper optimizes the original fingerprint database as a fingerprint database with context-assisted information, improves the differentiation between different fingerprints in the fingerprint database, and thus achieves the purpose of improving the positioning performance.

The KNN algorithm is a relatively mature method in theory, with stable classification performance and significant classification effect. It has been widely used in many fields, such as pattern recognition, text classification, image, and space classification. The algorithm can also classify the positioning signals of different locations in indoor environment with better classification performance. Therefore, this paper firstly puts forward the context location method based on KNN.

Of course, KNN also has some shortcomings in classification. For example, this algorithm only selects the “nearest” neighbor samples and directly averages the fingerprint positions. The final result is the center point of the positions, but the actual position is often offset to some extent. For some problems existing in a traditional KNN algorithm, References [32, 33] adopted the mathematical idea of variable weight value to calculate the weighted center of mass for the nearest neighbor points generated by classification to improve the positioning accuracy. Reference [34] proposed a strategy for obtaining a value dynamically, aiming at the problem of fixed values in the KNN classification algorithm. This strategy can adapt to the running environment of the current algorithm and improve the classification performance. Based on the above research results, this paper introduces a dynamic value and variable weight value to improve the classification performance of KNN algorithm.

Therefore, the CAA-PM proposed in this paper optimizes and improves both the positioning signal and the positioning algorithm. The positioning algorithm introduces dynamic value and variable weight based on References [32, 33]. In addition, the processing of positioning signals in this paper is based on References [24, 30, 31] to enrich the positioning signal source and optimize the fingerprint database from the perspective of multiscale positioning.

3. A Context-Aware Assisted WiFi Positioning Method

The overall architecture of the CAA-PM is divided into offline stage and online stage.

3.1. The Offline Phase

For sample collection, the information collection device scans the RSS information around the current location Point (Access Point), and its dimension depends on the number of WiFi in the actual environment, while the context information (light and sound information) needs two fixed dimensions. Considering the convenience of data processing and the complexity of computing time and space, the collected RSS and context information dimensions are splicing directly. Therefore, the data characteristics of each fingerprint information after the merger are dimensions.

After obtaining sample data, it is necessary to preprocess the collected sample data (data alignment, processing of default values, etc.) and minimize the impact of irresistible unexpected factors (inevitable walking or occlusion of personnel, sudden abnormal AP signal, etc.) during the collection of sample data. This provides a stable and accurate sample size for subsequent research.

In this paper, a simple, effective, and widely used noise reduction method of “averaging multiple measurements” is adopted. A large number of sample data collected are “averaged” to blur the impact of individual accidents on the whole sample data, so as to achieve the purpose of noise reduction and clutter removal.

After the processing of the above steps, the research results of RSS information processing in References [30, 31] were referred to. The three characteristic values ( are the characteristic values of RSS, light, and sound, respectively) of RSS and context information were extracted from all the collected data. Thus, RSS fingerprint information with context assistance can be obtained. Set , where is the number of fingerprint information. Therefore, a fingerprint database with context assistance information can be established, as shown in Table 1.

If only the RSS feature value is extracted, the original fingerprint information can be obtained. Set , where is the quantity of fingerprint information. We can create an original fingerprint database , as shown in Table 2.

3.2. The Online Stage

As can be seen from the previous introduction, the KNN fingerprint positioning algorithm takes the average of the corresponding positions with the highest occurrence frequency in the first as the positioning result. The first fingerprint data do not make any distinction to the final result, and they have the same weight to the final positioning result. That is to say, the algorithm can only calculate the center positions of the first positions. However, the actual position may be offset, so the positioning effect is often poor, and the positioning result will produce a large error. Therefore, this paper firstly introduces variable weights in the KNN fingerprint localization algorithm. The first data will lead to different weights, which are proportional to the reciprocal of the Euclidian distance.

But at the same time, we should note that RSS and context information should not be treated as “equivalent” in the calculation of Euclidean distance. In other words, the attributes and of situation information in the fingerprint database should be regarded as a single attribute value of a certain fingerprint. Therefore, in the Euclidean distance calculation part of the algorithm, we introduced $Context$ as the context parameter to control the different weights of RSS and context information. The idea of introducing weights and parameters has been proved in other applications [35].

Therefore, the RSS Euclidean distance , the Context Euclidean distance and the whole Euclidean distance of the test point fingerprint test and the fingerprint data in the fingerprint database and influence weight of the first fingerprint data can be calculated as follows:

The final positioning result is obtained by weighting calculation. If the th corresponding position in the first fingerprint data is (), the final result can be expressed as (), which can be obtained by the following expression:

Thus, the fixed value fingerprint algorithm using the context fingerprint database is realized.

On the other hand, the localization effect based on the KNN fingerprint localization algorithm depends largely on the value, that is, the selection of values. If the value of is too small and the adjacent number is too small, the probability of error will be large and the positioning accuracy will be reduced. If the value of is too large, the adjacent number selected is too large. Since this algorithm calculates the first nearest fingerprints, whether these fingerprints are close to the positioning target or not will have an impact on the final positioning results. In the traditional KNN algorithm, the general processing method of value is to select the value with the best positioning effect through a large number of data test and comparison. The value thus obtained does perform well in the actual positioning. In fact, such a fixed value cannot guarantee the best positioning effect for each individual test in a large number of tests, but it can only guarantee the minimum overall average positioning error in a large number of tests. Therefore, this paper continues to introduce dynamic value to solve this problem. Reference value is comprehensively considered from reference value and reference value , wherein reference value is related to the weight mentioned above and reference value depends on the value of . They can be calculated using the following expression:

As shown in Reference [36], the dynamic environment in the execution of the algorithm (especially the RSS in this article is sensitive to the surrounding environment) must be dealt with, or the results will be difficult to achieve. The core idea of dynamic is to dynamically determine the value of the current by analyzing the operating environment of each algorithm separately. Referring to Reference [37], the specific implementation of dynamic value is defined by threshold parameters.

Its core dynamic mechanism is as follows: set the threshold parameter as , and judge the performance evaluation reference value of current value as by . If , increases by 1 until , is determined. remains unchanged and is selected as the dynamic value of this operation for subsequent algorithm execution.

The improved VWD-KNN fingerprint recognition algorithm is used for location. Set the fingerprint database as , the corresponding position of each fingerprint in the fingerprint database as and the fingerprint of the test point as (). Then, the VWD-KNN fingerprint recognition algorithm is expressed as follows.

Input: Fingerprint library , the corresponding position of each fingerprint in the fingerprint library is ,the fingerprint of the test point is ,the Context parameter is Context, and the threshold parameter is c.
Output: The positioning result of the test point is .
1: The Euclidean distance between the fingerprint of the test point and each fingerprint in the fingerprint database is calculated. The distance is denoted as , using formula (1)(2)(3), and the corresponding index sequence is generated;
2: Dis reorders in ascending order. In the sorting process, the index is bound to dis, and the sorting result is marked as ;
3: Based on and traverse calculated each fingerprint impact on the final result weight weight= , Initialize the ;
4: The fourth step: Determination process of dynamic K:
5: Get the length len of the weight;
6: for to len do
7:   (1) Calculating =+(1-)=. Using formula (9);
8:   (2) If , continue cyclic processing until increases to len and dynamic equals len. Otherwise, is taken as the determination result of dynamic , and then transferred to (3);
9:   (3) Take the larger of dynamic and initializing as the final decision result and return;
10: end for
11: Recalculate the weights Among them, . Using formula (4);
12: Get the positioning result and . Using formula (5)(6)

4. Experimental Process and Result Analysis

4.1. Selection of Experimental Layout

The experimental data were collected in two typical spaces surrounded by a number of APs to verify the effectiveness of the positioning method proposed above and improve the positioning accuracy.

In the process of information collection, the acquisition equipment is fixed with a bracket to strictly control the height and duration of data collection, so as to complete the data collection of real indoor scenes. In the data collection work, by controlling the collection time, 1000 pieces of data were collected for each collection point (the result of one scan of the collection device at the collection location was one piece of data): RSS dataset and context dataset. The floor plan of the experiment scene is given below, in which the hollow point is the training point of the fingerprint database and the red solid point is the test point.

Considering the need for data with rich context information, first of all, we collected information in an open indoor space. The space is a 2.4-meter wide corridor, and we randomly selected 12 meters. 28 fingerprint training points and 8 test points were collected in this space. The specific distribution of location information collection points is shown in Figure 1(a).

Secondly, data collection was conducted again in a closed laboratory space to compare the positioning effect in an environment where the context information was scarce. 30 fingerprint training points and 12 test points were collected in this space. The specific distribution of location information collection points is shown in Figure 1(b).

The collected dataset is based on base 50, and increments of 50 gradually increase to 1000 (50, 100, 150, …, 1000) to generate 20 datasets with added context assist information. These datasets were then preprocessed and trained to generate 20 fingerprint Banks with context-assist information, as well as several test fingerprints.

In the scenario shown in Figure 2(a), the maximum dimension of RSS is 224 and the dimension of context information is 2, so 20 fingerprint database datasets with added context auxiliary information of 28 location points in 226 dimensions are formed, which is called the corridor dataset (CDS). And the specific values of average positioning errors are shown in Table 3. In the scenario shown in Figure 2(b), the maximum dimension of RSS is 134, and the dimension of context information is 2. Therefore, a 136-dimensional fingerprint database of 20 kinds of 20 location points with added context auxiliary information is formed. Similarly, we call it laboratory dataset (LDS) here. And the specific values of average positioning errors are shown in Table 4.

4.2. Experimental Results and Analysis

The VWD-KNN fingerprint recognition algorithm used in the localization method proposed in this paper is an improved KNN algorithm by introducing variable weights and dynamic values. First, CDS was used to conduct a comparison experiment between CAA-PM and SIKNN [38], CDPC-KNN [39], and KRS-KNN. Reference [40] proposed by researchers in recent years. The comparison experiment was then repeated using LDS. Table 5 shows the dynamic list ofvalues for CDS, and Table 6 shows the dynamic list ofvalues for LDS. Finally, on the basis of the above experiments, we made an in-depth analysis of the results of the comparison experiments under the two datasets.

Through experimental analysis and comparison, threshold values and context parameters with better effects were selected. In both open and closed scenes, compared with other methods, CAA-PM with the assistance of fingerprint database containing context information can indeed improve the positioning effect and performance.

5. Conclusion

This paper proposes a context-aware assisted WiFi positioning method (CAA-PM), by using the context information (i.e., light information and sound information) which is introduced into the original RSS as the new feature data and the VWD-KNN algorithm which is an improved KNN algorithm. Compared with the traditional method, the proposed method improves the indoor positioning accuracy. However, there are still some problems to be solved in the practical application of the method proposed in this paper. For example, the optimization and improvement of VWD-KNN dynamic value selection strategy still needs to be further studied.

Data Availability

The experimental data used in this paper are not public datasets but are collected by students themselves using the self-developed APP.

Conflicts of Interest

The authors declare that there is no conflict of interest regarding the publication of this paper.

Acknowledgments

This study was supported by the National Natural Science Foundation of China (41761086), the Natural Science Foundation of Inner Mongolia Autonomous Region (2019MS06030), and the program for Young Talents of Science and Technology in Universities of Inner Mongolia Autonomous Region (NJYT-18-B10).