1 \chapter{Visual representations and reasoning
}
2 We chose pizzas for our domain, as everybody likes pizzas. We chose to have six different pizzas.
4 \item Margherita; basilicum
5 \item Hawaii; ham, pineapple and basilicum
6 \item Salami; salami and basilicum
7 \item Funghi; mushrooms and ham
8 \item Pepperoni; salami and jalape\~nos
14 p_margarita <- basilicum.
17 prob hawaiibasilicum:
0.1.
18 p_hawaii <- ham & pineapple & basilicum & hawaiibasilicum.
21 prob salamibasilicum:
0.1.
22 p_salami <- salami & basilicum & salamibasilicum.
26 p_funghi <- mushrooms & ham & funghiham.
29 p_pepperoni <- salami & jalapenos.
32 p_oliva <- basilicum & olives.
35 In a more structured way, you are required to describe clearly and fully:
36 • The domain and the individual images
37 • The representation of observations, assumables and the causal theory between them in AILog
38 • The style of reasoning employed (abductive, deductive) and what considerations have played
40 • The queries used to infer information about individual images
41 • The results of the queries and reflections on their effectiveness and intuitions behind them
42 • General reflections on your model, how appropriate it is for this domain, how effective it is
43 and how would need to proceed if one would like to extend it to large datasets or realistic,
48 \section{Domain representation
}
49 Translating the domain specification to AILog results in the following AILog
51 \inputminted[linenos,fontsize=
\footnotesize]{prolog
}{./src/pizza.ail
}
54 \subsection{Initial probabilities
}
55 Chances for shapes to be present are visible in Table~
\ref{chances
} and from
56 that we can calculate all the initial probabilites for all the shapes for
57 example with the following queries:
58 \begin{minted
}[fontsize=
\footnotesize]{prolog
}
59 ailog: predict circle.
60 Answer: P(circle|Obs)=
0.01.
61 [ok,more,explanations,worlds,help
]: ok.
62 ailog: observe circle.
63 Answer: P(circle|Obs)=
0.01.
64 [ok,more,explanations,worlds,help
]: ok.
65 ailog: predict circlePresent.
66 Answer: P(circlePresent|Obs)=
0.95.
67 [ok,more,explanations,worlds,help
]: ok.
71 \begin{tabular
}{|l|ll|
}
82 \subsection{Querying probabilites for pizzas
}
83 Since the chance of a false positive on a shape is so low the initial
84 probabilities for pizza types are very low. When certain shapes that belong to
85 a certain type of pizza occur the probability improves a lot. We can show this
86 by showing the probabilites of a pepperoni pizza before, during and after
87 observing the ingredients with the following queries:
88 \begin{minted
}[fontsize=
\footnotesize]{prolog
}
89 ailog: predict p_pepperoni.
90 Answer: P(p_pepperoni|Obs)=
0.0019.
91 [ok,more,explanations,worlds,help
]: ok.
92 ailog: observe circle.
93 Answer: P(circle|Obs)=
1.0.
94 [ok,more,explanations,worlds,help
]: ok.
95 ailog: predict p_pepperoni.
96 Answer: P(p_pepperoni|Obs)=
0.0019.
97 [ok,more,explanations,worlds,help
]: ok.
98 ailog: observe doublecircle.
99 Answer: P(doublecircle|Obs)=
0.01.
100 [ok,more,explanations,worlds,help
]: ok.
101 ailog: predict p_pepperoni.
102 Answer: P(p_pepperoni|Obs)=
0.19.
103 [ok,more,explanations,worlds,help
]: ok.
106 \subsection{Finding out which pizza is the most likely to be present on the
108 We do not only want to know what the probability for a specific pizza is but
109 also the most likely pizza so that we can give an educated guess about the
110 pizza type present on the image processed. This can be done with the following
111 queries using the
\texttt{whatpizza
} predicate. The
\texttt{whatpizza
}
112 predicate is a predicate that is a disjunction of all pizza types. In the
113 following queries, when the possible explanations, are given we can query for
114 every possible explanations to find out how the most likely world looks like:
115 \begin{minted
}[fontsize=
\footnotesize]{prolog
}
116 ailog: predict whatpizza.
117 Answer: P(whatpizza|Obs)=
[0.19251740120000002,
0.19278577620000004].
118 [ok,more,explanations,worlds,help
]: explanations.
119 0: ass(
[],
[basilicumcircle,circle,doublecircle,doublecircleOlives,noObserveError
],
9.5e-6)
120 1: ass(
[],
[circle,doublecircle,doublecircleJalapenos,noObserveError,salamicircle
],
1.9e-5)
121 2: ass(
[],
[blob,blobHam,blobMushrooms,circle,funghiham,noObserveError
],
3.3249999999999995e-6)
122 3: ass(
[],
[basilicumcircle,circle,noObserveError,salamibasilicum,salamicircle
],
7.6e-5)
123 4: ass(
[],
[basilicumcircle,circle,noObserveError
],
0.0019)
124 5: ass(
[],
[blob,blobBasilicum,circle,noObserveError
],
9.5e-6)
125 [ok,more,how i,help
]: how
4.
128 How?
[Number,up,retry,ok,prompt,help
]: up.
129 Answer: P(whatpizza|Obs)=
[0.19251740120000002,
0.19278577620000004].
130 [ok,more,explanations,worlds,help
]: ok.
132 Answer: P(blob|Obs)=
0.01.
133 [ok,more,explanations,worlds,help
]: ok.
134 ailog: predict whatpizza.
135 Answer: P(whatpizza|Obs)=
[0.28994000000000003,
0.33126500000000003].
136 [ok,more,explanations,worlds,help
]: explanations.
137 0: ass(
[],
[blob,blobHam,blobMushrooms,circle,funghiham,noObserveError
],
3.3249999999999995e-6)
138 1: ass(
[],
[basilicumcircle,blob,circle,noObserveError
],
1.9e-5)
139 2: ass(
[],
[blob,blobBasilicum,circle,noObserveError
],
9.5e-6)
140 [ok,more,how i,help
]: how
0.
143 How?
[Number,up,retry,ok,prompt,help
]: ok.
146 \section{Reflections
}