# Breast Histopathological Image Classification Based on Auto-Encoder Reconstructed Domain Adaptation
## 3 Method
### Framework
#### 3.2.2 High-Level Feature Reconstruction and Alignment  
A fully connected layer-based auto-encoder is designed to reconstruct high-level features. It contains encoder and decoder parts. The encoder is used to compress and learn the feature embedding of high-level features of the histopathological images. The latent feature of the encoder is reconstructed by the decoder, so that the feature vector contains the meaningful representation of the breast histopathological images. It improves the learning efficiency of the auto-encoder for the high-level features. Since the proposed auto-encoder reconstructs the extracted features rather than the whole image, the auto-encoder is lighter, more controllable in capacity, and substantially improved in convergence. It reduces the model complexity and training difficulty. The encoder consists of three fully connected layers of 512, 256, 128 neurons. The decoder is built with three fully connected layers of 128, 256, 512 neurons. High-level features are extracted by a deep learning model and fed into a fully connected auto-encoder to learn the mapping from the original space to the latent space. The distributions of the extracted features, latent features, and reconstructed features are  
Figure 1: The diagram of auto-encoder reconstructed semi-supervised domain adaptation for breast histopathological image classification. aligned and the differences are minimized, which enables adaptive classification of breast histopathological images. The objective of the training is to minimize the loss as:  
\[\mathcal{L}_{m}=\mathcal{L}_{task}+\alpha\mathcal{L}_{recon}+\beta\mathcal{L}_{ similarity}+\gamma\mathcal{L}_{MMD} \tag{2}\]  
where \(\alpha\), \(\beta\), and \(\gamma\) are weights that control the interaction of the loss function, \(\mathcal{L}_{task}\) is the cross-entropy loss, \(\mathcal{L}_{recon}\) is the reconstruct loss, \(\mathcal{L}_{similarity}\) is the similarity loss, and \(\mathcal{L}_{MMD}\) is the domain alignment loss. The cross-entropy loss \(\mathcal{L}_{task}\) not only learns the histopathological image classification information carried by the labels adequately, but also ensures that the domain-distinguishing features carried by the entire data from the source domain and the labeled data from the target domain are learned effectively. The cross-entropy loss function can be expressed as:  
\[\mathcal{L}_{task}=\mathcal{L}_{task\_s}+\mathcal{L}_{task\_t} \tag{3}\]  
\[\mathcal{L}_{task\_s}=-\sum_{i=1}^{n_{S}}\sum_{m=1}^{c}y_{S_{i}}^{m}\log(p(y_ {S_{i}}\Big{|}x_{S_{i}}^{m})) \tag{4}\]  
\[\mathcal{L}_{task\_t}=-\sum_{i=1}^{n_{I}}\sum_{m=1}^{c}y_{I_{i}}^{m}\log(p(y_ {I_{i}}\Big{|}x_{I_{i}}^{m})) \tag{5}\]  
where \(n_{S}\) and \(n_{I}\) denote the number of labeled samples in the source and target domains, \(c\) denotes the number of the patch categories, \(y_{S_{i}}^{m}\) and \(y_{I_{i}}^{m}\) denote the true labels of the samples \(i\) in both domains, \(x_{S_{i}}^{m}\) and \(x_{I_{i}}^{m}\) denote the model inputs for the labeled samples \(i\) in the source and target domains, and \(p(y_{S_{i}}\Big{|}x_{S_{i}}^{m})\) and \(p(y_{I_{i}}\Big{|}x_{I_{i}}^{m})\) denote the probability labels obtained at the last layer of the sample classifier. The auto-encoder uses a nonlinear function to map high-level features from the input layer to the hidden layer to perform the coding operation:  
\[\mathbf{x}_{C}=f(\mathbf{W}_{au}*x+\mathbf{b}_{au}) \tag{6}\]  
where \(\mathbf{x}_{C}\) denotes the latent feature output (which is also used as the input of both domain discriminator and sample classifier), \(\mathbf{W}_{au}\) denotes the encoding weight matrix, and \(\mathbf{b}_{au}\) denotes the encoding bias vector.