## 5 The Visual Question Answering Model
The BoW model utilized in this study is a simple yet widely used approach of representing text data when performing any type of machine-learning application. This model is a representation of the text that describes the occurrence of words within a document. The main part is that it involves a number of known words and a measure of the presence of those words. It has its name because the order of the structure of words inside the document is not important, therefore it can be considered simply to be a \"bag\" of words [36]. Since this study aims to only use a relatively small dataset (the Sally-UWF dataset) when compared to others, the BoW can be considered to be a great asset. This is because one of the limitations of the BoW is the length of its vocabulary. However, since only dealing with a small, fixed set, where one of the answers will always be the correct one, this model can be very effective. The BoW model turns arbitrary text into fixed-length vectors by counting how many times each word appears. This process is also known as vectorization [37]. For example, looking into our dataset, a few specific sentences were used for vectorization, such as \"Is there any damage on this image?\" or \"How much damage can be seen?\". Looking at these specific questions, a vocabulary can be determined. To create a vocabulary, each word needs to be separated by itself: \"Is, there, any, damage, on, this, image, how, much, can, be, seen.\" After that, this dataset is vectorized by assigning a number to each word. That means that every time the word appears in a sentence, it is counted. Table 1 depicts an example of this approach. In Table 1, vectors of [1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0] and [0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1] are created. After creating a fixed-length vector for each question, the vectors are used as an input for a feedforward neural network. This feedforward neural network takes vectorized inputs, multiplies them by specific weights, and produces an output [37]. For this study, since a relatively simple question dataset is being used, the BoW vectors obtained from our model are used as the input for this feedforward neural network, and passed through two fully connected neural network layers, where every node is connected to every output from the previous layer, to be able to produce an output [37]. Finally, the results of the CNN model and the BoW model are combined and merged together. However, to be able to obtain the conclusive final results for this approach, the \"softmax\" function was used. This function allows turning the output values into probabilities, in order to quantify the certainty for each answer. The main focus of the VQA is on the detection accuracy aspect of the proposed pipeline. In total, this model has used 1000 frames and 30 questions, and the questions have 7 possible answers, which are Yes, No, One, Two, Three, Four, More. The further analysis of the VQA and the comparison of the results is presented in Section 6. \begin{table}
\begin{tabular}{c c c c c c c c c c c c} \hline \hline  & & & & & & & & & & & & & & \\ \hline
**Question** & is & there & any & damage & in & this & image & how & much & can & be & seen \\ \"Is there any damage in this image?\" & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 & 0 \\ \"How much damage can be seen?\" & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 1 & 1 & 1 & 1 & 1 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: An example of the vectorization of a Bag of Words application.