Code and models for the machine learning used in Privacy Pioneer
See the code
1. What Is in This Repo?
2. What Did We Do?
3. Links to Datasets and Final Models
4. What Libraries, Technologies, and Techniques Are We Using?
5. Known Issues
6. Thank You!
Privacy Pioneer is a browser extension for helping people understand the privacy implications of their visits to websites.
This repo contains everything machine learning-related to Privacy Pioneer:
The machine learning for Privacy Pioneer is developed and maintained by the Privacy Pioneer team.
We had to create a way to integrate Machine Learning into a browser extension. This brought up a few questions to answer:
The Privacy Pioneer extension is structured around distributing information about how websites are taking your data and sending it to third parties without your explicit consent or knowledge. Thus we want this machine learning functionality to run locally on a user's browser. This means that we need a small, fast, accurate model to be stored and running within the extension itself.
BERT is a pre-trained model for language understanding built by Google for search optimization. It uses neural networks and transformer architectures to improve results on Natural Language Processing (NLP) tasks. The original BERT paper created two models, bert-base-uncased (500mb model) and bert-large-uncased (1.2gb model). However, we decided to use smaller models because large models have both a large amount of data consumption and long analysis times. There are numerous smaller models that have been created that have fairly comparable analysis results. We chose to use TinyBERT as our pretrained model, weighing in at 59mb. As you can see below, it performs 1.2 billion floating point operations per section (actually a fairly small amount), which gives it a fast runtime of 9.4 times faster than bert-base-uncased. Yet, you can see that the average results on all of the datasets used for the TinyBERT study was a 77%, which is just slightly below the 79.5% of bert-base-uncased at almost 1/8th the size.
Here is a brief overview of the steps we took to get to our final models:
We now had a final model that met our requirements, we used Hugging Face and Tensorflow to convert our model (a PyTorch saved_model) into a tfjs GraphModel format. Thus, we had a model that was able to run in Javascript on the browser. We placed that model into the Privacy Pioneer extension, where it gets downloaded to the indexed-db and loaded into the browser for use when our extension is running.
Datasets:
Models:
Results: (note: each value is the Average F1 Score)

We would like to thank our supporters!
Major financial support provided by Google.
Additional financial support provided by Wesleyan University and the Anil Fernando Endowment.
Conclusions reached or positions taken are our own and not necessarily those of our financial supporters, its trustees, officers, or staff.
Code and models for the machine learning used in Privacy Pioneer
See the code
1. What Is in This Repo?
2. What Did We Do?
3. Links to Datasets and Final Models
4. What Libraries, Technologies, and Techniques Are We Using?
5. Known Issues
6. Thank You!
Privacy Pioneer is a browser extension for helping people understand the privacy implications of their visits to websites.
This repo contains everything machine learning-related to Privacy Pioneer:
The machine learning for Privacy Pioneer is developed and maintained by the Privacy Pioneer team.
We had to create a way to integrate Machine Learning into a browser extension. This brought up a few questions to answer:
The Privacy Pioneer extension is structured around distributing information about how websites are taking your data and sending it to third parties without your explicit consent or knowledge. Thus we want this machine learning functionality to run locally on a user's browser. This means that we need a small, fast, accurate model to be stored and running within the extension itself.
BERT is a pre-trained model for language understanding built by Google for search optimization. It uses neural networks and transformer architectures to improve results on Natural Language Processing (NLP) tasks. The original BERT paper created two models, bert-base-uncased (500mb model) and bert-large-uncased (1.2gb model). However, we decided to use smaller models because large models have both a large amount of data consumption and long analysis times. There are numerous smaller models that have been created that have fairly comparable analysis results. We chose to use TinyBERT as our pretrained model, weighing in at 59mb. As you can see below, it performs 1.2 billion floating point operations per section (actually a fairly small amount), which gives it a fast runtime of 9.4 times faster than bert-base-uncased. Yet, you can see that the average results on all of the datasets used for the TinyBERT study was a 77%, which is just slightly below the 79.5% of bert-base-uncased at almost 1/8th the size.
Here is a brief overview of the steps we took to get to our final models:
We now had a final model that met our requirements, we used Hugging Face and Tensorflow to convert our model (a PyTorch saved_model) into a tfjs GraphModel format. Thus, we had a model that was able to run in Javascript on the browser. We placed that model into the Privacy Pioneer extension, where it gets downloaded to the indexed-db and loaded into the browser for use when our extension is running.
Datasets:
Models:
Results: (note: each value is the Average F1 Score)

We would like to thank our supporters!
Major financial support provided by Google.
Additional financial support provided by Wesleyan University and the Anil Fernando Endowment.
Conclusions reached or positions taken are our own and not necessarily those of our financial supporters, its trustees, officers, or staff.