Posts Tagged ‘machine learning’

Visualizing TensorFlow image classifier behaviour

Saturday, July 10th, 2021

How to use Scratch to create a visualization that explains what parts of an image a TensorFlow image classifier finds the most significant.

An image classifier recognizes this image as an image of The Doctor.


prediction: The Doctor
confidence: 99.97%

Why? What parts of the image did the classifier recognize as indicating that this is the Doctor?

How could we tell?

(more…)

Machine learning workshop for school teachers

Friday, April 2nd, 2021

This week I ran a remote workshop for school teachers about machine learning and artificial intelligence. It was organised with University College London as part of a series of activities they are running to celebrate the CS Expo: 40+ years of UCL Computer Science.

It was quite a long session, as we wanted it to be a hands-on practical CPD (Continuing Professional Development) workshop rather than just me giving a short talk. In the 90-minute workshop, we made two separate AI projects, which was a chance to see and contrast a few different approaches.

(more…)

Introducing ‘Machine Learning for Kids’ to teachers

Thursday, December 17th, 2020

I gave a short talk about Machine Learning for Kids last week as part of an online conference run by Somerset eLIM. Here’s the recording.


youtu.be/8St1REZbE5w

I started with a couple of definitions, then demonstrated a variety of projects that I’ve seen primary school students make, and finally walked people through a hands-on demo so they could try it out for themselves.

Running TensorFlow models in Scratch

Thursday, November 19th, 2020

I gave a short presentation today to explain how you can use TensorFlow machine learning models in the student block-based coding platform, Scratch.

This post has the recording of my presentation, and I’ve put some notes (all the stuff I meant to say but forgot!) and screenshots below.


recording at https://youtu.be/qHKwtefn21w

I demonstrated three things:

  1. Using your own TensorFlow models in Scratch
  2. Using pretrained models in Scratch
  3. Creating TensorFlow models in Teachable Machine and using them in Scratch

(more…)

Explaining ML with neural networks

Tuesday, October 27th, 2020

I’m working on interactive visualisations for Machine Learning for Kids that explain more of the machine learning models that children create.

Machine Learning for Kids is a platform to teach children about artificial intelligence and machine learning, by giving them a simple tool for training machine learning models, and using that to make projects using tools like Scratch. I’ve described before how I’ve seen children learn a lot about machine learning principles by being able to play and experiment with it.

But I still want the site to do more to explain how the tech actually works. I’ve done this before for the decision tree classifiers that students train for numbers projects but with this new feature I’m trying to explain neural networks.

I’ve recorded a video run-through of what I’ve done so far. The screenshots below link to different sections of the video.

(more…)

Using TensorFlow to make predictions from Kafka events

Sunday, September 6th, 2020

This post is a simple example of how to use a machine learning model to make predictions on a stream of events on a Kafka topic.

It’s more a quick hack than a polished project, with most of this code hacked together from samples and starter code in a single evening. But it’s a fun demo, and could be a jumping-off point for starting a more serious project.

For the purposes of a demo, I wanted to make a simple example of how to implement this pattern, using:

  • sensors that are easily and readily available, and
  • predictions that are easy to understand (and easy to generate labelled training data for)

With that goal in mind, I went with:

  • for the sensors providing the source of events, I used the accelerometer and gyroscope on my iPhone
  • to set up the Kafka broker, I used the Strimzi Kafka Operator
  • for the machine learning model, I used TensorFlow to make a simple bidirectional LSTM
  • the predictions I’m making are a description of what I’m doing with the phone (e.g. is it in my hand, is it in my pocket, etc.)

I’ve got my phone publishing a live stream of raw sensor readings, and passing that stream through an ML model to give me a live stream of events like “phone has been put on a table”, “phone has been picked up and is in my hand”, or “phone has been put in a pocket while I’m sat down”, etc.

Here is it in action. It’s a bit fiddly to demo, and a little awkward to film putting something in your pocket without filming your lap, so bear with me!

The source code is all at
github.com/dalelane/machine-learning-kafka-events.

(more…)

Using repl.it with Machine Learning for Kids

Sunday, May 10th, 2020

Students can work on machine learning projects in Python entirely in the browser, without any need for setup, installs, or registration.

(more…)

Using TensorFlow with IBM Event Streams
(Kafka + Machine Learning = Awesome)

Thursday, October 31st, 2019

In this post, I want to explain how to get started creating machine learning applications using the data you have on Kafka topics.

I’ve written a sample app, with examples of how you can use Kafka topics as:

  • a source of training data for creating machine learning models
  • a source of test data for evaluating machine learning models
  • an ongoing stream of events to make predictions about using machine learning models

I’ll use this post to explain how it works, and how you can use it as the basis of writing your first ML pipeline using the data on your own Kafka topics.

(more…)