Web applications starting from simple form data capturing in the past has grown up to a complex and dynamic applications. Today this application are becoming more smarter with machine learning libraries. In this article we will see web browser based machine learning libraries.
Nowadays web applications are gaining more popularity over that of desktop application as it can be easily deployed and modified easily and instantly. Now machine learning has joined together with this application to give them more power. There are two ways to use ML in web application.
- ML as a client side component
- ML as a server side component
Both of them have their own pros and cons, using ML in server side needs each request to be sent to the server and process which leads to a network bottleneck and also introduces latency in the application. But using it in the client side can overcome the above issues and at the same time client side systems nowadays have better processing capabilities. We will be exploring on web browser based machine learning libraries.
There are many such libraries developed and used like Tensorflow.js, ml5.js, brain.js, convnet.js, etc… We will discuss in detail with Tensorflow.js.
- The ML models can be built and developed from scratch using powerful API’s.
- This can be used to run the existing TensorFlow modules in the browser.
- We can also retain the existing modules
There are many ways to include TensorFlow.js in the web application the easiest way is by using CDN as
<script src = https://cdn.jsdelivr.net/npm/@firstname.lastname@example.org/dist/tf.min.js > </script>
We can also do using NPM as
npm install @tensorflow/tfjs
You can refer https://www.tensorflow.org/ for more details like demo and sample codes.