INTRODUCTION
1.
LED lights have many valuable features that suit visible light positioning (VLP) systems. First, they are energy-efficient and provide good lighting quality, which must not be affected by the positioning function. The lights should not flicker or change color in a way that people can notice. LEDs also support dimming, so the positioning system must work with different brightness levels. There are two main types of white LEDs: red, green, and blue, and the other uses a blue LED with a phosphor coating. In practical applications, both types of LEDs are used. Therefore, the signal used for the positioning process does not rely on color change. The advantage of LEDs is that they can transmit data inside a room without fear of interference. LED lighting systems are now pre-installed in most households. Replacing them can also be done easily and quickly. A special feature is that we can transmit control signals to LEDs through the existing wiring without needing new wiring. This makes LEDs a suitable choice for indoor positioning applications [1].
In recent years, the development of LED technology has transformed the lighting industry by providing high energy efficiency, long lifespan, and low heat emissions. LEDs are now dominant in most lighting applications and are expected to remain so in the near future [2]. Besides replacing traditional lighting methods, LEDs are also a solution for high-precision indoor positioning systems. The ability to position based on existing infrastructure makes LEDs a practical and cost-effective choice [3].
In study [4], the authors presented several popular indoor VLP techniques. Traditional methods such as angle of arrival (AoA), received signal strength (RSS), and phase difference of arrival (PDoA) serve as the foundation for many systems. However, in recent years, machine learning methods have attracted researchers' attention for improving localization accuracy [5]. Some popular algorithms include decision trees (DT), support vector machines (SVM), artificial neural networks (ANN), reinforcement learning, and deep learning models. Currently, combining several traditional localization techniques with machine learning models has improved localization accuracy and enhanced the stability of indoor visible-light localization systems. This method predicts indoor location with high accuracy by applying the AoA of light and a multi-layer perceptron (MLP) regression model. This proposal achieved a positioning error of 5.2 cm, corresponding to 80% of the measured points, using 4 LEDs and an OpenMV camera [6]. Besides AoA, Time Difference of Arrival (TDoA) has also been applied to enhance indoor VLP by narrowing the fingerprint matching range [7,8]. The authors in [7] proposed method significantly reduces the matching workload and improves positioning accuracy by combining TDoA with a fingerprint database and using an improved version of K-nearest neighbor (KNN), namely weighted kNN. In [8], N. Chaudhary et al. combined different localization techniques by integrating RSSI-based trilateration with the TDoA method to improve indoor positioning accuracy in VLP systems. The authors in [9] introduce a hybrid indoor VLP system that integrates RSS and TDoA, applying RSS in areas with sufficient signal strength and TDoA elsewhere, resulting in a reduced root-mean-squared error (RMSE) from 7.34 cm to 5.81 cm and improved efficiency. Similarly, the study [10] proposes a quasi-synchronous VLP system combining TDoA and RSS, showing that a two-step method can approach the accuracy of direct positioning at high signal-to-noise ratios. To enhance system robustness under limited LED coverage, the authors in [11] propose a loosely-coupled fusion of a VLP with an Inertial Measurement Unit (IMU) and a rolling shutter camera. Experimental results proved that their proposed method achieved an average accuracy of 2.1 cm, even with the LEDs off and with background light interference. Under limited lighting conditions, the study [12] successfully optimized power distribution among the LEDs to improve positioning accuracy.
In practice, achieving high positioning accuracy is very difficult when the system is affected by environmental noise and transceiver noise. Research [13] proposed a method to measure and mitigate noise using Allan variance for noise analysis and positioning algorithms such as ALSQ and EKF. The results showed that this solution improved by up to 60.4% with an average accuracy of 153 mm. Similarly, to improve the impact of ambient light on the positioning system accuracy, research [14] introduced the RatioVLP method. In addition, another work proposes a method based on Frequency Division Multiplexing (FDM) and real-time signal-to-noise ratio estimation to compensate for positioning errors caused by strong sunlight and other optical conditions. This solution demonstrates that positioning accuracy can be improved using low-cost hardware and a software-defined method [15]. Based on these studies, the authors in [16] examined the impact of signal-dependent shot noise (SDSN) on the visible light communication system. The results showed that SDSN degraded localization performance across all cases, with varying degrees of severity.
In addition to the aforementioned noise sources, the tilt of the LED is also considered a significant factor affecting the accuracy of the VLP. In [17], the authors show that even small tilts of the LED can lead to significant positioning errors. This can result in errors of 1 to 6 cm linearly with the degree of tilt. To overcome the positioning error due to camera tilt in VLP systems, a neural network is used to extract LED image features to correct the tilt. The authors then apply triangulation to perform coordinate estimation [18]. Similarly, the authors in [19] demonstrate that intentionally tilting the transmitter towards a central point on the receiving plane can significantly improve positioning accuracy. Experiments show that the accuracy improves by up to 66% while maintaining uniformity standards of light.
Recently, a novel direction using the Transformer model has been introduced for RSS-based indoor VLP. By effectively extracting hidden spatial features, the approach achieves centimeter-level accuracy. It also maintains stable performance at higher receiving planes, outperforming conventional RSS-based methods [20].
In this study, we focus on improving localization accuracy in L-shaped and T-shaped corridors. These are familiar but particularly challenging environments for localization tasks. These narrow spaces often have limited lighting infrastructure. LEDs are typically installed along a vertical axis and are not symmetrically distributed as in traditional configurations. This reduces the line-of-sight (LOS) signal and increases the presence of the non-line-of-sight (NLOS) signals. Such conditions pose significant difficulties in reducing localization errors. Therefore, we attempt to address these limitations by optimizing signal processing techniques and tuning localization algorithms. The goal of the solution is to enable the system to operate reliably in low-light conditions and in narrow spaces. To evaluate the capabilities of VLP systems in such environments, we propose a novel localization algorithm specifically designed for both LOS and NLOS environments. This study investigates the problem of LED-based indoor localization in complex multipath reflection environments. Specifically, we focus on narrow L-shaped and T-shaped corridors. In these spaces, the LOS assumptions are often weaker, and signal distortion is severe. A context-aware localization method that combines GraphSAGE and Transformer is proposed. First, noisy RSS measurements are filtered using a global reliability modeling strategy to improve data quality. Next, the cleaned features are then processed by GraphSAGE to capture local spatial relationships. Then, we use a Transformer to model global interactions among RSS signals. To further improve robustness in NLOS conditions, Huber loss is applied to reduce the impact of strong outliers. Finally, the proposed method is evaluated against standalone Transformer, GraphSAGE, Random Forest (RF), and kNN models.
The remainder of this paper is organized as follows. Section 2 presents the layout of the experimental environment and the LED-based localization module. Section 3 introduces the proposed algorithm. Section 4 discusses the experimental setup, evaluation metrics, and comparison. Finally, Section 5 concludes the paper.
PHYSICAL SPACE AND LED LOCALIZATION MODULE
2.
In this study, we used two narrow corridors, L-shaped and T-shaped, to establish the experimental space as described in Figs.1 and3. The L-shaped corridor is 6 m long and 3 m wide. The T-shaped corridor is 6 m long and 4.6 m wide. In both cases, the LEDs are arranged in the middle and evenly spaced. The lights at the beginning and end of the corridor are 0.6 m from the walls. These arrangements ensure uniform illumination throughout the corridor. Simultaneously, this configuration allows for reliable RSS data collection. As a result, the system can achieve high localization accuracy in environments with limited space and lighting conditions.
To better illustrate the arrangement of the LEDs and photodetectors (PD), Figs.2 and4 depict a 3D model of the proposed positioning system. Specifically, ceiling-mounted LEDs are installed along the corridor and act as transmitters in the VLP system. Each LED is installed at a height of 2.8 meters above the floor. The PD is placed on the floor. These 3D images clearly illustrate the relative positions of the LEDs and PD. From this, we can easily visualize the complexity of the research model and the limitations of the light signal in a narrow environment. This configuration closely resembles a real-world indoor environment, with narrow corridors and a specific layout.
In the simulation model, the transmitter units are implemented using ceiling-mounted LEDs. These LEDs serve as the optical signal sources for the positioning system. Each LED emits light following a Lambertian radiation pattern with an emission order of approximately 1.31. It has a semi-angle at half power of . The optical power transmitted by each LED is 500 mW. The PD has a physical detection area of 1 cm², which is typical for indoor optical receivers. The PD is assumed to have a field of view (FOV) of . The PD is also equipped with an optical concentrator characterized by a refractive index of 1.5.
In this paper, we consider the combined effects of shot noise, thermal noise variance, and first-order multipath reflections encountered in practical environments. In VLC systems, NLOS signal propagation arises when light emitted from the LED source reaches the PD after reflecting off intermediate surfaces. The received optical power NLOS depends on several key physical and geometrical factors. It begins with the radiated power from the LED, which follows a Lambertian emission pattern and is given by:
where is the source power, is the Lambertian order, and is the angle of irradiance relative to the surface normal. This emitted light travels through an indirect path involving a reflection. It experiences geometric attenuation over distance, captured by the path loss term:
with and denoting the distances from the LED to the reflection point and from the reflection point to the PD, respectively.
The interaction with the reflecting surface contributes additional attenuation and angular dependence as:
where is the surface reflection coefficient, and are the angles of incidence and reflection, and is the effective reflecting area. The received power is further modulated by the receiver's orientation and optical components, represented by:
where is the angle of incidence at the receiver, is the PD area, and are the optical filter and concentrator gain functions, respectively.
By combining these effects—radiation, distance-dependent loss, surface reflection, and receiver response—the NLOS received power is formulated as:
which comprehensively describes the indirect optical power transfer in reflective environments.
To visualize how optical signals propagate in the experimental environment, we analyzed the distribution of received optical power under different conditions.Fig. 5 shows the received power with direct LOS from the LEDs. Conversely,Fig. 6 illustrates the power due to reflection from surrounding walls. Although the reflected signal is weaker, it still affects the signal in areas with limited LOS coverage. Finally,Fig. 7 combines both LOS and NLOS components. It provides a more realistic view of the total received power that is ultimately used for positioning.
PROPOSED CONTEXT-AWARE GRAPHSAGE - TRANSFORMER ALGORITHM
3.
To effectively estimate indoor positions from received optical signals, we propose an improved deep learning architecture, Context-Aware GraphSAGE–Transformer (CA-GST), which combines context-aware GraphSAGE with a Transformer encoder.
Graph Sample and Aggregate (GraphSAGE) is a framework designed for inductive representation learning on large graphs [21]. Instead of using the full graph structure, GraphSAGE samples a fixed-size neighborhood and learns to aggregate information from neighboring nodes. This allows it to generate node embeddings for unseen data and scale effectively to large, dynamic graphs.
Transformer, originally developed for natural language processing tasks, is based on a self-attention mechanism that allows it to capture relationships between all elements in a sequence regardless of their positions [22]. It has been widely adopted in various fields, including computer vision and graph learning, due to its ability to model long-range dependencies and its highly parallelizable architecture.
In this paper, we propose a context-aware GraphSAGE–Transformer model for robust indoor localization under NLOS conditions, as shown inFig. 8. The model first introduces an early-stage context-aware reliability modeling strategy that learns global RSS consistency patterns across multiple LEDs. By adaptively reweighting LED signals before graph-based message passing, unreliable RSS measurements are suppressed, preventing noise propagation in subsequent feature aggregation. Next, GraphSAGE is employed to model local spatial relationships among LEDs, where each LED is treated as a graph node and neighborhood aggregation captures inter-LED signal correlations induced by spatial proximity and shared propagation paths. Then, a Transformer encoder is applied to the graph-enhanced features to capture global and long-range dependencies across all LEDs. Through self-attention, the Transformer dynamically assigns importance to different LEDs based on their global relevance. Finally, the Huber loss is adopted during training to improve robustness against severe NLOS-induced outliers further. Because Huber loss combines the advantages of both MSE and MAE, it behaves quadratically for small residuals and linearly for large ones.
The model configuration details are summarized inTable 1, where the input includes RSS vectors, and the output consists of the predicted 2D coordinates along with the localization error metric. All configuration details of the proposed model, including network architecture parameters, GraphSAGE and Transformer settings, context-aware module design, training hyperparameters, and optimization strategy, are also summarized in this table.
The detailed procedure of the proposed CA-GST algorithm is described inTable 2.
Based on the detailed algorithm description inTable 2, the specific steps of the training process and results evaluation are as follows:
Normalize input RSS values () and target coordinates () using standard score normalization:
where , are the mean and standard deviation of , similarly for .
An undirected graph = (, ) is constructed to model inter-LED signal relationships. Each node represents one LED, and edges connect adjacent LEDs:
This graph structure enables GraphSAGE to aggregate contextual information across neighboring LEDs.
Before graph-based feature extraction, a context-aware mechanism is introduced to reweight the RSS inputs adaptively. Given an RSS vector , a lightweight gating network produces a confidence vector:
The reweighted input is then computed using residual guidance:
where denotes element-wise multiplication and is a residual coefficient.
To capture contextual dependencies among the LED signals, each RSS vector is first reshaped into a column vector:
It is then projected into a higher-dimensional space using a linear transformation:
where andare learnable parameters. is the initial hidden dimension of GraphSAGE.
Then, two layers of GraphSAGE aggregate features from neighbor LEDs:
where:
() denotes the neighbors of node
is a non-linear activation
is the GraphSAGE aggregation function
is embedding dimension
The set of LED feature vectors after GraphSAGE is treated as:
Learnable LED embeddings are added to to serve as positional encodings:
The resulting sequence is passed through a multi-layer Transformer encoder to extract latent features:
Finally, the encoder output is flattened to yield a fixed-size feature vector:
Finally, the model predicts the 2D coordinates via a fully connected regression head:
here, denotes the predicted 2D position for the th sample; is the trainable weight matrix of the regression layer; is the bias.
The model is trained by minimizing the Huber loss between the predicted coordinates and the ground-truth coordinates :
where is the transition threshold.
Performance is assessed on a separate test set of samples. Three standard regression metrics are used:
These metrics quantify the Euclidean and Manhattan distances between predicted and true positions, respectively.
EXPERIMENTAL EVALUATION AND COMPARATIVE ANALYSIS
4.
In this study, we conducted a comprehensive experimental evaluation to compare the localization accuracy of five models: CA-GST, Transformer, GraphSAGE, RF, and kNN. As illustrated inFig. 9, the performance of each model was assessed using standard statistical metrics, including RMSE, MAE, and ME.
For both hallway configurations—L‑shaped and T‑shaped—the CA‑GST model delivered the strongest results, achieving RMSE, MAE, and ME of 0.20 m, 0.13 m, and 0.17 m, respectively. This demonstrates the effectiveness of combining the topological information learned by GraphSAGE with the Transformer's sequential modeling power. In addition, the context-aware feature reweighting mechanism adaptively suppresses unreliable RSS measurements caused by NLOS effects. At the same time, the use of Huber loss improves robustness against severe outliers during training. When combined, these components help the model capture both spatial relationships and broader signal interactions, which in turn improve localization accuracy.
In contrast, the Transformer model recorded an RMSE of 0.44 m, an MAE of 0.25 m, and a Median Error of 0.30 m. Despite being capable of modeling sequence patterns, its lack of structural awareness in the spatial context results in higher localization errors. The GraphSAGE model performed slightly better than the Transformer regarding RMSE (0.36 m) and MAE (0.21 m), but still underperformed the complete hybrid model. Furthermore, to gain a more comprehensive understanding of the effectiveness of the proposed algorithm, we also compared it with popular machine learning models such as RF and kNN. Experimental results showed that the CA-GST model has significantly lower errors than the machine learning models. Specifically, the RF and KNN algorithms have an RMSE approximately three times higher than our solution. These results indicate that the proposed CA-GST model significantly improves localization accuracy over the individual models.
To better understand the model's performance, the histogram and cumulative distribution function (CDF) illustrate its localization accuracy as depicted in Figs.10 and11. The histogram in both cases, with the L-shaped and T-shaped hallways, shows that most errors are below 0.3 meters, indicating high precision with only a few outliers above 0.5 meters. The CDF confirms this trend, with 80% of predictions under 0.25 meters and nearly all within 0.35 meters. These results highlight the stability and reliability of the CA-GST model, even in complex indoor environments. Finally, to provide a more intuitive evaluation of the coordinate estimation results from the CA-GST algorithm, we visualize the absolute error distribution on both the and axes, as shown inFig. 12. This plot offers a clearer comparison of prediction accuracy across different models or configurations by highlighting the extent to which the estimated positions deviate from the ground truth along each axis.
To evaluate the stability of the proposed algorithm on the system's dataset, cross-validation is applied. This is an important technique for assessing the model's generalizability to data that has never appeared during training. Instead of dividing the data into only two sets, training and testing, we divided the dataset into five groups. The model is trained multiple times, each time using a portion as the test set and the remaining portions as the training set. The experimental results are detailed inTable 3. The proposed CA-GST algorithm achieved an average RMSE of 0.2062 ± 0.0194 m and 0.2098 ± 0.0212 m in the L-shaped and T-shaped hallways, respectively, after 5-fold cross-validation. The results show that the RMSE value remained stable across 5 assessments for both types of hallways.
CONCLUSION
5.
In this paper, a context-aware GraphSAGE–Transformer model is proposed, which integrates reliability modeling to capture both local spatial relationships and global signal dependencies. The proposed method is designed for challenging environments such as L-shaped and T-shaped corridors, where NLOS conditions and limited lighting infrastructure significantly affect localization performance. This study demonstrated the effectiveness of our proposed indoor localization algorithms in narrow hallway environments with limited LED infrastructure. The proposed CA-GST method helped achieve a root mean squared error (RMSE) of 0.2 meters, representing a 55% reduction compared to the Transformer model and a 44% reduction compared to GraphSAGE alone. Furthermore, the proposed algorithm has an RMSE approximately three times lower than that of traditional machine learning algorithms, such as RF and kNN. These improvements are especially significant given the 1.4-meter-wide, oddly shaped hallway and the limitations imposed by the number of available LED sources.
However, the proposed method still has some limitations. It requires further validation in larger environments with more obstacles. In addition, the method has relatively high computational cost, which may affect real-time performance.
Future work will focus on deploying this model in real-time systems and evaluating its performance on mobile indoor robots to enable reliable navigation in complex, constrained indoor spaces.













