This article is taken from blog.bitsrc.io by Jonathan Saring, Heart of the Machine.

In building Bit, the author explored and experimented with the possibility of using Javascript and machine learning together, and found some elegant libraries that can integrate Javascript, machine learning, DNN, and even NLP.
“Wait, what?? That’s a terrible idea!”

When I first talked to our NLP principal researcher about this concept, she said this. Maybe she’s right, but it’s also a very interesting concept that’s been getting more attention in Javascript lately.

Over the past year, our team has been building Bit (https://bitsrc.io/), which makes it much easier to build software from components. As part of this work, we developed ML and NLP algorithms to better understand how code is written, organized, and used.

While most of the work is done in languages like Python, Bit is in the Javascript ecosystem, both in its front and back end communities.

This interesting intersection led us to explore and experiment with the strange possibilities of using Javascript and machine learning together. Through our research, there are some neat libraries that combine Javascript, machine learning, DNN, and even NLP.



1. Brain.js

Brain.js is a Javascript library for neural networks to replace the (now deprecated) “Brain” library, which can be used with Node.js, or in Browser (mind computation), and provides different types of networks for different tasks. The following is an example of training the network to recognize color contrast.

Link: github.com/BrainJS/bra…

Brain.js is trained to recognize color contrast

2. Synaptic

Synaptic is a Javascript neural network library for Node.js and browsers that allows you to train first and even second order neural network structures. The project includes built-in architectures such as multilayer perceptrons, multilayer long and short-term memory networks, liquid state machines, and trainers capable of training real networks.

Link: github.com/cazala/syna…

Synaptic image filter perceptron

3. Neataptic

This library provides rapid neuron evolution and back propagation for browsers and Node.js, and has some built-in networks including perceptron, LSTM, GRU, Nark, and more. Here is a simple training tutorial: https://wagenaartje.github.io/neataptic/docs/tutorials/training/.

Link: github.com/wagenaartje…

Target seeks AI demo

4. Conventjs

This popular library, developed by Stanford PhD, has not been maintained for the past 4 years, but it is one of the most interesting items on the list. It is a Javascript implementation of neural networks that supports generic modules, classification, regression, an experimental reinforcement learning module, and even the ability to train convolutional networks for processing images.

Link: github.com/karpathy/co…

A Conventjs demonstration of 2D toy classification was carried out with 2 layer neural network

5. Webdnn

This Japanese-made library is used to run deep neural network pretraining models on a browser, and it runs very fast. Since running DNN on a browser can consume a lot of computing resources, the framework optimizes the DNN model to compress model data and accelerate execution through JavaScript APIs such as WebAssembly and WebGPU.

Link: github.com/mil-tokyo/w…



6. Deeplearnjs

This popular library allows you to train neural networks in a browser, or run pre-trained models in inference mode, and even claims to be used as a web version of NumPy. With an easy-to-read API, the library can be used for the authenticity of useful applications and is actively maintained.

Link: github.com/tensorflow/…



7. Tensorflow Deep Playground

Deep Playground is an interactive visualization of neural networks written in TypeScript using D3.js. Although this project contains a very basic Tensorflow playground, it can be used for different purposes, or as an educational function with impressive different uses.

Link: github.com/tensorflow/…

Tensorflow playground

8. Compromise

This very popular library provides “modest natural language processing in JavaScript”. It is very basic and straightforward, and can even be compiled into a small file. For some reason, its modest “good enough” approach makes it the preferred choice for almost any application that requires basic NLP.

Link: github.com/spencermoun…

The Compromise reminds us that English is really simple

9. Neuro.js

This is a great project that provides a Javascript library framework for deep learning and reinforcement learning for browsers. It implements a machine learning framework based on full-stack neural networks supported by extended reinforcement learning, and is considered by some to be a successor to convnet.js.

Link: github.com/janhuenerma…

10. mljs

A set of libraries developed by the MLJS organization that provide machine learning tools for Javascript. It includes supervised and unsupervised learning, artificial neural networks, regression algorithms, and support libraries for statistics, mathematics, and more. Here’s a short guide: hackernoon.com/machine-lea…

Link: github.com/mljs



11. Mind

A flexible neural network library for Node.js and browsers that learns to make predictions, use matrices to process training data and enable configurable network topologies. You can also plug and play the learned “Mind”, which is useful for your application.

Link: github.com/stevenmille…



Other important libraries:



Natural

Node.js is an actively maintained library that provides tokenization, stem extraction (to reduce unnecessary roots), classification, phonetics, TF-IDF, WordNet, string similarity, and more.

Link: github.com/NaturalNode…



Incubator-mxnet

Apache MXNet is a deep learning framework that allows you to combine symbolic and imperative programming with graphical optimization layers online to improve performance. Mxnet.js brings a deep learning reasoning API to the browser.

Link: github.com/apache/incu…



Keras JS

The library runs the Keras model in a browser, uses WebGL, and supports gpus. Because Keras uses many frameworks as backends, models can also be trained in TensorFlow, CNTK, and other frameworks.

Link: github.com/transcrania…



Deepforge

A deep learning development environment that enables you to quickly design neural network structures and machine learning pipelines, and reproduce experiments using built-in version control. It’s worth a try.

Link: github.com/deepforge-d…



Land Lines

It’s not so much a library as a very cool demo/web game based on the Google Chrome experiment. Although I’m not sure how to handle it, it will certainly make for the most enjoyable 15 minutes of your day.

Link: lines.chromeexperiments.com/

Land Lines from Google



What’s next?

Clearly, Javascript is far from being the language of choice for machine learning. However, common problems such as performance, matrix manipulation, and rich and useful libraries are slowly disappearing, narrowing the gap between common applications and useful machine learning.



IO /11-javascri…