## 2 Materials and Methods
### Sparse Latent Space Deep Thermomics  
The high-dimensional throughput of thermal features, called _thermomics_[44; 45; 46; 47; 48], inspired from radiomics [53; 54; 55], are often referred to as quantitative feature extraction from medical images. Thermoc's contain quantitative measurements of distinct thermal patterns that may aid in the diagnosis of diseases or assist in the course of treatment. Like radiomics (well known in radiographic medical imaging), thermomics have proven to have the capability to find the characteristics of some diseases that cannot be revealed by the naked eye [44; 45; 46; 47; 48]. These features are usually complimentary with clinical covariates to increase analytical power. Deep neural networks have been recently explored to improve conventional radiomics [49; 50; 48]. Computer-aided diagnosis systems often leverage having a sufficient number of features to capture the imaging characteristics, whereas the abundance of thermoc's impedes the performance of the system and creates an overfitting problem, known as the _curse of dimensionality_[48]. Deep features are commonly extracted from the hidden weight layers of pre-trained models such as ResNet [56], ImageNet [57], and VGG [58]. This often leads to high-dimensional throughput information and challenges in reducing the dimensionality, which often overfits the model. Conventional feature selection methods, which are efficient for traditional radiomics, might not be the best solution to reduce the dimensionality in such features due to a tight connection among the hidden weights, which can be interpreted as collinearity. The application of a sparse autoencoder for reducing the dimensionality of the pre-trained hidden layers of pre-trained deep learning models can be an acceptable solution for such problems due to training such dimensionality reduction models to be sensitive to slowly varying high dimensionality [48]. In this study, we propose a sparse autoencoder directly for the low-rank approximation of thermal sequences to extract the low-dimensional thermomics and use them to diagnose breast cancer. This surpasses the use of pre-trained models. The autoencoder comprises encoding and decoding pathways to compress the input data to lower dimensions hierarchically and expand the compressed data to regenerate the input image and strive to get as similar an output as possible. This measures the loss function and distance between the original input and the regenerated output, and the parameters of such a model are optimized through a stochastic gradient descent algorithm and strive to minimalize the differences between the input and the reconstructed image (otherwise known as reconstruction loss). Let \(\mathbf{x}\in\mathbb{R}^{n\times m}\) be the input with the spatial dimensions of \(512\times 512\times 3\). The latent space dimension of \(\mathbf{\eta}\), \(\mathbf{\eta}=\mathrm{F_{e}(x)=a_{e}(\mathbf{W}x+b_{e})}\) is the compressed representation of the input image, \(\mathbf{a_{e}}\) is the encoder activation, and \(\mathbf{W}\) and \(\mathbf{b_{e}}\) are the weight and encoder bias matrices, respectively. \(\mathbf{y}=\mathbf{G_{d}(\mathbf{\eta})=a_{d}\big{(}\mathbf{W}^{T}\mathbf{ \eta}\big{)}}\) expands the latent features back to the original input spatial dimensions. \(\mathbf{y}\) is the equivalent of \(\mathbf{x}\), and \(\mathbf{a_{d}}\) is the decoder's activation. A deep autoencoder composed of a multilayer model with several activations \(\mathbf{a_{(\cdot)_{i}}}\), biases \(\mathbf{b_{(\cdot)_{i}}}\), and weights \(\mathbf{W_{i}}\) and matrices with the goal of minimization \(\{\mathbf{W_{i}},\mathbf{b_{e_{i}}}\}\):  
\[\mathcal{J}_{\text{AE}}=\ \mathbb{E}_{\mathbf{x}}\big{[}\ell\big{(}\mathbf{x}, \mathbf{G_{d_{i}}(\mathbf{F_{e_{i}}(x)})}\big{)}\big{]} \tag{2}\]  
Following this optimization, the predominant noise invariant representative patterns of the thermal data are captured. \(\ell(.