## 2 Model Systems and Computational Methods
### Image-to-Image Translation Using Pix2 pix  
Given the computational cost of the ED calculations and the fact that the number of possible neuromorphic configurations of interest grows sharply, we implement an efficient and accurate ML approach based on cGANs, which enables a rapid estimation of the charge localization under different potential maps, which depend on the input conditions. The image-to-image translation is implemented using the pix2 pix method developed by [PERSON] et al. [35]. This is a general purpose image-to-image translation based on cGANs, which assume a generator and a discriminator network trained adversarially. As more examples are fed in, the generator improves gradually so that its prediction accuracy increases, along with the discriminator's capacity to distinguish between calculated and generated images. The training process continues until the discriminator is no longer able to distinguish the generated images from the ground truth. The novel aspects concerning the pix2 pix method are in regards to the implementation of a U-Net architecture for the generator and a PatchGAN for the discriminator, which better captures local details. The choice for the cGAN approach is motivated by the small stochasticity of the generated output, which can be even completely removed. In this way, one can provide one-to-one mappings between the available and targeted quantities, e.g., potentials and charge densities.  
The cGAN architecture is specified by the generator and discriminator networks. The U-Net of the generator contains the encoder with 6 layers, using the LeakyReLU activation function, constructed for an input size of \(64\times 64\times 1\) (one RGB channel). The convolution parameters are \(padding=same\) and \(stride=2\). For the decoder, we used the same parameters, while the activation functions are ReLU (first 5 layers) and tanh (last layer). The discriminator is a PatchGAN classifier with 5 layers, input size of \(64\times 64\times 2\) (image pairs), zero-padding and the strides sequence \((2,2,2,1,1)\). The Adam optimizer was employed with a learning rate of \(10^{-4}\) and momentum parameters \(\beta_{1}=0.5\) and \(\beta_{2}=0.999\).  
Different measures can be considered for the prediction accuracy. The overall prediction accuracy for a test set with \(N_{\text{test}}\) examples is determined using the \(R^{2}\) coefficient of determination, adapted for image comparison:  
\[R^{2}=1-\frac{\text{SS}_{\text{res}}}{\text{SS}  
Equations (7) and (8) are performed on the grid points used in the calculation and prediction of the density maps. The \(R^{2}\) characterizes the entire test set.  
In addition to \(R^{2}\), we calculated the structural similarity index measure (SSIM) [36] and the \(L_{\infty}\) norm for reference-predicted pairs of images. SSIM is highly relevant for comparing images, giving an overall assessment of potential dissimilarities concerning shapes, contrast and luminance. On the other hand, \(L_{\infty}\) accounts for local variations:  
\[L_{\infty}(i)=\|n_{0,i}-n_{0,i}^{\text{ref}}\|_{\infty}. \tag{9}\]  
In the following, we shall refer to averaged values on the test set \(\langle\text{SSIM}\rangle\) and \(\langle\text{L}_{\infty}\rangle\).  
The dataset was generated by randomly varying the \(A\), \(L\) and \(M\) parameters of the Richards curve. In this way, we obtained a set of 1000 confinement potentials, of which \(N_{\text{train}}=900\) were used for training and \(N_{\text{test}}=100\) for testing. We performed ED calculations for \(N=1,2,3,4\) particles and determined the ground state particle density. For each \(N\), a cGAN model was trained for 40,000 epochs on \(N_{\text{train}}\) potential density pairs.