1 Introduction

Smart cities contribute to the quality of residents' lives by providing advanced services like intelligent transport, affective health monitoring, connecting people via information networks, waste collection management, promoting sustainable development, optimizing resources, intelligent parking slots, etc. Without having a specific target population, smart cities provide services to everyone, including children, older people, working women, sanitation staff, security officials, etc.

One of the major components that influence the growth of smart cities is smart buildings, as people spend most of their time indoors and the Internet of Things plays a crucial role in developing smart building applications. Smart Buildings can connect and automatically control various building operations through the Internet of Things like lighting control, regulating electrical usage, occupancy, efficient use of resources, intelligent security monitoring, location-based marketing services. They play a vital role in emergencies like dynamic routing to a safe exit in case of fire, smart navigation like locating the required store in a large shopping mall. Consider a situation where a five floored shopping mall contains around 100 stalls on each floor; no one can remember the locations of each stall and guide the visitors to the stall they want to go to, even if employees were recruited for such purposes, a machine easily outperforms them in such activities.

Location-based services are a primary asset for any smart building. Almost all of these mentioned operations require the location of people indoors, but accessing GPS (Global Positioning System) is difficult within indoor environments. Such difficulties gave rise to indoor localization techniques where the infrastructure of the building has to be used to provide localization. The fundamental challenge in such services is the accuracy of location.

The relationship between the RSSI (Received Signal Strength Indicator) and the device location is utilized as discussed in [1]. Different techniques, wireless technologies, architectures, and mechanisms used to achieve indoor localization were studied and described in [2, 3]. Figure 1 presents the basic architecture for indoor localization used in our proposal.

Fig. 1
figure 1

Basic architecture of indoor localization

The mobile device which is connected to Wi-Fi provided by the smart building, reads the signal strength of each access point in the form of RSSI(Received Signal Strength Indicator) values; the RSSI values generally range from -100 to 0, the closer it is to 0, higher the signal strength. This list of RSSI values is sent to the server to predict the mobile device's location.

The predicted location can be sent to the mobile device for navigation purposes and stored in a database for specific application usage and analysis purposes later on. The terms access points "or "anchor nodes" are used commonly to indicate the Wi-Fi devices that are fixed in the building from which the mobile device scans RSSI values. An RSSI fingerprint is defined as a vector of signal strengths from the visible anchor nodes to describe the radio signal characteristics at a specific location.

For predicting the location based on the list of RSSI values, a machine learning algorithm SCRNN is proposed, which gets trained when already collected data of RSSI values and locations are given to it and then can be used for testing where only RSSI values are given as input, and the locations are to be predicted. This approach has been discussed in Sect. 3.

One more challenge in indoor localization is that the mobile device may skip reading the RSSI values of one or more access points depending on its location. This may be due to temporary or permanent failure of a particular access point.

Figure 2 shows a scenario where RSSI values are received only from 3 access points, and the other one fails. Now only a list of 3 RSSI values is received by the server, and the challenge is it has to predict the location based on an algorithm that has already been trained with RSSI values of 4 access points. So definitely, location accuracy gets compromised because of such real-time issues. To handle such faults, ‘most recent RSSI’ and ‘nearest RSSI’ techniques are proposed, which are explained in Sect. 3.

Fig. 2
figure 2

Access point failure in indoor localization

Fingerprints are collected at a grid of known locations. These known locations are called reference points (RPs). Then the fingerprints and corresponding known location labels are stored in a database called a fingerprint database or radio map. The manual site survey is used to construct the fingerprint database, presented in Fig. 3.

Fig. 3
figure 3

Data set generation process through a manual site survey

A signal map (also known as a fingerprint database) is constructed by associating the collected fingerprints with physical locations.

The signal map that is already built is compared with the newly observed fingerprint for location determination. The approach to signal map construction—manual site survey – requires comprehensively exploring the whole area of interest and collecting fingerprints at a regular grid of survey points with known locations usually obtained with a physical floor plan [4].

1.1 Measurement techniques

1.1.1 Pedestrian dead reckoning

Pedestrian Dead Reckoning [5] is one of the solutions that can be used for indoor navigation. The term dead reckoning means the process of updating the value of any variable quantity by using an earlier value and adding whatever changes have occurred in the meantime. Analogous to this, the current position is computed using the previously determined position. Advancement of a position is done based on the known or estimated speeds over elapsed time and course.

Inertial measurement sensors like accelerometers, gyroscopes, and magnetometers in mobile devices provide directional acceleration information and are widely used for dead reckoning.

Next position Pn(xn, yn) from initial position Pi(xi, yi) can be determined using (1) and (2).

$${x}_{n}={x}_{i}+\sum\limits_{c=1}^{n}{\lambda}_{c}\mathrm{cos}{\alpha }_{c}$$
(1)
$${y}_{n}={y}_{i}+\sum\limits_{c=1}^{n}{\lambda }_{c}\mathrm{sin}{\alpha }_{c}$$
(2)

\({\alpha }_{c}\) and \({\lambda }_{c}\) are the angle of orientation and step length obtained from inertial measurement units.

1.1.2 Wi-Fi access points

Wi-Fi technology determines user position based on the Received Signal Strength Indication information. A wireless local area network consisting of Wireless Access Points enables location computation in complex environments. RSSI collected from a group of access points at an instance forms a fingerprint. Distance (Dpq) between two fingerprints Rp = [Rp1, Rp2, …, Rpj] and Rq = [Rq1, Rq2, ….., Rqj] is defined in (3).

$${D}_{pq}=\sqrt{\sum\limits_{i=1}^{j}{|{R}_{pi}-{R}_{qi}|}^{2}}$$
(3)

To address heterogeneity, adjustments can be made among two devices, P and Q using (4).

$${RSSI}_{Q}={\alpha }_{1}{RSSI}_{P}+{\alpha }_{2}$$
(4)

α1 is close to 1, and α2 is the adjusted value. Therefore optimal RSSI offset (Opq) during heterogeneity can be calculated through (5) and (6).

$${O}_{pq}=\mathrm{arg}\;\underset{{\alpha }_{2}}{\mathrm{min}}{D}_{pq}$$
(5)
$${D}_{pq}=\sqrt{\sum\limits_{i=1}^{j}{\left|{R}_{pi}-{R}_{qi}-{O}_{pq}\right|}^{2}}$$
(6)

1.1.3 Bluetooth beacons

Bluetooth Low Energy is a form of wireless communication explicitly designed for short-distance transmission. More recently, researchers started to use BLE based positioning method in indoor environments [6]. Indoor localization can be tracked by fusing the information from RSSI analysis from multiple BLE beacons.

The mobile device detects the signal from the beacon and can roughly calculate the distance from the beacon to estimate the location. The distance (D) can be computed using (7), where RSSI represents the signal strength received from the Bluetooth device.

$$D\approx {10}^{\frac{(MP-RSSI)}{(10*n)}}$$
(7)

where MP (Measured Power) is the industry calibrated read-only value, which generally indicates the RSSI reading at 1 m distance. N is a constant within the range 2–4, which depends on the environmental changes.

Still, there are more technologies like visible light information, Radio Frequency Identification Devices, etc., that can be used for estimating indoor location where as the three most widely used technologies have been discussed. In this proposal, Wi-Fi access points were used to perform localization.

2 Related work

Significant research has been done to optimize location accuracy in indoor localization, and quite a few techniques were proposed to handle faults. Some of such essential and recent works were reviewed and mentioned as follows.

For Modelling RSS deviations more realistically, non-Gaussian probability density functions were proposed in [7] and Dempster-Shafer's theory for combining and representing individual pieces of information provided by different RSS sources regarding target node position. Prediction based on CLTA (cooperative localization and tracking algorithm) [8] is developed to improve position accuracy, [9] discusses a weighted average filter method and using different types of recurrent neural networks to enhance accuracy when temporal fluctuations of RSSI are encountered.

Mini-batch Singular Value Decomposition is used in [10] to detect the target in case of sensor location uncertainty, [11] has proposed multiple machine learning algorithms to construct space of candidate labels, and user's location is estimated by label credibility. An array calibration method [12] and Angle of Arrival estimation algorithm were designed to achieve flexible orientation using limited resources. TILoc (Torus Intersection Localization) [13] aims to improve accuracy and robustness by mitigating noise problems and positioning a target. A lightweight privacy-preserving scheme (LWP2) [14] protects data privacy and location privacy at a lower cost by minimizing the least square error for an over-determined linear formulation.

A scalable Deep Neural Network Architecture [15] with denoising autoencoder is proposed to achieve good location performance, and high scalability, [6] uses two methods –fingerprinting-based method and trilateration-based method to accurately track human location in home environments using Bluetooth Low Energy (BLE) devices. CollabLoc [16] achieves cross-building localization and privacy by collaborating signals from Wi-Fi and Cellular RSSI, geomagnetic levels, light, and sound. SAWKNN (Self Adaptive Weighted K Nearest Neighbors) technique is proposed in [17] to achieve higher accuracy than normal KNN, [18] uses Naive Bayes classifier and Channel State Information to improve localization accuracy. Median localization accuracy of 1 m is achieved in [19], where new hardware is designed for an IoT device with a BLE interface, accelerometer, and magnetometer sensors.

A fault-tolerant localization algorithm was developed in [20] using K-means clustering and majority voting methods [21] also proposed a fault-tolerant recurrent neural network approach to improvise location accuracy. Outstanding improvements in location accuracy were achieved. This is one of the latest and efficient researches in indoor localization. But during momentary failure, when a base station fails, location is predicted only based on remaining active base stations by ignoring the failed base station.

Work [22] proposes a fault-tolerant area division strategy. The anchor deployment technique was used to generate various shapes of sub-areas. The shipboard RSSI signals were investigated by conducting experiments in a real-world shipboard environment, and good results were achieved [23]. focused on minimizing the number of required anchor nodes for prediction, which works even during a node failure. This is achieved using the Integer Linear Programming formulation, which solved localization's anchor node placement problem based on trilateration. Better results were shown optimizing the number of nodes, but results regarding location accuracy were not presented [22, 23]. Focus more on deploying the nodes at correct positions or minimizing the required nodes rather than dealing with faults after they are generated.

The Truncated Mean method pre-processes the data in [24] to eliminate outliers on the valid data. The basic idea is to eliminate the segments of minimum valued end and maximum valued ends and then perform the mean of the remaining data. After sorting the data collected in increasing order, five percent of both minimum and maximum values are removed.

A hierarchical framework using the K-means clustering algorithm and class-specific cost regulation extreme machine classifier (CCR-ELM) [25] is proposed for large-scale device-free localization. Another proposal, CRISloc [26], uses Channel State Information as fingerprints and (EEKNN) edge enhanced k nearest neighbors to automatically adjust the value of k and weights.

Also, some optimization techniques like EOMR [27], particle swarm optimization [28], and mathematical models of [29,30,31,32] were studied to gain an understanding of how they optimize in various networking scenarios and whether they can be applied to maximize localization strategies.

A two-layered Indoor Localization System architecture by considering the General Data Protection Regulation (GDPR) as the grounding framework for preserving privacy through a compliant Access Control (AC) system was proposed in [33] to preserve social distance among people in indoor environments as prevention for covid-19 [34]. also uses a two-phase online localization process using MDT (Minimization of Drive-Tests) data and a Bayesian classifier to reduce maintenance costs and manual collection.

The proposed method in [51] uses Channel State Information phases and amplitudes of various communication links for fingerprint construction to achieve Device-Free Localization (DFL). The probability of testing fingerprint belonging to each reference point is computed through a probabilistic approach that depends on Kullback–Leibler divergence. Then the resulting probabilities are used as weights for averaging the reference points for target localization. Least SquaresVariance based Radio Tomography (LSVRT) is proposed in [52], which attempts to reduce the discrepancies generated by intrinsic motion, which may become noise to the localization model and increase the measured RSS variance. Instead of using offline calibration, a new online calibration technique is proposed to use online real-time measurements. The Kalman filter is used for tracking estimation on the proposed models.

Even though indoor localization can deliver timely information, the models proposed to perform localization still suffer from specific difficulties and pose challenges concerning fault tolerance, usability, and accuracy. The signal strengths get faded because of attenuation, and they are vulnerable to interference. Such noise reduces the accuracy of localization systems.

In terms of fault tolerance, there hasn't been much research, and very few techniques were proposed to deal with faults. Moreover, the existing methods use additional hardware to improve location prediction accuracy during faulty conditions, which results in more installation and maintenance costs.

Alternate Deep Learning models were already proposed for the same problem scope but do not consider the speed consciousness, which surely assists in reducing localization error during faults. Alternate deep learning models include Convolutional Neural Networks and several variations of Recurrent Neural Networks like simple RNN, Long Short-Term Memory, and Gated Recurrent Unit [21]. A scalable Deep Neural Network Architecture achieves good location performance and high scalability by using autoencoder denoising [15]. Quite a few deep learning models already exist in indoor localization. However, our approach encourages further improvement in the scope of fault tolerance without additional costs.

Various notations used in the proposed model section are described in Table 1. A summary of some of the essential works is presented in Tables 2 and 3. Based on all this knowledge and also after reviewing a few more works [35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50], it was found that there has not been more research work that focused on detecting an invalid predicted location based on the speed of the pedestrians in an indoor environment. So, a model that depends on Recurrent Neural Network and uses the speed of pedestrian navigation to adjust the predicted location label is proposed, which is discussed in Sect. 3.

Table 1 Description for various notations used
Table 2 The table represents the summary of the latest related works
Table 3 Table representing the parameters optimized in each work

3 Proposed model

3.1 Localization based on speed conscious recurrent neural network

The proposed localization model constitutes of 3 phases (i) Generating the data set through manual site survey, (ii) Training phase where both vectors of RSSI values and actual locations are fed to the proposed algorithm, and (iii) The proposed SRNN predicts the locations when vectors containing only RSSI values are given.

The proposed Speed Conscious Recurrent Neural Network has inputs R(T) = R(1), R(2), … R(t), where T represents time ranging from 1 to t. R(t) is given as the input to RNN at the time ‘t’. PL(T) gets used as a memory for the network (hidden state), representing the Previous Location in our implementation. The previously hidden form and present input are used to calculate the PL(T).

$$PL\left(T\right)=f\left(U.R\left(T\right)+W.PL\left(T-1\right)\right)$$
(8)

tanh non linear transformation is used as function f:

$$P{L}_{t}=\mathrm{tanh}\left({W}_{p}P{L}_{t-1}+{W}_{R}{R}_{t}\right)$$
(9)

Table 3 presents the parameters considered for optimization as mentioned in each research work.

The immediate last state in the recurrent neuron is considered; multiple such states can be used for longer sequences. Output can be produced once the final state is determined.

$${F}_{t}={W}_{f}P{L}_{t}$$
(10)

For Loss Function M, gradients of weight matrices need to be updated using learning rate(γ).

$$W=W-\gamma \frac{\partial M}{\partial W}$$
(11)

Weights are updated so that the loss function is minimized.

The probability vector of outputs can be obtained using the softmax function in (12), where each neuron output is used as an argument.

$$(\Delta f(t)M)i=\frac{\partial M}{\partial {f}_{i}^{(t)}}=\frac{\partial M}{\partial {f}^{(t)}}\frac{\partial {M}^{t}}{\partial {f}_{i}^{(t)}}$$
(12)

RNN's can use internal or hidden states to process the RSSI input sequences, as shown in Fig. 4. The speed consciousness is fed into the neural network by (13) that uses the current and previous output states to check the validity of prediction:

Fig. 4
figure 4

An unfolded Recurrent Neural Network was used for Localization

$$\forall i\in \{1,....,b\}if({F}_{t}innbr({F}_{(t-1)}))\to valid;else\to invalid$$
(13)

If ‘invalid’ is returned, then Ft is updated to the neighbor of Ft-1.

3.1.1 Kullback–Leibler divergence

Kullback–Leibler divergence provides relative entropy, which can identify the deviation of the faulty data with actual data and vice versa. Entropy can be used to measure the disorder of a data set which usually ranges between 0 and 1. Still, sometimes it can also be greater than 1, which indicates that there is a considerable amount of disorder, entropy can be defined as in (14):

$$Entropy(D)=\sum_{j=1}^{x}-{q}_{j}\;{\mathrm{log}}_{2}\;{q}_{j}$$
(14)

where qj represents the probability of occurrence of a class 'j' in the given data set and x is the total number of classes. But this entropy can be used to compute the disorder of data sets individually and cannot relate one data set with another; Kullback–Leibler divergence (15) comes in handy for measuring the deviation in features before after faults.

$$KLD(A||B)=-{\sum }_{k=1}^{y}A\left(k\right)*\mathrm{log}\left(\frac{B\left(k\right)}{A\left(k\right)}\right)$$
(15)

Operator '||' represents A's divergence from B, and 'y' is the total number of probability events. A and B are the probability distributions. Standard deviation can be computed by (16):

$$\sigma =\sqrt{\frac{1}{G}{\sum }_{i=1}^{G}{\left({x}_{i}-\mu \right)}^{2}}$$
(16)

where 'G' is the total size of the population, 'µ' represents the mean and \({x}_{i}\) is each value of the data.

The advantage of using Kullback—Leibler divergence is unlike other divergences; it does not compute divergence symmetrically, i.e.,

$$KLD(A||B)\ne KLD(B||A)$$
(17)

3.1.2 Fault tolerance

Any access point can be prone to faults during the localization procedure. An efficient data pre-processing technique before passing data to the prediction algorithm can reduce the localization error up to a certain extent. Let the data set be represented as shown in (18).

Rij represents the RSSI value of ith data point for the jth anchor node. Ck is the class label associated with the RSSI vector. Whenever an access point is faulty, consider 2nd in this case. Then its reading can fluctuate, as shown in (19).

$$\begin{bmatrix}R_{11}&R_{12}&..&..&R_{1j}&C_k\\R_{21}&R_{22}&..&..&R_{2j}&C_k\\:&:&:&:&:&:\\:&:&:&:&:&:\\R_{i1}&R_{i1}&..&..&R_{ij}&C_k\end{bmatrix}$$
(18)
$$\left[\begin{array}{ccccccccc}{R}_{12}& NA& {R}_{32}& NA& NA& {R}_{62}& NA& \dots .& {R}_{i2}\end{array}\right]$$
(19)

NA indicates RSSI reading is not available. The proposed most recent RSSI fills the missing values by considering the RSSI value from its previous RSSI reading, as shown in (20).

$$\begin{array}{c}\forall i\in \{1,....,d\}\\ \forall j\in \{1,....,z\}\end{array}({\begin{array}{cc}if({R}_{ij}=NA))\;then& R\end{array}}_{ij}\leftarrow {R}_{i-1j}$$
(20)

For nearest RSSI, Ri-1j in (20) is replaced with Ri nr, where Ri nr represents the RSSI value of the nearest access point within the same data point.

'd' is the total No. of data points, and 'z' is the total number of access points. Using the weighted average method, pre-processing the data set can be done using (21).

$$\begin{array}{c}\forall i\in \left\{1,\dots .,d\right\}\\ \forall j\in \left\{1,\dots .,z\right\}\end{array}({\begin{array}{cc}if({R}_{ij}=NA))\;then& R\end{array}}_{ij}\leftarrow \frac{\forall \left(k\ne j\right)\left(\sum\limits_{k=1}^{z}{w}_{ik}{R}_{ik}\right)}{z-1}$$
(21)

The weights of each RSSI value can be computed using (22). If the pre-processing is done through simple average or mean of remaining access points without considering their weights, these Weights (Wij) of (15) can be assigned to 1.

$$\begin{array}{c}\forall i\in \left\{1,\dots .,d\right\}\\ \forall j\in \left\{1,\dots .,z\right\}\end{array}{W}_{ij}=\frac{{R}_{ij}}{\sum\limits_{k=1}^{z}{R}_{ik}}$$
(22)

3.1.3 Environment and dataset description

Experiments through hardware implementation were carried out in 34 feet long × 22 feet wide indoor environment, whose layout is shown in Fig. 5. Four mobile hotspots were used as access points (AP1, AP2, AP3, AP4), and another mobile device is used as the navigating device, scans the RSSI values from these 4 access points, and sends them to the server. An android application is developed to scan these RSSI values, which uses android.net.wifi.WifiManager class and sends them through URL to a computer having flask server implemented using python. The proposed algorithms were implemented in python, predicting location labels based on the RSSI values received.

Fig. 5
figure 5

Layout of the indoor environment

The entire layout is divided into a grid of 16 locations, as shown in Fig. 5. Each row in the data set contains signal strengths (RSSI values ranging from -100 to 0) from 4 Wi-Fi access points and a location label (ranging from 1 to 16). 4000 such rows (data points) are present in the data set, out of which 3200 are used for training, and 800 are used for testing.

So the responsibility of the proposed approach is to predict one class label from 1 to 16 when readings from 4 access points are given as input. But during the testing phase, there might be faults. There is no guarantee that all 4 access points work as expected in real-time. So failures of each access point were also considered. While testing for fault tolerance, 400 data points from test data were supposed to be having such faults for experiment purposes.

To maintain speed consciousness in the proposed model, the nbr() function checks whether the current predicted location is a neighbor of the previous location or not. As it can be observed from Fig. 6, the distance between two neighboring locations, 4 and 9, is 5.4 feet, and that of non-neighboring nodes 4 and 10 is 10.8 feet. So the nbr() function uses this distance metric to check whether a person can travel from one location to the other within 1500 ms (the time interval between two data points). Obviously, at average walking speed, a person does not travel 10.8 feet/1500 ms. So this distance threshold is used to test whether the predicted location is valid or not compared to its previous location.

Fig. 6
figure 6

Part of indoor environment layout

Apart from the generated data set, another data set from [35, 36] is also used for experimentation. According to [35], the environment is set up at an office location in Pittsburgh, USA. This office has seven Wi-Fi routers, and the signal strengths received from these routers categorize the user's location in various office rooms.

An android device has been considered for capturing wireless signals, and these signal strengths were tabulated. The decision variable is one of the four rooms. It has 2000 data points which are now divided into 1500 training and 500 test data points. In this proposal, to test for fault tolerance, 400 data points out of 500 test points were made prone to faults where one RSSI value in each data point is randomly removed.

4 Results and discussion

The environment and the data set used to conduct experiments were already discussed in Sect. 3.1.3. The proposed algorithms were implemented in python using the scikit learn library. To compare the results of each approach, a data set is used that consists of 800 test data points in Sect. 4.1 and 500 test data points in Sect. 4.2. Each method uses each data point, predicts a location (or class label), and then compares whether this predicted location matches the actual location.

So finally, the number of locations "matched" and the number of locations "unmatched" out of total predicted locations are considered. An approach that generates less number of “unmatched” predicted locations and more number of “matched” predicted locations is said to be more efficient. The following terms will be used:

  • Matched—predicted location is same as actual location.

  • Unmatched—predicted location differs from the actual location (wrong or incorrect prediction).

  • Location—one out of sixteen locations {1, 2, 3,…,16}.

  • Datapoint number—each data point from the test data set.

The proposed algorithm is compared with machine learning algorithms used for localization like KNN (K- Nearest Neighbors), NB (Naïve Bayes), SV (Support Vector), and RNN (Recurrent Neural Network) algorithms.

4.1 Results using the generated data set through hardware implementation

Figure 7 presents a point graph of only unmatched predicted locations (in red-colored star-shaped marker) vs. actual room locations (in blue colored circle-shaped marker) of the test data for the proposed SRNN method, which resulted in 673 matched and 127 unmatched predictions, respectively.

Fig. 7
figure 7

Unmatched locations using SRNN

It isn't easy to study a graph if all the 800 test data points are presented, and in such cases, the markers used for predicted and actual locations appear to be at the same points for the human eye. It is almost impossible to find out where the unmatched locations are. So, only data points that generated unmatched predicted locations will be marked on the plot to make it easier to differentiate the actual and predicted location markers.

Figure 8 presents the number of unmatched locations individually at each location using SRNN. 0 (minimum) for location 12 and 22 data points (maximum) for location 9 were observed to be incorrect predictions.

Fig. 8
figure 8

No. of wrong predictions at each location with SRNN

Figure 9 presents the results of SRNN compared to various algorithms, and the proposed SRNN algorithm has an improvement of 13 data points over the RNN method.

Fig. 9
figure 9

No. of matched locations for each algorithm

The grey colored lines in Fig. 10 indicate the same lines of Fig. 9, which are now compared to matched data points during faults (colored lines in Fig. 10).

Fig. 10
figure 10

Plot for No. of matched locations during faults

Figures 10 and 11 show how the matched locations get reduced when nodes become faulty. The prediction becomes less efficient by around 37% (average for all the algorithms).

Fig. 11
figure 11

Comparison of results before and after faults

The nearest RSSI fault-tolerant technique fills the missing values before passing data to the algorithm. The improvement in prediction is shown in Fig. 12. The Number of matched locations improved by 28% (average for all the algorithms) compared to the data with faults.

Fig. 12
figure 12

Bar Graph presenting the improvement while using a fault-tolerant approach

The overall change in the number of correct predictions before and after faults and when using the proposed fault-tolerant approach can be observed in Fig. 13.

It can be observed from Fig. 13 how the number of wrong predictions changes before and after faults. Initially, there are 127 wrong predictions; faults increase to 376. However, they decrease to 267 when the fault-tolerant approach is used.

Fig. 13
figure 13

without faults vs. with faults vs. fault-tolerant approach

As presented in Fig. 14, the proposed fault-tolerant approaches nearest RSSI and most recent RSSI and SRNN improve the location accuracy by 4% and 2.1%, respectively.

Fig. 14
figure 14

Using SRNN before faults, after faults, and with fault tolerance

Kullback–Leibler Divergence as in Fig. 15 becomes more (6.06) when the data is prone to faults; later, when the data is pre-processed, the divergence reduces to 3.29. location prediction improves with the reduction in divergence.

Fig. 15
figure 15

The efficiency of various fault-tolerant approaches

It can be observed from Table 4 that Standard Deviation does not show much deviation between original data (11.27) and fault-tolerant data (11.70). However, KLD shows a divergence of 3.29 units, which means there can still be differences between original and fault-tolerant data predictions.

Table 4 Divergence values for various data used

Results were also compared with KLDPA (Kullback–Leibler Divergence-based Probabilistic Approach) and LSVT (Least Squares Variance based Technique), presented in Figs. 16 and 17, respectively. KLDPA produces 608 matched locations, and LSVT generates 629 matched locations which are less efficient when compared to RNN and SRNN, as shown in Fig. 18.

Fig. 16
figure 16

Kullback–Leibler Divergences at various stages of data pre-processing

Fig. 17
figure 17

Unmatched locations using KLDPA

Fig. 18
figure 18

Unmatched locations using LSVT

4.2 Results using the available data set [35, 36]:

Graphs in this section are results of experiments conducted through the already available data set [35, 36], which has RSSI readings of 7 devices.

Figure 19 shows how the matched locations get reduced when a node becomes faulty. The prediction becomes less efficient by around 27% (average for all the algorithms).

Fig. 19
figure 19

Unmatched locations using LSVT

The results of already existing fault-tolerant techniques along with the proposed schemes are presented in Figs. 20 and 21, which includes the Weighted Average method and Truncated Mean method. Truncated Mean outperforms the Weighted Average method, and the proposed nearest RSSI method and the Speed Conscious Recurrent Neural Network predict 5% better than the Truncated Mean method.

Fig. 20
figure 20

Comparison of results before and after faults

Fig. 21
figure 21

The efficiency of various fault-tolerant approaches

Fig. 22
figure 22

without faults vs. with faults vs. fault-tolerant approach.

The improvement in results while using SRNN with fault tolerance can be observed in Fig. 22.

In terms of running time, SRNN has taken approximately 740 ms more time than RNN for predicting 500 data points which can be negligible.

5 Conclusion

This paper describes the real-time implementation of indoor localization using minimum hardware possible, then proposes a Speed Conscious Recurrent Neural Network that monitors pedestrians' navigation speed to adjust the predicted location. Experiments reveal that the proposed SRNN algorithm has improved location accuracy over the conventional Recurrent Neural Network technique.

The most recent RSSI method and nearest RSSI proposed for tolerating faults work by filling missing values intelligently, making the proposal cost-effective, unlike the traditional fault tolerating methods that use specific hardware. The most recent RSSI technique optimizes the location accuracy by 2.1%, and it can be implemented when temporary fluctuations occur for multiple access points. Whereas the nearest RSSI technique optimizes the location accuracy by 4% and can be implemented in situations where one access point fails continuously. The experiments were conducted in python using scikit learn and Keras libraries with Spyder tool; flask server is used to communicate with navigating mobile and the server.

There is still scope for further research that can concentrate on the deployment of access points and automatic adjustment of access point positions through mathematical models to ensure more signal coverage. Considering the problem scope and the research applied here, focus can also be made on regulating the frequency of RSSI scans and server communication to improve energy efficiency. More research opportunities regarding privacy and security emerge with the wide use of localization to ensure user location is not disclosed to unauthorized persons.