Type-2 Fuzzy Rule-Based Model of Urban Metro Positioning Service

In the last few years there has been a growing interest in route building oriented mobile applications with the following features of navigation and sending timely notifications about arrival. Despite the large body of existing knowledge on navigational services, there has been an important issue relative to positioning accuracy. The paper discusses a possible solution to comparison problem, which is linked to the determination of the closeness to destination metro station through finding a difference between user’s current coordinates and fixed-point coordinates. With this end in view, fuzzy logic approach is used to develop Routes Recommender System (RRS) that utilizes linguistic variables to express the vague and uncertain term ‘closeness to...’. The paper provides detailed explanation of each variable considered in the fuzzy inference system (FIS), set of fuzzy rules in line with graphical representation of system’s output. Based on Mamdani model, we propose a set of test cases to check maintainability of the model and provide a description about received results. At a later time, an Android-based mobile application aimed at public transport route building will be developed whose notification system will be based on our model`s implementation presented. It should be emphasized that the paper examines potentials of the modeling approach based on interval type-2 fuzzy sets (IT2FS) that attract much attention these days in various research studies and conventional Mamdani fuzzy inference system (MFIS) as applied to real and rather topical problem. The significance of developing such models may be of a high demand for appropriate representation of factors that are inherently vague and uncertain. Hence, this study may also contribute to future research on similar topics.


Introduction
Over the past decade positioning techniques have become common in almost all branches of industry.In particular, nowadays vast majority of phone models are provided with GPS-module that can be enabled in different cases.Positioning feature is rather common to mobile applications supporting navigational services, and the latter can be used by people in urban transport.The purpose of the paper is to exploit the potentialities of fuzzy logic regarding recommender system with the navigational service.Such service may solve the problem of frequently encountered disorientation of passengers in unfamiliar terrain and allow to pave routes between stations of interest (case of urban transportation system).The potential application may notify a passenger about forthcoming arrival, when he/she is situated closely to the end station.The main purpose in the present context is to determine a deviation between current and end points (stations).Consequently, it leads to the serious problem, since we cannot precisely assert whether a user is close to the end station or not.It occurs because there is a need to estimate the smallest difference (delta) between current and end-point coordinates and then set rule(-s) to classify user`s location.The issue of applying fuzzy logic to positioning, tracking and transportation attracts attention of researchers.Selected publications have focused on indoor positioning.For example, Chen C.-Y., Yung J.,et al. [1] studied indoor positioning technique based on received signal strength and fuzzy approach; they showed experimentally that such method has better performance as compared to geometric triangulation method [2] -actually, the same objective was pursued in the research by Teuber A. and Eisfelller B. [2].The fuzzy system to control train automatic stop, with the emphasis on stop accuracy, was developed by Yasunobu S.,Miyamoto S. and Ihara H. in [3].It is evident that the practical application of fuzzy logic to positioning or transportation subject matter cannot be considered as exclusive one, however, the issue of positioning in metro should be studied in detail.As it was mentioned above, the study is devoted to indoor positioning within the metro transportation system.We make an attempt to develop a fuzzy model of metro stops allowing to send timely destination notifications to passenger.It is clear that we do not know exact minimum and maximum distances between stations or the moment when the application should send a reminder.Uncertainty has many faces and forms of manifestation.As stated by George J. Klir and Mark Wierman, "uncertainty involved in any problem-solving situation is a result of some information deficiency; … information may be incomplete, fragmentary, not fully reliable, vague, contradictory, or deficient in some other way" [4].Hence, when we do not know or cannot obtain exact values/parameters of some phenomena (e.g.distances between points, the location of some moment on a time scale), we need to deviate from type-1 fuzzy sets as a general framework to handle vagueness (for more information see seminal papers "Fuzzy Sets" (1965) and "The Concept of a Linguistic Variable and Its Application to Approximate Reasoning -I" (1975) by L. Zadeh) to more general type-2 fuzzy sets that allow to reflect the uncertainty in adequate, more thorough manner, or, put it precisely, to model it.In the work interval type-2 fuzzy sets (IT2FS) are used; to ensure computational efficiency, the preference is given mainly to piecewise linear functions (trapezoidal shape) as upper and lower membership functions of IT2FS.The rest of the paper is organized as follows: the second section explains the main problem that the paper is devoted to.Section 3 provides definition of linguistic variable (LV) and describes those variables and their linguistic values represented in the form of type-2 membership functions that are used in the inference process (Mamdani's fuzzy model); explanations on domains (universal sets) for each variable are also adduced in this section.The following section 4 makes emphasis on fuzzy rules that serve as a basis for fuzzy system (model developed), covers short comments on type-reduction defuzzification methods used in the study; results of experiments with the system under different values of input variables are presented in both tabular and graphical forms.The last, 5 th section of the paper concludes explicitly mentioning the ways of further elaborating upon the subject.

Problem definition and general comments
One of the main issues we have to deal with is to find a user's position.Current position obtained should be compared with fixed station's coordinates (e.g.end-point of the route or interchange point to other line) -it will allow to say where is a user now.If he/she is close to one of the points, the application should signal to him about it, thus the understanding and definition of the word "close" becomes essential.The factor of closeness is treated unequally by different people, and a nearby object for one person can be far away for another one.It means that estimation of closeness relates to certain difficulties and, as a consequence, we cannot associate crisp numbers as a basis for possible values of the variable "close".Therefore, the only way to describe closeness at a first approximation is to set a numerical interval of its possible values and to use it at further processing steps.We may assume that in the beginning the application gets start and end points of the route (input data), then it ensures passenger tracking using one of the positioning technologies (GPS, WiFi, Cellular Networks) and compares his/her current location with the one of key points.According to [5] and practical everyday experience, GPS has poor accuracy indoors, including metro, therefore, we do not consider GPS positioning accuracy to calculations shown in Table 1.As already mentioned before, we will use numeric interval to represent difference between fixed and current coordinates.
Received data concerning current position can be inaccurate, because positioning techniques used in the phone do not guarantee ideal precision of geographical coordinates supplied because of various objective reasons (e.g.tracking indoors or underground, inferior quality of signal from provider, etc.).Thus, it makes sense to emphasize another overt source of fuzziness, which relates to fuzzy (vague) matching of coordinates -latitude and longitude indicators will be analyzed separately.

Fuzzy logic model: definition of linguistic variables and their values
Firstly, we should select input-output variables for fuzzy system and provide necessary explanations.All significant internal and external factors, in which uncertainty shows itself, must be analyzed; this is an important stage in development of the model.Internal factors signify that certain issues depend solely on application itself (its realization), and some tuning steps can lead to better results.On the contrary, external factors indicate that there is obvious reality that is not dependent on realization per se -these are the factors that most people are familiar with, viz.bad quality of signal from provider, poor WiFi coverage, etc.

Fig. 1. Fuzzy model with names of linguistic variables in use
In order to explain internal factors, it is necessary to detect variables at the level of passenger's tracking; the central operation here is obtaining a current position.Once it is done the difference between fixed point coordinates and current point must be determined -we call this difference (i.e.variable) "Difference between fixed and current points (delta)".
If we use WiFi and Cellular Networks, it means that the application is going to get coordinates with different accuracy, even at the same place without any movements.
We have to admit that the factor of fuzziness definitely becomes apparent in the problem of coordinate matching, and the accuracy will depend on chosen positioning method (see Table 1).We will combine two techniques mentioned above, and because of that Table 1 contains cells with calculated average accuracy.In the paper, we take into account possible accuracy of latitude and longitude -let's name these variables as "Latitude accuracy" and "Longitude accuracy".The output of fuzzy system will represent position respective to metro station.All these variables as inputs and output of rule-based system to be used are shown in , where L v is the name of the variable (e.g.,.., l l (term-set of L v ; e.g.i 'insignificant ' l  , etc.).The names (labels) are generated using syntactic rule G , the meaning i M( ) l is a fuzzy set (respective membership function) defined on a universe of discourse (domain) U .The latter must be defined for all input and output variables introduced earlier.Thus, every variable is characterized by its own set of acceptable values and membership functions for each such value i l , i 1, n  .

Linguistic variable "delta" and its values
Earlier we were talking about the difference between fixed and current points (socalled delta).What does it really mean?The value that expresses the difference falls into the interval   0,a , where real-valued 0 a  (deviation is analyzed in absolute magnitude); its left bound (0) means that passenger's coordinates are similar (better to say, close) to some fixed point.We assume that the application should notify a passenger outright before a given destination, when he/she is at the station that precedes terminal station of the route, or at some later moment.Consequently, we consider the average distance between two stations, and a passenger should have enough time to alight from the railway (metro) carriage without effort.To calculate the biggest difference between coordinates, we should estimate the average distance between any two stations in the metro and double it, because at this moment it will be not an urgent question to notify a passenger about the arrival as he/she still has to go two or more stations more.Following [8,9], the mean distance between stations in Moscow metro is equal approximately to 1,780 meters.Hence, a value signifies the biggest possible difference, i.e. 40,075,000 meters (the length of Earth's equator) = 360 ᴼ (circle grade measure).
1,780 2 360 1,780 2 0.032 40,075,000 Therefore, values of delta are limited to the interval   0,0.032 (in degrees) that relates to domain (universal set) U, over which linguistic variable (1)   v " " L delta  is defined.Yet, why do we talk about linguistic variable in that case?In the everyday life people prefer to use words or phrases of the natural language as a habitual terms (values) for description of phenomena they are dealing with in their diverse activities.In case of delta variable such attached to it terms as 'big', 'small', etc., on one hand, form a solid ground for communication within the professional medium allowing almost uniform apprehension of the meaning of these values.On the other hand, their inherent uncertainty has to be adequately modeled when used in computational methods.In particular, we may introduce 2 linguistic terms 'small' and 'bigger' (difference between coordinates) as applied to the variable delta.Since type-1 membership functions (T1MF) are precise, i.e. the degree of belongingness μ(x) of each generic element x to corresponding fuzzy set is a crisp number, T1MF cannot represent the typical uncertainty intrinsic to estimates  μ(x) (tilde sign emphasizes the fact that these degrees are not reducible to ordinary numbers).

Fig. 2. Difference between fixed and current points (values of ″delta″)
Linguistic values can be represented in the form of interval type-2 fuzzy sets (IT2FS); the latter are characterized by Lower (L) and Upper (U) membership functions that bound the area called footprint of uncertainty (FOU).The shape of this region allows to express the uncertainty in  μ(x) estimates obtained, providing "additional degrees of freedom … to handle MF uncertainties" [10].For each x U  , where U is a universe of discourse under consideration, all points in the range (L)   (U) μ (x),μ (x)     may have equal unitary weights, i.e. secondary membership function defined on this interval is constant one.For practical reasons, such IT2FS seem to be convenient enough, accurate from the standpoint of giving proper weigh to uncertainty represented and most easily understood by stakeholders.Henceforth, just this kind of T2FS is used in the model with the direction of attention toward piecewise-linear type (trapezoidal case) of L and U membership functions.Firstly, it is needed to define trapezoidal MF in terms of L and U functions' parameters for each linguistic value (term) -all calculations are done in accordance with (1).We assume that 'small difference','bigger difference' with 2 elements (Fig. 2).The upper function (U) for the term 'small difference' of the variable delta can be characterized by parameter's set A(0,0), B(0,1), C(0.008,1) and D(0.016,0); the x-coordinate of the point C is the average of x-coordinates of parameters B ( x B ) and D ( x D ), the latter is the distance between any 2 stations.In much the same way, for the lower function (L) corresponding parameters are A(0,0), B(0,1), C(0.004,1) and D(0.008,0).The 4-tuple of the upper function (U) that represents the linguistic term 'bigger difference' of delta is A(0.012,0),B(0.022,1), C(0.032,1) and D(0.032,0), where A C 2 0.022    .It's worth noting that not-yet-application will receive latitude and longitude coordinates as input data, so values are bound to degrees, but not meters.For the lower function (L) set of its parameters takes the form A(0.024,0), B(0.028,1), C(0.032,1), D(0.032,0); again, the value that relates to maximum difference appears here, the x B value is obtained much as shown above, and x A equals to the sum of (U 'bigger ') x A and the width of the left tail constituting an approximate half of the distance between stations (890 m) converted to degrees.

Linguistic variable "latitude/longitude accuracy" and its values (terms)
(2) v " " L latitude/longitude accuracy  is the next variable to consider in the paper.As the telephone receives positioning information due to a correction to be made for the accuracy, it must be taken into account in calculation of difference between fixed and current points.The variable   L can be characterized by parameter's set A(0,0), B(0,1), C(0.00245,1) and D(0.0049,0); x C is calculated as the arithmetic mean of x B and x D , which is the minimal average accuracy shown in Table 1.As for the lower function (same linguistic term is considered), the values of its parameters are A(0,0), B(0,0), C(0.00222,1) and D(0.00444,0).First two parameters reflect perfect accuracy at the position; x C is obtained as before, while x D value corresponds to (2).Linguistic values 'close to latitude/longitude' should be viewed separately, because for each component of coordinate's pair factor of inaccuracy (its measurement) sounds alike, but still differently.Their presence leads to more stable model (Fig. 1) and helps to improve the results attained.The upper function (U) is determined by parameters A(0.00467,0), B(0.00548,1), C(0.007,1) and D(0.007,0), i.e.
  B is an arithmetic mean of x A and x C .For the lower function (L) parameters are specified as follows: A(0.00584,0), B(0.00642,1), C(0.007,1) and D(0.007,0), where B is calculated much as it is done in the case of upper function (U), both x C and x D are equated with the value of 0.007  that stands for minimum accuracy (or, maximum inaccuracy) -corresponding values are shown in Fig. 3.In the case concerned, only non-negative values of accuracy are considered; if calculations lead to negative result, we use its modulus.

Linguistic variable "location" and its values (terms)
The variable is the next matter under discussion -actually, it expresses the location, as it arises from variable's name, of a passenger due to indications related to previously mentioned variables.The variable is represented graphically in Fig. 4. We introduce two values (fuzzy sets) of (3) v L , namely, they are 'at station', i.e. main region that must be reached to notify a user about the arrival, and 'near the station'.The standard length of Moscow metro' platform is appr.155 meters (8 train carriages), the longest station is "Vorobyovy Gory" -its length is about 282 meters [11].The universe of discourse U the variable (3) v L is defined on can be denoted as   0,c , where the right bound c equals to the double length of the longest platform in the metro.For the upper function (U) as a constituent of IT2MF representing value 'at station', we set the following parameters: A(0,0), B(0,0), C(141,1) and D(282,0), where x C is a half of the longest station (282 m) in the Moscow's metro.The parameters of the lower function (L) of IT2MF are A(0,0), B(0,0), C(77.5,1) and D(155,0) with x C calculated as the arithmetic mean of x B and x D coordinates.We suggest to model the linguistic value 'near the station' with the IT2MF, whose upper function (U) is characterized by A(218.5,0),B(391.25,1),C(564,1) and D(564,0); the value of x A is obtained as   Rather detailed description of linguistic variables and their values is important for deeper understanding of fuzzy logic system (its model), the use of interval type-2 membership functions to represent uncertainty inherent in verbal values introduced and with the regard for specific character of possible implementation of the system in the code.To a large extent, the definition of a very small number of linguistic variables' values pursues two plain objects -namely, (1) to obtain the initial "nonoverloaded" (in terms of number of values and fuzzy rules) variant of the system to perform experiments with and to lay a ground for further analysis, tuning parameters and rule base, revealing drawbacks, etc., and (2) to examine the general idea of using type-2 fuzzy sets in recommendation services that are actively advancing as it applies to enormous market of mobile devices.

Rules of the fuzzy model (Inference System) and experiments conducted
The core of the fuzzy inference system (FIS) as shown in Fig. 1 is a set of linguistic values represented in the form of fuzzy sets, If-Then rules having a generic form ″If {antecedent} Then {consequent}″ and fuzzy reasoning scheme; the latter just operate on a given rules along with specified inputs to derive system's outputs or conclusions.
The experts' understanding of the phenomenon under study and their knowledge of the domain field provide a basis for formation of the primary version of rule-base, in which linguistic variables " L location  operates as system's output (its terms form consequent part of rules).The evident transparency of the rule-base in general is substantiated here by a specific fact of simplicity and lucidity of both linguistic values submitted for consideration and existing relations between them.To the opinion of authors, such situation can be viewed as an advantage in terms of efforts needed to design the rule-base.However, it does not mean that the subsequent fine-tuning of rules as well as values of variables will not be needed -most likely, this stage is unavoidable in practice regardless of the system at hand.At the moment, the rules can be represented in the following form: If delta is bigger difference and latitude accuracy is close to latitude and longitude accuracy is close to longitude Then location is near the station

Test 1 (difference between fixed and current points (delta))
The first carried out experiment is related to checking the difference between fixed and current points (i.e.linguistic variable delta) under the constant latitude/longitude accuracies equal to 0.00074 (step of delta's change is taken as 0.0032, number of steps equals to 10).IT2MF is an assortment of type-1 membership functions embedded between upper (U) and lower (L) functions.Each of these embedded functions (type-1) can be defuzzified, viz.converted to crisp number that represents generically corresponding fuzzy set (its membership function).The most commonly used method of defuzzification is called centroid [10].The processing of type-2 fuzzy systems provides for the use of type reduction procedure (TRp) that can be seen as an expanded form of type-1 defuzzification resorting to Extension principle [12].Each of rules Rule i, i 1,8  , "fires" and leads to obtaining output type-2 fuzzy set under a given input data.The union of these output sets and calculation of the centroid of resultant set is the essence of the centroid type reduction.Both theoretical framework and development of type reduction's use in type-2 fuzzy systems were

98
presented in publications by Karnik N.N. and Mendel J.M. [13,14].As applied to IT2FS (secondary membership function in that case is constant), TRp becomes simpler in comparison with generalized type-2 sets -the results of experiment (see the data above) using centroid type reduction (CTR) defuzzification as summarized in Table 2. On the other hand, another TRp called center-of-sets type reducing approach (CoSTR -it is a family of defuzzification methods proposed up to now) can be used to substitute the consequent parts of rule-base by singletons at the centroid of corresponding fuzzy sets (Then-part of rules).Subsequent step is connected with obtaining the centroid of type-1 fuzzy set constituted by aforementioned singletons [10].Calculated values that refer to test data (section IV, item's A preamble) are accumulated in Table 3.
It can be noticed that for a particular set of test data centroid TRp demonstrates better (i.e.smoother) approximation of the moderately growing exponential trend.Relative angularity (in Fig. 5 it is not so strongly pronounced in comparison with Fig. 6 case) relates to the use of piecewise linear (trapezoidal) functions representing fuzzy sets, certain (potential) drawbacks ascribed to rule-base design issues and small number of linguistic terms defined for each variable under consideration.However, even under these circumstances, results of centroid TRp indicate that it is more sensitive to accuracy changes (fine-tuning) than the second TRp.The second graph (Fig. 6) visualizes marked broken line consisting of 2 constant levels, and one of those is rather lengthy.To a variable degree, both lines are increasing, and centroid TRp is preferable, since it considers specificity of all functions' values.
Fig. 5. Centroid type reduction method for "delta" variable Fig. 6.Center-of-sets type reduction method for "delta" variable 4.2 Test 2 (latitude/longitude accuracy) The second test relates to checking the latitude/longitude accuracy under constant difference between fixed and current points (delta) equals to 0.0032 (longitude accuracy is 0.00074 OR latitude accuracy is 0.00074, the number of steps is set to 10).Results are shown by Tables 4 and 5.
Here, situation retains characteristic features observed in Fig. 5 and 6, i.e. centroid TRp also demonstrates better "behavior".The line (Fig. 7) grows monotonously being smooth enough, except for x-coordinates falling into the real range [0.00518, 0.00666] (approx.).Lines shown in both graphs (Fig. 7,8) follow the exponential trend (the less latitude/longitude accuracy, the less location accuracy observed).[n] is the rule's number (index).For example, Rule 3 corresponds to sequence of labelings 3a, 3b, 3c, 3d and 3e used in Tables 6 and 7. Test data were generated according to intervals of each variable's domain (the same approach as in tests 1 and 2).Step of delta changes is 0.0032, while step for the latitude and longitude variables equals to 0.00074.Input values are mixed to ensure wider coverage and variety.The last column presents location according to test values and calculation method (TRp) selected.Last column's cells with light-grey shading determine At station (≤ 282 meters) value (set), while other values show location near some station (linguistic value Near the station).Both tables are wittingly shortened, because of recurrent location results.

Conclusion
The paper examined potentials of the modeling approach based on interval type-2 fuzzy sets (IT2FS) and conventional Mamdani fuzzy inference system (MFIS) as applied to real and topical problem related to passengers tracking in urban metro (positioning service by the example of Moscow city).Appeal and significance of developing and further analysis of such models may be of a high demand for appropriate representation of those factors that are inherently vague and uncertain.The aspects that provide for eventuality to discuss models with broad sections of stakeholders owing to model's transparency, abilities to tune their parameters and to carry out experiments (test runs) play a sound role in theory and from practical standpoint.Empirical studies had shown that design issues concerned with linguistic variables and their labelled values (or, terms) influence significantly fuzzy model's output.Test cases presented in the paper corroborate both the applicability and relevance of fuzzy logic-based approach to various problems emerging in the field of navigational services, passenger tracking based on positional technologies.As it was mentioned in section IV, the model that makes use of IT2FS and MFIS leads at the end to resultant intervals that can be calculated in genuine mobile applications without appreciable extra costs with the object of determining the distance to notify users about their arrival (approach) to station.Hence, the developed fuzzy (prototype) model helps to estimate exemplary limits for values of each variable examined.Due to promising test results (for the time being we can talk about model prototype only) and its potential practical applicability, the model (Fig. 1) will be implemented in the Android-based mobile program aimed at building routes and notifying users about their destination.
From the standpoint of further theoretical research and topic evolvement, diverse types of membership functions together with fine tuning of their parameters as well as alternative type reduction defuzzification (TRDf) methods should be considered more thoroughly.Besides, by way of illustration GPS technique may beat its own path in IT2FS-based models as applied to ground transportation.

Fig. 1 .
Variables mentioned above in the text are linguistic variables, i.e. their values are words (or, phrases) of natural language; formally, these values are fuzzy sets, and they are represented by membership functions.In general, a linguistic variable is defined as set of labels of variable's L v linguistic values 1 n the maximum of average accuracy as shown in the last row of

4. 3
Test 3 (checking rules used in the model)

Table 1 .
Approximate accuracy for different positional techniques[6, 7] * The last row is calculated without GPS characteristics (signal in metro is bad)

Table 1 .
The not-yetapplication doesn't allow to use GPS in metro, so we consider combined usage of WiFi and Cellular Networks.All calculations shown below are based on values summarized in Table1, and they are performed in line with (1), i.e.
that takes into account the length of the standard metro train, i.e. the latter will have direct influence on the spread of the left tail of the membership function.As before, coordinate x B is the average of x A and x C (468.75 meters), and non-negative values are considered.
If delta is small difference and latitude accuracy is insignificant difference and longitude accuracy is insignificant difference Then location is at station Rule 2 If delta is small difference and latitude accuracy is close to latitude and longitude accuracy is insignificant difference Then location is near the station Rule 3 If delta is small difference and latitude accuracy is insignificant difference and longitude accuracy is close to longitude Then location is near the station Rule 4 If delta is small difference and latitude accuracy is close to latitude and longitude accuracy is close to longitude Then location is near the station Rule 5 If delta is bigger difference and latitude accuracy is insignificant difference and longitude accuracy is insignificant difference Then location is near the station Rule 6 If delta is bigger difference and latitude accuracy is close to latitude and longitude accuracy is insignificant difference Then location is near the station Rule 7 If delta is bigger difference and latitude accuracy is insignificant difference and longitude accuracy is close to longitude Then location is near the station Gimaletdinova A.R., Degtiarev K.Y.Type-2 Fuzzy Rule-Based Model of Urban Metro Positioning Service.Trudy ISP RAN/Proc.ISPRAS, vol.29, issue 4, 2017, pp.87-106.