3.1. Anomaly of Indoor Magnetic Field
The original purpose of the magnetic sensor was to measure the geomagnetic field of the earth and find the magnetic north. However, the magnetic field is easily distorted by metal or magnetic substances, which means that the magnetic sensor is very sensitive to the surrounding environment, and it is not easy to measure the correct geomagnetic field. The magnetic field distortion is classified into the hard-iron effect and the soft-iron effect, according to the distorting characteristics of the magnetic field. The hard-iron effect is a phenomenon in which the magnetic field is distorted by other magnetic substances. The soft-iron effect is a phenomenon in which the magnetic field is distorted by metallic material.
In particular, since the building structure is composed of various steel structures and iron H beams, the magnetic field inside the building is easily distorted, and the distortion varies according to the location. Thus, the location in a building can be determined by detecting the distorted magnetic field. The more the magnetic field is distorted, the more accurately the location can be determined. On the other hand, the severe magnetic distortion prevents us from finding the magnetic north correctly. Therefore, it is very challenging to achieve the purpose of measuring the magnetic heading and position mapping simultaneously.
Figure 2 shows the magnetic anomaly maps measured in the corridor after attaching a magnetic sensor to the foot and the waist. The anomaly maps present the distortion of the magnetic field, which is affected by the hard-iron effect and soft-iron effect. Magnetic anomaly refers just to the variations of the magnetic-field absolute values, which are norms of 3D magnetic vectors. In particular, the sensor attached to the foot suffers from large distortions owing to the iron structure inside the building because it is close to the building. However, the results show that each location in the corridor has its own identical magnetic field to some extent. The anomaly map of the magnetic sensor attached to the waist shows that the magnetic field is influenced by the magnetic disturbance, but the distortion is less serious, which means the magnetic heading information calculated by the sensor is less vulnerable.
Magnetic field distortions in a building are unique characteristics that depend on the size and location of the steel structures in the building, and the steel structure inside the building does not change after the building is built [
33]. Thus, the magnetic map-matching that uses magnetic distortion can be applied for determining the location. Moreover, the magnetic heading can also be obtained more accurately by adopting multiple three-axis magnetic sensors attached to different parts of the body.
3.2. Outlier Mitigation Technique Based on Multiple Magnetic Sensors, Roughness Weighting, and Normalization
The magnetic map-matching method using multiple sensors has the advantage that the absolute position and relatively accurate heading are detectable. When using multiple sensors, it is also expected that the mapping redundancy and position ambiguity can be restrained because additional information is used. For magnetic map matching, in general, the norm of the measured magnetic field is compared with that of the stored norm according to position [
33]. Since the characteristics of magnetic distortion are different according to the sensor configuration, the additional information has significant meaning. Instead of using one-dimensional data for comparison, two-dimensional information can be used for comparison, which enhances the possibility of the correct map matching.
When a pedestrian is walking in a room where the map is built, the magnetic data from the sensor are compared with the entire set of data in the magnetic map at every stance phase. By checking the likelihood, the position can be determined. To compare the magnetic field map and measurements, the cost function is defined by the mean square deviation method [
33].
When a single sensor is used for a magnetic-field map matching, only a magnitude comparison is performed. Therefore, several candidate positions may have a similar magnetic-field magnitude, which means many outliers may exist. The outliers exert bad influences on position accuracy because they increase position redundancy and ambiguity.
However, when multiple magnetic sensors are employed, more than two magnetic field norms, which compose a vector, are used for comparison. In this case, the cost function must be modified as follows:
where
is the vector whose components are the norms of the magnetic field from the multiple sensors at current position
, and
is the pre-stored magnetic norm vector pre-acquired at candidate grid point
. Here,
and
represent magnetic norms obtained from the foot-mounted sensor and waist-mounted sensor, respectively, and
is a grid map index vector, where
is a 2D grid index domain with the size of
. Since the floor height is used for height in the 3D magnetic map, only the 2D magnetic anomaly map is built using 3D magnetic sensor and considered for map matching. The position on the grid map where the cost function (
) is minimized becomes the candidate current position (
).
If multiple sensors are affected by magnetic disturbance differently, the vector may have a unique direction, which implies every grid point may have its uniqueness. When each magnetic-map grid point has unique values, the outlier can be eliminated easily, and magnetic map matching will provide more accurate results.
In this study, this advantageous feature of using multiple sensors is validated by employing the roughness concept, which quantifies the degree of the magnetic-field distortion. The uniqueness of each datum on the magnetic map can be qualified by comparing the data with near data. Therefore, the roughness index at
on
is defined as follows:
Here, the denominator is added to impose the weightings on data close to the test point ). Even though the roughness is a relative quantity, the large roughness index implies the test point can be locally well characterized, which contributes to the reduction of position ambiguity.
Using multiple sensors enhances the roughness because vector information is used in comparing map data and measurements, as shown in
Figure 3a. However, the improvement might be limited if one piece of information has much larger roughness. In this study, sensors are attached to the foot and waist, respectively. In this case, the roughness according to the foot-mounted sensor is much larger than that from the waist-mounted sensor, which restricts roughness improvement. Moreover, the roughness indices obtained from different sensors need to be compared with each other carefully because they are relative quantity.
To overcome this issue, the normalized magnetic fields are devised for the roughness test and map matching, and the roughness index is modified as follows:
Here,
and
are the standard deviations of each magnetic field data, and
and
are tuning factors which satisfy
.
is a weighting matrix consisting of standard deviation and tuning factors. In this study, a simple normalization matrix is not used, but tuning factors, which are roughness weightings, and they are multiplied to the normalizing factors. If the measured magnetic field were randomly distributed, the roughness weighting factors might not necessarily need to be multiplied. However, the measured data are not randomly distributed, but affected by the building structure and geomagnetic field. Thus, we employed the roughness weighting factors for equalizing their effects on each magnetic datum. The weighting factor is dependent on environments and decided via experiments during map building. Now, the modified cost function and modified map-matching method using the mean square deviation can be defined as follows:
By engaging the normalized magnetic data and roughness weighting factors, the roughness can be improved, as shown in
Figure 3b.
To validate the roughness concept, we experimented several times in various indoor environments. The experimental results are summarized in
Table 1. The results show that the roughness is improved in various cases when multiple sensors are employed, and, eventually, the position redundancy and ambiguity can be improved, as well, which implies outliers can be reduced by using multiple sensors and normalized magnetic data.
Using the normalization with roughness weighting and multiple sensors, the outlier can be mitigated, as well. To evaluate the outlier mitigation performance of the proposed method, we also performed several experiments.
Figure 4 shows map-matching errors and outlier distributions for three cases: foot-mounted sensor case, waist-mounted sensor case, and multiple sensor case without normalization (
. Experimental results show that the error is reduced, and outliers are mitigated more effectively when multiple sensors are used rather than when a single sensor is used. The result of the multi-sensor case with normalization (
) is shown in
Figure 5.
Figure 5a shows that the minimum outlier is achievable when
, that is, when
and
. The position error and outlier distribution are shown in
Figure 5b, which shows that the outliers are more mitigated when multiple sensors with normalization factors are used rather than multiple sensors are used simply. The proposed outlier mitigation technique is verified through several experiments, whose results are summarized in
Table 2. The results show that the outliers are reduced by the maximum of 62%, owing to the proposed technique, and overall position error is reduced by 40–86%.
3.3. Improvement of Position-Measurement Quality Using Importance Sampling
Although the use of multiple sensors and normalization methods can improve the map-matching accuracy, improper detection cannot be avoided completely because of the unavoidable ambiguity caused by uniform and repeated building structures. For example, iron doors spaced at equal intervals along a corridor induce similar magnetic distortions at a different position, which may result in an inaccurate map-matching solution.
To solve this problem, a candidate boundary, which is based on the simple probabilistic model, can be employed to determine the candidate positions for map matching. However, in this case, it is difficult to form an optimal boundary because the limited candidate boundary may result in the local minim of the cost function. For this reason, this study uses stride-based probabilistic sampling to create optimal boundaries and uses importance sampling to determine the proper position within the boundary. Importance sampling is a kind of Monte Carlo method that weights the samples determined through the sampling step and obtains the final estimate. Importance sampling can solve the problem by simply calculating the position with the cost function. The sampling process makes it possible to prevent a large position error due to the repeated magnetic patterns because it puts the weightings on the samples with importance.
For importance sampling, the candidate boundary for collecting samples should be determined first. In this research, it is assumed that the candidate positions are not far from the previous position. The boundary is selected efficiently by calculating the previous strides and smoothing them. To calculate the diameter of the boundary, the smoothing filter is employed as follows:
where
is a position estimate at time
, which is updated at the stance phase. To prevent local minima caused by the sampling within the limited boundary, the diameter of the candidate boundary for magnetic map matching is expanded to six times larger than
.
Simultaneously, position candidates that have high likelihood but locate abnormally far away from the previous position should be ignored, so that a large position error is prevented. To do this, the importance sampling method is employed. Within the candidate boundary, the appropriate -sampled positions on the grid map, whose cost functions, , are all small, are extracted. Instead of using the position with a minimum cost function, -sampled positions are all used for fixing the position by applying importance weightings.
The sampled positions,
, are assumed to be random variables with Gaussian normal probability density function (PDF), and their variances are determined by their importance weightings. In this research, we define the importance weighting at the sampled position,
, as the function of the cost function defined in Equation (15) and distance from the prior position estimate,
, obtained by the PDR. Therefore, the importance weighting or variance of the sampled position,
, is defined as follows:
Using the importance weightings and variances, the weighted PDF for the sampled position can be obtained as follows:
When
samples are extracted, the PDF of a sample can be normalized as follows:
Because the defined weighted PDF is normalized, the position can be chosen as the sum of the samples to which importance weightings are applied as follows:
which becomes the final map-matched position and also the position measurement for a Kalman filter. Here,
is the set of all sampled position indices. For determining the quality of the measurement, the covariance
of
should be calculated as follows:
Figure 6 shows the conceptual diagram of importance sampling, candidate boundary, and algorithm flowchart. The magnetic map-matching algorithm using importance sampling is summarized as follows:
Calculate the stride from the previous positions and set a candidate boundary.
Perform sampling within the candidate boundary.
Compute the importance weightings (or cost functions) corresponding to each sampled position.
Using the roughness weightings and normalization, find the normalized PDF for each sampled position.
Determine the map-matched position and its covariance.
Use the position and covariance as a new measurement for the measurement update of the Kalman filter.