{'fraction_non_alphanumeric': 0.03083886541943271, 'fraction_numerical': 0.013277006638503319, 'mean_word_length': 4.777894002789401, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Indoor Localization Under Limited Measurements: A Cross-Environment Joint Semi-Supervised and Transfer Learning Approach

The development of highly accurate deep learning methods for indoor localization is often hindered by the unavailability of sufficient data measurements in the desired environment to perform model training. To overcome the challenge of collecting costly measurements, this paper proposes a cross-environment approach that compensates for insufficient labelled measurements via a joint semi-supervised and transfer learning technique to transfer, in an appropriate manner, the model obtained from a rich-data environment to the desired environment for which data is limited. This is achieved via a sequence of operations that exploit the similarity across environments to enhance unlabelled data model training of the desired environment. Numerical experiments demonstrate that the proposed cross-environment approach outperforms the conventional method, convolutional neural network (CNN), with a significant increase in localization accuracy, up to 43%. Moreover, with only 40% data measurements, the proposed cross-environment approach compensates for data inadequacy and replicates the localization accuracy of the conventional method, CNN, which uses 75% data measurements.


I. INTRODUCTION
The wide-scale proliferation of smart phones and wearable devices with wireless communication capabilities for 4G/5G has motivated the deployment of a wide range of locationbased applications and services delivered to the user [1], [2]. Moreover, next-generation 6G and wireless networks based on millimeter-wave and THz frequencies are envisioned to be human-centric, which require accurate location estimation with centimeter-level accuracy [3], [4]. Consequently, estimating the location of the user or sensor node through indoor localization is becoming increasingly of paramount importance and a fundamental milestone for successful deployment of 5G and future 6G wireless network services and applications that fulfill the increasingly high requirements of data rate, energy efficiency, coverage and reliability.
Various localization techniques that employ the Wi-Fi infrastructure were reported in the literature such as indoor fingerprinting which constructs a database of indoor RF measurements in terms of received signal strength (RSS), channel transfer function (CTF), or frequency coherence function (FCF). Several machine learning algorithms, such as k-nearest neighbour (k-NN), decision tree (DT), support vector machine (SVM), have been developed along with deep learning [5]- [11].
Deep learning-based indoor localization faces the challenge of insufficient data available to perform training of the model [12]. Obtaining sufficient measurements and labelling them is a tedious task that involves substantial human effort and resources to collect the costly measurements. To overcome such a challenge, this paper proposes a cross-environment approach which employs joint semi-supervised and transfer learning to leverage the similarity between environments and exploit the availability of unlabelled data, for enhancing model performance.

II. REAL DATA FROM RF MEASUREMENTS A. Measurements Setup
Real data measurements were obtained using the setup in Fig. 1, which consisted of two omni-directional antennas (of height 1.5m each), low-loss RF cables, and a vector network analyzer (VNA) that measures S 21 , which refers to CTF. In fact, in the context of the physical environment, CTF refers to the measured complex value of the received signal, at position (x, y), relative to the transmitted signal. Hence, CTF is an RF characteristic of the radio environment and shall be denoted by RF in this paper. Under high signal-to-noise ratio (SNR) and for an operating frequency f o , the received signal, is [7]: where the three parameters a l , τ l , and θ l are respectively the location-dependent amplitude decay, time delay, and phase shift of the l th multipath component [7]. These parameters are spatial-dependent in the sense that their values vary according to the location (x, y) in the radio map of the environment, and L is the total number of multipath components.

B. Frequency Points of RF Measurements
A code script is executed for the VNA to run 10 consecutive sweeps at each frequency point within a 100MHz frequency arXiv:2108.02257v1 [eess.SP] 4 Aug 2021 band. This process is repeated for 601 frequency points, for which the frequency separation is 166.667kHz such that 601× 166.667kHz = 100MHz. The measurements were carried out under a stationary scenario where we ensured no movements occur around the transmit and receive antennas. This ensured that the measured transmission coefficient will only account for the multipath components due to the physical environment without any additional distortion from moving objects.

C. Location of Grid Points
The experimental measurements setup was repeatedly assembled in four different locations within a typical university campus. These locations were chosen to represent the primary types of any typical real-world indoor environment which are: highly cluttered environment (laboratory), medium cluttered environment (narrow corridor), low cluttered environment (lobby), and open space environment (sports hall). For each type of the four indoor environments, readings of the RF signal were taken at positions that are not close to each other but also not far apart; ensuring that small-scale variations can still be captured [8]. This has been achieved by arranging a square floor grid area in the measurements scene, and dividing it into uniform square cells, each having 12.5cm side length which is equivalent to one wavelength at frequency 2.4GHz being selected to examine the WiFi bands associated with IEEE 802.11g standard. This square-cell division of the floor grid results in a total of 14 × 14 = 196 cells. The receive antenna is moved across the floor grid and is positioned at the corners of the cells. At each cell corner, measurements on the VNA are obtained for 601 frequency points with 10 sweep readings each.

D. Formation of Dataset
The number of samples that comprise the dataset for each environment is the product of (196 grid positions × 601 discrete frequency points × 10 sweeps per frequency point).
Once entirely constructed from measurements, the full dataset is divided into two portions: 75% of the data samples are used for training the prediction algorithm, whereas the remaining 25% data samples are used for testing and validation.

E. Dataset Made Available as Open-Access
We are pleased to share the generated dataset with the academic community. It has been made available online for further explorations and can be found at IEEE data port and is available online as open access [13]. The same dataset is also available online on University of California Irvine (UCI) Machine Learning Repository [14].

A. Using CNN as the Building Block
Convolutional neural networks (CNNs), depicted in Fig. 2, are known for their strong ability of learning spatial representations from raw data [15]. This attribute makes CNN a favorable method for several applications. Moreover, CNN is employed in this paper to jointly optimize feature learning Let X ∈ R α×β be the input data to the convolution layer, where α = 601 is the number of frequency points, and β = 2 to denote the real and imaginary values of CTF. The convolutional operation uses P filters K i ∈ R m×n , where in general m ≤ α and n ≤ β, to sweep over the input matrix X from the top left to bottom right corner. One convolution operation is defined as: whereX ∈ R m×n is part of the input matrix X, and σ(.) is the activation function, adopted to be the rectified linear unit (ReLU) in this work. The output from the convolution The function of the pooling layer is to reduce model parameters by reducing the number of features. This is achieved by selecting the dominant features which are rotationalyand positionaly-invariant. In the CNN framework, we adopt max-pooling, which returns the maximal value of its inputs. Given a max-pooling size of d × e, the output of the maxpooling layer will have a dimension of P × (α − m + 1)/d × (β − n + 1)/e , where · is the rounding down operation.
Stacking multiple layers allows for extracting more abstract features from raw data [16]. For a stacked structure, the output of the previous layer is the input of the next layer, such that feature information is propagated through space. While the first layer tends to learn general features, the last layer tends to learn task-specific features [17]. In our CNN model, we stack two convolution-pooling layers to learn high-level features from the raw data, which is shown in Fig. 2.
The outputs of the convolutional network are flattened into a column vector that is fed into a fully-connected layer used to insert non-linearity into features and seek more abstract representation. With µ ∈ R 4032×1 being resulting vector after flattening, the output η ∈ R 100×1 of the fully-connected layer is given by: where W f ∈ R 100×4032 and ν f ∈ R 100×1 are respectively the weights and biases of the fully-connected layer.
The output vector η of the fully-connected layer is input to a linear regression layer that performs localization: where W l ∈ R 2×100 and ν l ∈ R 2×1 are the weights and biases of the linear regression layer. The output y ∈ R 2×1 has two elements which correspond to the target position (x, y). Given the true labels and the model outputs, errors are calculated and backpropagated to update the model parameters via gradient-based optimization algorithms. We use the optimization algorithm of Adam [18] to compute adaptive learning rates for different parameters. We also use dropout [19] after the fully-connected layer and batch normalization [20] for each convolution layer to prevent over-fitting.

B. Joint Semi-Supervised and Transfer Learning
The proposed cross-environment joint semi-supervised and transfer learning approach is divided into six successive stages, as illustrated in Fig. 3. We utilize data from two environments: (1) rich labelled measurement database referred to as source environment, and (2) limited labelled measurement database referred to as target environment. Datapoints in the source environment are denoted by RF l s ∈ R 601×2 and labelled with respect to their associated position referred to by C s ∈ R 2×1 for simplicity. Each datapoint at the associated position is the CTF comprising 601 frequency points each of which is associated with a complex-valued received signal reading. On the other hand, datapoints in the target environment are both labelled RF l t ∈ R 601×2 and unlabelled RF u t ∈ R 601×2 . The labels of RF l t denote to the associated position referred to by C t ∈ R 2×1 for simplicity.
In the first stage of Fig. 3 which describes the proposed cross-environment approach, CNN is trained using the source environment labeled data samples RF l s . Accordingly, the loss function to be minimized is the following mean square error: whereĝ(.) is the trained CNN model initialized randomly, for which the input is (RF l s ) and output isĝ(RF l s ) representing the estimated position. The resulting CNN function is denoted by g 1 , which has a very good localization performance since it is trained with the rich data of the source environment.
In the second stage of Fig. 3 which describes the proposed cross-environment approach, the CNN model is trained by minimizing a loss function comprised of the mean squared error between C t andĝ 1 (RF l t ): whereĝ 1 (RF l t ) is the trained CNN model, initialized with g 1 (output of the first stage). The resulting CNN model of the second stage is denoted by g 2 .
The third stage of the proposed cross-environment approach shown in Fig. 3 is a refinement stage that improves the estimation of the location, which is important for the generation of the pseudo labels of the unlabelled data. In this stage, the DNN model is trained by minimizing a loss function comprised of the mean squared error between C t andĝ 3 (g 2 (RF l t )) ∈ R 2×1 : whereĝ 3 is the trained DNN model, initialized with g 1 (output of the first stage). The resulting DNN model of the third stage is denoted by g 4 . In the fourth stage of Fig. 3, the Euclidean norm between unlabelled target data RF u t and labelled target data RF l t is calculated. The k RF u t of the smallest Euclidean norm in comparison to the RF l t is selected for use in the upcoming stages. The selected subset of RF u t is denoted by RF u t . In the fifth stage of Fig. 3 which describes the proposed cross-environment approach, a pseudo label is generated for RF u t using models g 2 and g 4 and will be denoted C u t . In the sixth stage of Fig. 3 which describes the proposed cross-environment approach, RF l t and RF u t will be used to train the CNN model by minimizing the loss function comprised of the sum of mean squared errors between (C t , C u t ) and the corresponding (ĝ 1 (RF l t ),ĝ 1 (RF u t )), respectively: where the resulting CNN model of the sixth stage is denoted by g 5 . The last three stages in Fig. 3 will be repeated where the size of the unlabelled data RF u t will be increased. The final CNN, g f inal , is the g 5 model that produces the least position estimation error (RMSE).

IV. RESULTS AND DISCUSSION
Localization accuracy is assessed in terms of the error, RMSE, between estimated and labelled positions: In the results to follow, conventional CNN method refers to applying CNN directly to the limited-data target environment. Table I summarizes the results of training a CNN in a conventional way using different sizes of the training data. It is evident that reducing the size of the training data degrades performance since the estimated position error (RMSE) increased. This is due to model overfitting and that the CNN is not able to generalize and predict new observed data. Fig. 4 plots the percentage gain in localization accuracy (or equivalently percentage reduction in RMSE) versus the size of available data for training. We have obtained the results for the "Lab" being the target environment, where the source environment is the "Lobby". Results of the proposed It is evident that the proposed cross-environment approach outperforms the conventional CNN method with significant performance gains. While the proposed cross-environment approach can still provide an accuracy gain at low data sizes (as low as 40% of available data), the performance of conventional CNN method degrades severely, starting from 60% training data size. Furthermore, Fig. 4 demonstrates that, with only 40% of the available data, the proposed cross-environment approach is capable of compensating for the data deficit and replicates the localization accuracy of the conventional CNN method which is trained on 75% of the available data.

B. Proposed Approach Compensates for Limited Data
Beside the aforementioned findings obtained for the Lab as a sample indoor environment, we expanded our numerical experiments to investigate all types of indoor environments with results shown in Table II. It is evident from Table II that the proposed cross-environment approach provides a significant increase in localization accuracy up to 43%, compared to the conventional CNN method. This is attributed to the joint semisupervised and transfer learning approach which leverages the similarity between environments and exploits the availability of unlabelled data.

V. CONCLUSION
This paper tackled the challenge of developing highly accurate indoor localization deep learning methods under limited data measurements. The paper proposed a crossenvironment approach that compensates for insufficient labelled measurements via a joint semi-supervised and transfer learning technique to transfer, in an appropriate manner, the model obtained from a rich-data environment to the desired environment for which data is limited. This is achieved via a sequence of operations that exploit the similarity across environments to enhance unlabelled data model training of the desired environment. Numerical experiments demonstrated that the proposed cross-environment approach outperforms the conventional method, CNN, with a significant increase in localization accuracy, up to 43%. Moreover, with only 40% data measurements, the proposed cross-environment approach compensates for data inadequacy and replicates the localization accuracy of the conventional method, CNN, which uses 75% data measurements.