webmachinelearning / proposals Goto Github PK
View Code? Open in Web Editor NEW🚀 Proposals for future work
🚀 Proposals for future work
Currently, there is a gap when it comes to web standards for supporting content blocking and filtering. With this proposal, we suggest to add content filtering as a use case in the webNN specifications.
(Moving the original PR from webNN repository to the more general proposals repo.)
We at eyeo have been working on machine learning (ML)-based content filtering and have pioneered the use of ML in ad filtering. As discussed in the issue previously, we highlighted that there is a gap when it comes to web standards for supporting content blocking and filtering. This hinders in implementing solutions that upholds the W3C ethical principle that "People should be able to render web content as they want".
Hence we propose to add a use case on “Content Filtering” to existing use cases: https://webmachinelearning.github.io/webnn/#use cases-application
ML-based content filtering can be applied to a number of use cases like intrusive ad filtering, user privacy protection, cyber bullying detection and avoidance, clean-page user experience for specially-abled users.
We propose to add a use case in webNN specs as follows:
Content Filtering
A user is cautious about her online privacy and wants to be protected from the online trackers, malware and any third-parties present on the web pages that she visits. The ML-based content-filter [REF] identifies and blocks the third party content, while allowing her to safely surf her favorite websites. Thus she is safe and more in control of her online experience [REF2].
[REF] Ad-blocking: A Study on Performance, Privacy and Counter-measures
[REF2] Point [2.12] of the W3C Ethical Web Principles
With this proposal, we submit the use case on "Content Filtering" for addition to the WebNN specs. Having this use case in the specs will allow us as the web community to not only allow implementation of ML-based content filtering but also influence the shaping of web extensions and discuss improvements to APIs such as webRequest and declarativeNetRequest.
Looking forward to next steps.
Please let me know if you have any questions or comments.
Thanks,
Humera
[email protected]
cc: @anssiko
ML on the client supports many use cases better than server-based approaches, and with lower cost for the application provider. However, clients can vary significantly in capabilities. A hybrid approach that can flexibly shift work between server and client can support elasticity and avoid the problem of developers targeting only the weakest clients’ capabilities.
The overall goal of hybrid AI is to maximize the user experience in machine learning applications by providing the web developer the tools to manage the distribution of data and compute resources between servers and the client.
For example, ML models are large. This creates network cost, transfer time, and storage problems. As mentioned, client capabilities can vary. This creates adaptation, partitioning, and versioning problems. We would like to discuss potential solutions to these problems, such as shared caches, progressive model updates, and capability/requirements negotiation.
For the end user, most of the existing WebNN use cases share common user requirements:
Even though it is not a primary requirement, developer ease of use is a factor for adoption. An approach that easily allows a developer to shift load between the server and the client using simple, consistent abstractions will allow for more Hybrid AI applications to be developed faster than one with completely different programming models.
Current implementations of hybrid AI applications (see User Research and References) have the following problems when targeting many of the WebNN use cases:
This is a proposal to define and implement a small number of standalone APIs for individual compute-intensive operations (like convolution 2D and matrix multiplication) that are often the target of hardware acceleration. The APIs would be atomic, and would not be tied to a graph or model loader implementation. It would be up to javascript libraries or WASM to call into these low-level APIs.
Across many common machine learning models, there are a handful of compute-intensive operations that may account for 90-99% of inference time, based on the benchmarking done for Web NN. If these few operations were offered as standalone APIs, hardware acceleration could give much of the performance benefit with a small simple API surface, without needing to define all of the many other instructions and graph topology needed for a higher-level API like a graph or model loader. As a benefit, it ought to be faster to get this handful of APIs shipped.
JavaScript ML libraries would need to be updated to take advantage of the APIs, just like they can take advantage of Web GL today.
Image classification typically uses convolution and matrix multiplication. With hardware accelerated versions of these two operations, the performance boost would be close to the optimal that could be achieved with a complete graph or model execution API.
Maybe the closest example is Web GL compute shaders, except that these operations would be much simpler.
I'm not qualified to write an actual proposal here so this is just a placeholder issue for discussion about supporting JAX-inspired JS frameworks. I originally created an issue in the WebNN repo was advised by @anssiko to create an issue here instead.
The thrust of the original issue was that JAX is becoming more popular, and that as the foundations of WebNN/WebML are built, it may be important to take into account its growing popularity so that highly-performant "JAX.js" type frameworks are possible in the future.
In the original issue I said:
IIRC, WebNN's initial focus is on inference for networks trained using non-web frameworks, which makes sense, but this question is more about the long-term trends, given the seeming possibility of JAX-like frameworks becoming the norm.
But I'd also like to add that gradients are required for the "guiding" done by models like VQGAN+CLIP. It seems like guiding embeddings/latents/inputs via models like CLIP is becoming more popular. It may end up being important for WebML to support this type of "inference", rather than just purely forward-prop inference, but maybe it's too early to say. Either way, allowing for the possibility of this when designing the foundations seems like a good idea.
Data Processing API for Web
The needs are mainly addressed by the fact that the deep learning models can not work independently and the data process is needed for both the inputs and outputs of one model.
Since we are drafting the web-dl spec, we should also pay attention to a standard data process spec. Furthermore, the data process should be compatible with js syntax.
const [trainData, testData] = rawImgDatas.map(it => it.resize([224, 224]).blur()).shuffle().splitTrainTest();
const tablarData = rawTablarData.head(10).shuffle();
We are currently working on datacook to implement some data-related processing methods based on tfjs & danfo. And we finish the API level design here and re-implement some methods natively within browsers.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.