A privacy-preserving browser extension.
- Your input data remains on your local machine.
- The browser extesion loads a local model for inference.
- This model predicts the sentiment(positive/negative stuff..) of your input text on websites. (Yes, it works similar to grammarly.)
- But your data is not uploaded to a central server.
- The model predictions can be corrected using an interactive panel. The corrections are stored locally.
- You can fetch updated models from the grid, which trains on the local data (the corrections made by you).
- A copy of the latest global model is saved on your device, which will be used for inference locally.
- The updated model is sent back to the grid.
- With multiple users correcting the model on a regular basis, the performance of the model imoproves exponentially, and everyone can benefit from it.
- Clone the repo. :)
- Install PySyft, PyGrid and Syft.js.
- The extension has been tested in
Firefox. cd server && python app.py(more info in server/readme.md)- This serves the initial model to Cryptly (our extension).
- Start the pygrid
Gatewayusingpython grid.py --host localhost --port 5001 --start_local_db.- Notice the port is
5001(cuase the above server is already running on5000).
- Notice the port is
- Run the
Grid/Host Plan.ipynbto host models to pygrid. npm i && npm run buildto built cryptly.Ctrl+Shift+Aand go toSettings -> Debug Add-ons > Load Temporary Add-on.- Click on
inspectto open the console attached to the extension. - Select the
Cryptly/dist/manifest.jsonto load the extension. - Open
Test/test.htmlin your browser (Firefox). - Cryptly is enabled by default on new websites.
- Open console by pressing
F12. - Type in text area, and you should see an emoji displaying the sentiment of your text.
- Click on the emoji to see the confiedence of the predictions made by the model. Click on save to go back.
- To pull the hosted model, click on the
Cryptlyicon in theToolbarmenu of the browser. - Enter version number (if you haven't changed it in
Host Plan.ipynbthen it is1.0.0). - Click on
Pull new modelto fetch the hosted model and train on local data. (Note: As of now the fetched model trains on dummy data.)
- Note: Disable the extension after testing. ;) Cause it may make your text area elements go crazy on other websites.
You can correct Cryptly's predictions. The corrections are stored locally and serve as training data for Cryptly models.
You can pull the updated model from grid using the extension popup. This updated model has been trained on the corrections provided by multiple users of Cryptly. The pulled model replaces your local model and provides better predictions.
- Awesome explanation of Federated Learning by Web & Mobile team @OpenMined.
- Thanks to developers of PySyft, PyGrid and Syft.js.
- Thanks Vova Manannikov for his quick fixes and help in integrating Syft.js.


