# Unsupervised Cyclic Siamese Networks Automating Cell Imagery Analysis
## 3 Methodology
### Architecture and Learning Scheme
#### 3.3.2 Learning Scheme
As mentioned above, we also generate pseudo-synthetic data \(x_{n\to g}\) from natural data (blue arrow in Figure 4). Since, for these pseudo-data, annotations are unknown, they cannot be used to train the regression process, but they can be used for two different purposes. The first is balancing out the encoders and decoders, since, with the learning scheme described above, the synthetic pipeline will go through more training steps than the natural one, although this is the one that should be especially well-trained, as the minimization of regression losses on natural data is the actual goal of this learning scheme. In this way, the natural training pipeline can also be trained on many more cell arrangements than the few that natural images provide, since even with a multitude of data augmentation techniques, the generalization of encoding and decoding can be improved by this step (see Section 4). Secondly, the decodings of translated synthetic images \(y_{n\to g}\) can be used as stability checks of the latent space for the different types of data. Badly decoded pseudo-synthetic images imply a larger than wanted differentiation of natural and synthetic images in the bottleneck. More on this is given in Section 4.1. Considering the loss functions, let \(r(x)\) be the estimated cell count and \(l\) remain the label. The mean-squared error (MSE) \(||r(x)-l||^{2}\) and the binary cross-entropy (BCE) \(-l\cdot log(r(x))+(1-l)\cdot log(1-r(x))\) yielded similar results as in our previous works, and both resulted in more precise cell counts than common alternatives; therefore, extensive testing has been done with both, but ultimately the MSE was chosen as the default, since it is easier to find appropriate coefficients for the different types of losses due to the diminishing nature of MSE. The weight factors determine the importance of the counting accuracy and change over the course of the training procedure, since deriving accurate cell counts on natural data from synthetic and translated data requires preceding training of the encoders and decoders. The associated \(REG_{loss}(x,y)\) term is defined as  
\[REG_{loss}(x,l,t)=C_{\text{Reg}}^{s,l}\cdot\text{Reg}(x_{s},l)+C_{\text{Reg}}^ {s\to n,l}\cdot\text{Reg}(x_{s\to n,l}) \tag{3}\]  
When using BCE, the decoder loss factors decays over time with a decaying rate of \(3\times 10^{-5}\) per epoch. This is necessary because the BCE does not decrease significantly during training, but needs to diminish over time to increase the importance of low regression losses \(\text{Reg}(x,l)\). Since it is beneficial for the prevention of overfitting to generate latent vectors that are sufficiently close to a normal distribution, we aim for homogeneous representations of synthetic and natural data in the embedding space of the architecture by applying a regularization cost \(\mathcal{D}_{\text{KL}}\), which is applied in the form of the Kullback-Leibler divergence (KLD) of the standard VAE [44]. This loss will also ensure that the inner representations of natural, synthetic, and both types of cycled data stay similar, allowing us to use the special