# A Context-Aware Assisted WiFi Positioning Method

Authors: Qi Feng; Bing Jia; Xi Luo; Sha Li
Journal: Wireless Communications and Mobile Computing
 (2021)

---

## 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.


---

## Body

## 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 [1–3] 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 includek-nearest neighbor (KNN) algorithm, Bayesian Information Criterion (BIC), Support Vector Machine (SVM) algorithm, decision tree, and K-means. Among them, the KNN algorithm has been widely applied to such aspects as location [4], transportation [5], medical treatment [6, 7], network [8–10], energy [11], and operations research [12]. At the same time, it is also quite advantageous to performance. In recent years, researchers have used k-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 theK 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 K 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 K values into the traditional KNN algorithm and mainly introduces dynamic K value to the traditional KNN algorithm.The fingerprint localization method based on KNN calculates theK 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 K 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 K values into the traditional KNN algorithm and mainly introduces dynamic K 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 [15–21], 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 [24–26] 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 [27–29] 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 dynamicK value, and the dynamic K value is mainly introduced to improve this algorithmIn the second part, this paper briefly reviews the schemes proposed by existing researchers to improve localization performance. In Section3, 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.


## 2. Related Works

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”K neighbor samples and directly averages the K fingerprint positions. The final result is the center point of the K 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 K value dynamically, aiming at the problem of fixed K 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 K 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 dynamicK 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 dimensionm 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 m+2 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 fr,l,s (r,l,s 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 F with context assistance can be obtained. Set F=f1,f2,⋯,fn, where n is the number of fingerprint information. Therefore, a fingerprint database D=F with context assistance information can be established, as shown in Table 1.Table 1
The list of fingerprint database.
Fingerprint informationFingerprint attributerFingerprint attributelFingerprint attributesf1r11,r12,⋯,r1ml1s1f2r21,r22,⋯,r2ml2s2…………fnrn1,rn2,⋯,rnmlnsnIf only the RSS feature valuef′r is extracted, the original fingerprint information f′ can be obtained. Set F′=f1′,f2′,⋯,fn′, where n is the quantity of fingerprint information. We can create an original fingerprint database D′=F′, as shown in Table 2.Table 2
The list of fingerprint database.
Fingerprint informationFingerprint attributerf1′r11,r12,⋯,r1mf2′r21,r22,⋯,r2m……fn′rn1,rn2,⋯,rnm


### 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 firstK as the positioning result. The first K 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 K 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 K data will lead to different weights, which are proportional to the reciprocal 1/dx 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 attributesl and s 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 distancedRSSn, the Context Euclidean distance dContext and the whole Euclidean distance dn of the test point fingerprint test and the fingerprint data tn in the fingerprint database and influence weight wm of the first k fingerprint data can be calculated as follows:
(1)dRSSn=∑i=1i=mrtesti−rni2,(2)dContextn=ltest−ln2+Stest−Sn2,(3)dn=1−Context∗dRSSn+Context∗dContextn,(4)wm=1/dm∑i=1k1/dk.The final positioning result is obtained by weighting calculation. If theith corresponding position in the first k fingerprint data is (xi,yi), the final result can be expressed as (xresult,yresult), which can be obtained by the following expression:
(5)xresult=∑i=1kwixi,(6)yresult=∑i=1kwiyi.Thus, the fixedK 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 theK value, that is, the selection of K values. If the value of K 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 K is too large, the adjacent number selected is too large. Since this algorithm calculates the first K 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 K value is to select the K value with the best positioning effect through a large number of data test and comparison. The K value thus obtained does perform well in the actual positioning. In fact, such a fixed K 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 K value to solve this problem. Reference value μm is comprehensively considered from reference value βm and reference value γm, wherein reference value βmis related to the weight mentioned above and reference value γm depends on the value of K. They can be calculated using the following expression:
(7)βm=∑i=1mwi,(8)γm=1−mK,(9)μm=βm+1−βm=∑i=1mwi+1−∑i=1mwi1−mK.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 K is to dynamically determine the value of the current K by analyzing the operating environment of each algorithm separately. Referring to Reference [37], the specific implementation of dynamic K value is defined by threshold parameters.Its core dynamic mechanism is as follows: set the threshold parameter asc, and judge the performance evaluation reference value of current K value as μm4 by c. If μm4≤c, K increases by 1 until μm4>c, is determined. K remains unchanged and is selected as the dynamic K value of this operation for subsequent algorithm execution.The improved VWD-KNN fingerprint recognition algorithm is used for location. Set the fingerprint database aslib=fijm∗n, the corresponding position of each fingerprint in the fingerprint database as loc=pijm∗2 and the fingerprint of the test point as (xresult,yresult). Then, the VWD-KNN fingerprint recognition algorithm is expressed as follows.Algorithm 1: A variable weight dynamic KNN fingerprint identification algorithm (VWD-KNN).
Input: Fingerprint library lib=fijm∗n, the corresponding position of each fingerprint in the fingerprint library is loc=pijm∗2,the fingerprint of the test point is ftest,the Context parameter is Context, and the threshold parameter is c.Output: The positioning result of the test point is xresult,yresult.1: The Euclidean distance between the fingerprint of the test point and each fingerprint in the fingerprint database is calculated. The distance is denoted asdis=dim , using formula (1)(2)(3), and the corresponding index sequence index=bim is generated;2: Dis reorders in ascending order. In the sorting process, the index is bound to dis, and the sorting result is marked asdisasc=dascim，indexasc=bascim;3: Based ondisasc and wm=1/dm/∑i=1k1/dk traverse calculated each fingerprint impact on the final result weight weight=wim , Initialize the Kinitm/intn;4: The fourth step: Determination process of dynamic K:5: Get the length len of the weight;6:forj=1 to len do7:   (1) Calculating μj=βj+(1-βj)γj=∑i=1jwi+1−∑i=1jwi1−j/len. Using formula (9);8:   (2) If μj4≤c, continue cyclic processing until j increases to len and dynamic Kgynamic equals len. Otherwise, j is taken as the determination result of dynamic Kgynamic, and then transferred to (3);9:   (3) Take the larger of dynamic Kgynamic and initializing Kinit as the final decision result Kfinaland return;10:end for11: Recalculate the weightsweightfinal=wfinaliKfinal Among them, wfinali=wi/∑i=1Kfinalwi. Using formula (4);12: Get the positioning resultxresult=∑i=1Kfinalwfinalipbasci1 and yresult=∑i=1Kfinalwfinalipbasci2 . Using formula (5)(6)


## 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 dimensionm 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 m+2 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 fr,l,s (r,l,s 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 F with context assistance can be obtained. Set F=f1,f2,⋯,fn, where n is the number of fingerprint information. Therefore, a fingerprint database D=F with context assistance information can be established, as shown in Table 1.Table 1
The list of fingerprint database.
Fingerprint informationFingerprint attributerFingerprint attributelFingerprint attributesf1r11,r12,⋯,r1ml1s1f2r21,r22,⋯,r2ml2s2…………fnrn1,rn2,⋯,rnmlnsnIf only the RSS feature valuef′r is extracted, the original fingerprint information f′ can be obtained. Set F′=f1′,f2′,⋯,fn′, where n is the quantity of fingerprint information. We can create an original fingerprint database D′=F′, as shown in Table 2.Table 2
The list of fingerprint database.
Fingerprint informationFingerprint attributerf1′r11,r12,⋯,r1mf2′r21,r22,⋯,r2m……fn′rn1,rn2,⋯,rnm


## 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 firstK as the positioning result. The first K 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 K 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 K data will lead to different weights, which are proportional to the reciprocal 1/dx 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 attributesl and s 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 distancedRSSn, the Context Euclidean distance dContext and the whole Euclidean distance dn of the test point fingerprint test and the fingerprint data tn in the fingerprint database and influence weight wm of the first k fingerprint data can be calculated as follows:
(1)dRSSn=∑i=1i=mrtesti−rni2,(2)dContextn=ltest−ln2+Stest−Sn2,(3)dn=1−Context∗dRSSn+Context∗dContextn,(4)wm=1/dm∑i=1k1/dk.The final positioning result is obtained by weighting calculation. If theith corresponding position in the first k fingerprint data is (xi,yi), the final result can be expressed as (xresult,yresult), which can be obtained by the following expression:
(5)xresult=∑i=1kwixi,(6)yresult=∑i=1kwiyi.Thus, the fixedK 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 theK value, that is, the selection of K values. If the value of K 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 K is too large, the adjacent number selected is too large. Since this algorithm calculates the first K 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 K value is to select the K value with the best positioning effect through a large number of data test and comparison. The K value thus obtained does perform well in the actual positioning. In fact, such a fixed K 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 K value to solve this problem. Reference value μm is comprehensively considered from reference value βm and reference value γm, wherein reference value βmis related to the weight mentioned above and reference value γm depends on the value of K. They can be calculated using the following expression:
(7)βm=∑i=1mwi,(8)γm=1−mK,(9)μm=βm+1−βm=∑i=1mwi+1−∑i=1mwi1−mK.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 K is to dynamically determine the value of the current K by analyzing the operating environment of each algorithm separately. Referring to Reference [37], the specific implementation of dynamic K value is defined by threshold parameters.Its core dynamic mechanism is as follows: set the threshold parameter asc, and judge the performance evaluation reference value of current K value as μm4 by c. If μm4≤c, K increases by 1 until μm4>c, is determined. K remains unchanged and is selected as the dynamic K value of this operation for subsequent algorithm execution.The improved VWD-KNN fingerprint recognition algorithm is used for location. Set the fingerprint database aslib=fijm∗n, the corresponding position of each fingerprint in the fingerprint database as loc=pijm∗2 and the fingerprint of the test point as (xresult,yresult). Then, the VWD-KNN fingerprint recognition algorithm is expressed as follows.Algorithm 1: A variable weight dynamic KNN fingerprint identification algorithm (VWD-KNN).
Input: Fingerprint library lib=fijm∗n, the corresponding position of each fingerprint in the fingerprint library is loc=pijm∗2,the fingerprint of the test point is ftest,the Context parameter is Context, and the threshold parameter is c.Output: The positioning result of the test point is xresult,yresult.1: The Euclidean distance between the fingerprint of the test point and each fingerprint in the fingerprint database is calculated. The distance is denoted asdis=dim , using formula (1)(2)(3), and the corresponding index sequence index=bim is generated;2: Dis reorders in ascending order. In the sorting process, the index is bound to dis, and the sorting result is marked asdisasc=dascim，indexasc=bascim;3: Based ondisasc and wm=1/dm/∑i=1k1/dk traverse calculated each fingerprint impact on the final result weight weight=wim , Initialize the Kinitm/intn;4: The fourth step: Determination process of dynamic K:5: Get the length len of the weight;6:forj=1 to len do7:   (1) Calculating μj=βj+(1-βj)γj=∑i=1jwi+1−∑i=1jwi1−j/len. Using formula (9);8:   (2) If μj4≤c, continue cyclic processing until j increases to len and dynamic Kgynamic equals len. Otherwise, j is taken as the determination result of dynamic Kgynamic, and then transferred to (3);9:   (3) Take the larger of dynamic Kgynamic and initializing Kinit as the final decision result Kfinaland return;10:end for11: Recalculate the weightsweightfinal=wfinaliKfinal Among them, wfinali=wi/∑i=1Kfinalwi. Using formula (4);12: Get the positioning resultxresult=∑i=1Kfinalwfinalipbasci1 and yresult=∑i=1Kfinalwfinalipbasci2 . 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 Figure1(a).Figure 1
Data collection scenario plans.
(a)(b)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 Figure1(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 Figure2(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.Figure 2
Fingerprint database serial numbers and error polygraph of different datasets: (a) using CDS and (b) using LDS.
(a)(b)Table 3
Specific values of average positioning errors of CDS.
Dataset50100150200250300350400450500KRS-KNN2.2372.1322.2312.1172.1422.2692.1482.2622.1672.140CDPC-KNN2.1372.1102.1622.0502.2002.2502.1522.1672.1442.158SIKNN2.2062.1152.1782.1482.1662.2592.0982.2172.1742.193CAA-PM2.0502.0092.0412.0502.0682.0262.0202.0412.0242.025Dataset5506006507007508008509009501000KRS-KNN2.1942.1712.1832.1922.1182.2002.2502.2102.1362.213CDPC-KNN2.1292.1342.1392.1182.1592.1662.1262.1742.1512.141SIKNN2.2942.1452.1802.2132.2372.1752.2502.1982.1882.193CAA-PM2.0232.0162.0112.0632.0262.0282.0212.0282.0122.017Table 4
Specific values of average positioning errors of LDS.
Dataset50100150200250300350400450500KRS-KNN3.4413.3363.4393.3073.3433.4643.4073.4653.3693.343CDPC-KNN3.3863.3593.4183.3003.4503.5003.4023.4183.3963.419SIKNN3.5023.4163.4843.4493.4693.5093.4003.5173.4823.475CAA-PM3.1503.1683.1433.1503.1703.1473.1223.1413.1233.125Dataset5506006507007508008509009501000KRS-KNN3.3943.4243.3763.3903.4373.4413.4493.4093.4273.423CDPC-KNN3.3773.3793.3813.3663.4093.4223.4213.4243.4003.391SIKNN3.5703.4483.4853.5123.5383.5033.5523.5003.4893.494CAA-PM3.1233.1253.1143.1673.1373.1383.1693.1313.1163.100


### 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 dynamicK 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 ofKvalues for CDS, and Table 6 shows the dynamic list ofKvalues 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.Table 5
Dynamic list ofK values for CDS.
Fingerprint database numberCAA-PM11721631541851862171781791510201118122013201418152016181721181519182018Table 6
Dynamic list ofK values for LDS.
Fingerprint database numberCAA-PM11321631241551461771781491210151117121213121413151516181715181719142013Through 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.


## 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 Figure1(a).Figure 1
Data collection scenario plans.
(a)(b)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 Figure1(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 Figure2(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.Figure 2
Fingerprint database serial numbers and error polygraph of different datasets: (a) using CDS and (b) using LDS.
(a)(b)Table 3
Specific values of average positioning errors of CDS.
Dataset50100150200250300350400450500KRS-KNN2.2372.1322.2312.1172.1422.2692.1482.2622.1672.140CDPC-KNN2.1372.1102.1622.0502.2002.2502.1522.1672.1442.158SIKNN2.2062.1152.1782.1482.1662.2592.0982.2172.1742.193CAA-PM2.0502.0092.0412.0502.0682.0262.0202.0412.0242.025Dataset5506006507007508008509009501000KRS-KNN2.1942.1712.1832.1922.1182.2002.2502.2102.1362.213CDPC-KNN2.1292.1342.1392.1182.1592.1662.1262.1742.1512.141SIKNN2.2942.1452.1802.2132.2372.1752.2502.1982.1882.193CAA-PM2.0232.0162.0112.0632.0262.0282.0212.0282.0122.017Table 4
Specific values of average positioning errors of LDS.
Dataset50100150200250300350400450500KRS-KNN3.4413.3363.4393.3073.3433.4643.4073.4653.3693.343CDPC-KNN3.3863.3593.4183.3003.4503.5003.4023.4183.3963.419SIKNN3.5023.4163.4843.4493.4693.5093.4003.5173.4823.475CAA-PM3.1503.1683.1433.1503.1703.1473.1223.1413.1233.125Dataset5506006507007508008509009501000KRS-KNN3.3943.4243.3763.3903.4373.4413.4493.4093.4273.423CDPC-KNN3.3773.3793.3813.3663.4093.4223.4213.4243.4003.391SIKNN3.5703.4483.4853.5123.5383.5033.5523.5003.4893.494CAA-PM3.1233.1253.1143.1673.1373.1383.1693.1313.1163.100


## 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 dynamicK 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 ofKvalues for CDS, and Table 6 shows the dynamic list ofKvalues 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.Table 5
Dynamic list ofK values for CDS.
Fingerprint database numberCAA-PM11721631541851862171781791510201118122013201418152016181721181519182018Table 6
Dynamic list ofK values for LDS.
Fingerprint database numberCAA-PM11321631241551461771781491210151117121213121413151516181715181719142013Through 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 dynamicK value selection strategy still needs to be further studied.



---

*Source: 6683456-2021-08-26.xml*