Blog - Jürgen Kanz

Logo Jürgen Kanz
Go to content

Excursion: horses, zebras and a blanket cover

Jürgen Kanz
Published by in Neural Networks ·
Tags: NeuralNetworkMathematicaWolframDeepLearningArtificialIntelligence
In this post, I want to show the results of some image transformations with the help of trained neural networks. Of course, this work does not help mankind, but some fun is always good.

I have used Mathematica V12 and in addition two networks from the "Wolfram Neural Net Repository"[1] to run the calculations. Wolfram's "CycleGAN Horse-to-Zebra Translation" net and the "CycleGAN Zebra-to-Horse Translation" net are based on the work of Jun-Yan Zhu [2] for Python software environments.

So, let us see how it works. We start with the image transformation of a horse picture and we want to convert them to zebras.

From Horses to Zebras:
 



That is nice!

From Horse with a blanket cover to Zebra




The horse looks partly already like a zebra. At the end it is a zebra.


From Horse with two men to Zebra




I do not know these guys, but beside the horse the men become zebras as well.
That is something that should be avoided in a serious transformation.

From Zebra to Horse




That is already something, but the backside of the zebra remains partly as a zebra.

From Zebra to Horse




In this example the transformation works better. I have taken the input image of this example from an official Wolfram notebook.

Summary:
Finally, it is only one line of code that make this kind of transformation possible in Wolfram Language. That is great. My observations: it is more convincing to transform images of brown horses. With black horses, the results are still good. At least during my tests I have had more transformations that are incomplete with a zebra input. Therefore, I had to put more effort in the selection of a good zebra image as input.

However, it is a fun to make this kind of exercises. In case you want to run the same transformations in your Python / Pytorch environment, please let me know and I will give you the inputs.

Resources:
[1] Wolfram Neural Net Repository, https://resources.wolframcloud.com/NeuralNetRepository/, last accessed May 11th, 2019
[2] CycleGAN, Jun-Yan Zhu, https://github.com/junyanz/CycleGAN, last accessed May 11th, 2019




Back to content