## 2 Materials and Methods
### Sparse Latent Space Deep Thermomics
)\) is our loss function for training our model, for which we use binary cross-entropy (BCE) as presented below:  
\[\mathcal{L}_{\text{BCE}}=\ -\ \frac{1}{\text{F}}\ \sum_{i=1}^{\text{F}} \mathbf{y}_{i}\ \log(p(\mathbf{y}_{i}))+(1-\mathbf{y}_{i})\log(1-p(\mathbf{y}_{i})) \tag{3}\]  
where \(p(\mathbf{y})\) presents the likelihood of predicting the label \(\mathbf{y}\) for each point (form \(\mathrm{i}\ =\ 1,\dots,\ \text{F}\)). The presenting value of the background versus the targeted class binarizes with \(\frac{1}{1+\mathrm{e^{-y}}}\), a Sigmoid function. To fit a training set through learning a dictionary through the sparse latent representation, an additional \(\ell_{1}\) of the latent space as an additional penalty term with a regularization parameter is added to the model as follows [59, 60]:  
\[min_{\mathbf{W_{i}},\ \mathbf{\eta_{i}}}\sum_{j=1}^{\text{F}}\Big{(}\|\mathbf{x}_ {j}-\mathbf{W}_{j}^{T}\mathbf{\eta}_{j}\|^{2}+\ \lambda\|\mathbf{\eta}_{j}\|_{1}\Big{)} \tag{4}\]  
where each \(\mathbf{W_{i}}\) and \(\mathbf{\eta_{i}}\) are convex in the objective of this optimization. The aforementioned objective applies for \(\mathbf{W_{1}}\) and \(\mathbf{\eta_{1}}\). Applying the following procedure, we extracted the low-dimensional deep thermomics and used them to train a random forest model, then classified the participants into symptomatic and healthy groups. Figure 3 shows the configuration of the SPAER network. This study used 208 participants from the database for mastology research (DMR), acquired from patients of the Hospital Universitario Antonio Pedro (HUAP) of the Federal University Fluminense [30]. This study was approved by the ethical committee of the HUAP under registration number CAAE: 01042812.0.00000.5243 by the Brazilian Ministry of Health and met the criteria defined by the Declaration of Helsinki. The participants cohort was divided into healthy (without symptoms) and symptomatic (healthy with symptoms or cancer patients) groups with a median age of 60 years, while the youngest and the oldest participants were 20 and 120 years old, respectively. There were 57 African (27.4%), 72 Pardo (34.6%), 77 Caucasian (37%), 1 Mulatto (0.5%), and 1 indigenous (0.5%) woman in this dataset. Among the participants, 38 went through hormone replacement (18.3%), and 52 had diabetes in their family histories (25%). A forward-looking infrared (FLIR) SC620 model infrared camera (Wilsonville, OR) with a sensitivity range of <0.04 \({}^{\circ}\)C was used to perform infrared imaging acquisition with a spatial resolution of 640 \(\times\) 480 pixels. Itcaptured a range of [\(-40\)\({}^{\circ}\)C, \(500\)\({}^{\circ}\)C] [15; 30]. Table 1 summarizes the demography and clinical information of our study set. \begin{table}
\begin{tabular}{l l l} \hline \hline
**DMR: Database for Mastology Research.** & \\ \hline Age & Median (\(\pm\)IQR) & 60 (25,120) \\  & Caucasian & 77 (37\%) \\  & African & 57 (27.4\%) \\ Race & Pardo & 72 (34.6\%) \\  & Mulatto & 1 (0.5\%) \\  & Indigenous & 1 (0.5\%) \\  & Married & 104 (50\%) \\  & Single & 66 (31.7\%) \\ Martial status & Widow & 26 (12.5\%) \\  & Divorced & 12 (5.7\%) \\  & Healthy 2  & 128 (61.5\%) \\ Diagnosis 1  & 3 (36.5\%) \\  & Diabetes & 52 (25\%) \\ Family history & Hypertensive & 5 (2.4\%) \\  & Leukemia & 1 (0.5\%) \\  & None & 150 (72.1\%) \\  & Hormone replacement & 38 (18.3\%) \\  & None & 170 (81.7\%) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Demographics and clinical information of our targeted cohort from the thermography database. Figure 3: Workflow of the proposed sparse deep convolutional autoencoder (SPAER) model, having an embedded, low-rank, matrix-approximated image as the input. The model contains two parts: a convolutional deep autoencoder and a sparse autoencoder, which decrease the dimensionality of the input to 16 thermomics.