# A Deep Learning Architecture For 3D Mapping Urban Landscapes
## 3 Network Architecture
### Implementation Details  
The development of the proposed model, the fine-tuning and the transfer learning were performed in Keras and Tensorflow [49]. The Encoder was trained with the images from a previously generated dataset that includes 2000 aerial images distributed as shown in Table 1. It is important to note that the aerial images from this database have been captured in a circular (Circular Mission) path around the target area. With multiple viewpoints of the area flown over by the drone, is expected to have a 360\({}^{\circ}\) perspective of the area of interest. Figure 2: The general configuration of the proposed model is shown in detail. The configuration of the internal layers of each stage of the architecture, both the Encoder and the Decoder, are now called GAN-Decoder. The special blocks used, such as the Residual Block (RB) and the Upsampling Block (UB), and Convolutional Block (CB) are shown in detail at the bottom. In this way, it is possible to perform the most detailed reconstruction of the area of interest with multiple objects and complex backgrounds. The model is trained until that the validation precision stopped increasing. To perform fine-tuning and transfer learning, 1500 images were used for training and 500 for validation. Furthermore, we trained for 50 epochs and used a batch size of 20. The training was carried out in a machine with two NVIDIA RTX 2080 Ti graphic cards, Ubuntu 19.04 operating system, and 32 GB of RAM memory. First, we trained the Encoder for approximately 24 h and obtained a training and validation loss of 0.623 and 0.219 (see Figure 2(a)), respectively, and an training and validation accuracies of 80.25% and 93.75%, respectively (see Figure 2(b)). In the second step, the training of the GAN-Decoder is carried out using [PERSON]'s optimizer [50], alternatively updating the Generator and Discriminator network. Furthermore, as the Generator uses convolutional blocks with skip connections, similar to those of the RestNet model and identical to those used in the Encoder stage, we decided to use the blocks and their corresponding weights obtained after training the Encoder. Additionally, following the work in [29], the Discriminating Networks is trained following using the key points obtained from aerial images generated by the Encoder stage and using the maximization function shown in Equation (1). \[min_{G}max_{D}E(D,G)=E_{P^{out}\sim p_{train}(P^{out})}[logD_{ \theta_{D}}(P^{out})]+\] \[E_{P^{input}\sim p_{G}(P^{input})}[log(1-D_{\theta_{D}})(G_{ \theta_{G}}(P^{input}))] \tag{1}\]  
where \(p_{G}\) is the generator distribution over the input data \(P\), and \(G_{\theta_{G}}\) generator with with its specific weights and biases denoted by \(\theta_{G}\). \(D\) represents the discriminator, with a \(D_{\theta_{D}}\) distribution representing the probability that the data or a point came from the data \(p_{G}\). The discriminator \(D\) is trained to maximize the probability of assigning the correct point to the samples taken from \(G\) and, in consequence, minimizes the fail probability of samples generated by \(G\). Moreover, to constrain the range of the discriminator point output, we propose to use a sigmoid activation at the end, we found it useful to stabilize the training in our experiments between the residual input points and the point cloud generated [51; 52; 53; 54]. With the above configurations we are able to reduce the complexity of the model and improve processing time. After training the Discriminator in the GAN-Decoder, we obtained a final loss of 0.647 in training and 0.338 in validation (see Figure 2(c)) and an accuracy of 78.04% in training and 90.63% in validation (see Figure 2(d)). Finally, in the third step, we train the complete architecture and obtain a training and validation loss of 0.673 and 0.237, respectively (see Figure 2(e)), and a training and validation accuracy of 76.68% and 96.88%, respectively (see Figure 2(f)).