# 3D Shape Generation via Variational Autoencoder with
## 4 Experiments
### Training Procedure  
The pair of \(\left\{img_{i},sdf_{real_{i}}\right\}\) that is drawn from the training dataset is used to train the proposed 3D-VAE-SDFRaGAN framework, where \(img_{i}\) is the 2D image, and \(sdf_{real_{i}}\) is the corresponding signed distance function of the 3D object. During training, the latent representation \(\left(z_{img}\right)\), which represents the image feature, is generated by the image encoder after encoding a 2D image \(img_{i}\). The SDF-generator network, which receives \(z_{img}\) with a 200-dimension vector as input, generates \(sdf_{gen}\) as output. A random vector \(z\) is sampled from a uniform distribution \(p(z)\) and fed to the SDF-generator network to produce \(sdf_{z}\). Both generated SDFs \(\left(sdf_{gen},sdf_{z}\right)\), along with \(sdf_{real}\), serve as the input to the SDF-discriminator network for classification purposes. The SDF-discriminator network distinguishes SDFs and determines whether the SDF is generated from the SDF-generator network or if it is the real SDF from the dataset. The learning rates with the values of \(10^{-5}\), \(10^{-3}\), and \(10^{-3}\) are used during training for the discriminator network, generator network, and encoder network, respectively. For optimization purposes, we use the Adam optimizer with \(\beta\) = 0.5. The proposed network is trained separately on each class of objects, with a batch size of 64. During the experiment, the values of 1 and 100 are set to \(\gamma_{1}\) and \(\gamma_{2}\), respectively. We used the ShapeNet dataset to train and test the proposed 3D-VAE-SDFRaGAN, with a dataset split of 80% and 20% for the training and test sets, respectively [30; 46; 47]. The model was trained for 1500 epochs on the table, lamp, sofa, and cabinet categories, while the car and chair categories were trained for 1700 epochs. The experiment was conducted using a single Nvidia GeForce GTX 1080 GPU, with a total training time of 192 h. The complex architecture of the proposed model, which combines a variational autoencoder (VAE) and a generative adversarial network (GAN), imposes a relatively high computational burden. During the training process, multiple iterations were carried out to cover the car, chair, cabinet, lamp, sofa, and table categories of the ShapeNet dataset. Model performance optimization was achieved by training some categories for 1500 epochs while others were trained for 1700 epochs. The computational burden was increased using a single Nvidia GeForce GTX 1080 GPU for training, resulting in longer training times due to limited computational resources. The following loss functions are used in the encoder, generator, and discriminator networks during training:  
\[L_{E}=\gamma_{1}L_{KL}+\gamma_{2}L_{R} \tag{9}\]  
\[L_{G}=-\mathbb{E}_{z}\backsim_{Q}[\log(1-\hat{D}(z))]-\mathbb{E}_{z_{img}} \backsim_{Q}[\log(1-\hat{D}(z_{img}))]-\gamma_{2}L_{R} \tag{10}\]  
\[L_{D}=L_{(SDFRaGAN)} \tag{11}\]  
The parameters of the discriminator network are updated when the accuracy is less than 0.8 in each batch. Figure 3 illustrates the training process flow of our proposed framework. During training, we use a random noise sampled from a uniform distribution, \(p(z)\), denoted as \(z\). We also use the signed distance function, \(sdf_{real}\), from the dataset. Additionally, we generate two new signed distance functions: \(sdf_{gen}\) from random noise, \(z\), and \(sdf_{z}\) from an encoded image, \(z_{img}\).