VOOZH about

URL: https://thenewstack.io/brain-js-brings-deep-learning-to-the-browser-and-node-js/

⇱ Brain.js Brings Deep Learning to the Browser and Node.js - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2022-08-11 07:40:27
Brain.js Brings Deep Learning to the Browser and Node.js
Frontend Development

Brain.js Brings Deep Learning to the Browser and Node.js

Brain.js is a JavaScript library for deploying a neural network in the browser or on Node.js. We interview the lead developer.
Aug 11th, 2022 7:40am by Richard MacManus
👁 Featued image for: Brain.js Brings Deep Learning to the Browser and Node.js
Feature image via Shutterstock.

Brain.js is a JavaScript library for deploying a neural network in the browser or on Node.js. It uses a computer’s GPU (graphics processing unit) for calculations, or pure JavaScript when GPU isn’t available.

The lead developer of Brain.js is Robert Plummer, by day a full-stack engineer at iFIT. I reached out to him to find out more about Brain.js, including its beginnings, what it’s currently used for, and plans for the future.

As the name of Plummer’s project suggests, neural networks are computer systems that mimic how a biological brain works. A neural network is made up of connected nodes, loosely modeled on the neurons in a brain. Also like brains, neural networks need to be trained on data that is input into the system — a type of machine learning known as deep learning.

The key benefit of Brain.js is that it uses the world’s most popular web programming language, JavaScript. Also, according to an IBM developer tutorial, a neural network-powered app built with Brain.js “can be created with surprisingly little code.”

Use Cases

So what are the use cases for neural networks in a browser? According to Plummer, they are “unlimited,” but he gave a couple of examples from the Brain.js community. “I’ve seen people use it for managing seeds in a farming community,” he said, “and I’ve seen people use it for predicting stock market prices or weather within a location.”

He cautioned that at this stage, data fed into a Brain.js-powered web app requires supervised training. Unsupervised learning and reinforcement learning have not yet made it into the library, he said.

I asked how Brain.js compares to programming neural networks in Python or R, two languages commonly used in machine learning. Does JavaScript have the same level of power?

Plummer confirmed that using JavaScript is “just as powerful,” but he noted that “there is some overhead” to using the number-crunching parts. However, he said, “we offer the capability of using the GPU, which is GLSL [OpenGL Shading Language], which is a subset of C++.” This is “very similar” to working with Python or R, he added.

History of Brain.js

Although Plummer is the lead developer of Brain.js and has been working on it since 2016, the library has its roots in a previous project created by Heather Arthur, called brain. Arthur had described her project as “a simple neural network library.” However, she stopped maintaining it around 2014. After some discussion among the brain community, Plummer cloned Arthur’s project in January 2016 — and thus Brain.js was born.

As an aside, Heather Arthur wrote a blog post in 2017 explaining why she abandoned not just brain, but all of her GitHub projects. It turns out that each one was a “personal side project” and she found it difficult to maintain them all, since she had no “organizational support.” There was “a massive amount of tedious effort,” she continued, which led her to declare “bankruptcy on GitHub.”

Perhaps Arthur was ahead of her time with brain, but fortunately, her work inspired a group of JavaScript developers (Plummer among them) to continue — and extend — the project.

As for why Plummer became interested in brain and wanted to continue it, he told me that until Arthur’s project, he’d “never seen neural nets developed as simply and understandably.”

“JavaScript is a beautiful language,” he said. “It’s very simple, and there’s no reason that it can’t be very performant. There are some things that are still kind of holding it back, but that’s slowly but surely moving forward.”

How Brain.js Has Evolved Since the Fork

It’s been six and a half years since Plummer started Brain.js, so I asked how different is it now from Arthur’s original project?

“In its original incarnation, it was just a feedforward neural net with the ability to output that as a single algorithm — a single trained neural net within basically one big long, long, line of code,” he replied. A feedforward neural net is a type of neural net where node connections do not form a loop.

“Since then,” continued Plummer, “we’ve added GPU as well. So you can write in JavaScript and that compiles to GLSL (or a subset of C++); it took two and a half to three years to make that work.”

Ironically, Plummer seems to have a similar problem to Arthur in terms of maintaining the Brain.js project — a lack of support. He’s the only active developer on the project and has to work on it outside the hours he spends on his day job.

“I’m quite busy with my day job and I don’t get to it as frequently as possible,” Plummer said, regarding work on Brain.js. “I’ve had developers come and go over the years. And I reach out to them, you know […] but for the most part, it’s just me.”

Plummer spends what little spare time he has mostly fixing bugs. But he’s also started working on “reinforcement neural nets, strongly typed,” which is a class of algorithms that aims to improve automatically based on experience.

JavaScript Heads: Try out Brain.js

A lot of deep learning projects will continue to use the likes of TensorFlow, or big company platforms like IBM Watson Studio or Google Cloud AI Platform. But if you’re a web developer wanting to try out deep learning inside the browser or on Node.js, then Brain.js is worth checking out. Especially if you have seeds to manage or stock prices to predict.

TRENDING STORIES
Richard MacManus is a Senior Editor at The New Stack and writes about web and application development trends. Previously he founded ReadWriteWeb in 2003 and built it into one of the world’s most influential technology news sites. From the early...
Read more from Richard MacManus
SHARE THIS STORY
TRENDING STORIES
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.