An interactive installation using deep learning (style transfer) and live Bitcoin price data.
Concept and background research
Chinese “Shan Shui”1 or “Mountain, Water” paintings depict natural landscapes referencing Taoist concepts. China's landscape is changing. Technological advances are powered mostly by coal produced electricity2. Bitcoin mining is prevalent in China using vast amounts of cheap electricty3. The Three Gorges Dam, built in an area of outstanding natural beauty, produces hydroelectric power but has resulted in more landslides in the area4.
Dao is the formless founding the perfection of all things, including technical objects. Qi is the support of Dao, allowing its' manifestation in sensible forms. Qi and Dao combine producing sacred harmony. As an elemental form within string theory, the Calabai-Yau manifold5 serves as an analogy for the flowering of Qi and Dao in balance with a moral cosmotechics6. But what should this balance look like, and at what cost?
To restyle traditional Shan Shui landscape paintings as futuristic cityscapes I looked at various artists’ visions of the future such as initial concept art for “Blade Runner” by Syd Mead7, modernist concepts of future cities such as those seen in Le Corbousier’s book “The City of Tomorrow and its Planning”8 and Frank Lloyd Wright’s “Broadacre City” as seen in “The Disappearing City”9.
I also researched traditional Shan Shui landscape paintings by artists such as Zhao Mengfu and Xia Gui10, and European facsimilies such as one by Giuseppe Castiglione which I eventually ended up using in my installation.
I wanted to look at how technology affected the environment. Bitcoin mining practices in China was one example of this. Electricity in China is cheap and mostly coal based. Bitcoin mining uses a lot of electricity, sometimes as much as a small country. China’s cheap electricity is attractive to Bitcoin miners. The blockchain works through decentralising transactions so no one bank or body controls them or can charge for them11. Large amounts of cheap coal-based electricity used by Bitcoin miners contributes to climate change12. The costs and benefits are worth debating further. The viewer’s interaction with the piece lets them literally choose where the balance between technology and nature should lie.
China’s Three Gorges Dam project is also similarly paradoxical. It produces large amounts of clean hydroelectric power, but its’ construction has forever changed an area of outstanding natural beauty. There are now more landslides in the area than there were before13. The idea of the subaltern14 is from the writings of Antonio Gramsci and Gayatri Spivak15. As Spivak said in an interview in 1992 “In post-colonial terms, everything that has limited or no access to the cultural imperialism is subaltern—a space of difference”. But although this could apply to nature, it could also apply to technology and our use of it.
This project also continued long running themes within my practice. I link String Theory’s Calabai Yau manifolds with Taoist mythological narratives about nature and the origin of the universe. In Yuk hui’s “The Question Concerning Technology in China” he describes the idea of a moral cosmotechnics as one where the cosmic order and moral order combine through technical activity16. Qi and Dao are postulated to combine in technical objects. I use the Calabai Yau manifold as an analogy for this. When moral cosmotechnical Qi Dao relations are affected by environmental pollution, distortion of the Calabai Yau structures is seen. Within this project I use changes in Bitcoin price to affect positions of their vertices.
I chose to create two Calabai Yau structures that would merge and separate like two colliding black holes. The gravitational waves they produce form a spiral which reminded me of the curves of the Yin and Yang symbol17.
Artists that had inspired the look and ideas for this work included Gene Kogan’s experiments with real time style transfer18, Ruth Asawa’s sculptures19 and Sarah Sze’s work “Images in Debris”20. All these ideas were important in the formation of the work, but I also wanted to allow for the piece to be interpreted in a broad range of different ways according to each individual.
Style transfer experiments:
I put together a system that could do style transfer in a timely fashion. Because of the vast number of calculations needed the process is a slow one. I bought a very fast core i7 Intel graphics mini pc to use in the exhibition, but also to create styled images. It came pre-installed with Ubuntu Linux. In order to make style transfer work I installed the following packages:
- Python 3.6
- jupyter notebook
I did a lot of research into different ways to do style transfer. In the end I adapted some code written in Python and Tensorflow21, a basic implementation of the original paper by Gatys, Ecker and Bethge22 (seen in the jupyter notebook files, utilising vgg16.py which also was not written by me). The code utilises a pre-trained model VGG16, which is used in object recognition and classification23. I changed the maximum size of the style image to “None” so they could be any size. I also changed the relative weights of content, style and denoising. I increased the number of iterations to 2500, as I found that after approximately 2200 iterations content images were styled as much as they could be. Further iterations returned little in terms of maximising styling.
I made sure content and style images were all public domain or had a creative commons license allowing me to change, use and display them as I pleased. Occasionally I needed to attribute images to an author and have done so where required24. Smaller style images closer in size to content images reproduced patterns of the style image at a smaller scale making it less abstract and more visually pleasing. I used cityscape photos with bright neon colours and a lighter overall colour. These seemed to produce results more reminiscent of futuristic cities. Smaller images took less time to process than larger ones.
Initial style tests:
Result with a style image closer in relative size to the content image, using the same style image as the last image in the above gallery:
Other pre-processing of images:
I had limited success with masked style transfer. I decided that the pictures I was getting through normal style transfer were best suited to my aims. Some pictures were very abstract and to balance this out I used a mask produced with OpenCV thresholding in openFrameworks (maskGenerator files), and a Python programme (merge.py) to merge two styled versions of the image together using the mask as a guide.
Styled image 1, styled image 2 (both styled images used the same content image but used different style images), result of merging the two styled images using a mask:
openFrameworks, Kinect and live Bitcoin data:
The double Calabai Yau structures were made in openFrameworks by converting a Python programme I found online to C++25. The spirals were made using the algorithm for Fermat’s spiral26, one white and one black, like the curves of the Yin and Yang symbol.
I used Perlin noise to mess up the Calabai Yau shapes and ofxJSON to read changes in Bitcoin price from the coindesk api27. The change in Bitcoin price was used to scale the rotating Calabai Yau shapes and the position of their vertices.
The orbiting Bitcoin symbols were made using ofTrueTypeFont in openFrameworks. They rotated around 3D lissajous paths28, coming back to the centre then going out again in a continuous loop.
I used OpenCV and ofxKinect in openFrameworks to detect people moving across the image from left to right using the Kinect sensor, which was placed on top of the main projection wall. OpenCV thresholding was also used to change between the Shan Shui landscape paintings and the new styled images in a smooth way.
I created 5 geometries in openFrameworks using ofMesh or 2D graphics to represent the different Chinese elements. These included small floating flowers based on the polar Rose curve algorithm29, three cylinders30, a small mound-like shape, an expanded 2D lissajous curve, and a ripple-like shape which slowly tilts around its axis31.
Gallery installation view of the work:
Making the piece run on the mini pc proved problematic as I could not get the Kinect to work with it (possibly due to misplacement of a library, or the fact it only had USB 3 ports). I decided to run it on my laptop (landscapeCityscape1 files built to form an executable file) but found using Linux to detect 2 external screens difficult. I ported the project to Windows where, with an appropriate USB 3 to HDMI connector, I was more easily able to get the two projectors to work.
There were a few things I would have liked to try. It would have been nice to train a new model with different skyscrapers that could later be inserted into the cityscape using deep dreaming. I would have liked to use depth and forwards or backwards motion to change the images and animation, rather than just a person’s movement parallel to the screen. I also would have liked to experiment with the Kinect v2 as it has a higher resolution and might be more useful in skeleton tracking. Differentiating between multiple people would have been useful to implement. These are all ideas for future iterations of the project.
There were many problems along the way, such as getting style transfer to work, making the Kinect properly align itself on startup, or getting two openFrameworks windows to work within the context of the installation. I later managed to fix these problems but trying the code on Windows rather than Linux I found it ran quite slowly. I optimised the code making sure it was not producing too many particles or vertices at a time, or doing too many processor heavy calculations. I put as much of the mesh calculations in setup as I could, only using update for values that were constantly changing such as Bitcoin price.
I felt I handled problems well managing to produce a good basic version of the installation. Perhaps it would have been better to try more different styles with the images, or train my own model to create inceptionism-like32 inserted futuristic buildings into the landscape. Trying different optimisers such as Adam optimiser or L-BFGS33 might have sped up the style transfer process. Another possible issue for people was understanding all the references, but I feel this was unnecessary as the piece lends itself to broad interpretations. However during the exhibition visitors had a tendency to want to touch the circular screen, expecting it to be interactive in some way. Perhaps I should have anticipated this being part of an interactive exhibition, but I don’t think it affected the meaning of the piece too much.
6. Hui, Yuk. “The Question Concerning Technology in China”, Urbanomic, (2016)
8. Le Corbusier. “The City of Tomorrow and its Planning”, Dover Publications, (1987)
16. Hui, Yuk. “The Question Concerning Technology in China”, Urbanomic, (2016)
24. Pictures with Creative Commons Share-Alike License:
Emperor Minghuang's Journey to Sichuan, section of a much larger image:
PericlesofAthens at English Wikipedia:
Trey Ratcliff "Tokyo at Dusk - Blade Runner Extreme":
Trey Ratcliff "Osaka Alive":
Trey Ratcliff "The Runner of Blades":
Anh Dinh "fullerton bay hotel":
All content and style images used in the final work can be downloaded from here:
25. converted single calabai-yau manifold from python code here
31. Chroma, Joseph. “Morphing: A Guide to Mathematical Transformations for Architects and Designers”, Laurence King Publishing, (2015)