This project uses AI models run in browser to enhance the user experience in a social network dApp. There are two models: (1) The first model detects malicious information and protects users against them. It is a pre-trained model based on 2 million toxic online comments provided by TensorFlow. (2) The second model helps recommend social media information based on users' preference. Whenever users like/dislike a content, this information will be used for model training that happens inside browser. Over time, the model will be better at recommend/hide posts based on users' preference. Since model training happens inside the browser, users' data are always in their browser. In this way to guarantee data security.
I used TensorFlow.js to load, create, run and train machine learning models inside users browser. All user information, along with the model data are stored in localStorage inside users' browser. Engineering wise, to enable multiple models work together, I embed models into different data pipeline, to ensure they have the input and output share the same data schema. Then there is another algorithm that combines all model results together, which will be used for UI rendering. For the second model, Your Privacy Model, I add an algorithm that dynamically adjust the model structure based on the amount of training data. This will help the model results. The web is built using VueJS and TailwindCSS. It is deployed on IPFS. No sponsor tech is used except for Lens-protocol API. I did not do anything hacky for the demo. To clarify, this project is built for exploring and presenting (not cherry-picking) AI's capability in dApp. It is not a complete social dApp, and it is not meant to be one.