Artificial neural networks are a type of computational model that can perform learning and identification on data and some other tasks like, classification, regression, clustering, and generation tasks. Many applications of DL include computer vision, natural language processing, speech recognition, and recommender systems. However, it must be noted that training of neural networks is not easy and can be quite time-consuming particularly for newcomers. Always topped up with the challenges of getting access to quality hardware, software and datasets.
In this article, we will describe the web application which helps everybody create, train, and test neural networks with the only help of the Web-browser. The aim of the online training environment is using ConvNetJS, an online deep learning framework implemented in JavaScript. We will also explain and demonstrate how to use the web-based training environment to create and train the atrificial neural networks of various tasks.
What is WebNN?
WebNN is a fundamental tool in webpage development that empowers the web developer to execute machine learning computations on several form of hardware, the CPU, GPU, or namely AI co-processor. It came out that WebNN is easy to use, flexible. And it supports integration with other generally used web standards and frameworks.
WebNN is founded on the computational graph that defines the flow of data and computations through a neural network. WebNN also offers the set of the built-in operations that embraces the most general types of the artificial neural network layers and activation functions. These operations can be utilized to build and run a graph computation by the Web developers on the browser. WebNN also supports exporting models in pre-trained formats of frameworks like TensorFlow, PyTorch, and ONNX.
Why use WebNN?
WebNN offers several benefits for web-based AI applications, such as:WebNN offers several benefits for web-based AI applications, such as:
Performance:
WebNN makes it possible to execute machine learning computations of web applications on the optimum equipment available in the device, including GPUs, and AI accelerators. This can be substantially better than using standard JS engines, or WebAssembly when it comes to AI inference speeds.
Privacy:
With WebNN, various machine learning computations are processed on the device where the web application is being run without transferring any data to any cloud or downloading any application. This can improve the security of the user data and also could help to lessen the network bandwidth and the value required.
Portability:
WebNN is a web standard that is implemented within the context of internet browsers and doesn’t need plugins or extensions. This could make Internet based AI applications more available and distribute AI applications for interaction with other web services and other Web 2.0 features.
How to use WebNN?
WebNN is still under active development and not as of the time this paper is being written integrated into most browsers. But, for now. You can implement WebNN through the experimental implementation that some of the browsers such as Chrome or Edge offer. WebNN is also available as a WebNN polyfill which mimics its API on web technologies including WebGL/WebGPU using JavaScript.
Steps to use WebNN
To use WebNN, you need to follow these steps:
- Step 1: Instantiate a WebNN context or just context, which is the connection between the web application and the physical machine.
- Step 2: Explain what a computational graph is and understand that it based on nodes (operation) and edges (tensor).
- Step 3: Construct the computational graph which compiles the execution plan to get to the target architecture.
- Step 4: Although no specific name is given to this last section, it can be referred to as the computational graph execution, which actually performs the machine learning computations.
Examples
WebNN is still in the development phase, and the tool is still not available for usage in any stable browser’s version. However, you can try some experimental demos and samples that showcase the potential of WebNN, such as:
- Face Detection: An informataion technology LIVE FACE RECOGNITION: Real time face detection using neural network model & WebNN1.
- Speech Command Recognition: A web speech recognition application employing a complete Neural Network model with WebNN.
- Image Classification: An application that categorizes images with several types of neural network models and WebNN.
- WebNN Samples: A set of web samples that can show how WebNN can be used to run different forms of neural networks.
ConvNetJS: AI Applications of Deep Learning in Your Browser
ConvNetJS is the lightweight deep learning library that is implemented solely in JavaScript. First, it was coded by Andrej Karpathy, the PhD student, at Stanford University. And later contributions from the community have been made. ConvNetJS enables the users to define and solve their neural networks in the JavaScript language and without involving any installation of the given software or compilation. As well as GPU support. All that a user can do is to open a tab and commence with training.
It implements popular network layers such as the fully connected layers, the convolution layer. The pooling layer, and non-linear transformations such as ReLUs among others; other features include dropout as well as batch normalization. It also supports various kinds of cost, including the classification cost (SVM/Softmax) and regression cost (L2).
ConvNetJS also offers several browser demos that illustrate how to use the library to train neural networks for different tasks, such as:
- Using a CNN, classify the MNIST digits
- CIFAR-10 database of images classify using a convolutional neural network
- Categorize the toy data with a two dimensional neural network
- Neutralize 1-D toy data with a neural network with an interacted manner
- Autoencoder is to be trained on data containing MNIST digits
- Deep Q learning which is a sub category of reinforcement learning
- Neural network draws a picture
Web-based Training Environment
The proposed web-based training environment is a web application implemented using the freely available ConvNetJS as the back-end. Which helps the users to create, train and test a artificial neural network. The web-based training environment consists of three main components:
Network Editor
GUI and Designer & Configurator Where parameters of each layer of the POS Neural Net can be set by dragging the layers and shaping its position and properties. Users can also save/Load currentartificial nueral network settings in a json file.
Data Manager
A program for the Exchange of Datasets for training and testing of Neural Nets which permit the user to upload/download datasets in use of Neural Nets. Users can also input the dataset or use the standardized ones like the MNIST, CIFAR-10, ImageNet dataset. And can also generate the data synthetically like random noise, sinusoidal waves and spirals.
Trainer
A module that enables the user to train as well as test the neural networks by utilizing the network configuration alongside the dataset of the user’s preference. It also allows the users to track the procedure of training and also certain parameters. Such as the training loss, the accuracy score and the confusion matrix, among others.
Conclusion
We have described a web-based training environment based on artificial nueral network which allows users to build, train and test feed-forward artificial neural networks only through a web browser. The WBT training environment exploits ConvNetJS, an open Java framework for deep learning. Which runs fully in the browser, and WebNN, a JS API. That lets the web developers quickly accelerate the machine learning computations on all possible devices. We outlined some examples of how to apply the web-based training environment creating. Training neural networks for diverse tasks, including image recognition, reinforcement learning, and autoencoding. The authors considered that the web based training environment is a viable tool. For teaching and experimenting with the neural nets as well as for building and implementing the web based AI solutions.