MNIST in the browser

MNIST in the browser

Using AI (or ML) models in practice has been a challenge for years. Yes, many nice examples do exist, but in our experience, most companies first face the challenge of bringing their data together, then the challenge of building and validating useful models,

Using AI (or ML) models in practice has been a challenge for years. Yes, many nice examples do exist, but in our experience, most companies first face the challenge of bringing their data together, then the challenge of building and validating useful models, and finally the challenge of deploying these models wherever they are most needed (be it in-house, in the cloud, or on the edge).

However, each of these challenges has become easier and easier over the last few years. None of them are exactly trivial yet, but tools abound for each step of the process. Even deploying relatively complex convolutional neural networks in the browser turns out to be pretty straightforward: let me share how.

1. Training the model: handwritten digit recognition

To demonstrate CNN deployment in the browswer we pick a simple task that CNNs often excel at: image recognition. For the sake of demonstration, we focus on the well-known MNIST dataset. This tutorial shows how to use Microsoft’s Cognitive Tookit to train a model that has pretty impressive performance. However, you don’t really need to train the model yourself; it is available for direct download in ONNX format in the ONNX Model zoo.

ONNX is an open format built to represent machine learning models. It is a great unified way of storing trained models (including pre- and post- processing) created using different tools (pyTorch, tensorflow, sklearn, etc.).

2. Model conversion: WebAssembly for easy deployment.

Now that we have a trained digit recognition model, we want to use it directly in the browser. One option to do so would be to use the javascript ONNX runtime (ONNX.js). However, we prefer first transpiling the ONNX to a WebAssembly executable (.WASM) before deployment.

artificial-intelligence data-science neural-networks webassembly web-development

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Introduction to Artificial Neural Networks for Beginners

Introduction to Artificial Neural Networks for Beginners. Understanding the concepts of Neural Networks.

50 Data Science Jobs That Opened Just Last Week

Data Science and Analytics market evolves to adapt to the constantly changing economic and business environments. Our latest survey report suggests that as the overall Data Science and Analytics market evolves to adapt to the constantly changing economic and business environments, data scientists and AI practitioners should be aware of the skills and tools that the broader community is working on. A good grip in these skills will further help data science enthusiasts to get the best jobs that various industries in their data science functions are offering.

Applications Of Data Science On 3D Imagery Data

The agenda of the talk included an introduction to 3D data, its applications and case studies, 3D data alignment and more.

Reducing the Artificial Neural Network complexity by transforming your data

A practical example in a hard-to-classify dataset. The need to reduce the complexity of a model can arise from multiple factors, often to reduce the computational requirements.

Intuitively, How Do Neural Networks Work?

Intuitively, How Do Neural Networks Work? - The term “Neural Networks” may seem mysterious, why is an algorithm called Neural Networks? Does it really mimic real neurons, and how?