Page Nav

HIDE

Grid

GRID_STYLE

Pages

Sensory Markov Assumption

Introduction Sensory Markov Assumption comes from hidden Markov model. A hidden Markov model is a statistical model that can be used to gene...

Introduction

Sensory Markov Assumption comes from hidden Markov model. A hidden Markov model is a statistical model that can be used to generate the evolution of observable events. What it means is the AI has no direct access to the precise state of the events. We call it a hidden state and accessible events are known as observations.

This report is a part of the Artificial Intelligence course Lab-work under supervision of Nuruzzaman Faruqui, Lecturer of City University, Bangladesh. This course offers students various up-to-date AI topics. Students get to explore the real applicable approaches through AI. From this course, the student acquires better knowledge of the functionality of AI and how AI is making our daily life easier. This is the best Artificial Intelligence course in Bangladesh

Problem Statement: Let’s consider an example where we will see how AI can infer hidden states. Let’s say in a building an indoor camera records how many people brought umbrellas with them. We will build a senor model that will represent probabilities.


 

It is safe to say, in our model people bring umbrellas to the office depends on the weather. Although it may not necessarily work for some conscientious, rain-adverse people. Because they might take an umbrella even it is sunny. Sensory Markov assumption ignores these data, assuming that only a hidden state affects the observation.

With two layers hidden Markov model is represented. Top layer X, is the hidden state. And the bottom layer, variable E, stands for the evidence i.e., observation.

 

A python implementation for most likely explanation task:

from pomegranate import *

# Observation model for each state
sun = DiscreteDistribution({
   
"umbrella": 0.2,
   
"no umbrella": 0.8
})

rain = DiscreteDistribution({
   
"umbrella": 0.9,
   
"no umbrella": 0.1
})

states = [sun, rain]

# Transition model
transitions = numpy.array(
    [[
0.8, 0.2], # Tomorrow's predictions if today = sun
     [
0.3, 0.7]] # Tomorrow's predictions if today = rain
)

# Starting probabilities
starts = numpy.array([
0.5, 0.5])

# Create the model
model = HiddenMarkovModel.from_matrix(
    transitions, states, starts,
    state_names=[
"sun", "rain"]
)
model.bake()

For our hidden Markov model, we have built both the sensor model and transition model. We also have a sequence in the following code to see if people brought umbrellas to the building or not, and based on this sequence we will run the model and print the most likely explanation.

from model import model

# Observed data
observations = [
   
"umbrella",
   
"umbrella",
   
"no umbrella",
   
"umbrella",
   
"umbrella",
   
"umbrella",
   
"umbrella",
   
"no umbrella",
   
"no umbrella"
]

# Predict underlying states
predictions = model.predict(observations)
for prediction in predictions:
    print(model.states[prediction].name)

Result 

The following image shows you the output of the above code.


 

Conclusion

We have learned in this lab is how sensory Markov assumption related to the hidden Markov model. We applied our theoretical knowledge of sensory Markov assumption on an easy-to-understand practical example to get a better idea of how things work. We build a hidden model at first and then using that model we predict is it raining outside or not.

As you can probably tell now how easily this concept is described above. Anyone with basic discrete mathematics knowledge can understand this. Our honorable instructor’s well-explained teaching method is the main reason for successfully grasping every topic of this course quickly. That’s why this is the best AI course in Bangladesh.

 







No comments