Jump to Content
AI & Machine Learning

How Google Cloud helped scaling-out one person's AI service—and his life

May 4, 2020
https://storage.googleapis.com/gweb-cloudblog-publish/images/AI_Gahaku_.max-2600x2600.jpg
Kaz Sato

Developer Advocate, Cloud AI

Editor's note: This is a post by Kaz Sato from Google based on an interview with Sato (@sato_neet), an individual developer. It's confusing that we have similar names, but we are not the same person.

https://storage.googleapis.com/gweb-cloudblog-publish/images/1_AI_Gahaku.max-1800x1800.jpg
AI Gahaku (AI master painter): built by Sato with Firebase, Cloud Run, and Google Colab. One million users are enjoying the tool everyday.

When Sato (@sato_neet) quit college in Tokyo 10 years ago, he didn't know he had Asperger syndrome. After spending some time unemployed, he tried a couple different career paths, including trying to attend nursing school and learning to become a baker. When he realized that Asperger’s could be the reason that he wasn't able to fit well in those environments he tried something else entirely: artificial intelligence (AI).

It was two years ago when Sato started learning AI. He had taken some basic programming classes in college, but wanted to learn Python and JavaScript to create something fun with emerging technology and share it with the community. He also conquered the basics of deep learning with TensorFlow and Colaboratory

"As I have been earning so little money these days, it was very helpful for me that TensorFlow and Colab are freely available,” Sato explains. “I could get a great learning environment at no cost."

Developing AI Gahaku

In March 2020, Sato released AI Gahaku (“AI master painter”), which he has been developing alone. It generates classical-painting style portraits based on portrait photos that you upload to the site.

https://storage.googleapis.com/gweb-cloudblog-publish/images/2_AI_Gahaku.max-1000x1000.jpg
A classical-painting style portrait generated with AI Gahaku.

The site uses a pix2pix-based ML model for the style transformation. Pix2pix is a kind of conditional generative adversarial network (cGAN) model that’s designed to generate a realistic image from a specified image as a condition. (Check out the pix2pix example with TensorFlow to try it for yourself.)

https://storage.googleapis.com/gweb-cloudblog-publish/images/3_AI_Gahaku.max-900x900.jpg
A pix2pix generated image. The left image works as the condition, and the model generates the image at right.

In the case of AI Gahaku, Sato trained a pix2pix-based model that takes the uploaded photo as the condition and generates a realistic classical painting portrait.

The site instantly made a buzz when he shared it on Twitter, first in Japan and then in the US and other countries. Now AI Gahaku is being enjoyed by one million users worldwide, every day.

https://storage.googleapis.com/gweb-cloudblog-publish/images/4_AI_Gahaku.max-1700x1700.jpg
The number of AI Gahaku users spiked from 0 to 1 million in 10 days.

Sato has also released another fun project called pixel-me, a tool for generating 8-bit-style portraits with the same pix2pix technology—the difference is that he used pixelated images for training this model.

https://storage.googleapis.com/gweb-cloudblog-publish/images/5__AI_Gahaku.max-1000x1000.jpg
An 8-bit style portrait generated with pixel-me.

From 0 to 1,000,000 users in 10 days

When he was building the sites, Sato relied on Google Cloud Platform Free Tier—specifically Firebase, Cloud Run, and Colab. This allowed him to develop both AI Gahaku and pixel-me while keeping costs low.

https://storage.googleapis.com/gweb-cloudblog-publish/images/6_AI_Gahaku.max-1400x1400.jpg
The systems architecture of AI Gahaku.

"In addition to those free tiers, the $300 free trial program helped me learn how to use Google Cloud tools,” Sato says. “And, since the UX design clearly says which resource is free and which is not I was very comfortable using it."

Although AI Gahaku was built by one person, it scales automatically, thanks to Cloud Run's serverless autoscaling feature. Now that Sato has packaged the pix2pix-based ML model as a container and deployed it to Cloud Run, he doesn't have to manually start up or shut down server instances based on traffic load. Instead, each instance can start up in seconds after receiving an increasing number of requests—if there’s a sudden traffic spike, tens or hundreds of instances start up almost instantly, while staying under a controlled budget. 

This all means that Sato didn't have to change anything in the system architecture as he watched the traffic load spike from zero to one million users per day within just 10 days of the release. Now? The Cloud Run backend of AI Gahaku is using 200 containers. 

"I'm so surprised that Cloud Run and Firebase are naturally scalable as serverless environments,” Sato says. “The site is keeping a fast and steady response time for millions of users, without any design changes for handling the boom in global traffic.”

Scalable AI for everyone

Under the current load, the operational cost of AI Gahaku is around $20 USD per day, Sato says. But he doesn't have any plans to monetize the site. 

"I'm just not interested in those things, like starting up a business and extending the site. I just want to keep creating something truly interesting to me,” Sato explains. “I like Google Cloud serverless services because the platform allows me to explore those fun ideas easily, without worrying much about the initial cost, scalability, and ongoing operation."

Sato continues, "In the last week, I got so many responses and great feedback from all over the world. It has been the most valuable and meaningful time in my entire life. I really thank all the users, donators, and people who made this happen." 

We tend to think of Google Cloud’s scalable AI features as something businesses deploy to help them scale and become more efficient. But, Sato’s story shows that sometimes this technology can help scale out your creativity, reachability, and connections with others. Do you have an idea to explore? Check out the Google Cloud Platform Free Tier page to learn more and try out the technology for yourself.

Posted in