Google Cloud Derby: The Fun Way To Learn GCP
Cloudreach Cloud Systems Developer, Ignazio Pollina shares his experience of learning about the machine learning capabilities of Google Cloud Platform when he completed the Google Cloud Derby Workshop.
Learning a new programming language will often mean taking a "Hello World" exercise.
Learning a new Cloud platform involves going back to basics and taking certifications.
Wouldn’t you rather create a mini robot instead?
They certainly do things differently at Google.
The Google Cloud Derby is an eight-hour workshop that aims to teach participants more about the products and services associated with Google Cloud Platform (GCP). The goal of the day was to work in teams to build self-driving, robot cars from scratch. At the end of the workshop, our robots would be pitted against each other in a ball game that would test their ability to recognise and collect different colour balls.
How hard could it be?
To give everyone a friendly head start, Google provided the code and instructions to the teams. As well as the cars, we were also given a Raspberry Pi 3 and GoPiGo hardware components provided by Dexter Industries. Then the challenge began!
The next few hours was a crash course in robotics and machine learning. Each GoPiGo car features a wide-angle camera and a laser sensor. We had to use various Google Cloud components to process the data collected by these inputs to equip our robots with the intelligence to distinguish colours and control movement
The GoPiGo Architecture above shows how modules interact with the software running on the car via GCPs PubSub and IoT Core. Here some of the main features:
- The Driving Controller uses Google Machine Learning to make driving decisions based on information gathered by the car (camera and sensor)
- TensorFlow Object Detection API is used to process images and help detect the locations of coloured balls
- The software on the GoPiGo car runs into the Raspberry Pi and uses Google Cloud IoT Core to communicate to the Cloud Derby modules running on GCP.
Data preparation was the most important part of the project, as it helped the car detect and identify objects. You can see this in action in the image of the real-time logs:
You may have seen how people have previously used the TensorFlow Object Detection API to identify pets (Check out the GitHub project).To get the Machine Learning to work for our robot we used a similar process. Here are the steps:
- Take images of balls and letters in different light conditions, distances etc. and annotate them with bounding boxes and labels. Upload these pictures to a bucket.
- Train an object detector using TensorFlow Object Detection API using the transfer learning method.
- Use the trained model to recognise colour and location of balls in images taken by the car's camera.
Transfer learning with TensorFlow (pre-trained neural network) was used for this module and helped us save a huge amount of time (Here is a GCP guide too).
So, our robot could identify the right colour balls, but how could we get it to drive towards them?
A driving controller software module was responsible for processing the incoming data (like angles and distance to the objects) to make decisions and send commands back to the car.
The driving controller, running on the AppEngine, was set to the self-driving mode using its web app. This processes the incoming data invoking remote inference runtime using REST API, which creates control messages which can be sent back to the car via PubSub. Car software will subscribe the PubSub topic where these control messages are published, interpret commands and issue signals to the car hardware.
After all this, we were very satisfied to see our robot in action and working perfectly in the main event at the end of the workshop!
A fun way to learn by doing
The Google Cloud Derby is a fun way to learn by doing, with an added competitive edge to the challenge! It is a great way to get an introduction to GCP’s capabilities and a basic idea of how it can be utilised for machine learning and basic automation tasks. Despite having the instructions from Google, we were encouraged to be creative throughout the task and find our own solutions. Overall, it was a fun day of learning new skills and sharing ideas with some fantastic colleagues.