# Bayesian Feature Fusion Using Factor Graph in Reduced Normal Form
## 3 Results
### Dataset Preparation  
Since privacy and legal issues, it is extremely difficult to access to a public dataset of identity documents. For this reason, we collected several identity documents from Internet adding 50 documents recorded in [32] and 36 private documents of some volunteers. The \"other\" documents are collected from Internet considering documents that could be related to the context of our interest and from RVL-CDIP Dataset [33], in particular from \"invoice\" and \"form\" categories.  
In this way, we built a private dataset composed of 412 images representing personal documents: Fiscal Codes, Identity Documents, Driving License, Passports, and Other Images that can occur in the maritime application domain. The Driving License are then fused in the more general Identity Documents category.  
For many documents (298) only the front pages are available and all the \"back\" variables (\(X_{\text{BB}}\), \(X_{\text{FB}}\), \(X_{\text{TB}}\)) are missing. These examples have been excluded from the training process. The resulting 114 documents are distributed as follows: 29.8% are Fiscal Codes (fc), 9.6% are Identity Documents (id), 32.5% are Passports (pa) and 28.1% are Other documents (other). Since the document distribution is not related to the probability that a document is shown to the desk, the prior probability \(\pi_{C}\) has not been learned and set to uniform over the 4 possible values. Table 1 contains the main characteristics of the considered dataset and the Figure 3 shows some examples.  
\begin{table}
\begin{tabular}{c c} \hline \hline  & **fc:** 1.0\% \\ \cline{2-3}  & **Only front:** 298 & **id:** 26.2\% \\ \cline{2-3}  & **pa:** 17.4\% \\ \cline{2-3}
**Total Images:** 412 & **other:** 55.4\% \\ \cline{2-3}  & **fc:** 29.8\% \\ \cline{2-3}  & **Front and back:** 114 & **id:** 9.6\% \\ \cline{2-3}  & **pa:** 32.5\% \\ \cline{2-3}  & **other:** 28.1\% \\ \hline \hline \end{tabular}
\end{table}
Table 1: Characteristics of the dataset.  
Figure 3: Some examples extracted from the Dataset. For privacy motivations, personal data has been obfuscated.  
Following what is described in Section 2.2, we set \(M_{X_{i}}\) to 95 th percentile of the values present in the Training Set, \(L_{X_{i}}=10\) and \(m_{X_{i}}=M_{X_{i}}/10\) for each observed variable \(X_{i}\), except for the variable \(X_{BB}\) which it is set to 75 th percentile of the values present in the Training Set. The \(\epsilon\) value is set to \(10^{-5}\).  
After the quantization process a 5-fold Stratified Cross Validation procedure has been performed to assess the Classification Accuracy of the learned model. To have a fair evaluation of the model's performance, at each split (after the quantization process based on the parameters defined from Training Set as described above), all duplicated records and records also present in the Training Set are removed from the Test Set. At this point we have backward messages for the observed variables and the same number of forward messages for the class variables. At each epoch the flow of messages in the network is used to learn the SISO blocks, with \(N_{s}=3\) cycles and following the rules described in [13; 28]. The learning process is stopped when all CPTs are unchanged and for a maximum of \(N_{e}=50\) epochs. In Table 2 the confusion matrix for the dataset is shown together with per class precision, recall and F1-Score [34]. The overall classification accuracy is 82.7% and the macro-average F1-Score (harmonic mean of the average precision and recall) is 0.8073.