An indoor positioning method and device based on multi-source data fusion and deep learning
By fusing Wi-Fi signals, inertial measurement units, and indoor map data through an end-to-end deep learning network, the problem of insufficient positioning accuracy and robustness in complex indoor environments is solved, achieving high-precision positioning and reducing hardware costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA UNICOM ONLINE INFORMATION TECHNOLOGY CO LTD
- Filing Date
- 2026-05-06
- Publication Date
- 2026-06-02
Smart Images

Figure CN122130095A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and location services, and in particular to an indoor positioning method, apparatus, device, and storage medium based on multi-source data fusion and deep learning. Background Technology
[0002] With the rapid development of IoT technology and smart mobile terminals, indoor positioning technology has shown broad application prospects in areas such as shopping mall navigation, emergency management, and personnel monitoring. However, signal propagation in complex indoor environments is susceptible to multipath effects, non-line-of-sight attenuation, and dynamic interference. A single signal source cannot simultaneously guarantee accuracy and robustness, making multi-source data fusion an important direction for indoor positioning research. Among these, how to efficiently fuse Wi-Fi signals, inertial navigation data, and indoor map information through deep learning and attention mechanisms is still being explored by academia and industry through various technical approaches.
[0003] The most similar existing implementation schemes mainly include:
[0004] A similar implementation scheme is the UWB / IMU-based deep learning fusion scheme. This approach typically uses ultra-wideband (UWB) instead of Wi-Fi as the primary wireless signal source and fuses it with inertial measurement unit (IMU) data. Its core lies in utilizing deep learning networks (such as Long Short-Term Memory (LSTM), Convolutional Neural Networks (CNN), or their variants) to extract deep features from multi-source data to address signal attenuation and multipath effects under non-line-of-sight conditions, ultimately achieving centimeter-level high-precision positioning. However, this scheme relies on dedicated UWB hardware base stations and tags, resulting in high deployment costs and power consumption, making it difficult to popularize in existing consumer terminals such as smartphones, thus limiting its large-scale application.
[0005] A similar implementation scheme two: a hybrid filtering and learning scheme based on Wi-Fi / IMU / map information. This scheme is closest to the data source used in this invention, namely, fusing Wi-Fi signal strength data and inertial sensor data. To improve positioning accuracy, some studies further introduce LiDAR or use indoor map information for spatial constraints. In terms of fusion architecture, this scheme often adopts a hierarchical or hybrid processing flow: first, deep learning is used to extract features and coarsely locate the Wi-Fi fingerprint, and then IMU data is fused through extended Kalman filter (EKF) for trajectory smoothing and cumulative error correction. This technical approach achieves a balance between low cost and usability to a certain extent, but still has the following limitations: First, the fusion architecture has a serial processing characteristic, which is essentially a combination of multi-source results rather than a deep fusion of features, making it difficult to fully explore the complementary information between sensors; second, the statistical assumptions of traditional filters regarding noise often do not hold in complex dynamic environments, easily leading to filter divergence; third, map information is mostly used as a post-processing constraint and fails to achieve joint optimization with signal data in the same feature space. Summary of the Invention
[0006] The present invention aims to at least partially solve one of the technical problems in the related art.
[0007] To address this, this invention proposes an indoor positioning method based on multi-source data fusion and deep learning. It involves real-time acquisition of Wi-Fi signal strength, inertial measurement unit (IMU) data, and indoor map data; time synchronization and sliding window slicing of heterogeneous data to construct a multimodal input tensor; extraction of Wi-Fi spatial features and inertial temporal features using convolutional neural networks and long short-term memory networks respectively, combined with a pre-trained residual network to extract map topological features; dynamic calculation of confidence weights for each modality using a cross-modal attention mechanism and weighted fusion; and input of the fused features into a fully connected decoder to regress the target location coordinates. This invention achieves tightly coupled fusion of multi-source data through an end-to-end deep learning framework, and adaptively adjusts signal weights using an attention mechanism, improving positioning accuracy and robustness in complex indoor environments while effectively reducing hardware deployment costs.
[0008] Another objective of this invention is to propose an indoor positioning device based on multi-source data fusion and deep learning.
[0009] The third objective of this invention is to provide a computer device.
[0010] A fourth objective of this invention is to provide a non-transitory computer-readable storage medium.
[0011] To achieve the above objectives, this invention proposes an indoor positioning method based on multi-source data fusion and deep learning, comprising: S1, acquire multi-source data, including Wi-Fi signal strength data, inertial measurement unit data, and indoor map data; S2 preprocesses the multi-source data by aligning and slicing the Wi-Fi signal strength data, inertial measurement unit data, and indoor map data according to the same time window to construct a multimodal input tensor. S3, input the multimodal input tensors into the corresponding feature extraction networks to extract the deep feature vectors of each modality; S4, input the deep feature vector into the attention mechanism module, calculate the dynamic weights of each modality, and perform weighted fusion of the deep feature vector according to the dynamic weights to obtain the fused features; S5 inputs the fused features into the localization decoder to obtain the target location coordinates.
[0012] An indoor positioning method based on multi-source data fusion and deep learning according to an embodiment of the present invention may also have the following additional technical features: In one embodiment of the present invention, acquiring multi-source data includes: S11, collect Wi-Fi data with the positioning terminal. The Wi-Fi data includes the MAC addresses of surrounding wireless access points and the corresponding received signal strength indication values, and record the scan timestamp. S12, the positioning terminal collects inertial data, including three-axis accelerometer data, three-axis gyroscope data and three-axis magnetometer data, and records high-precision timestamps; S13, acquire indoor map data. The indoor map data is a vector map, which includes the location of walls, passable areas, spatial layout information of doors and stairs, and is represented in the form of a binary raster map.
[0013] In one embodiment of the present invention, the preprocessing of multi-source data, which involves aligning and slicing Wi-Fi signal strength data, inertial measurement unit data, and indoor map data according to the same time window to construct a multimodal input tensor, includes: S21, using the sampling time of the inertial measurement unit data as a reference, linear interpolation is performed on the sequence of received signal strength indication values of Wi-Fi signal strength data, so that each inertial measurement unit data sample has a corresponding Wi-Fi feature vector, thereby achieving time alignment; S22, construct a sliding window, slice the aligned multi-source data with a preset window length and sliding step size, and generate window data containing Wi-Fi feature matrix and inertial measurement unit feature tensor; wherein, the dimension of Wi-Fi feature matrix is determined by the number of Wi-Fi scans in the window and the total number of wireless access points in the environment, and the dimension of inertial measurement unit feature tensor is determined by the number of inertial measurement unit samples in the window and the number of sensor channels. S23, using the center position of the sliding window as the center, crop a local map raster of a preset size from the indoor map data as the map feature corresponding to the window data.
[0014] In one embodiment of the present invention, the step of inputting the multimodal input tensors into corresponding feature extraction networks to extract deep feature vectors for each modality includes: S31, input the Wi-Fi feature matrix in the multimodal input tensor into the first feature extraction branch. The first feature extraction branch adopts an architecture that combines a one-dimensional convolutional neural network and a Transformer encoder to extract the local mode features of the Wi-Fi signal and the spatial correlation features between wireless access points, and outputs the deep feature vector of the Wi-Fi mode. S32, input the inertial measurement unit feature tensor in the multimodal input tensor into the second feature extraction branch. The second feature extraction branch uses a bidirectional long short-term memory network combined with a temporal attention mechanism to extract the motion temporal features of pedestrian heading and stride frequency, and automatically focuses on key motion moments in the gait cycle to output the deep feature vector of inertial mode. S33, input the local map raster image in the multimodal input tensor into the third feature extraction branch. The third feature extraction branch uses a pre-trained residual network to encode the map raster image into a map modality deep feature vector of a preset dimension.
[0015] In one embodiment of the present invention, the step of inputting the deep feature vector into the attention mechanism module, calculating the dynamic weights of each modality, and weighting and fusing the deep feature vector according to the dynamic weights to obtain the fused features includes: S41, the deep feature vectors of each modality are concatenated in the channel dimension to generate multimodal fusion features as the query matrix; the deep feature vectors of each modality are used as the key matrix and value matrix respectively; and the query matrix and the key matrices of each modality are mapped to the same dimensional space through a linear transformation layer, and the attention score between the query matrix and the key matrices of each modality is calculated. S42, the attention scores are normalized using the Softmax function to obtain the dynamic weight coefficients of each modality. The dynamic weight coefficients represent the confidence of each modality data source at the current time. Then, the value matrices of each modality are weighted and summed according to the dynamic weight coefficients to generate the weighted fused attention features, which are used as the fused features.
[0016] In one embodiment of the present invention, the step of inputting the fused features into the localization decoder to obtain the target location coordinates includes: S51 inputs the fused features into the localization regression decoder, which is composed of fully connected layers, and maps them to generate the predicted position coordinates at the current moment. S52, the localization regression decoder is trained end-to-end according to a pre-constructed composite loss function, the composite loss function including a coordinate regression loss term, a ground... Figure One Consistency loss term and trajectory smoothness loss term; among them, the coordinate regression loss term uses the root mean square error function to constrain the error between the predicted position coordinates and the true position coordinates; Figure One The consistency loss term is used to calculate the distance from the predicted location coordinates to the nearest passable area as a penalty when the predicted location coordinates fall into an inaccessible area in the indoor map; the trajectory smoothness loss term is used to constrain the rate of change of displacement between adjacent predicted location coordinates to suppress jumps in the positioning results.
[0017] To achieve the above objectives, another aspect of the present invention proposes an indoor positioning device based on multi-source data fusion and deep learning, comprising: The multi-source data acquisition module is used to acquire multi-source data, including Wi-Fi signal strength data, inertial measurement unit data, and indoor map data. The multimodal tensor construction module is used to preprocess multi-source data, aligning and slicing Wi-Fi signal strength data, inertial measurement unit data, and indoor map data according to the same time window to construct a multimodal input tensor. The multi-branch feature extraction module is used to input the multimodal input tensors into the corresponding feature extraction networks to extract the deep feature vectors of each modality. The dynamic attention fusion module is used to input the deep feature vector into the attention mechanism module, calculate the dynamic weights of each modality, and perform weighted fusion of the deep feature vectors according to the dynamic weights to obtain fused features. The location regression decoding module is used to input the fused features into the location decoder to obtain the target location coordinates.
[0018] This invention discloses an indoor positioning method and apparatus based on multi-source data fusion and deep learning. By constructing an end-to-end deep learning network that fuses heterogeneous multi-source data and employing a cross-modal attention mechanism to achieve dynamic feature weighting, it effectively solves the problems of poor positioning accuracy and insufficient robustness caused by signal source fluctuations, loose fusion architecture, and low map utilization in existing technologies. It achieves integrated modeling from multimodal tensor construction, deep feature extraction, dynamic weight fusion to location coordinate regression, significantly improving positioning accuracy and stability in complex indoor environments, while reducing hardware deployment costs and enhancing the model's environmental adaptability and engineering applicability in dynamic scenarios.
[0019] To achieve the above objectives, a third aspect of this application provides a computer device, including a processor and a memory; wherein the processor reads executable program code stored in the memory to run a program corresponding to the executable program code, for implementing an indoor positioning method based on multi-source data fusion and deep learning as described in the first aspect embodiment.
[0020] To achieve the above objectives, a fourth aspect of this application provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements an indoor positioning method based on multi-source data fusion and deep learning as described in the first aspect embodiment.
[0021] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0022] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 This is a flowchart of an indoor positioning method based on multi-source data fusion and deep learning according to an embodiment of the present invention; Figure 2 This is an overall architecture diagram of an indoor positioning system based on multi-source data fusion and deep learning according to an embodiment of the present invention; Figure 3 This is a multimodal feature extraction network structure diagram of an indoor positioning system based on multi-source data fusion and deep learning according to an embodiment of the present invention; Figure 4 This is a structural diagram of a cross-modal attention mechanism for an indoor positioning system based on multi-source data fusion and deep learning according to an embodiment of the present invention. Figure 5 This is a schematic diagram of an indoor positioning device based on multi-source data fusion and deep learning according to an embodiment of the present invention; Figure 6 It is a computer device according to an embodiment of the present invention. Detailed Implementation
[0023] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0024] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0025] The following description, with reference to the accompanying drawings, describes an indoor positioning method, apparatus, device, and storage medium based on multi-source data fusion and deep learning according to embodiments of the present invention.
[0026] The core idea of this invention is to achieve tightly coupled fusion of multi-source heterogeneous data by constructing an end-to-end deep learning network. Specifically, it collects Wi-Fi signal strength, inertial measurement unit data, and indoor map data in real time, performs time synchronization and sliding window slicing on the heterogeneous data, and constructs a multimodal input tensor. A multi-branch feature extraction network is used to extract Wi-Fi spatial distribution features using a convolutional neural network, inertial temporal features using a bidirectional long short-term memory network, and map topological features using a pre-trained residual network, obtaining deep feature vectors for each modality. Based on this, a cross-modal attention mechanism is introduced to dynamically calculate the confidence weights of each modality and perform weighted fusion, achieving adaptive integration at the feature level. Finally, the fused features are input into a fully connected positioning decoder to regress and obtain the target location coordinates. Through this integrated modeling, the traditionally separate signal processing and location calculation are transformed into an intelligent positioning system capable of adaptively fusing multi-source information, suppressing signal fluctuation interference, and fully utilizing map physical constraints. This significantly improves positioning accuracy, robustness, and environmental adaptability in complex indoor environments, while effectively reducing hardware deployment costs.
[0027] Example 1 To achieve the above invention, embodiments of the present invention provide an indoor positioning method based on multi-source data fusion and deep learning, such as... Figure 1 As shown, it includes: S1 acquires multi-source data, including Wi-Fi signal strength data, inertial measurement unit data, and indoor map data.
[0028] Specifically, Wi-Fi signal strength data reflects the spatial attenuation relationship between the terminal and surrounding wireless access points, and its distribution characteristics at different locations constitute the physical basis for fingerprint positioning. Inertial measurement unit (IMU) data continuously records the terminal's motion state, including linear acceleration, angular velocity, and geomagnetic direction, through accelerometers, gyroscopes, and magnetometers, enabling the capture of pedestrians' gait cycles, heading changes, and displacement increments. Indoor map data describes the topological constraints of the environment in a structured form, including wall boundaries, passable areas, and the spatial locations of key landmarks. These three types of data characterize the positioning scenario from three dimensions: signal propagation characteristics, kinematic laws, and environmental geometric constraints. Their joint acquisition provides a data foundation for subsequent in-depth mining and complementary fusion of multimodal features.
[0029] Specifically, a smartphone is used as the positioning terminal for multi-source data acquisition. Wi-Fi data acquisition is achieved by calling the terminal system's wireless scanning interface, periodically scanning surrounding wireless access points to obtain the MAC address of each access point and its corresponding received signal strength indicator value, while recording the system timestamp for each scan. Due to the limitations of the terminal hardware capabilities, the actual frequency of Wi-Fi scanning is approximately 1Hz. Inertial data acquisition is achieved by calling the terminal's built-in inertial measurement unit, acquiring three-axis accelerometer data at a frequency of 200Hz, three-axis gyroscope data at a frequency of 200Hz, and three-axis magnetometer data at a frequency of 100Hz, and attaching a high-precision hardware timestamp to each sampling point. Indoor map data is pre-loaded into the terminal's local storage, using a vector map format, including geometric information such as wall outlines, doorway locations, stairwell areas, and passable spaces, and is stored and retrieved in the form of a binary raster map, where white pixels represent passable areas, black pixels represent wall obstacles, and gray pixels represent unknown areas.
[0030] Furthermore, the parameters for Wi-Fi data acquisition include: a scanning frequency of approximately 1Hz, with 5 to 30 wireless access points detectable per scan, and recording the MAC address (48-bit physical address) of each access point and its corresponding received signal strength indication (typically ranging from -100dBm to -20dBm). The parameters for inertial data acquisition include: an accelerometer range of ±8g and a sampling frequency of 200Hz; a gyroscope range of ±1000° / s and a sampling frequency of 200Hz; a magnetometer range of ±4800μT and a sampling frequency of 100Hz; and storage of data for each channel in 16-bit integer or 32-bit floating-point format. The parameters for map data include: a vector map rasterized to generate a binary raster map with a resolution of 0.1 meters per pixel; and the coverage area of a single map can be set from 50m × 50m to 200m × 200m depending on the scene size.
[0031] Specifically, in large shopping mall environments, Wi-Fi data can be collected using the mall's existing commercial Wi-Fi coverage network, eliminating the need for additional dedicated base stations; inertial data is automatically recorded using users' smartphones, requiring no user intervention; and map data can be obtained by digitizing existing fire evacuation maps or floor plans. In office building scenarios, this method utilizes densely deployed enterprise-grade wireless access points in office areas to provide abundant Wi-Fi signal sources, combined with inertial data generated by employees' daily movements, to achieve continuous location tracking of people indoors. In underground parking lot scenarios, although GPS signals are completely absent, parking lots typically have Wi-Fi coverage; combined with inertial data generated by vehicle starting, turning, and parking, this effectively supports applications such as vehicle location and navigation.
[0032] Specifically, firstly, by fully utilizing existing infrastructure, data acquisition can be completed solely using the Wi-Fi modules and inertial sensors commonly found in smartphones, eliminating the need for dedicated positioning hardware such as UWB base stations and Bluetooth beacons, significantly reducing system deployment costs and maintenance complexity. Secondly, the synchronous acquisition of multi-source data preserves the original characteristics and timestamp information of various signals, providing a high-precision temporal reference for subsequent time alignment and sliding window tiling. Thirdly, the introduction of map data enables deep learning models to anticipate the physical constraints of the environment, providing prior knowledge for eliminating logical errors such as "wall penetration." Fourthly, the joint acquisition of high-frequency inertial data and low-frequency Wi-Fi data forms a complementary information acquisition architecture. While ensuring controllable system power consumption, it captures both the spatial distribution characteristics of Wi-Fi signals and records continuous temporal information of the motion process, laying a solid data foundation for high-precision positioning.
[0033] Furthermore, S1 includes: S11, the positioning terminal collects Wi-Fi data, including the MAC addresses of surrounding wireless access points and the corresponding received signal strength indication values, and records the scan timestamp.
[0034] Specifically, when Wi-Fi signals propagate in indoor environments, their received signal strength indicators exhibit specific spatial distribution patterns due to the influence of walls, obstacles, and multipath effects. By scanning surrounding wireless access points and recording their MAC addresses and corresponding RSSI values, the signal characteristics of different locations can be captured, forming a signal fingerprint associated with spatial coordinates. Simultaneously, recording the scan timestamp provides a timing reference for subsequent time alignment with inertial data, ensuring accurate correlation of multi-source data in the time dimension.
[0035] Furthermore, using a smartphone as the positioning terminal, data collection is achieved by calling the Wi-Fi scanning interface provided by the operating system. The terminal periodically initiates Wi-Fi scanning requests, and each scan returns a list of detectable wireless access points in the current environment. For each access point in the list, its Basic Service Set Identifier (MAC address) and the current received signal strength indicator value are obtained. Due to the hardware limitations of mobile terminals and system scheduling strategies, the actual frequency of Wi-Fi scanning is usually stable at around 1Hz. To ensure the temporal integrity of the data, after each scan, the system records the current timestamp. This timestamp can be obtained based on the terminal's system time and matched with the high-precision timestamp of subsequent inertial data, laying the foundation for time synchronization of multi-source data.
[0036] Furthermore, Wi-Fi data acquisition involves setting and recording several key parameters. The number of wireless access points acquired in a single scan depends on the AP deployment density of the terminal's environment, typically ranging from 5 to 30. Each access point corresponds to one data record, containing a 48-bit MAC address (stored as a hexadecimal string) and its corresponding Received Signal Strength Indicator (RSSI) value. The physical meaning of the RSSI value is the logarithm of the ratio of received signal power to 1 milliwatt, measured in dBm, with a typical dynamic range of -100dBm to -20dBm; a higher value indicates a stronger signal. Scan timestamps are recorded with millisecond precision, typically using the number of milliseconds since system startup or a Unix timestamp format for accurate alignment with the high-precision timestamps of inertial data. The scanning frequency is approximately 1Hz, meaning one set of Wi-Fi scan data is generated per second.
[0037] Specifically, in large shopping mall environments, Wi-Fi scanning leverages the mall's existing commercial Wi-Fi network, offering wide coverage and high AP density, providing rich fingerprint features. In office building scenarios, dense deployment of enterprise-grade APs supports high-resolution fingerprint positioning. In transportation hubs such as airports and train stations, the combination of public Wi-Fi coverage and high pedestrian density provides basic data for passenger navigation and personnel monitoring. In GNSS signal blind spots such as underground parking lots, Wi-Fi signals become the primary wireless positioning source; by collecting RSSI information, fingerprint maps of the parking lot can be constructed, supporting applications such as reverse vehicle location. Furthermore, mobile devices that support Wi-Fi scanning (such as smartphones, tablets, and smartwatches) can participate in data collection without additional hardware, demonstrating good versatility.
[0038] Specifically, firstly, by fully utilizing existing indoor wireless infrastructure, the system eliminates the need for dedicated beacons or base stations, significantly reducing system construction costs. Secondly, by simultaneously recording MAC addresses and RSSI values, the system preserves the identity and signal strength information of the access points (APs), providing a basis for subsequently distinguishing the spatial contributions of different APs. Thirdly, recording scan timestamps ensures precise synchronization of Wi-Fi and inertial data in the time dimension, laying a temporal foundation for the subsequent construction of multimodal time-series tensors. Fourthly, although the Wi-Fi scanning frequency is relatively low (approximately 1Hz), combining it with interpolation and compensation of high-frequency inertial data allows for control of terminal power consumption while maintaining positioning accuracy, achieving a balance between accuracy and energy consumption. Fifthly, the non-intrusive acquisition method of Wi-Fi data does not affect the user's normal use of the terminal, enhancing the system's user experience and practical value.
[0039] S12 collects inertial data using a positioning terminal. The inertial data includes data from a three-axis accelerometer, a three-axis gyroscope, and a three-axis magnetometer, and records a high-precision timestamp.
[0040] Specifically, the accelerometer, based on Newton's second law, measures the three-axis acceleration in the carrier coordinate system by detecting the inertial force acting on the sensitive mass block, reflecting the terminal's linear motion state in space. The gyroscope, based on the Coriolis effect, measures the three-axis angular velocity in the carrier coordinate system, characterizing the terminal's attitude changes and rotational motion. The magnetometer, based on the principle of geomagnetic field measurement, detects the three-axis components of the geomagnetic field in the carrier coordinate system, providing an absolute heading reference. These three types of sensors characterize the terminal's kinematic features from different dimensions. Their joint acquisition can comprehensively capture the pedestrian's gait cycle, walking direction, turning angle, and attitude changes, laying the physical foundation for deep learning models to extract temporal motion features. Simultaneously, high-precision timestamps are recorded to ensure accurate alignment of inertial data and Wi-Fi data in the time dimension, supporting the collaborative processing of multi-source heterogeneous data.
[0041] Furthermore, using a smartphone as the positioning terminal, inertial data acquisition is achieved by calling the sensor management service provided by the operating system. The terminal registers listeners for the accelerometer, gyroscope, and magnetometer, sets the sampling frequency, and specifies the data callback interface. When sensor data is updated, the system automatically triggers the callback function, transmitting a data packet containing triaxial components and a timestamp. To ensure data quality and real-time performance, the terminal uses hardware timestamps instead of software timestamps, directly reading the precise sampling time from the sensor chip registers. At the data storage level, each sampling point records a timestamp and the corresponding triaxial acceleration values (ax, ay, az), triaxial angular velocity values (gx, gy, gz), and triaxial magnetic field values (mx, my, mz), forming an inertial measurement unit data stream containing 9 channels. To prevent data loss, a circular buffer can be set in the terminal's memory to temporarily cache the raw data. Once a certain amount of data has accumulated, it is written in batches to the storage medium or transmitted to the processing unit in real time.
[0042] Furthermore, the acquisition of inertial data involves setting several key parameters. The accelerometer's sampling frequency is set to 200Hz, and its range is set to ±8g to meet the coverage requirements of the dynamic range of acceleration in daily walking scenarios. The data output format is 16-bit signed integer or 32-bit floating-point, with a resolution typically reaching 0.001g. The gyroscope's sampling frequency is also set to 200Hz to maintain synchronization with the accelerometer, and its range is set to ±1000° / s, covering the angular velocity range during normal walking and turning, with zero-bias stability controlled within 0.01° / s. The magnetometer's sampling frequency is set to 100Hz, its range is set to ±4800μT, and its resolution reaches 0.15μT, enabling accurate sensing of changes in the geomagnetic field. Regarding timestamp accuracy, the hardware timestamp accuracy can reach the microsecond level, ensuring that the time alignment error of multi-sensor data is controlled within 1 millisecond. To adapt to the requirements of long-term continuous acquisition, the data storage format adopts binary compression or incremental encoding to reduce storage space occupation and transmission bandwidth consumption.
[0043] Specifically, in shopping mall scenarios, the periodic changes in acceleration generated by a user's walking can be used for step frequency detection and step length estimation, the turning angular velocity recorded by the gyroscope can be used to determine heading changes, and the geomagnetic direction provided by the magnetometer can serve as an absolute heading reference. The combination of these three technologies enables pedestrian dead reckoning. In office building scenarios, vertical movements such as elevator rides and stair climbing can be identified through changes in the vertical component of the accelerometer, assisting in floor switching. In open areas such as airport waiting halls, inertial navigation data can compensate for the insufficient resolution of Wi-Fi fingerprinting in open areas, enabling continuous trajectory tracking through dead reckoning. In GPS blind spots such as underground parking lots, inertial data becomes the primary source of motion information, and combined with initial position calibration and map constraints, it can support vehicle tracking and navigation. Furthermore, various mobile terminals, including smartphones, smartwatches, AR glasses, and wearable devices, can participate in data acquisition as long as they have a built-in inertial measurement unit, demonstrating good hardware versatility.
[0044] Specifically, firstly, the acquisition of high-frequency inertial data (200Hz) significantly improves the temporal resolution of motion information, providing ample data support for subsequent deep learning models to extract fine-grained motion features such as gait cycles and heading changes. Secondly, the joint acquisition of triaxial accelerometer, angular velocity, and magnetometer data forms a complementary motion perception architecture. The accelerometer captures linear motion, the gyroscope records attitude changes, and the magnetometer provides absolute direction reference; the three work together to overcome the inherent defects of single-sensor integral drift. Thirdly, the introduction of high-precision timestamps ensures accurate alignment between inertial data and low-frequency Wi-Fi data, providing a temporal benchmark for subsequent sliding window slicing and multimodal tensor construction. Fourthly, by acquiring raw sensor data rather than processed attitude results, the most complete motion information is preserved, enabling deep learning models to autonomously learn the optimal motion feature representation and avoiding information loss caused by preprocessing in traditional dead reckoning. Fifthly, inertial data acquisition is entirely based on existing terminal hardware, requiring no additional sensor deployment, maintaining the system's low-cost advantage while ensuring data quality.
[0045] S13, acquire indoor map data. The indoor map data is a vector map, which includes the location of walls, passable areas, spatial layout information of doors and stairs, and is represented in the form of a binary raster map.
[0046] Specifically, indoor environments are not unobstructed, continuous spaces, but rather complex topological structures divided by elements such as walls, doors, and stairs. Vector maps record the boundaries and positions of these elements with precise geometric coordinates, reflecting the distribution of passable and impassable areas for pedestrians within the interior. Converting vector maps into binary raster maps essentially discretizes continuous space into regular grids and labels the passability attributes of each grid cell with pixel values, enabling deep learning models to understand the physical constraints of the environment through image processing. By using map data as one of the input modalities, the model can spontaneously develop an understanding of physical laws such as "people cannot pass through walls" during the learning process, thereby imposing spatial rationality constraints on the predicted location during localization calculations.
[0047] Specifically, the acquisition and processing of indoor map data follows this technical process. First, the original vector map data of the target scene is acquired. This data can originate from DXF / DWG files of architectural design drawings, CAD floor plans provided by the shopping mall operator, or a raster map pre-built using SLAM technology. The vector map contains precise geometric elements, such as walls represented by polylines, rooms by closed polygons, doors by line segments or point features, and stairs by area polygons. Next, the vector map is rasterized: the vector layer is overlaid onto a regular grid of a preset resolution. Each grid cell is traversed, and it is determined whether the cell intersects with impassable features such as walls or obstacles. If intersecting, the cell is marked as 0 (black, impassable); otherwise, it is marked as 255 (white, passable). For special areas such as doors and stairs, special markings can be applied according to actual access rules. For example, door areas can be marked as passable, and stair areas can be marked with special access attributes. The resulting binarized raster image is stored in image file format (such as PNG, BMP) or binary array form, for the positioning terminal to load during offline phases or access on demand during online phases. To reduce storage space and loading latency, the raster image can be stored in blocks and dynamically loaded, loading only local map tiles around the current location.
[0048] Furthermore, the resolution of the raster map is one of the core parameters. In this embodiment, it is set to 0.1 meters per pixel, meaning that each square meter contains 100 pixel units, achieving a balance between storage overhead and spatial accuracy. For a single-story area of a 50m x 50m shopping mall, the corresponding raster map size is 500 x 500 pixels; for a large transportation hub of 200m x 200m, the corresponding raster map size is 2000 x 2000 pixels. The bit depth of the raster map uses 8 bits per channel. Pixel value 0 represents impassable areas (walls, columns, fixed obstacles), pixel value 255 represents passable areas (corridors, lobbies, open spaces), and pixel value 128 can be reserved for marking semi-passable areas (such as temporary fences, special areas). The conversion from vector map to raster map involves geometric intersection calculations, and its tolerance parameter is usually set to half the raster resolution (i.e., 0.05 meters) to ensure the correct assignment of boundary pixels. To support the input requirements of subsequent deep learning models, raster images typically need to be normalized to the [0,1] interval and their size adjusted to fit the input size of the feature extraction network.
[0049] Specifically, in large shopping malls, map data includes the boundary outlines of each shop, corridors, and the locations of escalators and elevators. This data can be used to constrain positioning trajectories from traversing the interiors of shops, and to help determine which shop a user is near, supporting targeted marketing and customer flow analysis. In office building scenarios, map data includes functional area divisions such as office cubicles, meeting rooms, and break rooms. Combined with positioning results, this enables applications such as employee behavior trajectory analysis and meeting room occupancy detection. In hospital scenarios, map data includes precise boundaries of wards, examination rooms, operating rooms, and medical equipment areas, ensuring that positioning results do not mistakenly enter restricted areas, and providing navigation support for rapid response in emergencies. In transportation hubs such as subway stations and airports, map data includes the locations of ticket gates, waiting areas, transfer channels, and entrances / exits, supporting passenger navigation, passenger flow management, and abnormal behavior monitoring. In cultural venues such as museums and exhibition halls, map data can be further overlaid with exhibit location information to provide visitors with location-based guided tours. Furthermore, for multi-story buildings, independent raster maps of each floor can be constructed, and connections between floors (such as staircases and elevators) can be established, forming a three-dimensional spatial map constraint system.
[0050] Specifically, firstly, explicitly introducing environmental physical constraints into the positioning model eliminates positioning errors that violate physical laws, such as "passing through walls," significantly improving the reliability and interpretability of positioning results. Secondly, the joint input of map data and signal data enables the complementarity of prior knowledge and real-time observation. In areas with sparse or fluctuating Wi-Fi signals, map constraints can effectively narrow down the range of candidate locations, improving positioning accuracy. Thirdly, rasterization transforms complex vector geometry into regular matrix data, facilitating seamless integration with image processing models such as convolutional neural networks and reducing the engineering complexity of multimodal fusion. Fourthly, binarization simplifies the judgment logic of accessibility attributes, enabling the model to quickly focus on accessible areas, avoiding complex geometric calculations and improving online inference efficiency. Fifthly, the one-time acquisition and multiple reuse characteristics of map data make it a reusable positioning asset. As application scenarios expand, new areas only need to be supplemented with map data for rapid adaptation, demonstrating good scalability and reuse value.
[0051] S2 preprocesses the multi-source data by aligning and slicing the Wi-Fi signal strength data, inertial measurement unit data, and indoor map data according to the same time window to construct a multimodal input tensor.
[0052] Specifically, due to fundamental differences in sampling frequency, data dimension, and physical meaning between Wi-Fi signal strength data, inertial measurement unit (IMU) data, and indoor map data, they cannot be directly input into a unified deep learning network for joint processing. By using timestamp alignment and sliding window slicing, asynchronous time-series data can be unified onto a common time reference, establishing a correspondence between Wi-Fi characteristics and inertial motion states at each moment. Simultaneously, by constructing local map tiles, static environmental information and dynamic sensor observations are associated with the same spatial neighborhood. Based on this, a multimodal input tensor encodes the spatial distribution characteristics of Wi-Fi, the temporal characteristics of inertial motion, and the topological constraints of the map into a regular three-dimensional data structure, providing a uniformly formatted input for subsequent multi-branch feature extraction networks and achieving tight coupling and fusion of multi-source information at the feature level.
[0053] Specifically, the data preprocessing follows this technical process. First, using the high-precision timestamps of the inertial measurement unit (IMU) data as a reference, linear interpolation is performed on the Wi-Fi signal strength indicator sequence. Since the Wi-Fi scanning frequency is low (approximately 1Hz) while the inertial sampling frequency is high (200Hz), interpolation ensures that each inertial sampling moment obtains a corresponding Wi-Fi feature vector, achieving time alignment between Wi-Fi and inertial data. Then, a sliding window mechanism is constructed, with a window length T of 5 seconds corresponding to 500 inertial sampling points, and a sliding step Δt of 1 second corresponding to 100 inertial sampling points. For each window location, a Wi-Fi feature matrix is extracted within the window. Its dimensions are determined by the number of Wi-Fi scans within the window (typically 5) and the total number of wireless access points in the environment (set to 20 in this embodiment), forming a 5×20 two-dimensional matrix. An inertial measurement unit (IMU) feature tensor is also extracted within the window. Its dimensions are determined by the number of inertial sampling points within the window (500) and the number of sensor channels (3 axes for the accelerometer, 3 axes for the gyroscope, and 3 axes for the magnetometer, totaling 9 channels), forming a 500×9 two-dimensional matrix. Simultaneously, a 64×64 pixel local map tile is cropped from a pre-loaded indoor binary raster map, centered at the window's center, to form a two-dimensional raster image. Finally, the Wi-Fi feature matrix, the inertial feature tensor, and the local map tile together constitute the multimodal input tensor of the current window, serving as the input sample for subsequent deep learning models.
[0054] Furthermore, regarding time alignment, the accuracy of linear interpolation depends on the temporal resolution of the inertial data. A 200Hz sampling frequency corresponds to a 5ms time interval, ensuring that the time deviation between the interpolated Wi-Fi features and the inertial motion state is controlled within milliseconds. In the sliding window parameters, the 5-second window length is set based on a comprehensive consideration of pedestrian gait cycles and Wi-Fi signal stability. This allows for multiple complete gait cycles for the time-series model to extract motion features, while also accommodating at least 5 Wi-Fi scans to ensure sufficient fingerprint information. The 1-second sliding step achieves an 80% overlap between adjacent windows, effectively smoothing the positioning results and avoiding information gaps. In terms of data dimensions, the 20 columns of the Wi-Fi feature matrix correspond to the number of major wireless access points in the environment, which can be dynamically adjusted according to AP deployment density in practical applications. The 9 columns of the inertial feature tensor correspond to the 9-axis raw data of the IMU, preserving the most complete motion information. The 64×64 pixel map tile size corresponds to a 6.4m×6.4m local area (resolution 0.1m / pixel), sufficient to cover a sufficiently large area of environmental constraints around the center of the window. The data storage format adopts 32-bit floating-point type, and the value range is normalized to the interval [0,1] or [-1,1] to adapt to the distribution requirements of the neural network for the input data.
[0055] Specifically, in shopping mall environments, to address the uneven distribution density of access points (APs) across different areas, the sliding window mechanism can adaptively capture changes in Wi-Fi characteristics at various locations, ensuring rich fingerprint information is retained in AP-dense areas and maintaining feature continuity through interpolation in AP-sparse areas. In office building scenarios, pedestrian movement speeds are relatively stable, and a 5-second window length is sufficient to cover 3 to 5 complete gait cycles, providing ample temporal samples for bidirectional LSTM to extract motion features such as stride frequency and stride length. In open areas such as airport halls, 64×64 pixel local map tiles can cover waiting areas, passageways, and shop boundaries, effectively constraining the positioning trajectory from crossing obstacle areas. For multi-story buildings, the preprocessing module can switch map tiles to the corresponding floor based on the current floor, achieving seamless cross-floor positioning. In GPS blind spots such as underground parking lots, although Wi-Fi signals may be sparse, the dominant role of inertial data is fully utilized through time alignment and sliding window tiling. The map tiles also provide geometric constraints for parking spaces, passageways, and pillars, ensuring that the positioning results conform to the actual physical space. Furthermore, for different mobile terminal models and sensor performance differences, the preprocessing module can dynamically adjust the interpolation parameters and window configuration according to the actual sampling frequency to ensure the universality and robustness of the method.
[0056] Specifically, firstly, time alignment solves the fundamental problem of inconsistent sampling frequencies from multiple sensors, enabling low-frequency Wi-Fi signals to establish a precise time correspondence with high-frequency inertial data, laying a time-series foundation for subsequent deep fusion of feature layers. Secondly, the sliding window mechanism divides the continuous data stream into fixed-length sample units, preserving the temporal continuity of the motion process while facilitating batch training and online inference, achieving a smooth connection between data stream processing and model input. Thirdly, local map tiling associates static environmental information with dynamic sensor observations to the same spatiotemporal neighborhood, allowing the model to fully perceive surrounding physical constraints during each localization calculation, fundamentally avoiding logical errors such as wall penetration. Fourthly, the standardized construction of multimodal input tensors unifies heterogeneous data into a tensor format that can be processed by deep learning models, reducing the design complexity of subsequent feature extraction networks and improving the model's versatility and portability. Fifthly, the configurability of preprocessing parameters (such as window length, stride, and tile size) allows this method to flexibly adapt to the dynamic characteristics and accuracy requirements of different scenarios, ensuring localization accuracy while balancing computational efficiency and storage overhead.
[0057] Furthermore, S2 includes: S21, using the sampling time of the inertial measurement unit data as a reference, performs linear interpolation on the sequence of received signal strength indication values of Wi-Fi signal strength data, so that each inertial measurement unit data sample has a corresponding Wi-Fi feature vector, thereby achieving time alignment.
[0058] Specifically, Wi-Fi signal scanning, limited by terminal hardware capabilities and system scheduling strategies, typically involves periodic sampling at a relatively low, fixed frequency (approximately 1 Hz). In contrast, inertial measurement units (IMUs) can continuously record motion states at a high frequency (200 Hz). These two systems inherently exhibit differences in sampling density and phase deviation over time. Without time alignment, it is difficult to establish an accurate correspondence between Wi-Fi signal characteristics and inertial motion states, hindering the subsequent fusion model from effectively uncovering the temporal correlation between the two types of data. This step uses the high-sampling-frequency inertial data timestamp as a benchmark. By linearly interpolating the low-frequency Wi-Fi signal strength indicator sequence, a Wi-Fi feature vector corresponding to each inertial sampling moment is reconstructed. This achieves precise time alignment of heterogeneous sensor data, providing a unified time reference for the subsequent construction of time-synchronized multimodal input tensors.
[0059] Specifically, time alignment follows this technical process. First, raw data streams are acquired from the multi-source data acquisition module. Inertial measurement unit (IMU) data includes high-precision hardware timestamps and corresponding triaxial acceleration, angular velocity, and magnetometer values. Wi-Fi data includes scan timestamps and corresponding wireless access point MAC address lists and received signal strength indicators. Then, using the timestamp sequence of the inertial data as a reference, each inertial sampling time t_i is traversed. For each time, the two adjacent Wi-Fi scan times t_k and t_{k+1} are found in the Wi-Fi data stream, satisfying t_k ≤ t_i ≤ t_{k+1}, and the corresponding Wi-Fi feature vectors RSSI(t_k) and RSSI(t_{k+1}) are obtained. If t_i is exactly equal to a certain Wi-Fi scanning time, then the RSSI vector at that time is directly used; otherwise, the interpolation result at time t_i is calculated according to the linear interpolation formula: RSSI(t_i) = RSSI(t_k) + (RSSI(t_{k+1}) - RSSI(t_k)). (t_i - t_k) / (t_{k+1} - t_k). The above interpolation operation is performed independently for each wireless access point to ensure that a complete Wi-Fi feature vector is obtained at each inertial sampling time. After interpolation, the interpolated Wi-Fi feature vector is merged and stored with the inertial measurement unit data at the corresponding time to form a time-aligned multi-source data sequence.
[0060] Specifically, the time alignment step involves setting and constraining several key parameters. The sampling frequency of the inertial measurement unit is set to 200Hz, i.e., a timestamp interval of 5 milliseconds, providing a high-resolution time reference for interpolation. The Wi-Fi scanning frequency is approximately 1Hz, meaning the time interval between adjacent Wi-Fi scan moments is approximately 1000 milliseconds, and the interpolation interval length is typically on the order of 1000 milliseconds. Linear interpolation assumes that the signal strength changes linearly between two scan moments. This assumption holds true in most indoor environments because changes in Wi-Fi signal strength are mainly caused by path loss due to pedestrian movement, which can be approximated as linear on a second-scale timescale. For each wireless access point, the typical range of its received signal strength indication is -100dBm to -20dBm. The interpolation calculation retains floating-point precision, avoiding precision loss introduced by quantization errors. The interpolated Wi-Fi feature vector has the same dimension as the total number of wireless access points in the environment; in this embodiment, it is 20-dimensional. For access points not detected at time t_k or t_{k+1}, their signal strength values are filled with the minimum detectable value (e.g., -110dBm) or the previous valid value to ensure the integrity of the feature vector. The timestamp alignment accuracy is controlled within ±2.5 milliseconds, i.e., half of the inertial sampling interval, to ensure that interpolation errors will not significantly affect subsequent fusion.
[0061] Furthermore, in shopping mall scenarios, pedestrians walk at a normal pace, approximately 1.5 meters per second. A Wi-Fi scanning frequency of 1Hz means that Wi-Fi data is collected approximately every 1.5 meters, while inertial data at 200Hz records the detailed motion process within each step. Through time alignment, every subtle movement within each step (such as leg swing and landing) can be associated with the corresponding Wi-Fi signal features, providing fine-grained temporal alignment samples for deep learning models to learn the coupling relationship between gait cycles and signal changes. In office building scenarios, pedestrians may move quickly between different offices, and the Wi-Fi signal may change abruptly due to AP switching. Linear interpolation can generate a smooth transition interpolation sequence before and after the abrupt change, avoiding drastic changes in model input caused by signal jumps. In high-speed passage scenarios such as subway stations and airports, pedestrian movement speeds may reach over 2 meters per second. High-precision time alignment ensures that even under high dynamic conditions, Wi-Fi features and motion states maintain accurate temporal correspondence. In multi-story scenarios, when pedestrians move between floors via stairs or elevators, the Wi-Fi signal may change drastically due to floor transitions. Time alignment, combined with subsequent window slicing, ensures that the Wi-Fi changes at the moment of floor transition are synchronized with the vertical motion detected by inertial sensors, providing coordinated information for floor determination. Furthermore, to accommodate the performance differences of sensors from different terminal models, the interpolation algorithm can be dynamically adjusted according to the actual scanning frequency, compatible with Wi-Fi scanning fluctuations from 1Hz to 2Hz.
[0062] Specifically, firstly, it completely solves the data asynchrony problem caused by inconsistent sampling frequencies of multiple sensors, enabling low-frequency Wi-Fi signals to establish a precise time correspondence with high-frequency inertial data, laying a solid temporal foundation for subsequent deep fusion of feature layers. Secondly, the linear interpolation algorithm is simple and efficient with low computational complexity, allowing it to run in real-time on mobile terminals without significantly burdening system power consumption, while ensuring the continuity and smoothness of the interpolation results. Thirdly, it preserves floating-point precision during interpolation, avoiding information loss due to quantization or truncation, allowing subsequent deep learning models to fully utilize subtle changes in the original signal. Fourthly, the design concept based on high-precision inertial timestamps fully leverages the precision advantages of hardware timestamps, ensuring that the accuracy of time alignment is superior to software-level alignment schemes. Fifthly, the aligned data sequence provides a unified temporal index for subsequent sliding window slicing, ensuring that the data within each window has strict time synchronization characteristics, avoiding feature confusion caused by temporal misalignment. Sixthly, this method has good robustness to sampling frequency fluctuations in different terminals and scenarios, and can adaptively adjust interpolation parameters to ensure the consistency and reliability of time alignment results.
[0063] S22, construct a sliding window, slice the aligned multi-source data with a preset window length and sliding step size, and generate window data containing Wi-Fi feature matrix and inertial measurement unit feature tensor; wherein, the dimension of Wi-Fi feature matrix is determined by the number of Wi-Fi scans in the window and the total number of wireless access points in the environment, and the dimension of inertial measurement unit feature tensor is determined by the number of inertial measurement unit samples in the window and the number of sensor channels.
[0064] Specifically, inertial measurement unit (IMU) data continuously records the motion process using high-frequency sampling, while Wi-Fi data, after time alignment, forms a feature sequence corresponding to each inertial moment. Together, they constitute a continuous data stream that evolves over time. However, deep learning models typically use fixed-size tensors as input, making it impossible to directly process continuous data streams of variable length. By constructing a sliding window mechanism, the continuous data stream is divided into window segments of equal time spans. Each window simultaneously contains the Wi-Fi feature matrix and the inertial feature tensor for that time period, preserving the temporal continuity of the motion process while satisfying the model's requirements for input format standardization. The sliding step size of the window controls the degree of overlap between adjacent windows, adjusting the positioning frequency while ensuring information continuity. The choice of window length must balance positioning accuracy and computational efficiency, ensuring that the window contains sufficient temporal information for the model to extract motion and signal features.
[0065] Specifically, first, the window length T is set to 5 seconds, and the sliding step Δt is set to 1 second. Using the aligned multi-source data sequence as the processing object, a 5-second data segment is extracted from the beginning of the sequence as the first window. For this window, all inertial measurement unit (IMU) data samples are extracted to form an inertial feature tensor. Since the inertial sampling frequency is 200Hz, the 5-second window contains 1000 inertial samples, and the number of sensor channels is 9 (three-axis acceleration, three-axis angular velocity, and three-axis magnetometer), therefore the dimension of the inertial feature tensor is 1000×9. Simultaneously, Wi-Fi feature vectors corresponding to all Wi-Fi scan times within the window are extracted. Since the Wi-Fi scan frequency is approximately 1Hz, the 5-second window contains approximately 5 Wi-Fi scans, and the total number of wireless access points in the environment is set to 20, therefore the dimension of the Wi-Fi feature matrix is 5×20. After slicing the first window, the window's starting position is slid backward by 1 second, and the above extraction and dimension construction process is repeated to generate the second window data. This process continues until the window slides across the entire data sequence. Each generated window contains a corresponding Wi-Fi feature matrix and an inertial feature tensor, serving as input samples for subsequent feature extraction networks. For insufficient data at window boundaries, zero-padding or discarding can be used to ensure all windows are the same size.
[0066] Furthermore, the sliding window slicing involves the setting and optimization of several key parameters. The selection of a 5-second window length is based on a comprehensive consideration of pedestrian movement cycles and signal stability. The normal pedestrian gait cycle is approximately 0.5 to 0.8 seconds, and a 5-second window can contain 6 to 10 complete gait cycles, providing sufficient temporal samples for the bidirectional long short-term memory network to extract motion features such as stride frequency, stride length, and symmetry. At the same time, the 5-second window contains approximately 5 Wi-Fi scans, which can capture the continuous spatial changes of Wi-Fi signals and reflect the evolution of the pedestrian's signal fingerprint within a distance of approximately 5 to 8 meters. The 1-second sliding step size ensures an 80% overlap between adjacent windows. This high overlap design ensures the high frequency of positioning output (one positioning result per second) and suppresses jumps in positioning results through the smoothing effect of the overlapping windows. In the 5×20 dimension of the Wi-Fi feature matrix, 5 represents the typical number of Wi-Fi scans within a window. The actual value may fluctuate slightly depending on the precise distribution of scan times. This embodiment uses a linearly interpolated Wi-Fi sequence to ensure that each window contains a fixed number of 5 Wi-Fi moments. 20 represents the total number of major wireless access points in the environment. In practical applications, this can be dynamically adjusted according to the AP deployment density. For scenarios with a large number of APs, the dimensionality can be reduced to a fixed dimension through principal component analysis or feature selection methods. In the 1000×9 dimension of the inertial feature tensor, 1000 corresponds to the total number of samples sampled at 200Hz within a 5-second window, and 9 corresponds to the complete sensor channels of the triaxial acceleration, angular velocity, and magnetometer, preserving the most original motion information.
[0067] Specifically, in shopping mall scenarios, pedestrians walk at a normal pace, and a 5-second window covers a movement distance of approximately 5 to 8 meters, sufficient to capture signal changes from one shop to an adjacent shop; the 1-second sliding step size allows the positioning system to update its position once per second, meeting the refresh rate requirements for real-time navigation. In office building scenarios, pedestrians may move or stay within offices for short distances, and the 5-second window may contain a mixed temporal pattern of static and dynamic states, providing mixed samples for the model to learn signal characteristics in static states and dead reckoning in dynamic states. In open areas such as airport halls, pedestrians may walk at a relatively fast pace, and the 5-second window can cover a distance of over 10 meters; the Wi-Fi feature matrix within the window can reflect the gradual signal change patterns during long-distance movement. For multi-story building scenarios, when pedestrians move between floors via stairs or elevators, the 5-second window may span the moment of floor switching; the inertial feature tensor contained within the window can capture changes in vertical acceleration, while the Wi-Fi feature matrix records signal abrupt changes caused by floor switching, providing joint observation samples for subsequent model learning of floor switching patterns. In addition, for scenarios with different movement speeds, the window length and step size can be adjusted for adaptation. For example, in slow-moving scenarios (such as museum visits), the window can be appropriately extended to include more signal change information, while in fast-moving scenarios (such as airport shuttles), the window can be shortened to improve positioning response speed.
[0068] Specifically, firstly, normalizing the continuous data stream into a fixed-size input tensor enables deep learning models to receive and process multi-source heterogeneous data in a unified format, reducing the complexity of model design. Secondly, the 5-second window length strikes a balance between rich temporal information and computational efficiency, providing sufficient temporal context for motion feature extraction while avoiding redundant computation and increased latency caused by excessively long windows. Thirdly, the highly overlapping 1-second sliding step achieves a positioning output frequency of once per second, while the smoothing effect of the overlapping window effectively suppresses jumps and glitches in the positioning results, improving the smoothness and continuity of the positioning trajectory. Fourthly, the independent construction of the Wi-Fi feature matrix and the inertial feature tensor preserves the original data structure of their respective modalities. The two-dimensional form of the Wi-Fi matrix facilitates the extraction of spatial features by convolutional neural networks, while the two-dimensional form of the inertial tensor facilitates the extraction of temporal features by recurrent neural networks, providing a structured input foundation for the subsequent design of multi-branch feature extraction networks. Fifth, the flexibility of the slicing parameters allows this method to be adjusted according to the dynamic characteristics of the application scenario. For example, in fast-moving scenarios, the window length can be shortened to improve the response speed, while in high-precision scenarios, the window length can be extended to include more timing information, thus demonstrating good scenario adaptability.
[0069] S23, using the center position of the sliding window as the center, crop a local map raster of a preset size from the indoor map data as the map feature corresponding to the window data.
[0070] Specifically, the indoor map, as global prior knowledge, covers the complete spatial structure of the entire positioning area, while the positioning process focuses on the local environmental features of the terminal's current location. Using the center of the sliding window as a spatial reference, a local region centered on that point is cropped from the global map. Essentially, this transforms the infinite-dimensional global spatial constraints into finite-dimensional local image features, enabling the model to focus on the environmental topology information surrounding the current location within a limited receptive field. This local map slice, along with the Wi-Fi feature matrix and inertial feature tensor within the same window, corresponds to the window's center time in the temporal dimension. This achieves precise alignment between static environmental information and dynamic sensor observations in the spatiotemporal dimension, providing spatially synchronized input data for subsequent multimodal feature fusion.
[0071] Specifically, firstly, the center time t_c of the current window is obtained from the sliding window slicing step. This time corresponds to the midpoint of all inertial sampling points within the window. Then, the actual position coordinates (x_c, y_c) of the window's center time are obtained from the data annotation step and used as the clipping center point. If in the online inference stage, the positioning result or initial position of the previous time is used as the clipping center. Based on a pre-loaded indoor binary raster map, a square area with a side length of L pixels is clipped out by expanding a preset size around (x_c, y_c) as the center. In this embodiment, the preset size is 64×64 pixels, and the map resolution is 0.1 meters / pixel; therefore, the clipping area corresponds to a 6.4-meter × 6.4-meter range in actual space. Boundary conditions need to be handled during clipping: when the clipping area exceeds the global map boundary, the excess portion is filled with 0 values, representing impassable or unknown areas. The clipped local raster image retains its original binary attributes, where 0-value pixels represent impassable areas and 255-value pixels represent passable areas. To ensure compatibility with the input requirements of deep learning models, pixel values are normalized to the [0,1] range, and the image dimensions are adjusted to the (C, H, W) format, where C is the number of channels (1 in this embodiment), and H and W are both 64. The resulting local map tiles serve as the map features of the current window, and together with the Wi-Fi feature matrix and the inertial feature tensor, they constitute the multimodal input tensor.
[0072] Furthermore, the map resolution is set to 0.1 meters per pixel, meaning 100 pixel units are contained within each square meter area, achieving a balance between storage overhead and spatial accuracy. At this resolution, a 64×64 pixel local tile corresponds to an actual spatial range of 6.4 meters × 6.4 meters, sufficient to cover the maximum distance (approximately 7.5 meters) a pedestrian can move at a normal walking speed (approximately 1.5 meters per second) within a 5-second window, ensuring that the tile area includes all possible movement trajectories during the window period. The cropping center is based on the position at the center of the window, reflecting the core focus of the localization task: the model needs to predict the current position, therefore, the local environmental information centered at that moment is the most valuable reference. For boundary case handling, areas outside the global map range are filled with 0 values, essentially treating unknown areas as impassable by default. This is a conservative assumption that effectively prevents the model from predicting entry into unknown risk areas. Normalization maps the original pixel values from [0,255] to the [0,1] interval, maintaining the numerical distribution characteristics while adapting to the neural network's preference for the input data range. For color maps or labeled maps, it can be expanded to multi-channel input, for example, different elements such as walls, doors, and stairs can be encoded into different channels, but in this embodiment, a single-channel binary image is maintained to simplify processing.
[0073] Specifically, in shopping mall scenarios, a 6.4m x 6.4m local area is sufficient to cover the area of several adjacent shops, enabling the model to perceive the current shop area and surrounding passageway structure, preventing the positioning result from mistakenly entering the shop interior. In office building scenarios, local slices can include office cubicle boundaries, corridor directions, and meeting room entrances, providing spatial context for determining whether the user is walking in a corridor or entering a room. In open areas such as airport waiting halls, while local slices cannot cover the entire open space, they are sufficient to capture waiting area boundaries, seating areas, and passageway markings, constraining the positioning trajectory from crossing boundaries into restricted areas. For multi-story building scenarios, map clipping needs to be combined with floor judgment: if the positioning result at the center of the window indicates that the user is on a specific floor, then a local slice is clipped from the map of that floor; if the floor information is uncertain, slices can be clipped from multiple floors simultaneously, with the subsequent attention mechanism automatically selecting map features of the reliable floor. In underground parking lot scenarios, local slices can include parking space boundaries, column positions, and passageway directions, providing fine spatial constraints for vehicle positioning. In cultural venues such as museums and exhibition halls, partial slices can be overlaid with information on points of interest in the exhibits, providing a spatial index for location-based guided tours. Furthermore, the slice size can be dynamically adjusted for different movement speeds: in fast-moving scenes, the slice area can be expanded to cover a larger possible area of movement, while in slow-moving scenes, the slice area can be reduced to focus on finer local details.
[0074] Specifically, firstly, global map information is transformed into local features spatiotemporally aligned with dynamic sensor data, enabling the deep learning model to perceive the spatial constraints of the current environment during each localization calculation. This fundamentally avoids the lag and fragmentation caused by traditional methods where the map is only used as a post-processing constraint. Secondly, the design using the window center time as the clipping criterion ensures a direct correspondence between map features and the model's predicted target time, allowing environmental constraints to participate in the current location calculation in the most direct way, improving the spatial rationality of the localization results. Thirdly, the 64×64 pixel tile size strikes a balance between information richness and computational efficiency, providing sufficient spatial context to constrain the localization trajectory while avoiding computational redundancy and memory overhead caused by global map input. Fourthly, normalization and channel standardization ensure that map features and other modal features are consistent in numerical range and data structure, reducing the engineering complexity of multimodal fusion. Fifthly, the boundary padding mechanism ensures the robustness of the clipping operation; even if the localization result is temporarily close to the map boundary, the model can still obtain effective local environmental information, avoiding input failure due to boundary overflow. Sixth, the scalable design of local map tiles supports multi-element and multi-channel input, reserving interfaces for the subsequent introduction of richer environmental semantic information (such as points of interest and regional attributes), thus improving the scalability and application potential of the method.
[0075] S3: Input the multimodal input tensors into the corresponding feature extraction networks to extract the deep feature vectors of each modality.
[0076] Specifically, data from different modalities possess drastically different data structures and physical meanings: the Wi-Fi feature matrix reflects the spatial distribution pattern of wireless signals, exhibiting local correlation and global sparsity; the inertial feature tensor records the temporal changes in motion, containing both periodic and continuous features; and map tiles present the geometric topology of the environment in image form, possessing spatial structure and semantic invariance. Given these heterogeneous characteristics, using a single large-scale network for unified processing is insufficient to accommodate the personalized feature representations of each modality. Therefore, a dedicated feature extraction network is designed for each modality, enabling it to learn the optimal feature representation within its respective data domain. This network captures the spatial correlation of Wi-Fi signals, the temporal dependence of inertial data, and the texture and boundary features of map images, thereby achieving decoupling and preliminary abstraction of multimodal information at the feature level, laying the feature foundation for subsequent attention fusion.
[0077] Specifically, the multi-branch feature extraction network comprises three parallel sub-networks, which respectively process the Wi-Fi feature matrix, the inertial feature tensor, and the local map tiles. For the Wi-Fi modality, an architecture combining a one-dimensional convolutional neural network and a Transformer encoder is adopted: First, local mode features of the Wi-Fi signal are extracted through two one-dimensional convolutional layers with a kernel size of 3, a stride of 1, and output channels of 32 and 64, respectively; then, the convolutional output is flattened and input into the Transformer encoder, which contains four attention heads, a hidden layer dimension of 128, and a feedforward network dimension of 256. The self-attention mechanism captures the spatial correlation between wireless access points, and finally outputs a 128-dimensional deep feature vector of the Wi-Fi modality. For the inertial modality, a bidirectional long short-term memory network combined with a temporal attention mechanism is employed: a bidirectional LSTM with 128 hidden units and a 1000×9 inertial feature tensor as input captures the complete temporal dependencies of motion through forward and backward propagation; a temporal attention layer is then connected after the LSTM output to automatically calculate the attention weights for each time step, focusing on key motion moments in the gait cycle (such as the support and swing phases), and outputting a 128-dimensional deep feature vector for the inertial modality after weighted summation. For the map modality, a pre-trained residual network ResNet-18 is used: weights pre-trained on the ImageNet dataset are loaded, the first three convolutional blocks are frozen to retain general visual features, and only the last convolutional block and the fully connected layer are fine-tuned; a 64×64 single-channel map tile is input, and a 512-dimensional deep feature vector for the map modality is extracted after forward propagation. These three feature vectors are then fed into a subsequent attention fusion module for joint processing.
[0078] Furthermore, the one-dimensional convolutional layer of the Wi-Fi branch uses a kernel of size 3 with a stride of 1 and the same padding method to ensure that the length of the output sequence remains unchanged; the first convolutional layer has 32 output channels, and the second layer has 64 output channels; the Transformer encoder has an embedding dimension of 128, 4 attention heads, and a feedforward network hidden layer dimension of 256, with the number of layers set to 2. The Wi-Fi branch outputs a feature vector dimension of 128. The inertial branch has a bidirectional LSTM with 128 hidden units, 1000 time steps, and an input feature dimension of 9; the attention weights of the temporal attention layer are normalized by softmax, and the output is still 128-dimensional. The inertial branch outputs a feature vector dimension of 128. The ResNet-18 network structure for the map branch contains four residual block groups, each containing 2, 2, 2, and 2 residual blocks respectively. The input channel count is 1, expanded to 64 after the first convolutional layer. The parameters of the first three frozen residual block groups remain unchanged, with only the last residual block group and the fully connected layer being fine-tuned. The output dimension of the fully connected layer is set to 512, which is the dimension of the deep feature vector of the map modality. The feature vector dimensions of the three branches are 128, 128, and 512 respectively. Dimension alignment is required before subsequent fusion, which can be achieved by reducing the map features to 128 dimensions through linear transformation, or by maintaining the original dimensions and processing them separately in the attention mechanism. The total number of model parameters is approximately 12M, with ResNet-18 contributing approximately 11M and the other branches contributing approximately 1M, achieving both feature representation capability and computational efficiency.
[0079] Specifically, in shopping mall scenarios, the CNN in the Wi-Fi branch can extract local pattern differences in Wi-Fi signals from different shop areas, while the Transformer captures the co-occurrence relationships between access points (APs), helping to distinguish spatially close locations with different signal distributions. The Bi-LSTM in the inertial branch can accurately extract the gait cycle and turning features of pedestrians moving between shops, and the temporal attention mechanism automatically focuses on key angular velocity changes at turning moments, improving heading accuracy. The ResNet-18 in the map branch can identify shop boundaries, passageway directions, and entrance / exit locations, providing environmental semantic information for subsequent fusion. In office building scenarios, Wi-Fi signals may overlap significantly due to dense AP deployment. The Transformer's self-attention mechanism can effectively model the interference and complementarity relationships between APs. The inertial branch can extract zero-rate update features during prolonged periods of stillness (such as at a workstation), and the temporal attention mechanism automatically reduces the weight of non-moving moments, suppressing integral drift. The map branch can identify office cubicle layouts, preventing positioning results from penetrating walls into adjacent rooms. In open areas such as airport halls, Wi-Fi signals may be sparse. CNNs can extract gradual features from a limited number of access points (APs), and the global modeling capabilities of Transformers help utilize weak signals from distant APs. The inertial branch can accurately extract stride frequency and stride length during rapid walking, while temporal attention focuses on the propulsion phase of each gait cycle. The map branch can identify waiting area boundaries, seating areas, and aisle markings, constraining the cumulative error of long-distance dead reckoning. For multi-story buildings, the map branch can load map tiles for the corresponding floors based on floor level changes, and the pre-trained features of ResNet-18 have good generalization ability for similar structures across different floors.
[0080] Specifically, firstly, dedicated networks are designed to address the heterogeneous characteristics of different modalities, enabling each branch to learn optimal feature representations within its respective data domain. This significantly improves the quality and efficiency of feature extraction compared to a unified network. Secondly, the Wi-Fi branch employs a cascaded structure of CNN and Transformer, utilizing the local receptive field of CNN to capture local signal patterns while establishing global spatial relationships through the self-attention mechanism of Transformer. Experiments show that this architecture improves positioning accuracy by approximately 5% to 8% compared to pure CNN. Thirdly, the inertial branch introduces bidirectional LSTM and temporal attention, which not only captures complete motion temporal dependencies but also automatically focuses on key motion moments, effectively suppressing information-free noise during static or stable motion periods and improving the signal-to-noise ratio of motion features. Fourthly, the map branch uses pre-trained ResNet-18 and freezes low-level features, fully utilizing general visual knowledge learned from large-scale image datasets while only fine-tuning high-level semantic features to adapt to the specific structure of indoor maps, significantly reducing training data requirements and training time. Fifthly, the deep feature vectors output by each branch have unified or aligned dimensions, providing a format-compatible input for subsequent cross-modal attention fusion and simplifying the design of the fusion module. Sixth, the multi-branch parallel feature extraction architecture supports independent optimization and replacement of each branch. For example, the network depth can be adjusted or replaced with a lightweight network according to the actual deployment environment. It has good modularity and scalability, and is easy to adapt flexibly under different computing resource conditions.
[0081] Furthermore, S3 includes: S31, input the Wi-Fi feature matrix in the multimodal input tensor into the first feature extraction branch. The first feature extraction branch adopts an architecture that combines a one-dimensional convolutional neural network and a Transformer encoder to extract the local mode features of the Wi-Fi signal and the spatial correlation features between wireless access points, and outputs the deep feature vector of the Wi-Fi mode.
[0082] Specifically, Wi-Fi signal propagation in indoor environments exhibits a dual characteristic: on the one hand, due to signal attenuation with distance and the influence of multipath effects, adjacent spatial locations often have similar signal strength distributions, exhibiting local continuity; on the other hand, different wireless access points (APs) have co-occurrence relationships and spatial correlations, and certain AP combinations may jointly cover specific areas, forming a global fingerprint pattern. One-dimensional convolutional neural networks, through sliding convolution operations on local receptive fields, can effectively capture local pattern features between adjacent access points in a Wi-Fi sequence, essentially performing local smoothing and feature abstraction on the signal fingerprint. The Transformer encoder, through a self-attention mechanism, calculates the attention weights between access points globally, establishing long-distance dependencies between any two APs, thereby revealing the spatial co-occurrence structure and collaborative coverage patterns among wireless access points. The cascading of these two network structures achieves multi-level feature extraction from local to global, and from detail to semantics, ensuring that the final output deep feature vector contains both fine-grained local signal patterns and global spatial correlation information.
[0083] Specifically, the input data is a Wi-Fi feature matrix generated by a sliding window slice, with dimensions T_w × N_ap, where T_w is the number of Wi-Fi scans within the window (5 in this embodiment), and N_ap is the total number of wireless access points in the environment (20 in this embodiment). This matrix is first input into a one-dimensional convolutional neural network module. The convolutional layer performs sliding convolution along the access point dimension, that is, it performs feature transformation on the 20-dimensional Wi-Fi vector at each scan time. The first convolutional layer is set with a kernel size of 3, a stride of 1, and the same padding method, with 32 output channels; the second convolutional layer is also set with a kernel size of 3, a stride of 1, and the same padding method, expanding the number of output channels to 64. After two convolutional layers, the data dimension is transformed to 5×64, where 64 is the channel dimension, representing the local pattern features extracted from the original RSSI values. Then, the convolutional output is flattened into a sequence form and input into the Transformer encoder module. The Transformer encoder first maps the input features to a 128-dimensional embedding space using linear projection and adds positional encoding to preserve the sequential information of the scan time. The encoder contains four attention heads, each with a dimension of 32, and calculates attention weights between time steps using a self-attention mechanism to capture the correlation of Wi-Fi signals across different scan times. The encoder consists of two stacked layers, each containing a multi-head self-attention sublayer and a feedforward network sublayer, with the hidden layer dimension of the feedforward network set to 256. After processing by the Transformer encoder, the output sequence is average-pooled along the time dimension to obtain a 128-dimensional deep feature vector of the Wi-Fi modality, which serves as the final output of this branch.
[0084] Furthermore, the input dimension is 5×20, corresponding to 5 Wi-Fi scans and 20 wireless access points. The one-dimensional convolutional layers use a kernel size of 3, which maintains a suitable size for the local receptive field while covering adjacent access points; a stride of 1 ensures the output sequence length remains consistent with the input; the first layer has 32 output channels, and the second layer has 64 output channels, with the increasing number of channels enabling the network to learn increasingly abstract feature representations. The convolutional layers use the ReLU activation function to introduce non-linearity, followed by batch normalization layers to accelerate training convergence. The Transformer encoder has an embedding dimension of 128 and 4 attention heads, each focusing on a different feature subspace; this multi-head mechanism enhances the diversity of the model's expressive power. The feedforward network has a hidden layer dimension of 256, approximately twice the embedding dimension, increasing model capacity while maintaining manageable computational efficiency; the encoder has 2 layers, striking a balance between capturing complex dependencies and avoiding overfitting. The output feature vector dimension is 128, a choice that balances the sufficiency of feature representation with the computational efficiency of subsequent fusion modules. In terms of model parameter count, the convolutional layer contributes approximately (3×20×32 + 32) + (3×32×64 + 64) ≈ 2.1K, the Transformer encoder contributes approximately (128×128×4×2 + 128×256×2) ≈ 200K, and the total parameter count is approximately 202K, which is within an acceptable range for mobile devices.
[0085] Specifically, in shopping mall scenarios, the Wi-Fi feature matrix reflects the spatial distribution of AP signals in different store areas. One-dimensional convolutional networks can extract transitional patterns of signal changes between adjacent stores, such as the gradual change in AP signal strength when moving from the clothing area to the food and beverage area. The Transformer's self-attention mechanism can establish associations between APs specific to each store; for example, stores of a chain brand on different floors may share some AP identifiers, and the attention mechanism can automatically discover this co-occurrence relationship. In office building scenarios, APs are densely deployed and may experience co-channel interference. The local smoothing effect of convolutional networks can effectively suppress signal noise, while the Transformer's global modeling capability helps distinguish the signal fingerprints of different offices. Even if the signal strengths of some APs are similar, location identification can be achieved by capturing their correlation with other APs. In large public spaces such as subway stations and airports, the number of access points (APs) may exceed the preset 20. In this case, a feature selection algorithm can be used to select the 20 APs with the strongest signals as a fixed input set to ensure consistency of the input dimensions. Convolutional networks can extract the local order relationships between APs (sorted by signal strength), while Transformers can model the coupling relationship between the weak signals of distant APs and the strong signals of nearby APs. In underground parking lot scenarios, Wi-Fi signals may be relatively sparse, but through the local feature extraction of convolutional networks, gradual patterns of location-dependent changes can still be extracted from a small number of APs. Transformers can then associate these patterns with the physical deployment locations of the APs to form a spatial fingerprint representation. For multi-story scenarios, the set of APs may differ on different floors, but by fixing the input dimensions and setting the signal strength of APs not detected on the current floor to the minimum, the model can still learn the feature signals of floor switching from the zero-value mode.
[0086] Specifically, firstly, the one-dimensional convolutional neural network effectively extracts local pattern features of Wi-Fi signals between adjacent access points through sliding convolution operations on the local receptive field. These local features play a crucial role in distinguishing spatially close locations with slightly different AP combinations, essentially achieving refined local modeling of signal fingerprints. Secondly, the Transformer encoder establishes global dependencies through a self-attention mechanism, capturing the spatial correlation and co-occurrence structure between wireless access points. This enables the model to understand which APs tend to appear simultaneously and which APs have overlapping coverage, thus constructing a more complete fingerprint semantic at the global level. Thirdly, the cascaded architecture of CNN and Transformer achieves feature progression from local to global. Compared to using CNN alone, which can only extract local features and cannot model long-distance dependencies, and using Transformer alone, which may ignore local details, this architecture balances the finesse and globality of feature extraction. Experiments show that it can improve positioning accuracy by approximately 5% to 8% compared to pure CNN. Fourthly, the introduction of location encoding preserves the sequential information of Wi-Fi scanning, enabling the Transformer to perceive the signal's changing trend over time, which is of great significance for capturing signal changes during movement. Fifth, the output feature vector has a moderate dimension (128 dimensions), which contains rich semantic information while avoiding the computational burden on subsequent fusion modules caused by excessive dimensionality, thus achieving a balance between feature representation and computational efficiency. Sixth, this feature extraction network can be trained and optimized independently. When the AP deployment in the environment changes, it can be fine-tuned to adapt to the new environment without redesigning the entire network, demonstrating good maintainability and scalability.
[0087] S32, input the inertial measurement unit feature tensor in the multimodal input tensor into the second feature extraction branch. The second feature extraction branch uses a bidirectional long short-term memory network combined with a temporal attention mechanism to extract the temporal features of pedestrian heading and stride frequency, and automatically focuses on key motion moments in the gait cycle to output the deep feature vector of inertial mode.
[0088] Specifically, the inertial data generated by pedestrian movement exhibits significant temporal characteristics: accelerometers record periodic impacts and intervals in the gait cycle, gyroscopes capture sudden changes in angular velocity during turns, and magnetometers provide continuous geomagnetic direction references. Unidirectional recurrent neural networks can only utilize historical information for state updates, making it difficult to fully model the complete gait cycle because there is a sequential dependency between the support and swing phases. Bidirectional long short-term memory networks, through forward and backward propagation, integrate past and future information into the hidden state at each moment, enabling more accurate identification of key phases in the gait cycle. Building upon this, a temporal attention mechanism dynamically weights the hidden states at each time step, automatically identifying and focusing on the key moments in the gait cycle that contribute most to positioning (such as heel touchdown, toe liftoff, and turn initiation), suppressing information-free noise during stable motion or stationary periods. The final output deep feature vector contains both a complete temporal pattern of motion and highlights the characteristic expressions of key motion events.
[0089] Further, the input data is an inertial measurement unit feature tensor generated by a sliding window slice, with a dimension of T_imu × 9, where T_imu is the number of inertial samples within the window (in this embodiment, a 5-second window and 200Hz sampling correspond to 1000 samples), and 9 is the number of sensor channels (three-axis acceleration, three-axis angular velocity, and three-axis magnetometer). This tensor is first input into a bidirectional long short-term memory network. The bidirectional LSTM is set to have 128 hidden units, meaning that the forward LSTM and backward LSTM each output 128-dimensional hidden states, which are then concatenated to obtain a complete 256-dimensional hidden state sequence. The input data is sequentially fed into the LSTM units along the time dimension. The forward LSTM processes the data in forward time order, and the backward LSTM processes it in reverse time order. Finally, at each time step t, a hidden state h_t with fused context information is obtained, with a dimension of 256. After processing by the bidirectional LSTM, a hidden state sequence with a dimension of 1000 × 256 is obtained. This sequence is then input into a temporal attention layer. The attention mechanism first maps the 256-dimensional hidden state at each time step to a scalar attention score using a trainable attention weight matrix W_att, calculated as e_t = tanh(h_t · W_att), where W_att is a 256×1 weight vector. Then, the attention scores across all time steps are normalized using the softmax function to obtain the attention weight α_t for each time step, satisfying ∑α_t = 1. Finally, the hidden state sequence is weighted and summed according to the attention weights to obtain the inertial mode deep feature vector f_imu = ∑α_t · h_t, with a dimension of 256. To ensure compatibility with subsequent fusion modules, the 256-dimensional features can be further compressed to 128 dimensions via linear transformation, or the 256-dimensional features can be retained as the output of this branch.
[0090] Furthermore, the input dimension is 1000×9, where 1000 corresponds to the total number of samples sampled at 200Hz within a 5-second window, and 9 corresponds to the triaxial data from the accelerometer, gyroscope, and magnetometer. The number of hidden units in the bidirectional LSTM is set to 128, with 128 dimensions each for the forward and backward directions, resulting in a hidden state dimension of 256 after concatenation. The LSTM network includes an input gate, a forget gate, an output gate, and a cell state update mechanism. The parameter count is calculated as 4×(input dimension + hidden dimension + bias)×hidden dimension. With an input dimension of 9 and a hidden dimension of 128, the parameter count of a single-layer LSTM is approximately 4×(9+128+1)×128≈70K, while the bidirectional structure doubles the parameter count to approximately 140K. The LSTM layer is set to one layer to capture temporal dependencies while avoiding overfitting and gradient vanishing. The trainable parameters of the temporal attention layer are a 256×1 weight matrix, resulting in a very small computational cost of 256 parameters. The attention weights α_t are normalized using softmax and range from [0,1], with ∑α_t=1, giving the weighted feature vector a clear physical meaning: more important time steps contribute more. The output feature vector has a dimension of 256. If a dimensionality reduction to 128 is needed later, a linear transformation layer is added, with approximately 32K parameters (256×128). The total number of parameters is approximately 172K, allowing for efficient operation on mobile devices. During training, the attention weights are automatically adjusted during backpropagation. For example, in the gait cycle, the acceleration impact at heel strike and the peak angular velocity at turning time typically receive higher weights.
[0091] Specifically, in shopping mall scenarios, pedestrians exhibit diverse movement patterns, including walking straight, turning, stopping, and using escalators. Bidirectional LSTM can fully capture the changes in angular velocity before and after turning, with temporal attention automatically focusing on the critical moments at the start and end of the turn, enabling the model to accurately identify changes in heading. For the straight-walking phase, attention focuses on the heel-to-toe contact and toe-to-toe-off moments of each step, extracting stable gait frequency features. In office building scenarios, users may remain stationary at their workstations for extended periods or move short distances in corridors. Bidirectional LSTM can learn the low variance characteristics of accelerometers in stationary states, and temporal attention automatically assigns weights to movement periods, suppressing integral drift during stationary periods, maintaining positional stability even during prolonged stops. In open areas such as airport terminals, pedestrians walk at relatively high speeds with high gait frequencies. Bidirectional LSTM can extract stable periodic gait features, with temporal attention focusing on the progression phase of each gait cycle, providing accurate step length and heading information for dead reckoning. In underground parking scenarios, the inertial data generated by vehicle motion differs from that of pedestrians. However, bidirectional LSTM can still capture driving patterns such as acceleration, constant speed, turning, and deceleration. The attention mechanism focuses on the angular velocity changes during turning and the acceleration impact during starting. For multi-story buildings, when pedestrians go up and down stairs, the vertical component of the accelerometer shows significant periodic changes. Bidirectional LSTM can identify this vertical motion pattern, and the attention mechanism focuses on the timing of each step, providing key features for floor change detection. Furthermore, for different walking postures (such as walking slowly, walking quickly, running, and carrying items), bidirectional LSTM can adaptively learn the corresponding motion patterns, and the attention mechanism automatically adjusts the focus timing, exhibiting good generalization ability.
[0092] Specifically, firstly, bidirectional LSTM, by fusing past and future information, can more completely model the sequential dependencies of the gait cycle, improving gait phase recognition accuracy by approximately 10% to 15% compared to unidirectional LSTM, thereby enhancing the accuracy of heading estimation and stride frequency estimation. Secondly, the introduction of a temporal attention mechanism allows the model to automatically identify and focus on key motion moments in the gait cycle, such as the acceleration peak when the heel touches the ground and the sudden change in angular velocity during turning. These moments typically contain the richest motion information, and focusing on them effectively improves the signal-to-noise ratio of the features. Thirdly, the dynamic allocation of attention weights allows the model to adaptively adjust its focus based on the motion state: focusing on the gait cycle when walking, focusing on the turning process when turning, and reducing the overall weight when stationary. This adaptive mechanism significantly improves the robustness of the model under different motion modes. Fourthly, the weighted feature vector retains complete temporal motion information and enhances the expression of key information through the attention mechanism, providing high-quality inertial feature input for subsequent fusion modules. Fifth, the feature extraction network is adaptable to the length of the input sequence, and the sliding window mechanism ensures the regularity of the input temporal sequence, enabling the model to process motion sequences of different durations in batches. Sixth, experiments show that the inertial feature extraction architecture combining bidirectional LSTM and temporal attention can reduce the cumulative error by about 30% compared with the traditional dead reckoning algorithm in the heading estimation task, laying a solid foundation for improving the overall positioning accuracy.
[0093] S33, input the local map raster image in the multimodal input tensor into the third feature extraction branch. The third feature extraction branch uses a pre-trained residual network to encode the map raster image into a map modality deep feature vector of a preset dimension.
[0094] Specifically, indoor maps are presented as binary raster images, where pixel values intuitively distinguish between passable areas and obstacle boundaries. This data structure shares similar grid-like characteristics with natural images, but its content is more abstract and has fewer semantic categories. Deep residual networks effectively alleviate the gradient vanishing problem in deep network training by introducing skip connections between convolutional layers, enabling the network to learn hierarchical feature representations from low-level edge textures to high-level semantic concepts. Through pre-training on large-scale natural image datasets, the network has mastered general visual feature extraction capabilities, including edge detection, texture recognition, and shape perception. Transferring these pre-trained weights to map feature extraction tasks allows the network to directly utilize the learned general visual knowledge, requiring only fine-tuning of high-level semantic features to adapt to the specific distribution of map data. This enables efficient feature learning under limited indoor map training sample conditions, and the final output deep feature vector can effectively encode spatial topological information such as geometric boundaries, channel directions, and region divisions in the local map.
[0095] Specifically, the input data is a local map raster generated by sliding window slicing, with a size of 64×64 pixels, single channel, and pixel values normalized to the [0,1] interval. The ResNet-18 residual network, pre-trained on the ImageNet large-scale image dataset, is used as the basic feature extraction network. The ResNet-18 network structure includes an initial convolutional layer (7×7 convolutional kernel, stride 2, output channels 64), a max pooling layer (3×3 pooling kernel, stride 2), and four residual block groups. Each residual block group contains 2, 2, 2, and 2 residual blocks respectively, with the number of output channels for each residual block group being 64, 128, 256, and 512 respectively. To adapt to the map feature extraction task and prevent overfitting, the following fine-tuning strategy is adopted: all parameters of the first three residual block groups (i.e., the first residual block group outputs 64 channels, the second outputs 128 channels, and the third outputs 256 channels) are frozen to maintain the general visual feature extraction capability obtained from pre-training; fine-tuning is performed only on the last residual block group (outputting 512 channels) and subsequent global average pooling layers and fully connected layers. After inputting a 64×64 single-channel map tile, it is first copied into three channels to match the input requirements of the ImageNet pre-trained model, and then passed through each network layer in sequence. After processing by the last residual block group, the feature map size is 4×4×512, which is then processed by global average pooling to obtain a 512-dimensional feature vector, and finally mapped to a preset dimension through a fully connected layer. In this embodiment, the preset dimension is set to 128, that is, the final output is a 128-dimensional map modality deep feature vector.
[0096] Furthermore, the input map tile size is 64×64 pixels, corresponding to an actual spatial range of 6.4 meters × 6.4 meters, which controls computational cost while ensuring spatial resolution. The total number of parameters in the ResNet-18 network is approximately 11.2M, of which the first three frozen residual block groups have approximately 10.5M parameters, and the last residual block group for fine-tuning and the fully connected layer have approximately 0.7M parameters. The frozen parameters do not participate in gradient updates during training, significantly reducing the computational cost and memory usage of backpropagation, while preserving the general visual knowledge of the pre-trained model. The fine-tuning part uses a low learning rate (set to 0.1 times the learning rate in the pre-training stage) to avoid destructive updates to the pre-trained features. The global average pooling layer compresses the feature map with a spatial dimension of 4×4 and 512 channels into a 512-dimensional feature vector. Compared to the directly flattened feature map in the fully connected layer, global average pooling has stronger spatial invariance and fewer parameters. Finally, the fully connected layer has an input dimension of 512, an output dimension of 128, and approximately 65K parameters (512×128). The entire branch's floating-point computation during the inference phase is approximately 0.5 GFLOPs, which can be further compressed to less than 0.1 GFLOPs on mobile devices through model quantization and pruning. During training, data augmentation (such as random rotation, translation, and flipping) is used to expand the map training samples, improving the model's generalization ability. The output feature vector dimension of 128 is consistent with the output dimension of the Wi-Fi and inertial branches, facilitating unified processing by the subsequent fusion module.
[0097] Specifically, in shopping mall scenarios, local map tiles include the boundaries of adjacent shops, corridors, and escalator locations. The lower convolutional layers of the pre-trained ResNet-18 effectively extract edge features and texture differences at shop boundaries, while the upper residual block groups identify the overall shape and spatial layout of the shop area, enabling the final output feature vector to distinguish locations within different shops, even if these shops have similar Wi-Fi signal distributions. In office building scenarios, map tiles include the grid layout of office cubicles, open spaces in meeting rooms, and narrow corridors. ResNet-18 can extract vertical edge features of cubicle walls, accessibility features of meeting rooms, and the orientation of corridors, providing spatial context for determining whether a user is working in an office or moving through a corridor. In open areas such as airport halls, while map tiles cannot cover the entire open space, they can capture the curved edges of waiting areas, texture features of seating areas, and location information of corridor markers. The pre-trained model's sensitivity to curved edges helps identify boundary constraints in waiting areas. In underground parking scenarios, map tiles contain a grid structure of parking space lines, circular or square outlines of pillars, and the direction of passageways. ResNet-18 can effectively extract parallel line features of parking space lines and shadow features of pillars, providing geometric references for accurate vehicle localization. For multi-story buildings, maps on different floors have similar structural elements (such as walls, doors, and stairs), but the overall layout differs. Low-level features of the pre-trained model can be shared across floors, while high-level features can be fine-tuned to adapt to the unique layout of each floor, enabling a single model to handle multi-floor localization tasks simultaneously. Furthermore, for scenarios with complex distributions of points of interest, such as museums and exhibition halls, semantic features of exhibit areas can be further extracted by adding an interest point detection branch to the pre-trained model.
[0098] Specifically, firstly, ResNet-18 pre-trained on ImageNet is used as the base network, fully utilizing general visual features learned from large-scale natural image datasets, including edge detection, texture recognition, and shape awareness, avoiding the large amount of labeled data and training time required to train a deep network from scratch. Secondly, the transfer learning strategy of freezing low-level features and only fine-tuning high-level semantics preserves the general visual knowledge of the pre-trained model while enabling high-level features to adapt to the specific distribution of indoor maps, achieving efficient feature learning under limited map training samples and effectively preventing overfitting. Thirdly, ResNet's residual connection structure allows the network to be trained deeper while avoiding the gradient vanishing problem, enabling the extraction of hierarchical features from low-level edges to high-level layouts, and outputting feature vectors that contain both fine geometric boundary information and macroscopic spatial topological semantics. Fourthly, the introduction of global average pooling enhances the spatial invariance of features, making the model more tolerant to small translations or rotations of input map tiles, improving robustness in practical applications. Fifth, the output feature vector dimension is consistent with that of the Wi-Fi and inertial branches, providing a format-compatible input for subsequent cross-modal attention fusion and simplifying the alignment and fusion of multimodal features. Sixth, experiments show that introducing map features can effectively eliminate logical errors such as wall penetration, reducing the wall penetration prediction ratio by about 90% on the test set, while improving the overall positioning accuracy by about 15% to 20%, significantly enhancing the spatial rationality and credibility of the positioning results. Seventh, this feature extraction branch can be independently optimized and replaced. For example, in scenarios with limited computing resources, it can be replaced with a lightweight network such as MobileNet, and in scenarios where accuracy is prioritized, it can be upgraded to a deeper ResNet-50, demonstrating good modular design and scalability.
[0099] S4. Input the deep feature vector into the attention mechanism module, calculate the dynamic weights of each modality, and perform weighted fusion of the deep feature vector according to the dynamic weights to obtain the fused features.
[0100] Specifically, the reliability and information content of data sources of different modalities vary significantly under different spatiotemporal conditions: Wi-Fi signals may be stable and reliable in open areas, but fluctuate violently when near walls or metal obstacles; inertial data can accurately reflect the trajectory of movement during smooth walking, but accumulates drift after long-term integration; map information, as a static prior, is always reliable, but its constraints are more prominent in areas with sparse features. The attention mechanism calculates the similarity score between the query and each key by using the fused features as the query vector and the features of each modality as key-value pairs, and obtains the dynamic weight coefficients of each modality after normalization. This process essentially simulates the system's real-time evaluation of the confidence of each information source: when the features of a certain modality are highly correlated with the current fusion requirements, they receive a higher weight, and vice versa. Feature fusion is achieved through weighted summation, ensuring that the final fused features are always dominated by the most reliable information source in different environments, thereby achieving environment-adaptive tight-coupled fusion.
[0101] Specifically, firstly, the deep feature vectors obtained from the three feature extraction branches are concatenated to generate a multimodal fusion feature as the query matrix Q. Let the Wi-Fi modality feature vector be f_w (128-dimensional), the inertial modality feature vector be f_i (128-dimensional), and the map modality feature vector be f_m (128-dimensional). After concatenation, a 384-dimensional fusion feature F_fused is obtained. Simultaneously, the original feature vectors of each modality are used as the key matrix K and value matrix V, respectively, i.e., K_w = f_w, V_w = f_w; K_i = f_i, V_i = f_i; K_m = f_m, V_m = f_m. Then, a linear transformation layer maps the query matrix and the key matrices of each modality to the same dimensional space. Specifically, three trainable linear transformation matrices W_q, W_k, and W_v are set, each with dimensions of 128×384, 128×128, and 128×128, respectively. The linear transformation result Q' = W_q · F_fused of the query matrix Q is calculated to obtain a 128-dimensional transformed query vector. The linear transformation results K'_w = W_k · f_w, K'_i = W_k · f_i, and K'_m = W_k · f_m of each modality's key matrix are also calculated, all being 128-dimensional. Next, the attention scores between the query and each key are calculated: score_w = (Q' · K'_w) / √d, where d=128 is the scaling factor. Similarly, score_i and score_m are calculated. The three attention scores are normalized using the softmax function to obtain the dynamic weight coefficients α_w, α_i, and α_m for each modality, satisfying α_w + α_i + α_m = 1. Finally, the value matrix is weighted and summed: F_attention = α_w · (W_v · f_w) + α_i · (W_v · f_i) + α_m · (W_v · f_m), where W_v performs a linear transformation on the value vector to enhance its expressive power. F_attention is the weighted and fused attention feature, which is the final fused feature output with a dimension of 128.
[0102] Furthermore, regarding the input feature dimension, the deep feature vectors of all three modalities are unified to 128 dimensions. This dimension choice strikes a balance between feature representation sufficiency and computational efficiency, while also facilitating subsequent attention calculation and fusion. The linear transformation matrix dimensions are set as follows: W_q is 128×384, compressing the concatenated 384-dimensional fused features to 128 dimensions, with approximately 49K parameters (128×384≈49K); W_k is 128×128, used to map the features of each modality to a unified key space, with approximately 49K parameters (128×128×3≈49K); W_v is 128×128, used for linear transformation of the value vector, with approximately 49K parameters (128×128×3≈49K). The total number of parameters is approximately 147K, allowing for efficient operation on mobile devices. The scaling factor √d, with d=128, controls the magnitude of the attention score, preventing the softmax function from entering the gradient saturation region. The attention score is calculated using dot product similarity, which is computationally efficient and ensures stable gradient propagation. The weight coefficients α_w, α_i, and α_m obtained after softmax normalization range from [0,1] and sum to 1, possessing a clear physical meaning: a higher weight indicates a higher confidence level for that modality at the current moment. In actual testing, this attention mechanism exhibits good dynamic adjustment capabilities: when the Wi-Fi signal is strong and stable, α_w can reach 0.5-0.6; when the user enters a Wi-Fi blind spot or experiences severe signal fluctuations, α_w automatically drops below 0.2, while α_i and α_m increase accordingly; in structurally regular areas such as corridors, the map weight α_m is higher; in open halls, the inertia weight α_i dominates. The output fusion feature dimension remains 128 dimensions, consistent with the input modality feature dimensions, facilitating subsequent processing by the localization decoder.
[0103] Specifically, in a shopping mall scenario, when a user walks along the main aisle, the Wi-Fi signal is usually relatively stable, and the attention mechanism assigns a high weight to the Wi-Fi mode (α_w≈0.6). In this case, positioning mainly relies on Wi-Fi fingerprinting. However, when a user enters a store, approaches metal shelves, or enters a signal dead zone, the Wi-Fi signal may fluctuate drastically. The attention mechanism automatically reduces the Wi-Fi weight (α_w drops below 0.2) while increasing the inertial weight (α_i rises to 0.5) and the map weight (α_m rises to 0.3), making positioning primarily rely on dead reckoning and store boundary constraints. In an office building scenario, when a user moves quickly in a corridor, inertial data accurately reflects the movement trajectory, and the attention mechanism assigns a high weight to inertial data. When a user stays in an office, the Wi-Fi signal is relatively stable, and the attention mechanism increases the Wi-Fi weight to suppress inertial drift. In open areas like airport terminals, Wi-Fi signals may be sparse, but map boundaries are clear. The attention mechanism increases map weight (α_m can reach 0.4-0.5), using the waiting area boundaries to constrain the cumulative error of long-distance dead reckoning. In underground parking scenarios, Wi-Fi signals are generally weak, and inertial data becomes the primary information source. The attention mechanism assigns a higher weight to inertial data (α_i≈0.7), while maintaining a certain proportion of map weight (α_m≈0.2-0.3), using parking lines and pillar constraints to correct inertial drift. For multi-story buildings, when users go up and down stairs, Wi-Fi signals may change drastically due to floor transitions. The attention mechanism automatically reduces Wi-Fi weight and increases inertial weight to accurately detect vertical movement, while map weight is also increased accordingly, using stair position constraints to ensure accurate floor transitions. Furthermore, for differences in sensor performance between different terminal models, the attention mechanism can adaptively adjust weights based on actual signal quality. For example, when a terminal's magnetometer is severely interfered with, the attention mechanism automatically reduces the actual impact of the magnetometer component in the inertial mode.
[0104] Specifically, firstly, dynamic weight allocation enables the system to perceive environmental changes in real time and adaptively adjust the dependencies between information sources. When a signal source is interfered with or its confidence decreases, its influence is automatically reduced, and the system relies on a more reliable signal source, significantly improving the robustness of the positioning system in complex dynamic environments. Secondly, the attention mechanism elevates the traditional loosely coupled fusion of serial mixing to a tightly coupled fusion at the feature level, allowing the model to jointly optimize the contributions of each modality within the same feature space, avoiding information loss and error accumulation caused by a loose fusion architecture. Thirdly, by using the fused features as query vectors, global perception and selective attention to the features of each modality are achieved. This ensures that the final fused features contain both the original information of each modality and, through attention weights, strengthen key features in the current environment, improving the discriminative power of feature representation. Fourthly, experiments show that after introducing the attention mechanism, the positioning error is reduced by approximately 25% in areas with severe Wi-Fi signal fluctuations, by approximately 30% in long-distance walking scenarios with significant inertial drift, and by approximately 90% in wall-penetrating errors in key map-constrained areas such as near walls. Fifth, the interpretability of the attention weights enables the system to output confidence information for each modality, providing a basis for evaluating the reliability of the localization results and facilitating debugging and optimization. Sixth, this fusion module, together with the front-end feature extraction network and the back-end localization decoder, forms an end-to-end trainable whole, allowing the attention weights to automatically adjust as the overall localization target is optimized, achieving the optimal mapping from raw data to the final location. Seventh, the lightweight design of the attention mechanism (approximately 147K parameters) enables it to run in real-time on mobile devices, with a single inference time increase of less than 5ms, maintaining the system's real-time performance and low power consumption while improving localization accuracy.
[0105] Furthermore, S4 includes: S41, the deep feature vectors of each modality are concatenated in the channel dimension to generate a multimodal fusion feature as the query matrix; the deep feature vectors of each modality are used as the key matrix and value matrix respectively; and the query matrix and the key matrices of each modality are mapped to the same dimensional space through a linear transformation layer, and the attention score between the query matrix and the key matrices of each modality is calculated.
[0106] Specifically, in cross-modal attention fusion, it is necessary to evaluate the relevance between the features of each modality and the current fusion target. This evaluation is essentially calculating the similarity between vectors within the same feature space. However, although the deep feature vectors of different modalities have the same dimension, they still exist in their respective feature subspaces, making direct similarity comparisons physically meaningless. Therefore, the features of each modality are first concatenated to generate a fusion feature as a query matrix, which contains a global representation of all available information at the current moment. Subsequently, a linear transformation is used to map the query matrix and the key matrices of each modality to the same metric space, enabling feature vectors that were originally not directly comparable to perform similarity calculations in a unified embedding space. The dot product similarity between the query and the key reflects the degree of matching between each modality feature and the global fusion requirements; a higher attention score indicates a greater potential contribution of that modality to the current localization task. This process simulates the human decision-making mechanism in multi-source information fusion: first, all information is integrated to form an overall cognition, and then the relevance of each information source to the current cognition is evaluated, providing a basis for subsequent selective attention.
[0107] Specifically, firstly, deep feature vectors are obtained from three feature extraction branches: Wi-Fi modality feature vector f_w∈ ^{128}, inertial mode eigenvector f_i ∈ ^{128}, map modal feature vector f_m ∈ ^{128}. Concatenation is performed along the channel dimension to generate a multimodal fused feature F_fused ∈ ^{384}, i.e., F_fused = [f_w; f_i; f_m], where the semicolon indicates a vector concatenation operation. This fused feature serves as the query matrix Q in the attention mechanism. Simultaneously, the deep feature vectors of each modality are used as the key matrix and value matrix, respectively: K_w = f_w, V_w = f_w; K_i = f_i, V_i = f_i; K_m = f_m, V_m = f_m.
[0108] Furthermore, to achieve a unified mapping of the feature space, three trainable linear transformation matrices are set: the query transformation matrix W_q ∈ ^{128×384}, key transformation matrix W_k ∈ ^{128×128}, value transformation matrix W_v ∈ ^{128×128}. A linear transformation maps the query matrix to a 128-dimensional unified space: Q' = W_q · F_fused, resulting in the transformed query vector Q' ∈ ^{128}. The same linear transformation is performed on each modal bond matrix: K'_w = W_k · f_w, K'_i = W_k · f_i, K'_m = W_k · f_m, all of which result in 128-dimensional transformed bond vectors.
[0109] Further, the attention scores between the query vector and each modality key vector are then calculated. A scaled dot product attention mechanism is used, with the formula: score_w = (Q' · K'_w) / √d, where d=128 is a scaling factor to prevent the dot product result from being too large and causing the softmax function to enter the gradient saturation region. Similarly, score_i = (Q' · K'_i) / √d and score_m = (Q' · K'_m) / √d are calculated. These three attention scores are scalars, representing the degree of correlation between the Wi-Fi modality, inertial modality, map modality, and the current fusion requirements, respectively. A higher score indicates a better match between the features of that modality and the global fusion goal, and will receive a higher attention weight in subsequent steps.
[0110] Furthermore, the input feature dimension is 128-dimensional. This dimension choice is based on a comprehensive consideration of feature representation sufficiency and computational efficiency, while also facilitating subsequent attention calculation and fusion. The concatenated fused feature dimension is 384-dimensional, fully preserving the original feature information of each modality. The linear transformation matrix dimensions are designed as follows: W_q is 128×384, compressing the 384-dimensional fused features into a 128-dimensional query space, with a parameter count of 128×384 = 49,152; W_k is 128×128, used to map the 128-dimensional features of each modality to a unified key space, with a parameter count of 128×128 = 16,384; since the same W_k transformation needs to be applied to each of the three modalities, the actual parameter count is 16,384. In the scaling factor √d, d=128, and √128 ≈ 11.31. The introduction of this scaling factor keeps the variance of the dot product result around 1, which is beneficial to the gradient stability of the softmax function. Attention scores are calculated using a dot product, with a computational complexity of O(d). The dot product operation on a 128-dimensional vector is efficiently executed on mobile devices. All three attention scores are scalars, theoretically capable of taking any real number, but after scaling, they typically fall within the range of [-10, 10], facilitating subsequent softmax normalization. The total floating-point computation for the entire step is approximately 384 × 128 (Q-transform) + 3 × (128 × 128) (K-transform) + 3 × 128 (dot product) ≈ 100K FLOPs, resulting in minimal computational overhead.
[0111] Specifically, in a shopping mall scenario, when a user walks normally along the main aisle, the Wi-Fi signal is stable, the inertial data shows clear periodicity, and the map boundaries are clear. The fused feature F_fused after stitching contains a complete representation of these three types of information. The query vector Q' after linear transformation can be regarded as the "fusion requirement template" for the current scenario. It has a high similarity to the dot product of the Wi-Fi key K'_w, reflecting the high correlation between the Wi-Fi signal and the current positioning requirement; it also has a high dot product with the inertial key K'_i, reflecting the supplementary value of motion information; and its dot product with the map key K'_m is moderate, reflecting the auxiliary role of environmental constraints. When the user enters a Wi-Fi blind zone (such as near a metal shelf), the numerical distribution of the Wi-Fi feature f_w changes drastically, causing the transformed K'_w to deviate from the normal range. The dot product scores of Q' and K'_w decrease significantly, while the scores of Q' with K'_i and K'_m increase relatively, providing a numerical basis for subsequently reducing the Wi-Fi weight and increasing the inertial and map weights. In office building scenarios, when users move quickly in corridors, periodic gait information in the inertial features becomes prominent, resulting in high attention scores for Q' and K'_i. When users are stationary in the office, Wi-Fi features are relatively stable, with Q' and K'_w scores dominating. In open areas such as airport halls, map boundary information becomes a key constraint. Even with sparse Wi-Fi signals, map features f_m still provide stable spatial semantics, and attention scores for Q' and K'_m remain high. In underground parking scenarios, Wi-Fi signals are generally weak, making inertial features the primary source of information, with Q' and K'_i scores significantly higher than other modalities. For multi-story scenarios, when users go up and down stairs, the vertical motion component in the inertial features becomes prominent. Wi-Fi features may become confused due to floor changes, and the attention scores are automatically adjusted to ensure the inertial modality achieves the highest score, guaranteeing accurate detection of floor changes.
[0112] Specifically, firstly, by concatenating features from various modalities to generate a fusion feature as the query matrix, the query vector can comprehensively represent all available information globally, avoiding information bias that may result from using a single modal feature as the query, and laying the foundation for a fair evaluation of the contributions of each modality. Secondly, by using linear transformation to map the query and each modal key to the same metric space, the problem of multimodal features being unable to be directly compared due to differences in data distribution is solved, achieving alignment and comparability of heterogeneous features in the same embedding space. Thirdly, the introduction of scaled dot product attention controls the score scale while calculating similarity, avoiding gradient saturation caused by excessively large dot product results due to excessively high feature dimensions, and ensuring the stability of the training process. Fourthly, the calculation process of the attention score is fully differentiable and can be jointly optimized with the entire network, allowing the score to automatically adjust with the training objective of the localization task, achieving end-to-end confidence learning. Fifthly, this calculation mechanism provides a direct numerical basis for subsequent dynamic weight allocation, enabling the system to adjust its dependence on each modality in real time according to environmental changes, achieving true environmental adaptive fusion. Sixth, the computation process is lightweightly designed; the attention score calculation for the three modalities requires only about 100K FLOPs, which can be completed in milliseconds on mobile devices without affecting the system's real-time positioning performance. Seventh, the interpretability of the attention scores facilitates system debugging. Developers can observe score changes to determine the model's decision-making logic in different environments, making it easier to optimize the network structure and training data in a targeted manner.
[0113] S42, the attention scores are normalized using the Softmax function to obtain the dynamic weight coefficients of each modality. The dynamic weight coefficients represent the confidence of each modality data source at the current time. Then, the value matrices of each modality are weighted and summed according to the dynamic weight coefficients to generate the weighted fused attention features, which are used as the fused features.
[0114] Specifically, the attention score, serving as a similarity measure between each modality and the current fusion requirement, reflects the importance of each modality. However, the score itself is unnormalized and cannot be directly used as a weight. The Softmax function maps the three attention scores to a probability distribution that sums to 1. This transformation has profound physical implications: the output value can be interpreted as the confidence probability of each modality's data source in the current environment; a higher value indicates that the modality is more reliable and should contribute more to the localization result. Subsequently, the value matrices of each modality are weighted and summed according to these dynamic weight coefficients, ensuring that information from high-confidence modalities dominates the final fusion features, while information from low-confidence modalities is effectively suppressed. This process simulates the human decision-making mechanism in multi-source information fusion: when multiple information sources corroborate each other, they are comprehensively adopted; when some information sources are questionable, their influence is reduced, ultimately forming the optimal judgment based on the current confidence assessment.
[0115] Specifically, first, obtain three attention scores, score_w, score_i, and score_m, from the previous step. Combine these scores into a vector form s = [score_w, score_i, score_m] ∈ ³. The vector s is normalized using the Softmax function, calculated as: α_w = exp(score_w) / (exp(score_w) + exp(score_i) + exp(score_m)), with α_i and α_m calculated similarly. The Softmax function has two important characteristics: first, it maps any real number to the (0,1) interval; second, it preserves the original order of scores while amplifying differences, giving higher weights to high-scoring modes and further reducing the weights of low-scoring modes. The calculated α_w, α_i, and α_m are the dynamic weight coefficients for each mode, satisfying α_w + α_i + α_m = 1, and each coefficient is between 0 and 1.
[0116] Subsequently, the value matrices of each modality are weighted and summed according to the dynamic weight coefficients. The value matrices are derived from the deep feature vectors of each modality, but to enhance expressive power, they are first linearly transformed using the value transformation matrix W_v: V'_w = W_v·f_w, V'_i = W_v · f_i, V'_m = W_v · f_m, all yielding 128-dimensional transformed value vectors. The weighted summation formula is: F_attention = α_w · V'_w + α_i · V'_i + α_m · V'_m, resulting in a 128-dimensional attention feature vector. This vector is the weighted fused feature, serving as the input to the subsequent localization decoder. The entire calculation process is fully differentiable and can be jointly optimized with the entire network.
[0117] Furthermore, the input to the Softmax function is a three-dimensional attention score vector, and the output is a three-dimensional weight vector. The exponential operation in the Softmax function may cause numerical overflow; in practical implementations, the maximum value is usually subtracted before calculating the exponent to ensure numerical stability. The typical range of values for the dynamic weight coefficients α_w, α_i, and α_m varies dynamically with the environment: in areas with good Wi-Fi signal, α_w can reach 0.5-0.6; in Wi-Fi dead zones, α_w can drop below 0.2; in structurally regular areas such as corridors, α_m can reach 0.3-0.4; and in open areas, α_i can reach 0.5-0.6. The sum of the weight coefficients is always 1; this constraint ensures the energy conservation of the fused features and avoids feature scale drift caused by weighting.
[0118] Furthermore, the value transformation matrix W_v has 128×128 trainable parameters, with 16,384 parameters. This transformation provides independent trainable mappings for each modality feature, allowing the value vectors to be optimized according to task requirements without being constrained by the key vector mapping. The weighted summed fused feature F_attention maintains 128 dimensions, consistent with the dimensions of the input modality features, facilitating subsequent processing by the localization decoder. The total floating-point computation of the entire step includes: approximately 10 FLOPs for Softmax computation, 128×128=16,384 FLOPs for each of the three linear transformations of the value vectors, and 3×128=384 FLOPs for the weighted summation, totaling approximately 49K FLOPs, with minimal computational overhead.
[0119] Specifically, in a shopping mall scenario, when a user walks normally along the main aisle, the attention score is characterized by a high score_w, a moderate score_i, and a low score_m. After Softmax normalization, α_w reaches 0.5-0.6, α_i is approximately 0.3-0.4, and α_m is approximately 0.1-0.2. The weighted fusion feature F_attention is mainly dominated by Wi-Fi features, while incorporating appropriate amounts of inertial information and map constraints, resulting in accurate and smooth localization. When a user enters the store and approaches metal shelves, the Wi-Fi signal fluctuates drastically, causing a significant drop in score_w and a relative increase in score_i and score_m. The Softmax function amplifies this difference, causing α_w to drop below 0.2, α_i to rise to around 0.5, and α_m to rise to around 0.3. At this point, F_attention is mainly dominated by inertial and map features, Wi-Fi interference is effectively suppressed, and the localization result continues to maintain accuracy by relying on dead reckoning and store boundary constraints. In office building scenarios, when users move quickly in corridors, score_i is high, with α_i reaching 0.5-0.6; when users are stationary in the office, score_w is high, and α_w dominates. In open areas such as airport halls, map boundaries become a key constraint. Even with sparse Wi-Fi signals, score_m remains high, with α_m reaching 0.4-0.5, ensuring that long-distance dead reckoning does not deviate from passable areas. In underground parking scenarios, Wi-Fi signals are generally weak, and score_i is significantly higher than other modalities, with α_i reaching around 0.7. At the same time, the map weight α_m remains at 0.2-0.3, using parking line constraints to correct for inertial drift. For multi-story scenarios, when users go up and down stairs, score_i increases due to the prominent vertical movement, while score_w may become chaotic due to floor changes. Softmax ensures that α_i dominates, guaranteeing accurate detection of floor changes.
[0120] Specifically, firstly, Softmax normalization transforms attention scores into dynamic weight coefficients with probabilistic meaning, enabling the quantitative expression of the confidence of each modality and providing an intuitive basis for the system to understand the reliability of information in the current environment. Secondly, the constraint that the sum of the dynamic weight coefficients is 1 ensures the energy conservation of the fused features, avoiding feature scale drift caused by weighting, and allowing the subsequent localization decoder to process the fused features at a uniform scale. Thirdly, weighted summation of the value matrix according to the dynamic weights achieves true adaptive fusion: information from high-confidence modalities is amplified, while information from low-confidence modalities is suppressed, ensuring that the fused features are always dominated by the most reliable information source. Fourthly, the introduction of the value transformation matrix provides independent trainable mappings for each modality, allowing the value vectors to be optimized for the localization task and enhancing the discriminative ability of the fused features. Fifthly, experiments show that this dynamic weight allocation mechanism reduces the localization error by approximately 25% in areas with fluctuating Wi-Fi signals, approximately 30% in areas with significant inertial drift, and approximately 90% in wall penetration errors, significantly improving the robustness and accuracy of localization. Sixth, the observability of the weight coefficients provides valuable interpretability for the system. Developers can diagnose model behavior by analyzing weight changes, and users can also understand the main signal sources relied upon by the current positioning through weight information, enhancing their trust in the positioning results. Seventh, the entire calculation process is lightweight and can be completed in milliseconds on mobile devices without increasing system power consumption, achieving a balance between high performance and high efficiency.
[0121] S5 inputs the fused features into the localization decoder to obtain the target location coordinates.
[0122] Specifically, the fused feature vector F_attention, after prior feature extraction and attention-weighted fusion, encodes the spatial distribution characteristics of the current Wi-Fi signal, the temporal information of inertial data motion, and the geometric constraints of the map environment, representing a highly abstract and semantically rich joint representation. The localization decoder maps this feature vector to a two-dimensional geographic coordinate space through a nonlinear transformation of a fully connected network, achieving a transformation from the feature domain to the location domain. This mapping process is not a simple linear projection, but rather establishes a complex functional relationship between the fused features and the true location through multi-layer network combined learning. The entire network is trained end-to-end, enabling the decoder to further optimize the accuracy of coordinate regression based on the features extracted by the prior network, ultimately outputting the predicted coordinates with the smallest error to the true location.
[0123] Specifically, the localization decoder employs a multi-layer fully connected neural network structure. The input is the fused feature vector F_attention generated in the preceding steps, with a dimension of 128. The decoder network contains three fully connected hidden layers, with the number of neurons in each layer being 256, 128, and 64 respectively. Each layer is followed by a ReLU activation function to introduce a non-linear transformation, and then a batch normalization layer accelerates training convergence. After the third hidden layer outputs 64-dimensional features, it is connected to the output layer, which has two neurons corresponding to two-dimensional spatial coordinates (x, y). No activation function is applied to the output layer to ensure that the output value range is unrestricted and can cover any positional coordinate. During the training phase, the predicted coordinates output by the decoder and the true coordinates are used together to calculate the loss function. The loss function adopts a composite design, including a coordinate regression loss term and a grounding loss term. Figure One Consistency loss term and trajectory smoothness loss term. The coordinate regression loss uses the root mean square error function to calculate the Euclidean distance between the predicted coordinates and the true coordinates; Figure One The consistency loss term is used to calculate the distance from the predicted coordinate to the nearest passable area as a penalty when the predicted coordinate falls into an inaccessible area of the indoor map. The trajectory smoothness loss term constrains the rate of displacement change between adjacent predicted coordinates, suppressing jumps in the positioning result. The three losses are added according to preset weights and jointly optimized through the backpropagation algorithm to optimize the entire network parameters. During the online inference stage, the decoder directly receives the fused features and propagates them forward once to output the current position coordinates.
[0124] Furthermore, the input fusion feature dimension is 128. Hidden layer configuration: First hidden layer has 256 neurons, with 128 × 256 + 256 = 33,024 parameters; Second hidden layer has 128 neurons, with 256 × 128 + 128 = 32,896 parameters; Third hidden layer has 64 neurons, with 128 × 64 + 64 = 8,256 parameters; Output layer has 2 neurons, with 64 × 2 + 2 = 130 parameters. The total number of parameters is approximately 74K, resulting in a relatively small network size, which is convenient for real-time inference on mobile devices. The activation function used is ReLU, which is computationally simple and effectively alleviates the vanishing gradient problem. Batch normalization layers are placed after each hidden layer, and their parameters are learned during training and fixed during inference. The output layer has no activation function and directly outputs coordinate values. The coordinate range is determined based on the actual geographical area of the location. Typically, the coordinates are normalized during training (e.g., scaled to [0,1] or [-1,1]), and then denormalized again after output to obtain the true coordinates. Weight parameters in the loss function: Figure OneConsistency loss weight λ1 is set to 0.1, and trajectory smoothness loss weight λ2 is set to 0.05, determined through cross-validation. During training, the Adam optimizer is used with an initial learning rate of 0.001, decaying by 0.9 times every 10 epochs, a batch size of 64, 100 training epochs, and an early stopping mechanism with a patience value of 10. During inference, a single forward propagation takes approximately 0.5ms (based on actual testing on a Xiaomi 11 Ultra), meeting real-time positioning requirements.
[0125] Specifically, in shopping mall scenarios, the decoder receives fused features and outputs real-time location coordinates, which can be used for applications such as user navigation, store recommendations, and customer flow heatmap creation. Since the decoder learns map constraints during training, the output location naturally avoids passing through walls, ensuring the user's location always falls within a passable area, improving the feasibility of navigation paths. In office building scenarios, the decoder's output coordinates can be used for employee attendance, meeting room occupancy detection, and visitor trajectory tracking. Combined with trajectory smoothness loss, the output coordinate sequence is smooth and natural, avoiding location jumps caused by signal fluctuations and improving the user experience. In open areas such as airport halls, the decoder relies on ground... Figure One Consistency loss constraints ensure that the positioning trajectory does not deviate from the waiting area boundary during long-distance walking, providing passengers with accurate boarding gate guidance. In underground parking scenarios, the decoder outputs vehicle position coordinates, supporting reverse vehicle search functionality. Even with weak Wi-Fi signals, high accuracy is maintained by relying on inertial characteristics and map constraints. For multi-story buildings, the decoder's output 2D coordinates can be combined with floor markers to construct a 3D location, supporting cross-floor navigation. Furthermore, in emergency evacuation scenarios, real-time accurate positioning output provides crucial personnel location information for emergency command. Figure One Convective loss measures ensure that evacuation routes do not cross obstacles, thus improving safety.
[0126] Specifically, firstly, multimodal fusion features are efficiently mapped to two-dimensional coordinates, achieving end-to-end integrated modeling from raw data to the final positioning result, avoiding error accumulation and information loss caused by modular processing in traditional methods. Secondly, the design of the composite loss function enables the decoder to learn not only coordinate regression during training but also map physical constraints and trajectory smoothness requirements, making the output position both accurate and spatially reasonable, reducing wall-penetrating errors by approximately 90%, and significantly improving trajectory smoothness. Thirdly, the multi-layer fully connected network maintains lightweight design while ensuring sufficient expressive power, with a total parameter count of only 74K and inference speed at the millisecond level, meeting the real-time positioning requirements of mobile devices. Fourthly, the decoder output coordinates can be directly used in various location service applications without additional post-processing, reducing system complexity and deployment costs. Fifthly, the end-to-end training method allows the decoder to be jointly optimized with the preceding feature extraction network and attention fusion module, enabling the entire system to adjust collaboratively towards minimizing positioning errors, improving positioning accuracy by approximately 15% to 20% compared to staged training. Sixth, the modular design of the decoder allows it to be replaced or upgraded independently. For example, network depth can be increased in scenarios with higher accuracy requirements, and network width can be compressed in resource-constrained scenarios, giving it good scalability and adaptability.
[0127] Furthermore, S5 includes: S51 inputs the fused features into the localization regression decoder, which is composed of fully connected layers, and maps them to generate the predicted location coordinates at the current moment.
[0128] Specifically, the fused feature vector F_attention, after prior feature extraction and attention-weighted fusion, encodes the spatial distribution characteristics of the current Wi-Fi signal, the temporal information of inertial data, and the geometric constraints of the map environment, representing a highly abstract and semantically rich joint representation. However, this feature vector remains in a high-dimensional feature space and cannot be directly used as a localization result. The localization regression decoder, through hierarchical transformations of a fully connected network, gradually reduces the dimensionality of the abstract features and maps them to a two-dimensional geographic coordinate space, achieving the transformation from feature representation to physical location. Each neuron in the fully connected layer applies a non-linear activation function after linearly combining the input features. Through multi-layer stacking, it can fit arbitrarily complex functional relationships, enabling the network to learn the non-linear mapping between fused features and the real location. The final output layer uses linear activation, directly outputting continuous numerical coordinates, ensuring that the prediction results can cover any location without being limited by the value range.
[0129] Specifically, firstly, the fused feature vector F_attention at the current time step is obtained from the attention fusion module, which has a dimension of 128. This vector serves as the input to the decoder and passes through multiple fully connected hidden layers sequentially. The decoder network structure is designed with three fully connected hidden layers, with the number of neurons in each layer being 256, 128, and 64, respectively. The calculation process for each hidden layer is as follows: h1 = ReLU(W1·F_attention + b1), h2 = ReLU(W2·h1 + b2), h3 = ReLU(W3·h2 + b3), where W is the weight matrix, b is the bias vector, and ReLU is the rectified linear activation function. A batch normalization layer is added after each hidden layer to normalize the output, accelerate feature propagation, and improve training stability. After the third hidden layer outputs a 64-dimensional feature vector h3, it is fed into the output layer. The output layer consists of two neurons with no activation function, directly performing a linear transformation: pred = W4·h3 + b4, resulting in a two-dimensional vector pred = [x_pred, y_pred], which represents the predicted location coordinates at the current moment. The numerical range of these coordinates depends on the coordinate normalization method used during training. If maximum-minimum normalization is used to normalize to the [0,1] interval, the output value will be between 0 and 1; if zero-mean normalization is used, the output value will be distributed around 0. During online inference, the output coordinates can be denormalized to the actual geographic coordinates based on pre-saved normalization parameters.
[0130] Furthermore, the input fusion feature dimension is 128. The first hidden layer has 256 neurons, with a weight matrix W1 dimension of 256×128 and a bias b1 dimension of 256, resulting in 256×128 + 256 = 33,024 parameters. The second hidden layer has 128 neurons, with a weight matrix W2 dimension of 128×256 and a bias b2 dimension of 128, resulting in 128×256 + 128 = 32,896 parameters. The third hidden layer has 64 neurons, with a weight matrix W3 dimension of 64×128 and a bias b3 dimension of 64, resulting in 64×128 + 64 = 8,256 parameters. The output layer has 2 neurons, with a weight matrix W4 dimension of 2×64 and a bias b4 dimension of 2, resulting in 2×64 + 2 = 130 parameters. The total number of parameters is approximately 74K, making the network relatively small and suitable for mobile deployment. Each hidden layer employs the ReLU activation function, which is computationally simple and effectively alleviates the vanishing gradient problem. The parameters of the batch normalization layer are learned during training, including the scaling factor γ and the translation factor β. Each layer has 2 × the number of neurons. These parameters are fixed during inference and do not add extra computation after being combined with the network weights. The floating-point operations per forward propagation are approximately: 128 × 256 + 256 ≈ 33K for the first layer, 256 × 128 + 128 ≈ 33K for the second layer, 128 × 64 + 64 ≈ 8K for the third layer, and 64 × 2 + 2 ≈ 130 for the output layer, totaling approximately 74K FLOPs. In actual testing on a Xiaomi 11 Ultra phone, the inference time per propagation is approximately 0.5ms, meeting real-time positioning requirements.
[0131] Specifically, in shopping mall scenarios, the decoder receives fused features and outputs the user's location coordinates in real time. These coordinates can be directly used in the mall's navigation system to provide users with path guidance from their current location to the target store. Because the decoder's output frequency matches the sliding window step size (once per second), the user's location is continuously updated as they move, resulting in smooth navigation arrow movement and a good user experience. In office building scenarios, the decoder's output employee location coordinates can be used in attendance systems to determine if employees have arrived at their workstations within the specified time; it can also be used for meeting room occupancy detection, determining that a meeting is in progress when the coordinates fall within the meeting room at multiple consecutive moments. In open areas such as airport halls, the decoder's output passenger location coordinates can support applications such as gate navigation and waiting area service push notifications. Even with sparse Wi-Fi signals, the system maintains continuous trajectory based on inertial features and map constraints. In underground parking scenarios, the decoder's output vehicle location coordinates can be used for reverse vehicle location. After the user inputs the license plate, the system retrieves historical trajectories and displays the vehicle's current location and walking route. For multi-story buildings, the decoder's output two-dimensional coordinates can be combined with floor markers to form three-dimensional location information, supporting cross-floor navigation applications, such as navigating from an underground parking lot to an office on a specific floor. Furthermore, in emergency evacuation scenarios, the real-time output of location coordinates can provide the emergency command center with a heat map of personnel distribution, assisting in decision-making regarding evacuation routes. Figure One To prevent casualties, ensure that the output location is always in a passable area and avoid guiding personnel into dangerous areas.
[0132] Specifically, firstly, it efficiently maps high-dimensional fused features to two-dimensional coordinates, completing the end-to-end transformation from raw data to the final positioning result, avoiding error accumulation and information loss caused by modular processing in traditional methods. Secondly, the multi-layer fully connected network fits complex feature-position mapping relationships through nonlinear transformations, fully mining the spatial semantic information in the fused features, improving positioning accuracy by approximately 20% to 30% compared to linear regression. Thirdly, the lightweight design of the network structure results in a total of only 74K parameters, achieving millisecond-level inference speeds, enabling real-time operation on mobile devices, meeting high-frequency positioning requirements while maintaining low power consumption. Fourthly, the output layer's lack of activation functions allows coordinate prediction to be unrestricted by the value range, covering any spatial range, while the coordinate normalization processing during training ensures numerical stability and generalization ability. Fifthly, the introduction of batch normalization layers accelerates feature propagation during forward propagation, maintaining a stable distribution of outputs from each layer and improving the model's robustness in different scenarios. Sixth, the modular design of the decoder allows for independent optimization and replacement. For example, in scenarios with higher accuracy requirements, the network depth or width can be increased, while in resource-constrained scenarios, the network size can be compressed, demonstrating good scalability and adaptability. Seventh, the design of joint optimization with subsequent loss functions enables the decoder to further optimize coordinate regression based on the features extracted by the preceding network, achieving collaborative training and overall performance improvement of the entire system.
[0133] S52, the localization regression decoder is trained end-to-end according to a pre-constructed composite loss function, the composite loss function including a coordinate regression loss term, a ground... Figure One Consistency loss term and trajectory smoothness loss term; among them, the coordinate regression loss term uses the root mean square error function to constrain the error between the predicted position coordinates and the true position coordinates; Figure One The consistency loss term is used to calculate the distance from the predicted location coordinates to the nearest passable area as a penalty when the predicted location coordinates fall into an inaccessible area in the indoor map; the trajectory smoothness loss term is used to constrain the rate of change of displacement between adjacent predicted location coordinates to suppress jumps in the positioning results.
[0134] Specifically, traditional positioning methods typically only use coordinate regression loss (such as mean squared error) as the optimization objective. The model only focuses on how close the predicted position is to the true position, without considering whether the prediction violates physical laws (such as passing through walls) or whether the trajectory is smooth and continuous. The composite loss function organically combines three loss terms with different physical meanings: the coordinate regression loss term ensures that the predicted position numerically approximates the true position, which is the fundamental guarantee of positioning accuracy; the ground loss term ensures that the predicted position is numerically close to ... Figure One The consistency loss term introduces environmental geometric constraints, enabling the model to spontaneously understand physical laws such as "humans cannot pass through walls" during the learning process, and penalizing predictions that fall into impassable areas. The trajectory smoothness loss term, based on the assumption of motion continuity, constrains the stability of the rate of change of position between adjacent time steps, suppressing positioning jumps caused by signal fluctuations. The three losses are weighted and summed to form a joint optimization objective, enabling the model to optimize in three directions simultaneously during gradient descent, ultimately converging to an accurate and reasonable optimal solution.
[0135] Furthermore, for each sample window in the training dataset, the localization decoder outputs the predicted coordinates pred_t = (x_pred, y_pred), while the data annotation step provides the true coordinates gt_t = (x_gt, y_gt) at the center of that window. First, the coordinate regression loss term is calculated using the root mean square error function: L_coord = √[(x_pred - x_gt)² + (y_pred - y_gt)²]. This loss directly measures the Euclidean distance between the predicted and true positions, in meters, and has a clear physical meaning.
[0136] Furthermore, the second calculation Figure OneConsistency loss term. The predicted coordinates `pred_t` are mapped to the pixel coordinate system of the indoor binary raster map, and their pixel value is determined. If the pixel value is 0 (indicating an impassable area), the Euclidean distance `d_map` from that pixel location to the nearest traversable area (pixel value 255) is calculated in pixels and multiplied by the map resolution (0.1 meters / pixel) to convert it to the actual distance. The loss value is defined as `L_map = I(pred_t ∈ forbidden_area) · d_map`, where `I(·)` is an indicator function, taking the value 1 when the predicted point falls within an impassable area and 0 otherwise. This loss ensures that the model penalizes wall-penetrating predictions, with the penalty proportional to the wall-penetrating depth.
[0137] Furthermore, the trajectory smoothness loss term is calculated again. For the prediction sequence of consecutive time steps, the displacement vector between adjacent prediction points is calculated: Δ_t = pred_t - pred_{t-1}, Δ_{t-1} = pred_{t-1} - pred_{t-2}. The trajectory smoothness loss is defined as the L2 norm of the rate of change of adjacent displacements: L_smooth = ||Δ_t - Δ_{t-1}||². This loss constrains the velocity change between adjacent time steps to prevent it from becoming too large, which is equivalent to imposing an implicit penalty on acceleration, suppressing positioning jumps caused by sudden signal changes.
[0138] Furthermore, the final composite loss function is: L = L_coord + λ1·L_map + λ2·L_smooth, where λ1 and λ2 are hyperparameters balancing the weights of each loss term. During training, the gradient of the loss with respect to the network parameters is calculated using the backpropagation algorithm, and the parameters of the entire end-to-end network are updated using the Adam optimizer, so that the various losses decrease synergistically.
[0139] Furthermore, the coordinate regression loss L_coord is expressed as root mean square error, with its output unit being meters, providing a direct reflection of positioning accuracy. During training, the magnitude of this loss depends on the scale of the positioning scene; for a 50m x 50m shopping mall scene, a typical value for L_coord is in the range of 1-5 meters. Figure OneThe calculation of the consistency loss L_map involves the raster map resolution parameter, which is set to 0.1 meters / pixel in this embodiment. Therefore, d_map is calculated in pixels and then multiplied by 0.1 to convert it to meters. The indicator function I(·) is not differentiable, but during backpropagation, for predicted points falling in impassable areas, the gradient propagates only through d_map, which is differentiable relative to the predicted coordinates (achieved by calculating the distance field to the nearest traversable point). The trajectory smoothness loss L_smooth is measured in square meters, and its magnitude depends on the positioning frequency and movement speed. In this embodiment, the positioning frequency is 1 Hz, the normal walking speed is 1.5 meters / second, the typical value of the rate of change of adjacent displacements is between 0 and 1 meter, and the typical value of L_smooth is in the range of 0 and 1.
[0140] Furthermore, the weight parameters λ1 and λ2 are determined through cross-validation. In this embodiment, λ1 = 0.1 and λ2 = 0.05 are chosen, such that... Figure One The magnitudes of consistency loss and trajectory smoothness loss are comparable to those of coordinate regression loss, preventing any one loss from dominating training. During training, an early stopping mechanism is used to monitor the composite loss on the validation set. Training stops when the validation loss no longer decreases after 10 consecutive epochs to prevent overfitting. The optimizer used is Adam, with an initial learning rate of 0.001, decaying by 0.9 times every 10 epochs, a batch size of 64, and a maximum of 100 training epochs.
[0141] Specifically, in a shopping mall scenario, coordinate regression loss ensures that the predicted location is close to the user's actual walking trajectory. Figure One Consistency loss prevents the predicted location from traversing shop walls and entering inaccessible areas, while trajectory smoothness loss ensures smooth and natural navigation arrow movement, avoiding jumps caused by Wi-Fi signal fluctuations. In office building scenarios, [the following text is incomplete and requires further context to translate accurately]. Figure One The penalty for wall penetration prediction effectively prevents employees from accidentally entering office cubicle walls, while the trajectory smoothness loss ensures that the location trajectory in the attendance system accurately reflects the employee's movement between workstations and meeting rooms. In open areas such as airport halls, the ground... Figure One Consistency loss utilizes long-distance dead reckoning based on waiting area boundary constraints to prevent trajectories from deviating from passable areas and entering restricted areas. Trajectory smoothness loss ensures smooth transitions between positioning points when passengers walk continuously. In the underground parking scenario, the ground... Figure One Consistency loss is corrected by using parking space lines and pillar constraints to adjust for inertial drift, ensuring the vehicle's location remains within the lane. Trajectory smoothness loss ensures a continuous and reliable vehicle-finding navigation path. For multi-story buildings, when users go up and down stairs, the ground... Figure One Consistency loss ensures that the predicted location at the moment of floor switching does not pass through the stairwell walls, while trajectory smoothness loss makes the vertical movement transition natural. Furthermore, in emergency evacuation scenarios, the ground... Figure OneThe physical constraints that prevent damage ensure that real-time positioning is always in a safe and accessible area, providing reliable location information for emergency command.
[0142] Specifically, firstly, the coordinate regression loss term directly optimizes positioning accuracy, reducing the model's average positioning error on the test set to 1.5-2.5 meters, meeting the accuracy requirements of most indoor positioning applications. Secondly, the ground... Figure One The consistency loss term eliminates location errors that violate physical laws, such as wall penetration, at the root of the problem. On the test set, it reduces the wall penetration prediction rate by approximately 90%, significantly improving the reliability and interpretability of the location results. Third, the trajectory smoothness loss term effectively suppresses location jumps caused by signal fluctuations, improving the smoothness indicators of the output trajectory (such as root mean square acceleration) by approximately 40%, significantly improving the user experience. Fourth, the joint optimization of the three losses allows the model to learn accuracy, rationality, and continuity simultaneously during training, avoiding the bias that may result from single-objective optimization and achieving synergistic improvement in multi-dimensional performance. Fifth, the adjustability of the weight parameters λ1 and λ2 allows this method to flexibly adjust the optimization focus according to the needs of the application scenario; for example, in security-sensitive scenarios, it can improve accuracy. Figure One The consistency loss weights can improve the trajectory smoothness loss weights in real-time navigation scenarios. Sixth, the end-to-end training method allows the gradient of the composite loss function to backpropagate to the preceding feature extraction network and attention fusion module, enabling the entire system to collaboratively optimize towards minimizing the composite loss. Compared to staged training, this can improve overall performance by approximately 15% to 20%. Seventh, the modular design of the loss function makes it easy to extend; for example, more constraint terms such as velocity-limited loss and region semantic loss can be introduced in the future, demonstrating good scalability and adaptability.
[0143] This invention discloses an indoor positioning method based on multi-source data fusion and deep learning. It constructs a time-aligned and spatially correlated multimodal input tensor by real-time acquisition of Wi-Fi signal strength, inertial measurement unit data, and indoor map data. Convolutional neural networks, bidirectional long short-term memory networks, and pre-trained residual networks are used to extract deep features of each modality. Furthermore, a cross-modal attention mechanism is introduced to dynamically calculate confidence weights and perform weighted fusion. Finally, an end-to-end trained positioning decoder regresses the target location coordinates. This effectively solves the problems of poor positioning accuracy and insufficient robustness caused by signal source fluctuations, loose fusion architecture, and low map utilization in existing technologies. It achieves integrated modeling from multi-source data acquisition, multimodal feature extraction, dynamic attention fusion to location coordinate regression, significantly improving positioning accuracy and environmental adaptability in complex indoor environments, while effectively reducing hardware deployment costs.
[0144] Example 2 To achieve the above invention, embodiments of the present invention also provide an indoor positioning system based on multi-source data fusion and deep learning, such as... Figure One As shown, it includes: In this embodiment of data acquisition and preprocessing, a smartphone is used as the positioning terminal, and the specific acquisition process is as follows: Step 101: Synchronous acquisition of multi-source data.
[0145] Specifically, as the user walks indoors with a smartphone, the system collects data at a frequency of 100Hz: Wi-Fi data: scanning the MAC addresses and corresponding RSSI values of surrounding access points (APs). Due to the limitations of the phone's Wi-Fi scanning frequency, the actual acquisition frequency is approximately 1Hz. Scan timestamps are also recorded. Inertial data: three-axis accelerometer (200Hz), three-axis gyroscope (200Hz), and three-axis magnetometer (100Hz), all data with high-precision timestamps. Map data: a pre-loaded indoor vector map containing information such as wall locations, passable areas, doors, and stairs, represented as a binary raster image (white for passable areas, black for walls, and gray for unknown areas).
[0146] Step 102: Data preprocessing and synchronization.
[0147] Specifically, since the sampling frequencies of each sensor are different, time alignment is required: based on the IMU sampling time, the Wi-Fi RSSI sequence is linearly interpolated so that each IMU data has a corresponding Wi-Fi feature vector.
[0148] Furthermore, a sliding window is constructed: the window length is set to T = 5 seconds (500 IMU sample points), and the sliding step size Δt = 1 second (100 sample points). Each window contains: Wi-Fi feature matrix: (T_wifi × N_ap), where T_wifi = 5 (number of Wi-Fi scans within the window), and N_ap is the total number of APs in the environment (20 in this embodiment); IMU feature tensor: (T_imu × 9), with 9 dimensions including 3 axes of acceleration, 3 axes of angular velocity, and 3 axes of magnetometer.
[0149] Furthermore, map tiling: cropping a local map raster image of (64×64) pixels centered on the center of the window.
[0150] Step 103: Data labeling.
[0151] The true position coordinates (x, y) of the center moment are labeled for each window, and high-precision true values can be obtained through visual SLAM system or manual annotation.
[0152] In embodiments of feature extraction networks (such as...) Figure One (As shown), the specific parameter settings are as follows: Wi-Fi branch: Employs a 1D-CNN+Transformer architecture. CNN layers extract local signal patterns, while the Transformer encoder captures spatial correlations between access points (APs). Experiments show that this architecture improves localization accuracy by approximately 56% compared to pure CNN. IMU branch: Uses a bidirectional LSTM network with 128 hidden units, automatically focusing on key motion moments (such as the support and swing phases in the gait cycle) through a temporal attention mechanism. Research indicates that the CNN-LSTM combined model outperforms traditional CNNs and Deep CNNs in angle prediction tasks. Map branch: Uses a pre-trained ResNet-18, pre-trained on ImageNet, freezing the first three convolutional blocks and fine-tuning only the last convolutional block and fully connected layers. The map raster is encoded into a 512-dimensional feature vector.
[0153] In an implementation of the attention-weighted layer (e.g.) Figure Two As shown in the figure, the specific calculation process of the attention mechanism is as follows: The fused feature F_fused is used as the Query, and the original features F_w, F_i, and F_m of each modality are used as the Key and Value. The Query and Key are mapped to the same dimensional space (128-dimensional) through a linear transformation. The attention score is calculated as: score_i = (W_q·F_fused)·(W_k·F_i)^T / √d, where d=128. The attention weights of each modality are obtained by applying the Softmax function: α_i = exp(score_i) / (∑_j exp(score_j)). The Value is weighted and summed as follows: F_attention =∑ α_i·(W_v·F_i).
[0154] Furthermore, in actual testing, this attention mechanism demonstrated excellent dynamic regulation capabilities: When the Wi-Fi signal is strong and stable, α_w can reach 0.5-0.6; when the user enters a Wi-Fi dead zone or the signal fluctuates violently, α_w automatically drops below 0.2, and α_i and α_m increase accordingly; in areas with regular structures such as corridors, the map weight α_m is higher; in open halls, the IMU weight α_i dominates.
[0155] In an embodiment of loss function design, the following are included: Specifically, the coordinate regression loss uses the root mean square error (RMSE). L_coord = √[(x_pred - x_gt)² + (y_pred - y_gt)²]; Figure ThreeConsistency loss: Penalizes predicted points falling into impassable areas. L_map = ∑_{t} I(pred_t ∈ forbidden_area) · distance(pred_t, nearest_walkable); where I(·) is an indicator function. When a predicted point falls into an impassable area such as a wall, the distance to the nearest walkable area is calculated as a penalty. Trajectory smoothness loss: Constrains the rate of change of displacement between adjacent predicted points to suppress jumps. L_smooth = ∑_{t} ||(pred_t - pred_{t-1}) - (pred_{t-1} - pred_{t-2})||²; The total loss function is: L = L_coord + λ1·L_map + λ2·L_smooth; In this embodiment, λ1=0.1 and λ2=0.05 are taken and determined through cross-validation.
[0156] In an embodiment of model training and deployment, the training phase includes: Dataset: Data was collected from 4 teaching buildings and 3 shopping malls, totaling 15.2 hours and 42.3 kilometers of trajectory; Optimizer: Adam, initial learning rate 0.001, decaying by 0.9 times every 10 epochs; Batch size: 64; Number of training epochs: 100, with early stopping mechanism (patience=10); Hardware environment: NVIDIA Tesla V100 GPU.
[0157] Deployment phase: Model quantization: The FP32 model was quantized into INT8, and the size was compressed from 120MB to 30MB; Mobile inference: TensorFlow Lite was used for deployment, and the single inference time on the Xiaomi 11 Ultra was about 15ms; Power consumption test: After 1 hour of continuous positioning, the power consumption was about 8%, which is comparable to continuous use of map navigation.
[0158] This invention discloses an indoor positioning system based on multi-source data fusion and deep learning. It constructs a time-aligned and spatially correlated multimodal input tensor, employs a one-dimensional convolutional and Transformer cascade architecture to extract Wi-Fi spatial features, utilizes a bidirectional long short-term memory network combined with temporal attention to extract inertial motion features, and a pre-trained residual network to encode map topology features. A cross-modal attention mechanism is introduced to achieve dynamic weight allocation and feature fusion. Finally, an end-to-end trained positioning decoder regresses the target location coordinates. This effectively solves the problems of poor positioning accuracy and insufficient robustness caused by signal source fluctuations, loose fusion architectures, and low map utilization in existing technologies. It achieves integrated modeling from multi-source data acquisition, multimodal feature extraction, dynamic attention fusion to location coordinate regression, significantly improving positioning accuracy and environmental adaptability in complex indoor environments, while effectively reducing hardware deployment costs.
[0159] Example 3 To achieve the above invention, such as Figure Four As shown, this embodiment also provides an indoor positioning device 10 based on multi-source data fusion and deep learning. The device 10 includes: The multi-source data acquisition module 100 is used to acquire multi-source data, including Wi-Fi signal strength data, inertial measurement unit data, and indoor map data.
[0160] The multimodal tensor construction module 200 is used to preprocess multi-source data, aligning and slicing Wi-Fi signal strength data, inertial measurement unit data, and indoor map data according to the same time window to construct a multimodal input tensor.
[0161] The multi-branch feature extraction module 300 is used to input the multimodal input tensors into the corresponding feature extraction networks to extract the deep feature vectors of each modality.
[0162] The dynamic attention fusion module 400 is used to input the deep feature vector into the attention mechanism module, calculate the dynamic weights of each modality, and perform weighted fusion of the deep feature vector according to the dynamic weights to obtain fused features.
[0163] The location regression decoding module 500 is used to input the fused features into the location decoder to obtain the target location coordinates.
[0164] This invention discloses an indoor positioning device based on multi-source data fusion and deep learning. Through the collaborative work of a multi-source data acquisition module, a multimodal tensor construction module, a multi-branch feature extraction module, a dynamic attention fusion module, and a location regression decoding module, it achieves end-to-end integrated modeling from multi-source data acquisition, multimodal tensor construction, deep feature extraction, dynamic weight fusion to target location coordinate regression. By introducing a cross-modal attention mechanism to achieve dynamic evaluation and adaptive fusion of the confidence levels of each data source, this device effectively solves the problems of poor positioning accuracy and insufficient robustness caused by signal source fluctuations, loose fusion architecture, and low map utilization in existing technologies. It significantly improves positioning accuracy and environmental adaptability in complex indoor environments while effectively reducing hardware deployment costs.
[0165] To implement the methods of the above embodiments, the present invention also provides a computer device, such as... Figure One Figure Five Figure Six As shown, the computer device 600 includes a memory 601 and a processor 602; wherein, the processor 602 reads the executable program code stored in the memory 601 to run a program corresponding to the executable program code, so as to implement the various steps of the indoor positioning method based on multi-source data fusion and deep learning described above.
[0166] To implement the above embodiments, this application also proposes a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements an indoor positioning method based on multi-source data fusion and deep learning as described in the foregoing embodiments.
[0167] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0168] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.
Claims
1. An indoor positioning method based on multi-source data fusion and deep learning, characterized in that, include: S1, acquire multi-source data, including Wi-Fi signal strength data, inertial measurement unit data, and indoor map data; S2 preprocesses the multi-source data by aligning and slicing the Wi-Fi signal strength data, inertial measurement unit data, and indoor map data according to the same time window to construct a multimodal input tensor. S3, input the multimodal input tensors into the corresponding feature extraction networks to extract the deep feature vectors of each modality; S4, input the deep feature vector into the attention mechanism module, calculate the dynamic weights of each modality, and perform weighted fusion of the deep feature vector according to the dynamic weights to obtain the fused features; S5 inputs the fused features into the localization decoder to obtain the target location coordinates.
2. The method as described in claim 1, characterized in that, Acquire multi-source data, including: S11, collect Wi-Fi data with the positioning terminal. The Wi-Fi data includes the MAC addresses of surrounding wireless access points and the corresponding received signal strength indication values, and record the scan timestamp. S12, the positioning terminal collects inertial data, including three-axis accelerometer data, three-axis gyroscope data and three-axis magnetometer data, and records high-precision timestamps; S13, acquire indoor map data. The indoor map data is a vector map, which includes the location of walls, passable areas, spatial layout information of doors and stairs, and is represented in the form of a binary raster map.
3. The method as described in claim 1, characterized in that, The preprocessing of multi-source data involves aligning and slicing Wi-Fi signal strength data, inertial measurement unit data, and indoor map data according to the same time window to construct a multimodal input tensor, including: S21, using the sampling time of the inertial measurement unit data as a reference, linear interpolation is performed on the sequence of received signal strength indication values of Wi-Fi signal strength data, so that each inertial measurement unit data sample has a corresponding Wi-Fi feature vector, thereby achieving time alignment; S22, construct a sliding window, slice the aligned multi-source data with a preset window length and sliding step size, and generate window data containing Wi-Fi feature matrix and inertial measurement unit feature tensor; wherein, the dimension of Wi-Fi feature matrix is determined by the number of Wi-Fi scans in the window and the total number of wireless access points in the environment, and the dimension of inertial measurement unit feature tensor is determined by the number of inertial measurement unit samples in the window and the number of sensor channels. S23, using the center position of the sliding window as the center, crop a local map raster of a preset size from the indoor map data as the map feature corresponding to the window data.
4. The method as described in claim 1, characterized in that, The step of inputting the multimodal input tensors into the corresponding feature extraction networks to extract deep feature vectors for each modality includes: S31, input the Wi-Fi feature matrix in the multimodal input tensor into the first feature extraction branch. The first feature extraction branch adopts an architecture that combines a one-dimensional convolutional neural network and a Transformer encoder to extract the local mode features of the Wi-Fi signal and the spatial correlation features between wireless access points, and outputs the deep feature vector of the Wi-Fi mode. S32, input the inertial measurement unit feature tensor in the multimodal input tensor into the second feature extraction branch. The second feature extraction branch uses a bidirectional long short-term memory network combined with a temporal attention mechanism to extract the motion temporal features of pedestrian heading and stride frequency, and automatically focuses on key motion moments in the gait cycle to output the deep feature vector of inertial mode. S33, input the local map raster image in the multimodal input tensor into the third feature extraction branch. The third feature extraction branch uses a pre-trained residual network to encode the map raster image into a map modality deep feature vector of a preset dimension.
5. The method as described in claim 1, characterized in that, The process of inputting the deep feature vector into the attention mechanism module, calculating the dynamic weights of each modality, and weighting and fusing the deep feature vectors according to the dynamic weights to obtain fused features includes: S41, the deep feature vectors of each modality are concatenated in the channel dimension to generate multimodal fusion features as the query matrix; the deep feature vectors of each modality are used as the key matrix and value matrix respectively; and the query matrix and the key matrices of each modality are mapped to the same dimensional space through a linear transformation layer, and the attention score between the query matrix and the key matrices of each modality is calculated. S42, the attention scores are normalized using the Softmax function to obtain the dynamic weight coefficients of each modality. The dynamic weight coefficients represent the confidence of each modality data source at the current time. Then, the value matrices of each modality are weighted and summed according to the dynamic weight coefficients to generate the weighted fused attention features, which are used as the fused features.
6. The method as described in claim 1, characterized in that, The step of inputting the fused features into the localization decoder to obtain the target location coordinates includes: S51 inputs the fused features into the localization regression decoder, which is composed of fully connected layers, and maps them to generate the predicted position coordinates at the current moment. S52, the positioning regression decoder is trained end-to-end according to a pre-constructed composite loss function, which includes a coordinate regression loss term, a map consistency loss term, and a trajectory smoothness loss term. The coordinate regression loss term uses the root mean square error function to constrain the error between the predicted location coordinates and the actual location coordinates. The map consistency loss term is used to calculate the distance from the predicted location coordinates to the nearest passable area as a penalty when the predicted location coordinates fall into an inaccessible area in the indoor map. The trajectory smoothness loss term is used to constrain the rate of change of displacement between adjacent predicted location coordinates to suppress jumps in the positioning results.
7. An indoor positioning device based on multi-source data fusion and deep learning, characterized in that, include: The multi-source data acquisition module is used to acquire multi-source data, including Wi-Fi signal strength data, inertial measurement unit data, and indoor map data. The multimodal tensor construction module is used to preprocess multi-source data, aligning and slicing Wi-Fi signal strength data, inertial measurement unit data, and indoor map data according to the same time window to construct a multimodal input tensor. The multi-branch feature extraction module is used to input the multimodal input tensors into the corresponding feature extraction networks to extract the deep feature vectors of each modality. The dynamic attention fusion module is used to input the deep feature vector into the attention mechanism module, calculate the dynamic weights of each modality, and perform weighted fusion of the deep feature vectors according to the dynamic weights to obtain fused features. The location regression decoding module is used to input the fused features into the location decoder to obtain the target location coordinates.
8. An electronic device, comprising: processor; The memory stores executable instructions; when the processor executes the instructions, it implements the indoor positioning method based on multi-source data fusion and deep learning as described in any one of claims 1-6.
9. A computer-readable storage medium storing a computer program, which, when executed by a processor, implements an indoor positioning method based on multi-source data fusion and deep learning as described in any one of claims 1-6.