Hands-on Tutorials

Getting sensor data out of an Arduino Nano 33 BLE

Sensors perceive. They see, listen, and smell things that we, humans, cannot (or shouldn’t) see, listen, or smell. Sensors digitalize. Through seeing, listening, and smelling, they quantify and digitalize our surroundings — they create data. A sensor-equipped Arduino is an example of such a device. These devices “sense” their surroundings and explain them with data. And maybe you have wondered how you can extract this data.

This article explains how to capture multiple sensor data from an Arduino and read it using Python and the library PySerial. The Arduino I’ll use is the NANO 33 BLE, a microprocessor equipped with…


Using colors to predict whether this is Pikachu or Bulbasaur

The deployment environments of a machine learning (ML) model are changing. In recent years, we went from locally training models and running them on standalone scripts to deploying them in massive and specialized setups. However, the industry hasn’t been focusing only on large-scaled-productionized ML, but also its small, portable, and accessible counterpart — for machine learning has found a place in embedded systems.

Improving machine learning involves more than making the algorithms smarter and larger. As the field improves, there has also been an improvement in their speed, size, and computational efficiency. …


Serving TensorFlow.js’ Toxicity Detection model using Google Cloud

Feature image by Ben White on Unsplash

Like a broken record, I often find myself repeating the phrase “a deployed machine learning model is a happy model.” While a bit inaccurate (because models don’t have feelings yet), the idea behind this thought is that — and this is my opinion — an ML model shines when it is accessible and deployed out there.

This article shows how to deploy a pre-trained toxicity detection model in TensorFlow.js using Node.js and Google Cloud’s Cloud Run. But before getting there, let me describe the tools we will use.

About TensorFlow.js

TensorFlow.js is TensorFlow JavaScript’s counterpart library for the training, execution, and deployment…


Anomaly detectors, rule-based systems, fallback options, and common sense

Photo by Will Myers on Unsplash.

The Internet is a sea of information. Whenever you have a question, you visit Google and ask: “How to make a pancake?” “What’s the best Pokemon?” “What are things I should keep in mind while dealing with fraud?” One of these is not like the other, right? At the end of the day, we all know Pikachu is going to win. Jokes asides, I would like you to read that last question and make a mental list of things you believe someone should keep in mind while using data to deal with fraud; I’ll come back to the list later.


Testing and comparing Android’s ML acceleration with a MobileDet model

As the requirements for more private and fast, low-latency machine learning increases, so does the need for more accessible and on-device solutions capable of performing well on the so-called “edge.” Two of these solutions are the Pixel Neural Core (PNC) hardware and its Edge TPU architecture currently available on the Google Pixel 4 mobile phone, and The Android Neural Networks API (NNAPI), an API designed for executing machine learning operations on Android devices.

In this article, I will show how I modified the TensorFlow Lite Object Detection demo for Android to use an Edge TPU optimized model running under the…


Wander Data

Using R and soundgen to visualize the spectrogram and loudness of places I’ve visited

At the risk of sounding like a broken record (that’s an audio pun right there), I have to start this piece by saying that for the last year I’ve been backpacking. During this adventure, I’ve seen wonderful places, tasted extravagant flavors, and heard many sounds.

To shortly give you an anecdote, one night, I was at a camp in New Zealand, and the only thing I could hear was the smooth and serene sound of a nearby stream. And it got me thinking, “how would this tone look like?” So I recorded a short sample of the sound with the…


Training of CNNs in TensorFlow, object detection models in Google Cloud, and visualizing of activation maps in TensorFlow.js

© 2020 Pokémon

Our whole existence is a never-ending riddle. Are we the only ones in the universe? What’s the point of life? Is a neural network better than Ash at recognizing Team Rocket? The first two are non-trivial questions that keep many scientists and philosophers up at night. The last one, however, does not let me sleep. In this article, I’ll attempt to answer it.

These days I’ve taken some of my lockdown time to watch the first season of the Pokemon show (it is not like I need an excuse anyway). As I watched Ash and friends embark on their adventures…


Building a web service to serve a MobileNet object detection model with TensorFlow Go.

Photo by Jannis Brandt on Unsplash

The term TensorFlow goes beyond Python and neural networks. Behind that trendy word, there’s a complete ecosystem made of several frameworks, projects, and even hardware. One of these projects is TensorFlow Go. This TensorFlow API for Go excels at loading and deploying models within a Go program, models created with the Python counterpart. In this tutorial, we will see an example of this. The goal here is creating a web server in Go that serves an object detection model trained in TensorFlow.

Installing TensorFlow Go

Installing TensorFlow Go requires downloading the package using

$ go get github.com/tensorflow/tensorflow/tensorflow/go

Additionally, you need to install the…


Learning more about me with Foursquare data

One of the many 7-Elevens. Photo by me (https://www.instagram.com/juandesr/)

Name a better pair than 7-Eleven and Asia. I’ll wait…

Ok, fair enough. Food, culture, and surreal cities are also valid choices. But my point still stands. 7-Eleven is, in my opinion, a staple of the lifestyle of certain Asian countries. There, you can find (almost) anything you need. Did you just land and need a SIM card? Go to 7–11. Do you need water because security made you empty your bottle? Go to 7–11. Hungry and want a cheap (and tasty) breakfast? You already know.

During my traveling adventures in this beautiful continent, I’ve quite often found solace (and…


Using visualizations, maps, time series and Google Trends data to describe this event

San Juan, Puerto Rico. Photo by me.

Since late December 2019 until early January 2020, the southwestern region of the island Puerto Rico has been experiencing a series or swarm of earthquakes, leaving in its wake a trail of destruction and uncertainty among Puertorricans. According to the United States Geological Survey (USGS) office, what’s causing these earthquakes is the convergence of the North American and Caribbean plates. The North America plate, located north of Puerto Rico, is converging with the Caribbean plate, while in the south, the Caribbean plate subducts under Puerto Rico at the Muertos Trough (source).

In this article, we’ll explore several attributes of these…

Juan De Dios Santos

Data storyteller. Also, I like Pokemon. https://juandes.com, @jdiossantos.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store