1. Introduction
Global navigation satellite systems provide reliable outdoor positioning but become ineffective in indoor environments due to severe signal attenuation, multipath propagation, and non-line of sight blockage [
1]. As a result, large and structurally complex buildings—particularly hospitals—require dedicated indoor positioning solutions to ensure patient tracking, staff navigation, asset management, emergency response, and workflow optimization [
2]. Hospital environments are especially challenging because of their dense room partitions, long corridors, metal-rich equipment, and dynamic human activity, all of which produce highly non-stationary radio and magnetic fields.
A wide range of indoor positioning technologies has been explored to address these challenges. Fingerprinting-based methods using Wi-Fi Received Signal Strength Indicator (RSSI) [
3,
4,
5], Bluetooth Low Energy (BLE) beacons [
6,
7], or magnetic field fingerprints [
8,
9] have been widely adopted due to their compatibility with commodity smartphones. However, these approaches often suffer from labor-intensive site surveys, sensitivity to environmental changes, limited accuracy in multi-floor settings, and high maintenance overhead [
10]. Time-based and angle-based technologies—such as ultra-wide band, angle of arrival [
11], time differential of arrival [
12], and Wi-Fi round trip time [
13]—can achieve higher accuracy but typically require costly infrastructure upgrades, careful calibration, or specialized receivers that are impractical for many hospitals. Recent machine learning and deep learning approaches [
14,
15] attempt to enhance localization using radio maps, inertial sensing, or hybrid modalities, yet they remain constrained by drift accumulation, sparse ground truth, or the difficulty of learning robust spatial representations under complex indoor dynamics.
While recent advances such as deep learning-based fingerprinting and magnetic SLAM have demonstrated promising improvements, they still face several practical limitations in complex indoor environments. Deep learning fingerprinting methods often require large labeled datasets and remain sensitive to temporal variations in radio maps caused by environmental dynamics [
16,
17,
18]. Magnetic SLAM approaches typically rely on loop-closure constraints or computationally intensive optimization procedures, which are difficult to satisfy in long and structurally repetitive hospital corridors [
8,
9]. Graph-based PDR correction methods can improve trajectory consistency by incorporating spatial constraints, but their performance fundamentally depends on the accuracy of the underlying motion model and therefore remains vulnerable to cumulative drift [
19,
20,
21,
22]. These limitations highlight the need for a localization framework that leverages accumulated spatial signal structures while maintaining low infrastructure dependency and robustness to inertial errors.
To overcome these limitations, spatial pattern analysis has emerged as a promising direction. In particular, Surface Correlation (SC) [
23,
24] offers a powerful way to compare two spatial signal distributions by evaluating the structural similarity between a user-generated signal surface and the corresponding spatial patterns in a pre-constructed radio map. SC is particularly suitable for indoor environments with rapid and irregular signal fluctuations, as it compares accumulated spatial signal patterns rather than relying on instantaneous measurements. However, in pedestrian localization, the user RSSI surface is constructed based on Pedestrian Dead Reckoning (PDR) estimated trajectories, and accumulated PDR errors can distort the generated surface itself, leading to unreliable pattern matching.
In this work, we propose a novel AI-based spatial pattern matching framework for hospital indoor positioning. The framework constructs user spatial patterns using an AI-based Pedestrian Dead Reckoning (PDR) model that directly estimates pedestrian trajectories from inertial sensor sequences, without relying on explicit step detection or manually tuned thresholds. By learning pedestrian motion patterns in a data-driven manner, the AI-PDR provides more stable trajectory estimates compared to conventional step-based approaches. These AI-generated trajectories are fused with BLE RSSI measurements to form a User RSSI Surface (URS), which captures both geometric motion information and accumulated spatial radio signal characteristics.
Unlike conventional indoor localization approaches that rely on instantaneous signal matching or geometry-based trajectory correction, the proposed framework operates on accumulated spatial signal patterns generated along the pedestrian trajectory. This paradigm shift enables robust localization under severe RSSI fluctuations and inertial drift conditions commonly observed in hospital environments. Furthermore, the proposed system integrates a data-driven inertial trajectory model with surface-level radio signal matching and iterative heading correction, forming a unified localization framework that differs fundamentally from existing fingerprinting, SLAM, and graph-based approaches.
The main contributions of this work are summarized as follows:
A spatial pattern-based localization framework that utilizes accumulated RSSI surfaces instead of point-wise signal matching.
An AI-based inertial trajectory generation model that stabilizes spatial pattern construction without explicit step detection.
A surface correlation-based heading correction mechanism that iteratively compensates trajectory drift during localization.
Finally, the remainder of this paper is organized as follows.
Section 2 reviews existing indoor positioning approaches, their limitations and recent machine learning and deep learning-based localization techniques.
Section 3 describes the proposed AI-generated spatial pattern matching system, including the overall workflow, the AI-PDR module, and the bi-directional candidate generation with SC-based heading correction.
Section 4 presents the experimental setup, quantitative performance evaluation, and analysis conducted in a real hospital environment.
Section 5 concludes the paper by summarizing the main contributions and discussing potential applications and future research directions for complex indoor facilities.
2. Related Works
Fingerprinting-based localization using Wi-Fi or BLE signals [
25,
26,
27] is among the most widely adopted indoor positioning approaches due to its compatibility with existing wireless infrastructure and commodity mobile device. These methods typically consist of an offline phase, where radio signal characteristics such as RSSI are collected at known reference points to build a radio map, and an online phase, where real-time measurements are matched against the stored fingerprints. Wi-Fi fingerprinting can achieve reasonable accuracy in many indoor scenarios; however, its performance is sensitive to environmental dynamics, device heterogeneity, and signal fluctuations [
28,
29]. BLE-based fingerprinting has gained attention due to low power consumption and flexible deployment, yet BLE RSSI often exhibits stronger temporal and spatial variability, making stable localization difficult without frequent recalibration [
30]. In addition, fingerprinting approaches require labor-intensive site surveys and suffer from scalability and maintenance issues in large or multi-floor environments [
31].
Smartphone-based PDR [
19,
20,
21,
32] estimates user motion by integrating inertial measurements from built-in sensors such as accelerometers and gyroscopes and in some cases magnetometers to reconstruct relative trajectories. Because it does not require dedicated external infrastructure, smartphone PDR enables continuous positioning and is appealing for scalable indoor navigation. However, it is inherently prone to cumulative errors. Sensor noise, changes in how the phone is carried such as hand held versus pocket, and inaccuracies in heading estimation lead to drift that accumulates over time. Even small angular biases can cause substantial positional deviations along long trajectories. Although map constraints and sensor calibration can partially reduce drift, smartphone-only PDR remains unreliable for long term absolute localization.
With the advancement of machine learning and deep learning, data-driven approaches have been increasingly applied to indoor localization. Neural networks have been used to model nonlinear relationships between signal measurements and locations, replacing conventional distance-based or probabilistic fingerprint matching techniques [
16,
33]. Convolutional [
17,
34], recurrent [
18], and attention-based architectures [
35,
36] have been explored to capture spatial and temporal correlations in radio signals, and learning-based fingerprinting methods often show improved robustness to noise and partial environmental changes. However, these models typically require large labeled datasets, and their generalization across different buildings or after environmental changes remains limited, often necessitating retraining or fine-tuning. Learning-based models can be used in inertial navigation to estimate motion more accurately over short time windows from sequences of sensor readings. However, if there are few or no external references such as radio anchors, maps, or landmarks, errors still accumulate and long term drift remains difficult to avoid.
In contrast to the aforementioned approaches, the proposed method does not rely on point-wise signal fingerprints, explicit geometric constraints, or loop-closure assumptions. Instead, it constructs trajectory-generated spatial RSSI patterns and performs localization through structural similarity evaluation. By integrating data-driven inertial trajectory modeling with surface-level radio signal matching, the proposed framework provides robustness against short-term signal fluctuations and inertial drift without requiring dense infrastructure or computationally expensive optimization. This positioning differentiates the proposed approach from existing fingerprinting, SLAM, and graph-based localization methods.
4. Experimental Results
4.1. Experimental Setting
The experiments were conducted on the first floor of Hallym Sacred Heart Hospital, located in Chuncheon, Gangwon Province, Republic of Korea, which represents a typical indoor environment where GPS signals are unavailable. This section sequentially describes the BLE beacon deployment, the radio map construction process, and the test data collection procedure for evaluating localization performance.
To ensure experimental reproducibility, the hardware and software configuration used in this study is described as follows. The data collection experiments were performed using a commercial smartphone (Samsung Galaxy S22 Ultra, Samsung, Suwon, Republic of Korea) equipped with IMU sensors and BLE communication capability, running the Android 16 operating system. Sensor measurements, including tri-axial accelerometer and gyroscope data, were recorded at a sampling rate of 50 Hz using a custom-developed Android application.
BLE signals were transmitted using custom-developed BLE beacon devices designed and implemented by the authors in compliance with the Korean radio communication standards for low-power wireless equipment. The beacons were configured with a transmission power of −4 dBm and an advertising interval of 100 ms. A total of 11 BLE beacons were deployed along the hospital corridor to provide sufficient spatial coverage for radio map construction.
The collected dataset was processed and used to train the AI-PDR model using Python 3.10 with the TensorFlow deep learning framework and standard scientific computing libraries, including NumPy and SciPy.
4.1.1. Experimental Environment
To construct the radio map within the experimental environment, a total of 11 BLE beacons were deployed. The beacons were evenly installed along the corridors and main pedestrian pathways on the first floor of the hospital.
Figure 9a presents the actual photograph of the first floor of Hallym Sacred Heart Hospital, while
Figure 9b shows the floor plan of the first floor used for the experiment.
4.1.2. Radio Map Construction
Data collection for radio map construction was conducted by a single participant following the same closed-loop trajectory. BLE RSSI data were collected along a closed-loop path that starts from the elevator area and returns to the initial location, as illustrated in
Figure 10.
First, reference points were generated at 1 m intervals within the actual walkable area, and the overall spatial extent of the radio map was determined based on the spatial distribution of these reference points. The RSSI measurements collected along the walking trajectory were assigned to the nearest reference points. To enhance spatial robustness, the RSSI value at each reference point was further propagated to its adjacent reference points at 1 m intervals; for reference points where RSSI values remained missing, the RSSI was completed by searching for nearby valid reference points along the
and
directions and averaging the retrieved values. In addition, for physically inaccessible areas, RSSI values were uniformly set to −100 dBm to explicitly represent the absence of radio signals. Based on the constructed radio map, a two-dimensional Gaussian smoothing was further applied to suppress local noise and irregular fluctuations while preserving the overall spatial distribution characteristics of the radio signals, resulting in a stable and continuous radio map, as illustrated in
Figure 11.
4.1.3. Test Data Collection
Test data collection for evaluating localization performance was conducted by two different participants in the same experimental environment. Each participant collected data while walking along two predefined user scenarios. The user scenarios employed in the experiments are illustrated in
Figure 12. A Samsung Galaxy S22U smartphone was used for test data collection. During the data acquisition process, the smartphone simultaneously recorded IMU sensor data and time-synchronized BLE RSSI measurements. The collected IMU time-series data were used as inputs to the proposed AI-PDR model, which estimates the traveled distance and heading change for each walking segment. These estimates were cumulatively integrated to generate the pedestrian’s movement trajectory. The generated pedestrian trajectories and the BLE RSSI data collected along the walking paths were then combined with the previously constructed radio map and used for localization performance evaluation. In this manner, the test data were collected independently from the radio map construction data, enabling a fair comparison of localization results under identical environmental and path conditions.
4.2. Experimental Analysis
In both scenarios, the localization trajectories obtained using the SC-based method generally followed the ground-truth walking path, indicating good consistency in path estimation. The generated trajectories exhibited high spatial smoothness and continuity, maintaining stable trajectory characteristics even in turning and curved segments.
4.2.1. Estimation Analysis
As shown in
Figure 13, the localization trajectories for both users generally follow the ground-truth paths in both scenarios. In Scenario 1, User 2 exhibits more noticeable local fluctuations in the left turning region, whereas User 1 shows relatively smoother trajectories; the results for both users become more stable in the straight corridor segments. In Scenario 2, the trajectories of both users show higher overall consistency, particularly along the long straight corridor, where they closely overlap with the ground-truth path. The main deviation appears as a small parallel offset in the bottom corridor section. Overall, the proposed method maintains reasonable trajectory continuity and stability across different users and path conditions.
4.2.2. Quantitative Error Analysis
Table 3 summarizes the statistical results of localization errors for different localization methods, including KNN fingerprinting, particle filter (PF), the standalone AI-PDR approach, and the proposed method. The evaluation metrics include the mean error, root mean square error (RMSE), and maximum error under various scenarios and user conditions.
For the standalone AI-PDR approach, the initial position and initial heading were assumed to be known. Specifically, the starting point of the trajectory was aligned with the ground-truth coordinate, and the initial heading was calibrated using the reference orientation at the beginning of the trajectory. This assumption allows the evaluation to focus on the relative motion estimation capability of the AI-PDR model, independent of initialization errors. In practical deployments, such initialization information can be obtained from infrastructure-based localization methods or user-assisted calibration procedures. In contrast, the proposed method reduces the dependence on accurate initialization by incorporating infrastructure-derived spatial constraints.
Let
denote the localization error at the
-th estimated position and
denote the total number of samples. The three error metrics are defined as follows:
In Scenario 1 for User 1, the standalone AI-PDR approach achieved the best performance, with a mean error of 1.84 m and an RMSE of 2.21 m, whereas the proposed method showed relatively lower performance, with a mean error of 4.90 m and an RMSE of 6.11 m. However, this result can be attributed to the favorable effect of the initialization assumption for AI-PDR under specific path conditions. The slight increase in the maximum error of the proposed method is also caused by localized deviations in a small number of segments and does not significantly affect the overall performance trend.
In contrast, for Scenario 1 with User 2, the proposed method achieved the best performance across all metrics, with a mean error of 4.01 m, an RMSE of 4.31 m, and a maximum error of 8.08 m, outperforming KNN, PF, and the standalone AI-PDR approach.
In Scenario 2, the proposed method consistently showed the best performance for both users. For User 1, the mean error and RMSE were reduced to 2.05 m and 2.56 m, respectively, compared with KNN and PF as illustrated in
Figure 14. For User 2, the proposed method achieved the most notable improvement, with a mean error of 1.87 m, an RMSE of 2.12 m, and a maximum error of 4.43 m. The significant reduction in maximum error for User 2 indicates that the proposed method maintains strong robustness against variations in trajectory patterns and user characteristics.
The overall results further confirm the superiority of the proposed method, which achieved a mean error of 3.21 m and an RMSE of 4.10 m, outperforming KNN (5.03 m, 5.99 m), PF (3.56 m, 4.22 m), and the standalone AI-PDR approach (7.02 m, 9.30 m).
In summary, the proposed method achieves the best localization accuracy overall and maintains stable performance across different users and path environments, demonstrating strong robustness.
4.2.3. Error Distribution Analysis
Under identical path conditions,
Figure 15 presents the cumulative distribution functions (CDFs) of localization errors for the KNN-based fingerprinting method, particle filter (PF), the standalone AI-PDR approach, and the proposed method across different users and scenarios. This comparison enables an analysis of the error distribution characteristics and the tendency of large-error occurrences for each method.
In Scenario 1, performance differences vary depending on the user; however, the proposed method generally exhibits more stable distribution characteristics in the intermediate and high-error regions. For User 1, the standalone AI-PDR approach shows relatively favorable performance in the low-error range, whereas the error distributions of PF and KNN expand more rapidly as the error increases. In contrast, the proposed method maintains a more gradual increase in the high-error region, effectively suppressing the occurrence of large localization errors. For User 2, the advantage of the proposed method becomes more evident, achieving lower error values than the other methods at the same confidence levels (e.g., the 90th percentile).
In Scenario 2, the proposed method demonstrates the most stable CDF behavior for both users. While the differences among methods are relatively small in the low-error region, the superiority of the proposed method becomes increasingly pronounced in the intermediate-to-high error range. In particular, under the User 2 condition, the proposed method maintains a more constrained distribution compared with the KNN and standalone AI-PDR approaches, which exhibit larger distribution spreads in the high-error region, thereby effectively reducing large localization errors.
Overall, the CDF analysis indicates that the proposed method maintains a more stable error distribution across different users and path conditions and effectively reduces localization errors in high-confidence regions. These results demonstrate that the proposed method provides more consistent localization performance and improved robustness compared to the existing methods.
4.3. Discussion
The results of this study indicate that indoor localization based on accumulated spatial patterns provides a robust alternative to conventional point-wise fingerprint matching. The proposed technology constructs unified spatial patterns that reflect both user motion and radio signal distributions. Operating at the pattern level allows the system to leverage temporally accumulated information, which improves robustness against short-term RSSI fluctuations and reduces sensitivity to instantaneous measurement noise.
Despite these advantages, several challenges must be addressed to achieve more general and widely applicable indoor localization. First, reliable operation under diverse pedestrian motion behaviors remains essential. Real-world users exhibit varying walking speeds, frequent stops, abrupt turns, and irregular motion patterns, all of which can affect trajectory estimation. While the AI-PDR model improves trajectory stability, further evaluation under a broader range of motion conditions is necessary. Second, although BLE-based radio surfaces demonstrated promising performance in the evaluated environment, their robustness under more extreme or complex signal conditions requires further study. Scenarios involving sparse beacon deployment, strong interference, or highly cluttered indoor spaces may introduce additional uncertainty, and understanding the limits of BLE-based spatial patterns is an important direction for future work. A further challenge is related to the intrinsic behavior of surface correlation during the early stage of pattern formation. Because reliable correlation requires a sufficient accumulation of spatial patterns, localization estimates can become unstable before the user-generated pattern fully develops, leading to transient position jumps. This issue is fundamentally associated with insufficient spatial support rather than absolute initialization error. One promising direction to address this limitation is to incorporate additional and complementary measurements—such as short-term inertial constraints, Wi-Fi signals, magnetic field patterns, or map-derived features—to stabilize localization during the early phase before the spatial pattern matures. In addition, the construction of radio maps still relies on site surveys. Integrating simultaneous localization and mapping-based techniques offers a promising approach to reduce deployment effort while maintaining spatial consistency. Furthermore, extending the framework to support heterogeneous users and devices, as well as fusing multiple sensing modalities, could significantly enhance generalization and robustness. These extensions would move the proposed approach closer to a unified indoor localization framework capable of operating reliably across diverse environments and usage conditions.