Abstract
WiFi fingerprinting has become a widely adopted solution for indoor localization due to its low deployment cost and wide availability. However, its positioning accuracy is often unsatisfactory, especially in complex environments involving multiple floors and buildings, where signal interference and structural complexity significantly degrade localization performance. To address these challenges, this paper proposes a deep neural network (DNN) framework that integrates a Stacked Autoencoder (SAE) for feature extraction and a multi-label classification strategy for accurate localization using received signal strength (RSS) data. To optimize the model parameters effectively in high-dimensional spaces, we introduce a Dual-Swarm Particle Swarm Optimization (DSPSO) algorithm. Unlike conventional PSO, which is prone to premature convergence, DSPSO partitions the particle population into two distinct sub-swarms with adaptive update mechanisms to enhance global exploration and avoid local optima. Experimental evaluations on seven 100-dimensional benchmark functions demonstrate that DSPSO outperforms traditional PSO and recent algorithms like the Sparrow Search Algorithm (SSA), achieving the global optimum in four cases. When applied to the WiFi localization task, the DSPSO-optimized SAE-DNN model achieves an average positioning error of 9.42 m—representing 13.74% improvement over the Support Vector Regression (SVR) model and 24.03% improvement over the non-optimized version. Furthermore, the model achieves 100% accuracy in building identification and 92.97% accuracy in floor prediction, proving its effectiveness in multi-building, multi-floor indoor localization scenarios.
Keywords: Deep neural network model, Multi-Label classification, Dual-Population-Particle swarm optimization, Received signal strength, Stacked autoencoder, WiFi fingerprint localization
Subject terms: Computer science, Information technology
Introduction
With the development of the Internet of Things (IoT), location-based services (LBS) have become increasingly integrated into daily life and have shown exceptional utility in areas such as navigation. In outdoor environments, accurate positioning can be achieved using the Global Positioning System (GPS) or cellular base stations. However, indoor environments present a significantly different scenario. Due to obstructions, pedestrian movements, and complex spatial layouts, severe multipath interference occurs, making it difficult for GPS or cellular-based systems to provide reliable indoor localization1.
To enable indoor positioning in such complex environments, researchers have explored dense deployments of WiFi, Bluetooth, and Ultra-Wideband (UWB) technologies to perform absolute positioning based on distance, angle of arrival, or fingerprint features. Although UWB can offer high positioning accuracy, it requires the deployment of anchors and tags, and the power consumption of tags is relatively high, making it less suitable for large-scale practical deployment. To strike a balance between cost and performance, some researchers have proposed hybrid methods such as IMU-Bluetooth or WiFi-IMU fusion for indoor localization. However, these approaches still involve relatively high deployment and operational costs.
Recently, indoor localization research has focused on device-based positioning in social-aware environments using smartphones, which are now widely equipped with integrated wireless and sensor modules2. One key advantage of WiFi fingerprinting-based localization over other techniques is that it does not require additional infrastructure, thereby significantly reducing deployment cost. With the use of Channel State Information (CSI), localization accuracies of 0.73 m in hallways and 0.82 m in laboratories have been achieved3. Today, indoor localization plays a vital role in fields such as smart warehousing4, smart furniture systems5, and indoor navigation6. However, acquiring CSI or Round-Trip Time (RTT) information requires physical layer access and support for standards such as IEEE 802.11n, 802.11mc, or 802.11az, limiting the feasibility of large-scale public deployment.
In contrast, Received Signal Strength (RSS) is readily obtainable using consumer-grade mobile devices. Currently, two mainstream research directions in RSS-based indoor localization exist: distance-based and fingerprint-based methods. Distance-based approaches rely on the physical principle that signal strength decays with distance, commonly modeled using log-distance path loss models. However, due to multipath effects and obstructions, these methods often produce positioning errors exceeding 10 m in complex environments.
Fingerprint-based positioning, on the other hand, tends to yield much smaller errors when using RSS. Due to its low cost and relatively high accuracy, WiFi fingerprinting has become a widely adopted approach in indoor positioning7. A typical fingerprint-based method consists of two phases. In the offline phase, an RSS fingerprint dataset is constructed by associating processed RSSI data with the coordinates of reference points, creating a “location–fingerprint” mapping8. In the online phase, the user collects real-time RSSI values at an unknown location using a mobile device9, which are then matched against the fingerprint database to estimate the current position, and the database can be updated dynamically.
To further improve positioning accuracy, various classical machine learning algorithms have been introduced into WiFi fingerprinting. Early studies employed simple classifiers such as k-Nearest Neighbors (KNN) and Naive Bayes, but these models often suffer from poor performance in real environments where the number of Access Points (APs) is large and strongly correlated with physical layout, leading to significant model errors. To overcome this, researchers have turned to more advanced models like Support Vector Machines (SVM)10 and Long Short-Term Memory (LSTM) networks11, which perform well in single-floor indoor positioning scenarios. However, these models often encounter limitations in multi-building, multi-floor environments that require multi-label classification.
To address these challenges, this paper proposes a Deep Neural Network (DNN) composed of a Stacked Autoencoder (SAE) and a multi-label classifier for localization in complex indoor environments. This architecture allows high-dimensional RSS data to be flattened and effectively processed through multi-label classification. To further enhance localization performance, optimization algorithms are applied to fine-tune model parameters. Traditional optimization methods such as Particle Swarm Optimization (PSO)12, Probabilistic PSO (PPSO)13, and the Arithmetic Optimization Algorithm (AOA)14 have shown promise. However, these algorithms often suffer from premature convergence when applied to high-dimensional problems.
To overcome this limitation, we propose a Dual-Swarm Particle Swarm Optimization (DSPSO) algorithm specifically designed to optimize the SAE-based multi-label DNN. The DSPSO enhances global search capability and enables more accurate classification and localization. Finally, extensive experiments are conducted to compare the performance of DSPSO against other algorithms on high-dimensional benchmark functions, demonstrating its superiority. The DSPSO-optimized DNN is then compared with models such as SVR to validate its effectiveness in complex indoor localization scenarios.
The main contributions of this work are as follows:
A deep learning model composed of a Stacked Autoencoder (SAE) and a multi-label classifier is proposed to perform localization in complex indoor environments involving multiple buildings and multiple floors. The model achieves this by reducing the dimensionality of high-dimensional RSS data and performing multi-label classification for accurate positioning.
To address optimization in high-dimensional problems, this paper proposes a multi-swarm Particle Swarm Optimization (PSO) algorithm. Its effectiveness in finding better optimal solutions is demonstrated through comparisons with other optimization algorithms in high-dimensional settings.
The DSPSO algorithm is employed to optimize the deep learning model in order to enhance localization accuracy. The proposed model is further compared with other baseline models to demonstrate its superior performance in complex indoor environments involving multiple buildings and multiple floors.
The remainder of this paper is organized as follows: Sect. 2 reviews related work. Section 3 provides a detailed description of the DSPSO algorithm and the proposed model composed of a Stacked Autoencoder (SAE) and a multi-label classifier. Section 4 presents experimental results to validate the effectiveness of the proposed algorithm and model, along with comparisons to existing methods. Finally, Sect. 5 concludes the paper.
Preliminaries
WiFi fingerprinting-based indoor localization using Received Signal Strength (RSS) is a technique that estimates a user’s position by analyzing the RSS values from surrounding Access Points (AP) received by the user’s device. This method first constructs a radio fingerprint database by collecting RSS measurements at various known locations within the indoor environment. During the online phase, the user’s real-time RSS readings are compared with the fingerprint database to determine the user’s current location. Due to its wide signal coverage, low implementation cost, ease of deployment, and scalability, this method has become highly practical. Moreover, since nearly all modern mobile devices are equipped with WiFi modules, users can perform localization simply by carrying their WiFi-enabled devices, without the need for additional infrastructure, as illustrated in Fig. 1. These characteristics make RSS-based WiFi fingerprinting a highly applicable and user-friendly indoor positioning solution.
Fig. 1.
Flowchart of WiFi Fingerprint-Based Localization.
WiFi fingerprint indoor localization using SVR model
Support Vector Regression (SVR) is an extension of Support Vector Machines (SVM). The SVR model aims to find an optimal regression hyperplane such that all data points lie as close as possible to this hyperplane, with prediction errors falling within a specified acceptable margin15. Similar to SVM, SVR leverages kernel functions to transform data that is not linearly separable in the original feature space into a higher-dimensional space16, where linear separation becomes feasible. A schematic diagram of the SVR model is shown in Fig. 2. The regression function of the SVR model is defined as follows:
![]() |
1 |
Fig. 2.
Schematic diagram of the SVR model.
w denotes the weight vector, b is the bias term, and
represents the input vector.
The optimization objective function of SVR is defined as follows:
![]() |
2 |
![]() |
denotes the ground truth value, while
represent the slack variables, which allow deviations outside the
-insensitive zone. C is the regularization parameter (or penalty factor), and
is the epsilon-insensitive parameter., which defines the maximum allowable error within the tolerance margin.
The Support Vector Regression (SVR) model can directly predict continuous position coordinates, which aligns more closely with real-world localization requirements and results in higher positioning accuracy. In addition, SVR effectively leverages the functional relationship between Received Signal Strength (RSS) and actual location coordinates, thereby avoiding the loss of accuracy commonly associated with classification-based methods due to coarse-grained region partitioning17. SVR also demonstrates greater robustness to signal fluctuations and environmental interference, offering stronger generalization capability, which makes it more suitable for nonlinear indoor localization environments. For example, K. Shi et al. applied an SVR model in a 221 m² indoor area, using RSS data collected from 25 access points (APs), and achieved a localization error of only 0.88 m, which strongly validates the feasibility of SVR in RSS-based WiFi fingerprinting indoor localization. However, its performance tends to degrade in large-scale complex indoor environments, where significant localization errors may still occur18.
Stacked autoencoder
The Stacked Autoencoder (SAE) is a deep neural network architecture composed of multiple Autoencoders (AEs) connected in a cascaded manner. It performs feature extraction on high-dimensional data through layer-wise unsupervised pretraining followed by global supervised fine-tuning. Each AE consists of an encoder and a decoder. The encoder compresses the input data through dimensionality reduction while extracting key features, and the decoder reconstructs the original data from the compressed low-dimensional representation. The formula for the encoder is defined as follows:
![]() |
3 |
represents the input data vector, w is the encoder weight matrix, and b is the bias vector. The function f(⋅) denotes a nonlinear activation function, such as ReLU, Sigmoid, or Tanh. The formulas for these three activation functions are given as follows:
![]() |
4 |
![]() |
5 |
![]() |
6 |
The decoder formula is defined as follows:
![]() |
7 |
denotes the reconstructed data,
is the decoder weight matrix, and
is the bias term. The function g (⋅) typically uses an activation function similar to that of the encoder. The objective of the autoencoder is to minimize the reconstruction error, and the most commonly used loss function is the Mean Squared Error (MSE), which is defined as follows:
![]() |
8 |
The Stacked Autoencoder (SAE) is constructed by cascading multiple autoencoders to form a deep architecture. The input layer receives the raw data, which is then passed through multiple encoding layers that progressively reduce dimensionality and compress features. Dimensionality reduction and feature extraction are performed in the intermediate hidden layers, where the output of each hidden layer is used as the input to the next layer.
Subsequently, the data is passed through multiple decoding layers to gradually reconstruct the original input dimensionality, until it matches the size of the input layer. The overall structure is illustrated in Fig. 3.
Fig. 3.
Example diagram of SAE architecture.
Multi-label classification
Multi-label classification is a type of supervised learning task in which each sample may simultaneously belong to multiple category labels, unlike traditional single-label classification where each sample is associated with only one label. In practical applications, many scenarios naturally exhibit multi-label characteristics—for instance, an image may contain “person,” “car,” and “tree” at the same time, while a text document may involve both “politics” and “economy.” Therefore, multi-label classification models are widely applicable in fields such as image recognition, text annotation, medical diagnosis, and emotion detection.
In terms of modeling approaches, multi-label classification mainly adopts two strategies: the first is problem transformation, such as the Binary Relevance (BR) method, which decomposes the multi-label problem into multiple independent binary classification problems; the second is algorithm adaptation, where models like neural networks are modified to directly output the predicted probabilities for multiple labels. In deep learning frameworks, the sigmoid activation function is typically used in the output layer to ensure that each label prediction is independent of the others. The loss function evaluates the deviation between the predicted probabilities and the true labels for each tag and optimizes them individually, thereby accommodating the needs of multi-label tasks. Compared with single-label classification, multi-label problems are more challenging, involving issues such as modeling label dependencies, handling label imbalance, and selecting appropriate evaluation metrics, making them an important topic of research.
Optimization algorithm
The Particle Swarm Optimization (PSO) algorithm is inspired by the collective foraging behavior observed in bird flocks and fish schools. It simulates a population of particles that iteratively search the solution space by following both their personal best positions and the global best position, ultimately converging toward the global optimum19. Due to its simplicity, few parameters, and fast convergence speed, PSO has quickly become a classical method in the field of swarm intelligence optimization. During the optimization process, each particle updates its velocity and position based on its personal best position (Pbest) and the global best position (Gbest ) found so far. The velocity update formula for pos is defined as follows:
![]() |
9 |
w denotes the inertia weight, which controls the momentum of the particle. c1 and c2 represent the cognitive acceleration coefficient and social acceleration coefficient, respectively, which determine the particle’s movement toward its personal best position and the global best position. Higher acceleration coefficients can help particles converge more quickly toward better solutions, but may also increase the risk of getting trapped in local optima. The term rand refers to a uniformly distributed random variable in the interval [0, 1]. The inclusion of randomness introduces diversity in particle updates, helping to prevent premature convergence. After the velocity is updated, the particle’s position is updated as follows:
![]() |
10 |
After each position update, if the current particle’s fitness is better than its historical personal best fitness, then its personal best position is updated accordingly:
![]() |
11 |
If a particle’s personal best position is better than the current global best position, the global best position is updated accordingly:
![]() |
12 |
The integration of optimization algorithms, such as Particle Swarm Optimization (PSO), with machine learning models has become increasingly common across various domains. For example, M. Hasanipanah et al.20 proposed a hybrid PSO-SVR model for predicting air pressure resulting from explosions. Similarly, optimization algorithms can also be applied to indoor localization models. WiFi fingerprint-based localization is typically formulated as a high-dimensional problem, in which traditional PSO tends to easily fall into local optima when handling complex, high-dimensional search spaces.
Math
Indoor localization using a model composed of stacked autoencoder and classifier
To achieve more accurate localization in complex indoor environments involving multiple buildings and floors, this paper adopts a Deep Neural Network (DNN) architecture that combines a Stacked Autoencoder (SAE) with a classifier. As described earlier, the SAE progressively reduces the dimensionality of input data through its multi-layer encoder structure. In such complex architectural scenarios, the received RSS data is typically high-dimensional. The SAE encoder is used to perform dimensionality reduction and feature extraction on this multi-dimensional RSS input. However, instead of reconstructing the original input through a decoder, the compressed and flattened features19 are directly fed into a classifier for final localization. This design bypasses the decoding process and enables efficient classification-based prediction. The overall architecture is illustrated in Fig. 4.
Fig. 4.
Deep Neural Network (DNN) Composed of SAE and Classifier.
In indoor localization tasks, Received Signal Strength (RSS) data is often affected by multipath effects, device variations, and environmental changes, leading to significant randomness and noise. Directly using raw RSS data for modeling can compromise the accuracy and stability of localization. To address this issue, the paper introduces a Stacked Autoencoder (SAE) to perform dimensionality reduction and feature extraction on RSS data. SAE can automatically learn compact and discriminative feature representations from high-dimensional and redundant RSS inputs, effectively suppressing noise and enhancing the model’s adaptability to varying conditions. Compared to traditional manual feature extraction methods, SAE offers stronger nonlinear representation capabilities and adaptive learning, providing a more reliable feature basis for subsequent building, floor, and location classification. Therefore, using SAE to process RSS data not only improves localization accuracy but also enhances the scalability and robustness of the entire system.
compressing the original high-dimensional Access Point (AP) signals into a low-dimensional feature space. This feature compression reduces data dimensionality while preserving spatial distribution characteristics of the signals via activation functions such as ReLU, thereby mitigating noise caused by device heterogeneity and signal fluctuations. The multi-label classification component transforms the three-level localization task—building, floor, and location—into a parallel prediction problem. Compared to traditional multi-class classification approaches, this design significantly reduces the number of output nodes and enhances the scalability of the model. The computation formula for the hidden layer in the classifier is given as follows:
![]() |
13 |
The calculation formula of the output layer is defined as follows:
![]() |
14 |
The binary cross-entropy loss function is used for multi-label classification, and is defined as follows:
![]() |
15 |
denotes the ground truth label,
represents the predicted probability that the label is 1, N is the number of samples, and M is the number of labels.
In the proposed DNN architecture, the classifier component processes the feature vectors extracted by the Stacked Autoencoder (SAE) and outputs the corresponding building, floor, and location labels. Unlike traditional multi-class classification approaches, this study models the indoor localization task as a multi-label classification problem, thereby enhancing the model’s scalability and its ability to represent the hierarchical structure. The classifier’s output consists of three parts: Building label: B=(B1,B2,…,BNB), Floor label: F=(F1,F2,…,FNF), Position label: L=(L1,L2,…,LNL). Each part is encoded using one-hot encoding, and the overall output vector is formed by concatenating these parts.
![]() |
16 |
BNB,FNF,LNL are the number of buildings, the maximum number of floors and the maximum number of locations.
To enhance the robustness and accuracy of localization under fingerprint drift, we introduced κ and σ to aggregate multiple high-confidence reference points and filter out outliers. κ represents the selection of the top κ candidate location points from the probability vector output by the neural network, aiming to introduce redundancy and avoid localization errors caused by reliance on a single reference point, thereby enhancing the system’s robustness against fingerprint drift. Compared with traditional approaches that rely solely on the highest-probability point, incorporating multiple high-confidence candidates helps mitigate the effects of local signal fluctuations. σ serves as a normalized confidence threshold to further filter out low-probability candidates among the κ selected points, which may exhibit large positional deviations. Specifically, only those candidates with predicted probabilities greater than or equal to σ times the maximum probability are retained, preventing the inclusion of noisy or distant points when κ is large. Through the collaborative use of κ and σ, the system can aggregate reliable location information while effectively suppressing outliers, thus significantly improving localization accuracy and stability in the presence of fingerprint drift.
For the output results, the predicted labels are obtained using the argmax operation. The building ID is predicted accordingly:
![]() |
17 |
The floor ID is predicted accordingly:
![]() |
18 |
The location vector is predicted accordingly:
![]() |
19 |
Here, σ is the threshold parameter, and κ represents the maximum number of candidate point to retain. The predicted location coordinates are obtained by calculating the weighted centroid of the remaining reference points:
![]() |
20 |
Here, S refers to the set of selected location candidates.
Dual-Swarm particle swarm optimization (DSPSO) algorithm
In complex optimization problems, Particle Swarm Optimization (PSO) may suffer from slow convergence speed, and in high-dimensional spaces (with dimensions greater than 2), PSO is prone to premature convergence to local optima. To better optimize the Deep Neural Network (DNN) model for improved localization accuracy, this paper proposes a Dual-Swarm Particle Swarm Optimization (DSPSO) algorithm to address the limitations of conventional PSO in high-dimensional and complex problem settings. The DSPSO algorithm divides the particles into two separate swarms, each processed with distinct update strategies, in order to effectively avoid being trapped in local optima. To enhance the global search capability of the algorithm in complex optimization problems and overcome the tendency of classical PSO to fall into local optima, DSPSO introduces a dual-population cooperative strategy. An independent update formula is adopted for the second population, as shown in Eq. (21). This formula does not rely on the individual historical best position (Pbest), but instead performs perturbation-based updates solely based on the current global best position (Gbest). By introducing symmetric perturbations (positive or negative) and a dynamic control factor ξ(t), as defined in Eq. (22), particles can achieve broader exploration in the search space around Gbest.
The core advantages of this design are twofold: on the one hand, removing the constraint of Pbest prevents the population from premature convergence, thereby improving diversity and the ability to escape local optima; on the other hand, the time-decaying mechanism of the perturbation intensity allows particles to explore more aggressively in the early stages and gradually converge in the later stages, achieving a dynamic balance between exploration and exploitation. Experimental results show that this design demonstrates stronger robustness and stability in high-dimensional function optimization and real-world engineering problems. It maintains global search capability while accelerating convergence, representing a significant improvement over traditional particle swarm optimization strategies.
![]() |
21 |
all instances of r represent random numbers uniformly distributed in the interval [0, 1], and the formula for ξ(t) is defined as follows:
![]() |
22 |
The exponential function ξ(t) serves as a key mechanism in DSPSO, dynamically controlling whether particles adopt velocity adjustments. This enhances the algorithm’s robustness, diversity, and global optimization capability. It provides DSPSO with an adaptive strategy to balance exploration and exploitation, effectively mitigating the premature convergence often observed in classical PSO. The design rationale behind this function is that, in the early stages of the algorithm, high-speed particle movement is desirable to explore the search space extensively. As the iteration count T progresses, more refined local search is needed. Therefore, this function allows the algorithm to perform broad exploration in the early phase, while focusing on solution refinement and exploitation in the later stages.
b denotes a constant, and T represents the maximum number of iterations. The first swarm is introduced to expand the search space. The second swarm, on the other hand, is designed to prevent premature convergence and accelerate the search process by controlling the particle velocity. Additionally, to avoid excessively rapid convergence, particles in this swarm are allowed to move with a probability of 0.5. The corresponding formula is given as follows:
![]() |
23 |
The overall process of the DSPSO algorithm is as follows: First, parameters are defined and the velocities and positions of all particles are initialized. The population is then divided into two sub-swarms: Sub-swarm 1 adopts a modified traditional PSO update mechanism, where particles have a probability of maintaining their previous velocity in each iteration to avoid premature convergence. Sub-swarm 2 completely bypasses the individual best position (Pbest) and performs symmetric perturbation updates based solely on the current global best position (Gbest), thereby enhancing global search capability and population diversity. In each iteration, the algorithm first updates the positions of particles in sub-swarm 1, followed by updating the velocities and positions of particles in sub-swarm 2. Then, the fitness of all particles is evaluated, and both the individual best positions and the global best position are updated accordingly. The operational flow of DSPSO is illustrated in Fig. 5. The pseudocode of the DSPSO algorithm is shown in Fig. 6.
Fig. 5.
Flowchart of the DSPSO algorithm.
Fig. 6.
Pseudocode of the DSPSO Algorithm.
By applying the DSPSO algorithm to optimize the DNN model during the offline phase, the optimal network architecture is obtained. In the online phase, real-time data is transmitted and fed into the trained model to achieve more accurate localization. The overall process is illustrated in Fig. 7.
Fig. 7.
Localization Process.
Experiment
Data description
The dataset used in this experiment is the publicly available UJIIndoorLoc dataset. UJIIndoorLoc is a widely used benchmark dataset in the field of indoor localization, released in 2014 by a research team from Universitat Jaume I in Spain. The dataset was collected from WiFi signals within three multi-floor buildings on the university campus, covering an indoor area of over 100,000 square meters. It includes densely distributed reference points, with an average spacing of less than 1.2 m between adjacent points, and records Received Signal Strength (RSS) values, Access Point (AP) identifiers, and precise geographic coordinates. The dataset consists of 19,938 training samples and 1,112 testing samples, involving a total of 520 APs. It is commonly used for the development and evaluation of fingerprint-based localization algorithms, and is particularly suitable for tackling multi-building and multi-floor indoor positioning challenges.
Comparison of dspso’s superiority in handling complex functions in high-dimensional spaces
To verify that the DSPSO algorithm can achieve better optimal solutions in high-dimensional scenarios, this study compares DSPSO with Particle Swarm Optimization (PSO), Whale Optimization Algorithm (WOA)21, Henry Gas Solubility Optimization (HGSO)22, Grey Wolf Optimizer (GWO)23, as well as the recently proposed Sparrow Search Algorithm (SSA)24, HSPSO (Hybrid Strategy PSO25 and Arithmetic Optimization Algorithm (AOA). The comparison is conducted using seven benchmark functions under the condition of 100 dimensions and 500 iterations, where each function is independently executed 30 times to calculate the mean and variance. By applying the above algorithms to the seven benchmark functions listed in Table 1, the Mean and Variance results are used to evaluate the stability of each algorithm and assess their optimization performance in high-dimensional problems based on whether the global optimum is successfully found. The parameter settings for each algorithm are detailed in Table 2.
Table 1.
Benchmark functions.
| Formulas | Range | Minimum Value |
|---|---|---|
|
[− 100,100] | 0 |
|
[− 10,10] | 0 |
|
[− 100,100] | 0 |
|
[− 100,100] | 0 |
|
[− 30,30] | 0 |
|
[− 100,100] | 0 |
|
[− 1.28,1.28] | 0 |
Table 2.
Algorithms and their parameter settings.
| Algorithms | Parameters | Values |
|---|---|---|
| DSPSO | S1,S2 | 15,15 |
| PSO | C1,C2,w | 2,2,0.9 − 0.4 |
| WOA | a | 2 − 0 |
| HGSO | Cluster Size, M1,M2,K,α,β | 5,0.10.2,1,1,1 |
| GWO | a | 2 − 0 |
| SSA | P | 0.5 |
| AOA | C1,C2 | 2,6 |
| HSPSO | N, C1, C2,w, vmax,vmin | 15,1.5,1.5,0.4–0.8,1,-1 |
By comparing the results in Table 3, it can be observed that when addressing high-dimensional optimization problems, the DSPSO algorithm successfully finds the global optimum on multiple benchmark functions. Even for the functions where the optimum is not found, DSPSO still achieves relatively low variance, indicating stable performance. In contrast, both the PSO and SSA algorithms fail to reach the global optimum on several benchmark functions. Moreover, except for SSA, which performs well on function f₇, these two algorithms exhibit high variance across most functions, suggesting poor stability and reliability in high-dimensional scenarios. Among all the algorithms compared, DSPSO, GWO, and AOA consistently demonstrate strong overall performance. While AOA shows higher stability on certain functions, DSPSO achieves slightly better results in terms of optimal value discovery, making it the most effective method overall for high-dimensional benchmark optimization.
Table 3.
Mean and variance of benchmark function results across Algorithms.
| F | DSPSO | PSO | WOA | HGSO | GWO | SSA | AOA | HSPSO | |
|---|---|---|---|---|---|---|---|---|---|
|
Mean Variance |
0 0 |
1.29e + 01 2.39e + 01 |
0 0 |
0 0 |
0 0 |
6.48e + 02 2.21e + 05 |
0 0 |
0 0 |
|
Mean Variance |
0 0 |
1.47e + 01 6.51 |
0 0 |
0 0 |
0 0 |
5.35e + 01 3.55e + 01 |
0 0 |
0 0 |
|
Mean Variance |
0 0 |
2.13e + 01 8.22e + 01 |
4.53e + 4 1.87e + 08 |
0 0 |
1.75e-4 8.34e-7 |
1.93e + 04 3.94e + 07 |
0 0 |
0 0 |
|
Mean Variance |
0 0 |
1.35 5.58e-02 |
8.27e + 01 5.04e + 01 |
2.33e + 01 1.98e + 01 |
0 0 |
3.69e + 01 3.59e + 01 |
1.61e + 01 1.06e + 01 |
0 0 |
|
Mean Variance |
1.11e + 01 2.26e + 01 |
1.93e + 03 8.65e + 05 |
2.71e + 01 2.25e-01 |
9.86 2.95e-01 |
2.87e + 01 7. 00e-03 |
3.46e + 2 3.28e + 12 |
9.98e + 01 4.85e-2 |
1.09e + 01 1.32e + 01 |
|
Mean Variance |
2.97 4.83 |
1.58e + 01 2.32e + 01 |
6.49e-2 7.00e-2 |
1.18e + 02 1.73 |
1.98 3.33e-01 |
7.14e + 02 5.32e + 02 |
2.31e + 01 3.40e-1 |
3.41 5.21 |
|
Mean Variance |
3.31e-04 4.38e-04 |
12.384 23.837 |
1.06e-03 8.37e-07 |
7.716e-02 1.59e-03 |
2.55e-02 8.13e-4 |
2.59e-01 1,22e-02 |
2.65e-02 1.47e-04 |
2.12e-03 2.91e-03 |
By comparing the results in Table 3, it can be observed that when addressing high-dimensional optimization problems, the DSPSO algorithm successfully finds the global optimum on multiple benchmark functions. Even for the functions where the optimum is not found, DSPSO still achieves relatively low variance, indicating stable performance. In contrast, both the PSO and SSA algorithms fail to reach the global optimum on several benchmark functions. Moreover, except for SSA, which performs well on function f₇, these two algorithms exhibit high variance across most functions, suggesting poor stability and reliability in high-dimensional scenarios. Among all the algorithms compared, DSPSO, GWO, and AOA consistently demonstrate strong overall performance. While AOA shows higher stability on certain functions, DSPSO achieves slightly better results in terms of optimal value discovery, making it the most effective method overall for high-dimensional benchmark optimization. In comparison with HSPSO, another variant of PSO, we observe that HSPSO performs slightly better than DSPSO on one benchmark function. However, overall, it still falls slightly short of DSPSO.
As illustrated by the fitness convergence curves in Fig. 8, it can be observed that DSPSO converges more slowly than PSO in certain cases. This is primarily due to DSPSO’s use of a dual-swarm structure and random motion strategies, which, while slightly reducing convergence speed, significantly enhance the algorithm’s ability to avoid premature convergence to local optima. Compared to other algorithms, DSPSO generally achieves faster convergence in most scenarios while maintaining a strong global search capability. This is particularly evident in the case of function f₄, where although most algorithms converge quickly, all—except for GWO—fall into local optima. In contrast, DSPSO maintains effective convergence without being trapped, further demonstrating its robustness in complex high-dimensional optimization tasks.
Fig. 8.
Fitness convergence curves of each algorithm on the seven benchmark functions.
Comparison between the SAE-Classifer-Based DNN model and the SVR model
The cumulative distribution function (CDF) curves of the positioning errors for the SVR and DSPSO-DNN localization algorithms are shown in Fig. 9. The CDF curve provides a comprehensive view of the overall localization performance of each algorithm. The x-axis represents the positioning error (in meters), while the y-axis represents the CDF value expressed as a percentage. A curve that lies closer to the left side of the figure indicates higher localization accuracy. In Fig. 9, the blue curve corresponds to the CDF of the SVR model, whereas the orange curve represents the CDF of the DSPSO-DNN model. By comparing the two curves, it is evident that DSPSO-DNN outperforms SVR in terms of both positioning accuracy and error distribution, demonstrating its superior performance for indoor localization tasks.
Fig. 9.
CDF Curve Comparison Between SVR and DSPSO-DNN Models.
Comparison of models constructed using different optimization algorithms
As shown in Fig. 10, the positioning errors obtained using different optimization algorithms are presented. The x-axis represents the models, while the y-axis indicates the average weighted positioning error across all test samples. Before model evaluation, each model was optimized using its corresponding optimization algorithm over 100 iterations. Meanwhile, we also compare our approach with the BagofFeatures + kNN proposed by Sohaib Bin Altaf Khattak et al. [26], as well as the All-embracing Transformers model proposed by Son Minh Nguyen et al. [27]. The results show that the DSPSO (Dual-Swarm Particle Swarm Optimization) algorithm achieves the lowest average weighted positioning error of 9.42 m among all the tested optimization methods. This clearly demonstrates the superiority of DSPSO in optimizing indoor localization models under high-dimensional conditions. A comparison of the average weighted positioning errors between the DNN and SVR models reveals that the SAE-based DNN model with multi-label classification yields an error of 12.4 m, while the SVR model achieves a smaller error of 10.92 m. From this perspective, the DNN model performs slightly worse than SVR in terms of pure localization accuracy. However, when we take into account the building and floor prediction accuracy results shown in Table 4, a more comprehensive comparison can be made between the two models. Although their overall workflows are similar, the DNN model utilizes one-hot encoding to flatten the input data, then extracts features using a deep network, and finally outputs predictions through three separate branches corresponding to building, floor, and location. In contrast, the SVR approach builds three separate regression models, each dedicated to one of the three tasks. According to the data presented in Table 4, the DNN model outperforms SVR in floor-level prediction, which further supports the conclusion that a Stacked Autoencoder combined with a multi-label classifier is a more effective solution for handling complex indoor environments involving multiple buildings and floors. At the same time, we can observe that the Bag of Features combined with k-NN struggles with processing complex architectural structures, whereas the All-embracing Transformers perform well in floor-level localization but are less satisfactory in terms of positioning accuracy. The parameters of the model are shown in the Table 5.
Fig. 10.
The average weighted positioning error of each model.
Table 4.
The Building and floor prediction accuracy of each model.
| Model | Building Classification Accuracy | Floor Classification Accuracy | Probability of Correctly Predicting Both Building and Floor |
|---|---|---|---|
| DSPSODNN | 100 | 92.97 | 92.97 |
| DNN | 99.81 | 91.79 | 91.70 |
| SVR | 99.81 | 90.82 | 90.82 |
| AOADNN | 100 | 92.61 | 92.61 |
| HGSODNN | 99.90 | 90.09 | 90.09 |
| WOADNN | 100 | 90.81 | 90.81 |
| SSADNN | 99.09 | 90.93 | 90.54 |
| All-embracing Transformers | 99.72 | 93.07 | 93.07 |
| Bag of Features + k NN | 98.01 | 87.36 | 87.36 |
Table 5.
Model parameter.
| DNN parameter | Value |
|---|---|
| Ratio of training data to overall data | 0.90 |
| Number of Epochs | 20 |
| Batch size | 10 |
| SAE hidden layers | 256-128-256 |
| SAE activation | Rectified Linear (ReLU) |
| SAE Optimizer | ADAM |
| SAE loss | Mean Squared Error (MSE) |
| Classifier hidden layers | 64–128 |
| Classifier activation | ReLU |
| Classifier optimizer | ADAM |
| Classifier loss | Binary Crossentropy |
| Classifier dropout rate | 0.20 |
| κ | 8 |
| σ | 0.2 |
Conclusions
This paper first addresses the challenge of distinguishing buildings and floors in complex indoor environments by proposing a deep neural network (DNN) model composed of a Stacked Autoencoder (SAE) and a multi-label classifier. Comparative experiments with the Support Vector Regression (SVR) model show that although the SAE-based DNN does not yield significant improvements in building classification accuracy, it achieves superior floor prediction performance, reaching nearly 92%. In addition, we compare multiple optimization algorithms on several high-dimensional benchmark functions. The results demonstrate that the proposed Dual-Swarm Particle Swarm Optimization (DSPSO) algorithm generally outperforms most of the compared methods, especially when handling high-dimensional optimization tasks. When applied to the localization model, the DSPSO-optimized DNN shows further improvements over its non-optimized counterpart: floor prediction accuracy increases, and positioning error is reduced by 24.03%. Compared to the SVR model, positioning accuracy improves by 13.74%. However, the DSPSO-DNN framework still faces certain challenges. It requires a large number of initial parameters and relies on extensive datasets with wide spatial coverage for effective training. Additionally, the DSPSO algorithm exhibits relatively slow convergence during the model optimization process.
Acknowledgements
This study did not use AI.
Abbreviations
- PSO
Particle Swarm Optimization
- RSSI
Received Signal Strength Indication
- DSPSO
Dual-Population- Particle Swarm Optimization
- SAE
Stacked Autoencoder
- SVR
Support Vector Regression
- AOA
Arithmetic Optimization Algorithm
- HGSO
Henry Gas Solubility Optimization
- WOS
White Shark Optimizer
- SSA
Sparrow Search Algorithm
Author contributions
Yiguo Cheng was responsible for the experiment and manuscript writing in this study. Kun Zhang and Bing Zheng improved some comparative experiments. Keliu Long, Yu Zhou, Ming Jin and Jiayao He are responsible for revising the manuscript.All authors reviewed the manuscript.
Funding
This work was supported by the Hainan Province Science and Technology Special Fund (Fund No. ZDYF2024GXJS034); Hainan Engineering Research Center for Virtual Reality Technology and Systems (Fund No. Qiong fa Gai gao ji [2023] 818); the Innovation Platform for Academicians of Hainan Province (Fund No. YSPTZX202036); the Education Department of Hainan Province (Fund No.Hnky2024ZD-24); the Sanya Science and Technology Special Fund (Fund No. 2022KJCX30).
Data availability
Data and materials are available, Data is a public dataset. Data sets can be obtained directly through the following websites: https://archive.ics.uci.edu/dataset/310/ujiindoorloc.
Declarations
Competing interests
The authors declare no competing interests.
Institutional review board statement
Studies not involving humans or animals.
Informed consent
Studies not involving humans or animals.
Footnotes
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Contributor Information
Kun Zhang, Email: kunzhang@hainnu.edu.cn.
Bing Zheng, Email: zb@hvust.edu.cn.
Keliu Long, Email: keliulong@jxust.edu.cn.
References
- 1.Yang, Z., Zhou, Z. & Liu, Y. From RSSI to CSI: Indoor localization, via channel response. ACM Comput. Surv.46 (2), 1–32 (2013). [Google Scholar]
- 2.Xiao, J. et al. A survey on wireless indoor localization from the device perspective. ACM Comput. Surv. (CSUR). 49 (2), 1–31 (2016). [Google Scholar]
- 3.Zheng, X. et al. A novel device-free positioning method based on Wi-Fi CSI with NLOS detection and Bayes classification. Remote Sens.15 (10), 2676 (2023). [Google Scholar]
- 4.Gao, Z. et al. CRISLoc: Reconstructable CSI fingerprinting for indoor smartphone localization. IEEE Internet Things J.8 (5), 3422–3437 (2020). [Google Scholar]
- 5.Frischer, R. et al. Commercial ICT smart solutions for the elderly: State of the Art and future challenges in the smart furniture sector. Electronics9 (1), 149 (2020). [Google Scholar]
- 6.Jia, W. et al. Maximum mixture correntropy based Student-t kernel adaptive filtering for indoor positioning of internet of Things. Inf. Sci.696, 121729 (2025). [Google Scholar]
- 7.Singh, N., Choe, S. & Punmiya, R. Machine learning based indoor localization using Wi-Fi RSSI fingerprints: An overview. IEEE Access.9, 127150–127174 (2021). [Google Scholar]
- 8.Wei, Z. et al. RSSI-based location fingerprint method for RFID indoor positioning: A review. Nondestruct. Test. Eval. 39 (1), 3–31 (2024). [Google Scholar]
- 9.Xie, Y., Wang, K. & Huan, H. BPNN based indoor fingerprinting localization algorithm against environmental fluctuations. IEEE Sens. J.22 (12), 12002–12016 (2022). [Google Scholar]
- 10.Zhang, S. et al. Improving Wi-Fi fingerprint positioning with a pose recognition-assisted SVM algorithm. Remote Sens.11 (6), 652 (2019). [Google Scholar]
- 11.Zhao, Y. et al. An efficient and robust fingerprint-based localization method for multifloor indoor environment. IEEE Internet Things J.11 (3), 3927–3941 (2023). [Google Scholar]
- 12.Shami, T. M. et al. Particle swarm optimization: A comprehensive survey. Ieee Access.10, 10031–10061 (2022). [Google Scholar]
- 13.Tran, B., Xue, B. & Zhang, M. A new representation in PSO for discretization-based feature selection. IEEE Trans. Cybern. 48 (6), 1733–1746 (2017). [DOI] [PubMed] [Google Scholar]
- 14.Abualigah, L. et al. The arithmetic optimization algorithm. Comput. Methods Appl. Mech. Eng.376, 113609 (2021). [Google Scholar]
- 15.Dhiman, H. S., Deb, D. & Guerrero, J. M. Hybrid machine intelligent SVR variants for wind forecasting and ramp events. Renew. Sustain. Energy Rev.108, 369–379 (2019). [Google Scholar]
- 16.Sun, Y. et al. An improved grid search algorithm to optimize SVR for prediction. Soft. Comput.25, 5633–5644 (2021). [Google Scholar]
- 17.Shi, K. et al. Support vector regression based indoor location in IEEE 802.11 environments. Mob. Inform. Syst.2015 (1), 295652 (2015). [Google Scholar]
- 18.Luo, S. et al. Transfer learning based on improved stacked autoencoder for bearing fault diagnosis. Knowl. Based Syst.256, 109846 (2022). [Google Scholar]
- 19.Daviran, M., Maghsoudi, A., Ghezelbash, R. & Optimized, A. I. M. P. M. Application of PSO for Tuning the Hyperparameters of SVM and RF algorithms195105785 (Computers & Geosciences, 2025).
- 20.Hasanipanah, M. et al. Prediction of air-overpressure caused by mine blasting using a new hybrid PSO–SVR model. Eng. Comput.33, 23–31 (2017). [Google Scholar]
- 21.Nasiri, J. & Khiyabani, F. M. A Whale Optimization Algorithm (WOA) Approach for clustering51483565 (Cogent Mathematics & Statistics, 2018). 1.
- 22.Hashim, F. A. et al. Henry gas solubility optimization: A novel physics-based algorithm. Future Gener. Comput. Syst.101, 646–667 (2019). [Google Scholar]
- 23.Hatta, N. M. et al. Recent studies on optimisation method of grey Wolf optimiser (GWO): A review (2014–2017). Artif. Intell. Rev. 52, 2651–2683 (2019).
- 24.Gharehchopogh, F. S. et al. Advances in sparrow search algorithm: A comprehensive survey. Arch. Comput. Methods Eng.30 (1), 427–455 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 25.Yao, J. et al. Research on hybrid strategy particle swarm optimization algorithm and its applications. Sci. Rep.14 (1), 24928 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 26.Altaf Khattak, S. B. et al. WLAN RSS-based fingerprinting for indoor localization: A machine learning inspired bag-of-features approach. Sensors22 (14), 5236 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 27.Nguyen, S. M., Le, D. V. & Havinga, P. J. M. Seeing the world from its words: All-embracing transformers for fingerprint-based indoor localization. Pervasive Mob. Comput.100, 101912 (2024). [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Data Availability Statement
Data and materials are available, Data is a public dataset. Data sets can be obtained directly through the following websites: https://archive.ics.uci.edu/dataset/310/ujiindoorloc.
















































