In robotics especially navigation in unstructured environments and manipulation you are often faced with continuously changing environment for the robot to operate in. Since training deep networks rely heavily on large-scale labelled datasets, its not often very clear how one can utilize deep learning and expect it to scale well within this changing environment. Well, people started to realize that we have lots of training data in synthetic environments and we can easily create more. So why not use them to train deep networks then deploy on real data, or use a mix of relatively smaller labelled real data and abundant synthetic data. The problem with such methods is that there is a gap between synthetic and real domains.

Some work has addressed this domain shift on the feature level during the training of tasks such as semantic segmentation like the recent work from LSD-Seg in CVPR’18 [19]. Others are working on learning a mapping from synthetic to real domains and generating real images from either synthetic images or from semantic labels. Image-to-Image translation is the problem of translating images from one domain to another. This is not a post to exhaustively go through different work in that area. It’s rather a summary of 3 papers from Nvidia that are relevant to this topic. Since my work is focused on robot learning I found the work super exciting, and valuable to that area and hope other robtics researchers can benefit from that too.

The 3 main work I will be summarizing is:

Pix2Pix HD [1]

Vid2Vid [2]

UNIT [3]

This post does not detail variational auto-encoders nor generative adversarial networks. In order to learn about them you can check these nice tutorials:

GANs Tutorial NIPS’16 (PDF, Video) Detailed derivation to relate GAN loss and Jenson Shannon Divergence. (Blog Post) VAE Explained nicely here (Blog Post)

In the area of Image-to-Image translation supervised methods rely on paired images from the two domains during the training. While unsupervised methods work with unpaired images. The first two papers are under supervised methods, while the third one is an unsupervised method.

Datasets

I will first list couple of datasets or simulation environments that can help researchers collect data to test synthetic to real adaptation. Then detail the methods listed above.

Autonomous driving:

Indoor robot navigation and manipulation:

You will notice I am inclined toward semantic segmentation datasets cause that is relevant when it comes to robotics scene understanding. I am not inclined toward pure end2end methods without auxiliary losses. I also dont think its enough to have sole object detection for example for robot learning. Segmenting the contours for the different objects to aid grasping, and further segmenting the affordances (associated actions) for the different parts in an object is a must.

Pix2Pix HD

Paper Code

It is a conditional GAN method that focuses on generating high resolution images and has two main contributions:

Multiscale generator and disciminator

Adversarial loss based on feature matching

A coarse to fine generator with 2 sub-networks ( at resolution 1024 x 512, at resolution 2048x1024). Each generator is composed of:

A convolutional front-end .

A set of residual blocks .

A transposed convolutional backend .

A multi-scale descriminator is used as well by building a pyramid of 3 scales, where the real/generated images are downsampled by factor 2 and 4.

The GAN loss is further improved by incorporating a feature-matching loss based on the discriminator. By extracting features on multiple layers from the discriminator network for both synthesized and real images. This helps the training of the generator as it enforces it to generate statistics similar to the real data.

] Where:

: total number of layers.

: number of elements in each layer.

: the ith layer of the discriminator at scale k.

: semantic label map.

: corresponding real photo.

: corresponding generated image.

Vid2Vid

Paper Code

The work in video-to-video synthesis [2] is a conditional GAN method for video generation. It is similar to Image-to-Image translation methods such as Pix2Pix, but instead of generating still images it generates coherent video frames by modeling the temporal dynamics. So summarizing how it works:

Problem Setup: Source Images: [Semantic Segmentation Masks] Target Images: [Real Images] Predicted Images:

Vid2Vid Method: Sequential Generator: The current generated frame depends on 3 things: The current source image. The past L source images (L=2 in his case). The past L generated images. (Relying on this specifically is what makes the video generation coherent rather than generating each frame independantly) Based on this a feedforward network is trained to predict . is modelled based on the warping of the previously generated frame with the computed optical flow : Note that this warping would be able to help the generation of most of the scene, yet some new objects and scenery would be entering the field of view, others will be occluded. So it is important to model both : To detail each part in the above equation: : is the warping function based on computed optical flow from to . Note that this flow is computed from the previous L source images (segmentation masks) + previous L generated images. : is a mask that determines the areas that are new or occluded and needs to be hallucinated from scratch. : The hallucinated image from scratch. Discriminator: There are 2 discriminators, the image discriminator and the video discriminator . ensures that each generated frame would resemble a real image. While ensures the consecutive frames resemble a real video with coherent temporal dynamics. Objective : The overall objective is still a minimax game where the is the generator and two discriminators for image and video and . Along with the flow estimation loss .



The video demo of the work is super cool:

The above setup relies on paired training data, which means if you need to train the method for synthetic to real video generation you will need a paired training data. Which is not so feasible to do, although VKITTI and KITTI raw data can be used. However, it is very small training data to work with. Thats why I will talk next about the unpaired setup.

They show that their method can be utilized to generate simulated images for testing autonomous driving in NeurIPS’18 which is pretty cool. Although the main bottleneck here how to ensure diversity in your generated images? As it will generate images similar to distribution of cityscapes or the dataset trained upon.

UNIT

Paper Code

Unsupervised Image-to-Image Translation works on unpaired set of images without the need for paired set of images. The main idea for that work is on learning a shared latent space.

Problem Setup: , : two image domains (e.g: Synthetic and Real) , : Encoders for the two domains that map to a shared latent space , : Generators for the two domains. By ensuring that: , A shared latent space is learned that can be used to translate images from one domain to another The translation function between the 2 domains will be a composition of both encoders and generators: Goal: Learn , While maintaining the cycle consistency constraint:

UNIT Method: The following Figure shows the framework used.



A VAE is constructed from the encoder-generator pair for each domain. maps from input image to the shared latent space , while reconstructs the image , behave similarly. and are the discriminators responsible for classifying the generated images as real/fake for the GAN loss. This results in 6 subnetworks as shown in the Figure from the paper, the final layers of the 2 encoders , have shared weights that extract the high-level representation. The first few layers of the 2 generators , are shared as well. It is important to note that during training there are 4 types of recononstructed output to ensure the shared latent space:



: That is the reconstructed image from generator that operates on latent space sampled from the output of the encoder . It reconstructs the image to its domain .



: That is the reconstructed image from generator that operates on latent space sampled from the output of the encoder . It reconstructs the image to its domain .



: That is the reconstructed image from generator that operates on latent space sampled from the output of the encoder . It translates to the other domain



: That is the reconstructed image from generator that operates on latent space sampled from the output of the encoder . It translates to the other domain Objective has 3 types of losses without going in details: VAE loss for ( , ) and ( , ) GAN loss for ( , , ) and ( , , ), note that adversarial training is for the translated images. Cycle Consistency Loss to ensure the constraint we mentioned above is met:



So whats next?

It will be interesting to see the unpaired version of video-to-video synthesis without relying on semantic labels to generate the data.

I am also curios whether optical flow is the best fit to utilize on its own for video-to-video synthesis. What other modalities can be incorporated? How specifically to incorporate the geometry of the scene from LIDAR as an example to improve the generated images.

I am still wondering how to generate multiple images from the same semantic label to ensure diversity in your training data? Since the paired setting relies heavily on supervised training if its trainined on cityscapes it will just generate images similar to cityscapes distribution. Not only that but how to control the generated scene elements to vary even if similar to cityscapes distribution.

References

[1] Wang, Ting-Chun, et al. “High-resolution image synthesis and semantic manipulation with conditional gans.” arXiv preprint arXiv:1711.11585 (2017).

[2] Wang, Ting-Chun, et al. “Video-to-Video Synthesis.” arXiv preprint arXiv:1808.06601 (2018).

[3] Liu, Ming-Yu, Thomas Breuel, and Jan Kautz. “Unsupervised image-to-image translation networks.” Advances in Neural Information Processing Systems. 2017.

[4] Richter, Stephan R., Zeeshan Hayder, and Vladlen Koltun. “Playing for benchmarks.” International conference on computer vision (ICCV). Vol. 2. 2017.

[5] Richter, Stephan R., et al. “Playing for data: Ground truth from computer games.” European Conference on Computer Vision. Springer, Cham, 2016.

[6] Ros, German, et al. “The synthia dataset: A large collection of synthetic images for semantic segmentation of urban scenes.” Proceedings of the IEEE conference on computer vision and pattern recognition. 2016.

[7] Gaidon, Adrien, et al. “Virtual worlds as proxy for multi-object tracking analysis.” Proceedings of the IEEE conference on computer vision and pattern recognition. 2016.

[8] Cordts, Marius, et al. “The cityscapes dataset for semantic urban scene understanding.” Proceedings of the IEEE conference on computer vision and pattern recognition. 2016.

[9] Geiger, Andreas, et al. “Vision meets robotics: The KITTI dataset.” The International Journal of Robotics Research 32.11 (2013): 1231-1237.

[10] Neuhold, Gerhard, et al. “The Mapillary Vistas Dataset for Semantic Understanding of Street Scenes.” ICCV. 2017.

[11] Huang, Xinyu, et al. “The ApolloScape Dataset for Autonomous Driving.” arXiv preprint arXiv:1803.06184 (2018).

[12] Shah, Shital, et al. “Airsim: High-fidelity visual and physical simulation for autonomous vehicles.” Field and service robotics. Springer, Cham, 2018.

[13] Dosovitskiy, Alexey, et al. “CARLA: An open urban driving simulator.” arXiv preprint arXiv:1711.03938 (2017).

[14] Chang, Angel X., et al. “Shapenet: An information-rich 3d model repository.” arXiv preprint arXiv:1512.03012 (2015).

[15] Zhou, Bolei, et al. “Semantic understanding of scenes through the ADE20K dataset.” arXiv preprint arXiv:1608.05442 (2016).

[16] Silberman, Nathan, et al. “Indoor segmentation and support inference from rgbd images.” European Conference on Computer Vision. Springer, Berlin, Heidelberg, 2012.

[17] http://vuchallenge.org/thor.html

[18] Das, Abhishek, et al. “Embodied question answering.” Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR). Vol. 5. 2018.

[19] Sankaranarayanan, Swami, et al. “Learning from Synthetic Data: Addressing Domain Shift for Semantic Segmentation.” arXiv preprint arXiv:1711.06969 (2017).

[20] Siam, Mennatullah, et al. “Video Segmentation using Teacher-Student Adaptation in a Human Robot Interaction (HRI) Setting.” arXiv preprint arXiv:1810.07733 (2018).



