I had the chance to present a workshop for the 6th edition of ScalaIO. ScalaIO is a small non-profit conference in Lyon (France) about Scala but also functional programming. The talks are both in french and english. The conference is well organized thanks to a lot of people taking on their free time to offer a nice conference with reasonably priced tickets. Don’t hesitate to take a look if you are interested for the next edition: website, twitter.

CPE Lyon - ScalaIO
Figure 1: ScalaIO

Workshop

For 2019 edition, I had the opportunity to present a workshop with Xavier about an Introduction to Tensorflow in Scala.

This workshop has two main goals:

  1. Introduction to Artificial Intelligence
  2. Discover Tensorflow with Scala thanks to this library

To be able to start the workshop quickly, we made a VirtualBox image to have everything install in the same place. In this image, we have multiple components:

  • Tensorflow Scala and all related dependencies
  • Jupyter notebook

If you don’t know what is Jupyter, you can follow this link. To summarize, it allows you to run your code directly into a browser through an UI and to put text and code in the same place. So, it is the perfect tool for workshop because you can put all your resources in the same place and give extra informations for the user. The only setup necessary for participants is to install VirtualBox, run the image and open the browser on localhost:8080. Otherwise, we also provide a Dockerfile.

The workshop is splitted in four parts:

  1. Learning a simple linear model
  2. Classify images with digits MNIST: MLP
  3. Classify images with digits MNIST: CNN
  4. Demonstration of an anonymization web service thanks to Akka HTTP and Tensorflow

1. Learning a simple linear model

The first part will show to the user how to create a simple dataset and how to train a linear model on it. To create the dataset, we display multiple images like the one below.

DataSet Creation
Figure 2: Image to labelize

Each pixel will be a shade of green or blue. The user has to choose if the image looks more green or blue. After that, we can train a simple model on these images to be able to detect if the image is green or blue.

2. Classify images with digits MNIST: MLP

After the first part explaining the bases, we discover the Multi Layer Perceptron (MLP) with the famous MNIST dataset.

MNIST dataset
Figure 3: MNIST dataset extract

In this section, we provide an initial model. The goal of the participant is to play around with the different options like the activation function to have the best accuracy at the end.

3. Classify images with digits MNIST: CNN

The structure is the same than the previous part but instead of using a MLP, we use a Convolutional Neural Network (CNN). A CNN is more accurate on images than a MLP. The goal of this exercise is to discover by yourself the benefits of a CNN compare too a MLP.

Schema of a CNN
Figure 4: CNN

4. Demonstration of an anonymization web service thanks to Akka HTTP and Tensorflow

This part is related to that blog post. We are serving an HTTP endpoint to upload a picture. After uploading an image, the service will anonymize the image and send it back.

This final section is to show a real use case of Tensorflow instead of the classical examples like the MNIST dataset.

Conclusion

This workshop was a really nice experience. I learnt how to manage my time and my presentation to fit in the schedule (It was 3 hours by workshop for ScalaIO).

If you are interested by the workshop, all the resources are available on github and all the slides are on it also. Do not hesitate if you have a general question or a question about the exercises. Thanks for reading.