## 2 Materials and Methods
### Statistical Methods and Construction of BN + CNN Expert Model from Data  
The proposed methodology consists of the following steps:  
1. Feature extraction from the thermal images. This step is described in more detail in another subsection. The extracted factors from the image are:
2. Maximum temperature;
3. Minimum temperature;
4. Max temperature minus min temperature;
5. Mean temperature;
6. Median temperature;
7. Standard deviation;
8. Variance;
9. Max temperature minus mean temperature;
10. Max temperature minus max temperature of the healthy breast;
11. Max temperature minus min temperature of the healthy breast;
12. Max temperature minus mean of the healthy breast;
13. Mean temperature minus mean temperature of the healthy breast;
14. Distance (max to min in pixels);
15. A = number of all pixels around the point of the maximum temperature that have temperature > [ mean + 0.5 (maximum-mean)];
16. B = number of pixels/cells of the temperature matrix of the image of the breast with tumor;
17. C = number of all pixels that have temperature > [ mean + 0.5 (maximum-mean)];
18. A/B;
19. C/B.
20. First, a descriptive analysis must be performed to check the distributions and the probability density functions. Then, appropriate algorithms will be used for the imputation of missing values. In our case, the structural expectation maximization algorithm as it is implemented in BayesianLab 10.2 software was used;
21. BNs require the discretization of scale variables. A supervised multivariate discretization method optimized for the target variable tumor (positive = 1 or negative = 0 states) has been used;
22. Unsupervised learning has been performed to discover associations and possible causal structures. This step is independent of the supervised learning that finally will be used to build the final expert model. However, it is a consistency check and can also provide the influential nodes for the target variable, which is the tumor. Arrow-type connections and strengths of informational nodes are evaluated with the information-theoretic mathematical quantities of Mutual Information, Minimum Description Length (MDL) score, and the Kullback-Leibler Divergence or KL Divergence;
23. Supervised learning was performed using the Augmented Naive Bayes learning scheme. Next, validation of the results was checked using K-fold analysis;
24. Run the supervised learning for structuring a BN using the extracted features plus the following historical medical data for each patient: marital status, race, age, first menstruation, last menstrual period, eating fat, mammography, radiotherapy, plastic surgery, prosthesis, biopsy, hormone replacement, wart on breast and temperature;25. Run the same supervised learning for creating BN with the same data plus CNN prediction factor;
26. Compare. If the accuracy is similar, then accept the integrated CNN + BN expert model that achieves both explainability/interpretability and high accuracy. It is important for BN to have similar performance with the CNN methods because this means that the influential factors that can be discovered only with the BN method (and are significant for a physician) are enough for a good diagnosis.