M.A Pasha, S.A Hussain, M. Akhlaq, M.T Khan., “Using Bayesian Neural Network for Modeling Users in Location Tracking Pervasive
Applications”, in Proc. of National Conference on Information Technology and Applications, Balochistan, Pakistan, April 21-22, 2005.
R2
R8 R7 Airport
R1
Mozang
R9
Gulberg
It is noteworthy that Gulberg is a place in which most of adopted against this instance to ensure cab specific
the offices are located. Route can be explained by decisions in future.
combinations of sources and destinations as described
earlier. The last factor is Speed which is quite easy to 4 Learning Methodology
represent as it depends on Weather Conditions and Route:
Speed (Rainy, [R6, R5], 40)
Speed (Normal, [R6, R5], 60) Managing user models require techniques to acquire and
Having recorded all the necessary information in the model the knowledge. Predicate Calculus has been a useful
database, we are ready now to execute a scenario. way of acquiring and modeling the knowledge. The
problem with predicate calculus is that the predicates must
be chalked down knowing exactly how different variables
3.1 Example Scenario affect other variables. In context-aware applications we
cannot judge the exact behavior of variables in advance.
We have a recorded location of Cab1 at 10 A.M. The next Bayesian Network (BN) is proposed5 as an alternative
update would be available at 11 A.M. Our location tracking which does not need prior information about how variables
application calculates the location of Cab1 at 10:30 A. M. affect others. BNs implement a statistical inference
Let’s say following information is available at 10 A.M. technique that predicts the probability of an event on the
Source = City basis of available information. When compared with
Weather Condition = Normal predicate calculus, BNs is more realistic choice for
Event = Festival modeling users due to the fact that BNs do not require
Time of day = Morning exact knowledge of dependencies in advance. Moreover,
Given the above data, it is predicted that the user would be the probabilities of the happening of an event can be
heading Jallo (an entertainment spot) from City. He would refined by learning from history. Still, BNs require a static
be acquiring the route R6 Æ R5 Æ R3 Æ R4 since it initial allocation of probabilities, which make them
seems to be the shortest (initially inferred by system). susceptible for error prone decisions for a substantial time
Since the weather is fine, he would be having a speed of before it finally reaches to the probabilities almost opposite
60km/hr. So by multiplying 60 / 60 * 30, we get 30km. We to the initial allocation. Researchers have exploited the
can conclude from here that he would have reached 30km overlap between the fields of neural networks and statistics
from City on that route, and would be at R4. using strengths of both worlds to guarantee appropriate
Let’s say at 11 A.M. we got his location, and he proved learning in all situations6.
to be at R2 at 10:30. It means that he has acquired the route Artificial Neural Network (ANN) is parameterized non-
R6 Æ R7 Æ R2 Æ R4 due to some reason. The behavior linear models used for empirical regression and
of Cab1 has changed due to its own preferences and our classification modeling. Their flexibility makes them able
system should learn from this behavior. For that we have to to discover more complex relationships in data then
create an instance of our model for Cab1 and store this traditional statistical models8. Conventional approaches of
information against Cab1. A learning mechanism should be
4.1 Bayesian Learning for Neural Networks We created a two-layer Multiple Layer Perceptron
(MLP) network with 6 hidden units and one logistic output.
In Bayesian learning for Neural Networks, probability is A separate inverse variance hyperparameter was used for
used to represent uncertainty about the relationship being each group of weights (inputs, input bias, outputs, output
learned. Before we have seen any data, our prior opinions bias) and the weights were optimised with the scaled
about what the true relationship might be can be expressed conjugate gradient algorithm. After each 100 iterations, the
in a probability distribution over the network weights that hyperparameters were re-estimated twice. There were
define this relationship. After we look at the data, our eight cycles of the whole algorithm. Further, we trained an
revised opinions are captured by a posterior distribution MLP without Bayesian regularisation on the same dataset
over network weights12. using 400 iterations of scaled conjugate gradient. We
plotted the function represented by the trained networks.
We show the decision boundaries (output = 0.5) and the
5 Simulation optimal decision boundary given by applying Bayes'
theorem to the true data model, as shown in Fig. 5. Note
The evidence of usefulness of Bayesian learning for neural how the regularised network predictions are closer to the
networks is gathered by simulating a two-class classifier in optimal decision boundary, while the unregularised
MATLAB13. Classification was chosen as a potential test network is over-trained.
due to the reason that the identification of user models
based on history is a typical classification problem. An
open source MATLAB library Netlab14 was used to
implement the statistical behaviors along with Neural
Network Toolbox of MATLAB. We are thankful to Ian T
Nabney’s efforts to code “Bayesian classification for the
MLP” in Netlab, which was used for simulation with
modest refinements.
We generated a synthetic dataset with two-dimensional
input sampled from a mixture of four Gaussians. Each
class is associated with two of the Gaussians so that the
optimal decision boundary is non-linear. The plot of points
generated by two classes is shown in Fig. 4.