Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "Ethical Content Filtering" use case to WebNN specs #253

Closed
wants to merge 4 commits into from

Conversation

humeranoor
Copy link

@humeranoor humeranoor commented Feb 16, 2022

As discussed in the issue: #236, we have been working on machine learning-based content filtering; and notice 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".

With this PR, I submit the use case on "Ethical Content Filtering" for addition to the WebNN specs.

Thanks,
Humera
https://de.linkedin.com/in/humeranoor
https://eyeo.com/


Preview | Diff

@humeranoor
Copy link
Author

For reference, I've ensured that my github is connected to my w3c account (please see screenshot)
w3c-github

FYI: W3C Contact at Eyeo: Shwetank Dixit (s.dixit@eyeo.com)

@humeranoor
Copy link
Author

Hi @anssiko,
Any updates on this PR? It's with reference to #236.

Do you need anything else from my side?

Thank a lot.
Best,
Humera

@anssiko
Copy link
Member

anssiko commented Mar 14, 2022

Thanks for this proposal. This PR is currently in the WG's review queue and we hope to get to it soon.

You may be interested in taking part in the ethical considerations workshop early April organized by the WG. @dontcallmedom to connect.

@humeranoor
Copy link
Author

humeranoor commented Mar 15, 2022

Thanks Anssi for the updates and the tag to the brainstorming session.

Looking forward to it.

Best,
Humera

@humeranoor
Copy link
Author

Hi,
As discussed in the WebML WG Teleconference – 21 April 2022, we're providing a couple of concrete suggestions to update the WebNN API that will provide support in implementing ML-based content filtering.

Use Case 1: Support for network level request filtering through WebNN's API

We see a strong use case for providing extension developers – and hence users – to use ML to filter network level requests. Being able to filter these requests allows users to modify their browser in a way to filter out network requests to tracking providers, malware, ads and generally undesired content (e.g. for parental control). To this day the WebRequests API provides this functionality and makes it available to extension developers so they can filter network requests before they are made and filtering content can be achieved with or without ML. However with the WebRequest API being deprecated with the rollout of MV3, it will be replaced by the DeclarativeNetRequest API. The latter relies on pre-defined content filtering rules (i.e. filter lists) and doesn't allow for network requests to be blocked on the fly. For ML to be still relevant and usable in the space of network level content filtering, browsers need to provide an interface for ML models to be able to make real time decisions about allowing or blocking network requests. Otherwise ML can't be used in that space anymore.

Hence we're advocating for webnn to provide an interface for:

  • Listening to network requests for browser navigation (loading iframes, navigating to websites), asset loading (js, css, images), XMLHttpRequests etc.
  • Allowing to run inference on network level requests before the requests are made
  • Allowing to filter network level requests based on the outcomes of running inference

It is important to be able to run inference before requests are made so users are fully protected from loading unwanted assets proactively instead of reacting to unwanted or potentially harmful assets retroactively.

Use Case 2: Support for DOM access through WebNN's API

In addition to the use case of running inference on pending network level requests (see above), we see the same value in being able to run inference on the DOM structure of websites. This allows users to filter undesired content (tracking, ads, malicious content, parental control) which isn't reliant on external assets (as covered by network level requests) but on organic or disguised – and hence already loaded – content. This functionality is currently already provided to extension developers by the ability to inject scripts into websites. However execution of DOM-based content filtering is limited to said injected scripts and hence very limited in the scope of ML (e.g. limited to running a javascript-based model within the scope of the target website). webnn is in a position to give more powerful and performance friendly ways for users and extension developers to achieve DOM-based content filtering using ML.

Hence we're advocating for webnn to provide a interface for:

  • Running inference against a website's DOM structure
  • Running inference against specific DOM nodes

Having these updates will have a huge positive impact in supporting ML-based content filtering and thus in turn keeping users in control of their internet experience.

Please let me know if you have further questions or suggestions.

Thanks,
Humera

@anssiko
Copy link
Member

anssiko commented May 19, 2022

Thank you @humeranoor. Time allowing, we'll discuss your concrete suggestions on today's call as part of Open issues and pull requests review.

@anssiko
Copy link
Member

anssiko commented Jun 9, 2022

Thank you @humeranoor for presenting this use case at our 2022/06/02 meeting.

Per our discussion, for Use Case 1, it seems W3C Web Extensions Community Group would be an appropriate place to discuss improvements to APIs such as webRequest and declarativeNetRequest.

For Use Case 2, WebNN API adheres to the web's security model that builds upon the same-origin policy. It seems like the request here is to grant extension APIs more powerful access to the DOM structure. I believe also this request is appropriate for the W3C Web Extensions Community Group that is chartered to define "a model, permissions, and a common core of APIs for web browser extensions".

Thanks for sharing this use case and specific requirements with us. I'm inclined to propose we close this PR given the requirements are better addressed elsewhere on the web platform. Thank you for your work on this browser extension!

@humeranoor
Copy link
Author

Thank you @anssiko for having me in the meetings and present our case. However, before closing the PR, I want us to take a step back and check out the original PR.

The original PR is about adding a use case on "content filtering" to the documentation. We believe, it is very important to have this use case in there, because it opens the way to have these solutions implemented in the relevant APIs (which may be other than webNN). And it's important to have these provisions because that allows the users to be in control of a fair web and see what they want to see.

@anssiko
Copy link
Member

anssiko commented Jun 10, 2022

Thank you @humeranoor for this additional context.

We have adopted a use case-driven specification development model for the WebNN API specification and should we adopt this use case at this point it’d block our Candidate Recommendation (CR) release (tracker at #240) until we can validate this use case is implementable. We’re chartered to take the spec to CR soon. Based on what we hear this use case would depend on WebNN and also extension APIs that are changing and need more work.

I see two additional paths:

We can label this use case as post-CR so that we consider it in a future release of the WebNN spec subject to the extension APIs availability.

Alternatively we could abstract the use case as such it’d be implementable with current Web APIs shipping in browsers. The ”activates her content-filter” part implies browser extension and introduced a dependency on APIs that are changing.

Please let us know your preference.

@anssiko
Copy link
Member

anssiko commented Jun 16, 2022

@humeranoor the WG discussed this use case again on our call 2022/06/16 and felt this use case is valuable and that there's wider interest, even if currently out of scope given our charter and dependencies external to the WebML WG.

We welcome this use case as a proposal for future work and have created a dedicated repository where to submit the proposal (for example, reusing the material and comments in this PR): https://github.com/webmachinelearning/proposals

We look forward to your submission and thank you for your proposal. Please do not hesitate to reach out to us if you have any questions.

@humeranoor
Copy link
Author

Thank you @anssiko. Based on your and the WG's recommendation, I'll move this to https://github.com/webmachinelearning/proposals.

Thanks a lot.

@anssiko
Copy link
Member

anssiko commented Jun 20, 2022

Thanks @humeranoor, we look forward to your submission!

@wchao1115
Copy link
Collaborator

Thank you @humeranoor for the use case. It's a very good callout. For additional context, using ML for content filtering has become increasingly relevant in the online gaming scenario, and not only for privacy protection but extended to cover scenarios such as cyber bullying. So, it's definitely a growing area of concern where ML can make a real difference in the user experience.

@humeranoor
Copy link
Author

Thank you @wchao1115 for your feedback. Cyber bullying is definitely another very important topic where ML can help - after all it's all about user protection and safety online.

@anssiko
Copy link
Member

anssiko commented Aug 26, 2022

Discussion on this proposal continues in webmachinelearning/proposals#4

@humeranoor feel free to close this PR when the move to the proposals repo is complete.

@humeranoor
Copy link
Author

Thanks @anssiko, the proposal is moved to the proposals repo, but I think ultimately we'll need this PR for final implementation. I'm leaving it open till our next call, if that's OK.

@anssiko
Copy link
Member

anssiko commented Sep 8, 2022

Closing this PR per https://www.w3.org/2022/09/08-webmachinelearning-minutes.html#t07, discussion continues in webmachinelearning/proposals#4

@humeranoor for web extensions proposals, you could consider joining one of the WebExtensions Community Group meetings and introduce your proposal for APIs such as webRequest and declarativeNetRequest.

@anssiko anssiko closed this Sep 8, 2022
@anssiko
Copy link
Member

anssiko commented Sep 8, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants