{"id":13650469,"url":"https://github.com/microsoft/0xDeCA10B","last_synced_at":"2025-04-22T18:31:58.894Z","repository":{"id":37942257,"uuid":"181561897","full_name":"microsoft/0xDeCA10B","owner":"microsoft","description":"Sharing Updatable Models (SUM) on Blockchain","archived":false,"fork":false,"pushed_at":"2025-03-11T23:26:05.000Z","size":16547,"stargazers_count":579,"open_issues_count":15,"forks_count":146,"subscribers_count":31,"default_branch":"main","last_synced_at":"2025-04-20T10:14:17.410Z","etag":null,"topics":["ai","artificial-intelligence","blockchain","economics","ethereum","machine-learning","ml","node","prediction-mar","prediction-market","python","react","smart-contracts","truffle"],"latest_commit_sha":null,"homepage":"https://aka.ms/0xDeCA10B-blog1","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microsoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-15T20:37:11.000Z","updated_at":"2025-04-15T15:26:25.000Z","dependencies_parsed_at":"2024-01-03T05:11:12.090Z","dependency_job_id":"a034194e-92a1-4bf2-9cd6-8545336aea06","html_url":"https://github.com/microsoft/0xDeCA10B","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2F0xDeCA10B","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2F0xDeCA10B/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2F0xDeCA10B/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2F0xDeCA10B/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsoft","download_url":"https://codeload.github.com/microsoft/0xDeCA10B/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250297447,"owners_count":21407212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","artificial-intelligence","blockchain","economics","ethereum","machine-learning","ml","node","prediction-mar","prediction-market","python","react","smart-contracts","truffle"],"created_at":"2024-08-02T02:00:37.005Z","updated_at":"2025-04-22T18:31:57.824Z","avatar_url":"https://github.com/microsoft.png","language":"Python","readme":"# Sharing Updatable Models (SUM) on Blockchain\n(formerly Decentralized \u0026 Collaborative AI on Blockchain)\n\n\u003cimg src=\"./assets/logo.gif?raw=true\" width=500 alt=\"Animated logo for the project. A neural network appears on a block. The nodes change color until finally converging. The block slides away on a chain and the process restarts on the next blank block.\"\u003e\n\n\u003c!-- Put horizontally since build status badges are normally horizontal. --\u003e\n| [Demo][demo-folder] | [Simulation][simulation-folder] | Security |\n|:-:|:-:|:-:|\n| [![Demo: Test](https://github.com/microsoft/0xDeCA10B/actions/workflows/demo-test.yml/badge.svg?branch=main)](https://github.com/microsoft/0xDeCA10B/actions/workflows/demo-test.yml) | [![Simulation: Test](https://github.com/microsoft/0xDeCA10B/actions/workflows/simulation-test.yml/badge.svg?branch=main)](https://github.com/microsoft/0xDeCA10B/actions/workflows/simulation-test.yml) | [![Build Status](https://dev.azure.com/maluuba/0xDeCA10B/_apis/build/status/Security%20Checks?branchName=main)](https://dev.azure.com/maluuba/0xDeCA10B/_build/latest?definitionId=118\u0026branchName=main) |\n\n**Sharing Updatable Models (SUM) on Blockchain** is a framework to host and train publicly available machine learning models.\nIdeally, using a model to get a prediction is free.\nAdding data consists of validation by three steps as described below.\n\n\u003cimg src=\"./assets/architecture_flow.png?raw=true\" width=500 alt=\"Picture of a someone sending data to the addData method in CollaborativeTrainer which sends data to the 3 main components as further described next.\"\u003e\n\n1. The **IncentiveMechanism** validates the request to add data, for instance, in some cases a \"stake\" or deposit is required. In some cases, the incentive mechanism can also be triggered later to provide users with payments or virtual \"karma\" points.\n2. The **DataHandler** stores data and meta-data on the blockchain. This ensures that it is accessible for all future uses, not limited to this smart contract.\n3. The machine learning **model** is updated according to predefined training algorithms. In addition to adding data, anyone can query the model for predictions **for free**.\n\nThe basics of the framework can be found in our [blog post][blog1].\nA demo of one incentive mechanism can be found [here][demo].\nMore details can be found in the [initial paper][overview-paper] describing the framework, accepted to Blockchain-2019, The IEEE International Conference on Blockchain.\n\nThis repository contains:\n* [Demos][demo-folder] showcasing some proof of concept systems using the Ethereum blockchain. There is a locally deployable test blockchain and demo dashboard to interact with smart contracts written in Solidity.\n* [Simulation tools][simulation-folder] written in Python to quickly see how models and incentive mechanisms would work when deployed.\n\n\u003cimg src=\"./assets/aka.ms 0xDeCA10B QR.png?raw=true\" width=250 alt=\"Picture of a QR code with aka.ms/0xDeCA10B written in the middle.\"\u003e\n\n# FAQ/Concerns\n\n## Aren't smart contracts just for simple code?\nThere are many options.\nWe can restrict the framework to simple models: Perceptron, Naive Bayes, Nearest Centroid, etc.\nWe can also combine off-chain computation with on-chain computation in a few ways such as:\n* encoding off-chain to a higher dimensional representation and just have the final layers of the model fine-tuned on-chain,\n* using secure multiparty computation, or\n* using external APIs, or as they are called the blockchain space, oracles, to train and run the model\n\nWe can also use algorithms that do not require all models parameters to be updated (e.g. Perceptron).\nWe hope to inspire more research in efficient ways to update more complex models.\n\nSome of those proposals are not in the true spirit of this system which is to share models completely publicly but for some applications they may be suitable.\nAt least the data would be shared so others can still use it to train their own models.\n\n## Will transaction fees be too high?\nFees in Ethereum are low enough for simple models: a few cents as of July 2019.\nSimple machine learning models are good for many applications.\nAs described the previous answer, there are ways to keep transactions simple.\nFees are decreasing: Ethereum is switching to proof of stake.\nOther blockchains may have lower or possibly no fees.\n\n## What about storing models off-chain?\nStoring the model parameters off-chain, e.g. using IPFS, is an option but many of the popular solutions do not have robust mirroring to ensure that the model will still be available if a node goes down.\nOne of the major goals of this project is to share models and improve their availability, the easiest way to do that now is to have the model stored and trained in a smart contract.\n\nWe're happy to make improvements! If you do know of a solution that would be cheaper and more robust than storing models on a blockchain like Ethereum then let us know by filing an issue!\n\n## What if I just spam bad data?\nThis depends on the incentive mechanism (IM) chosen but essentially, you will lose a lot of money.\nOthers will notice the model is performing badly or does not work as expected and then stop contributing to it.\nDepending on the IM, such as in Deposit, Refund, and Take: Self-Assessment, others that already submitted \"good\" data will gladly take your deposits without submitting any more data.\n\nFurthermore, people can easily automatically correct your data using techniques from unsupervised learning such as clustering.\nThey can then use the data offline for their own private model or even deploy a new collection system using that model.\n\n## What if no one gives bad data, then no one can profit?\nThat’s great!\nThis system will work as a source for quality data and models.\nPeople will contribute data to help improve the machine learning models they use in their daily life.\n\nProfit depends on the incentive mechanism (IM).\nYes, in Deposit, Refund, and Take: Self-Assessment, the contributors will not profit and should be able to claim back their own deposits.\nIn the Prediction Market based mechanism, contributors can still get rewarded by the original provider of the bounty and test set.\n\n# Learn More\n\n## Papers\nMore details can be found in our initial paper, [Decentralized \u0026 Collaborative AI on Blockchain][overview-paper], which describes the framework, accepted to Blockchain-2019, The IEEE International Conference on Blockchain.\n\nAn analysis of several machine learning models with the self-assessment incentive mechanism can be found in our second paper, [Analysis of Models for Decentralized and Collaborative AI on Blockchain][self-assessment-analysis-paper], which was accepted to [The 2020 International Conference on Blockchain](http://blockchain1000.org/2020/).\n\n# Contributing\n\nThis project welcomes contributions and suggestions.  Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.microsoft.com.\n\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\n[demo-folder]: demo/\n[simulation-folder]: simulation/\n\n[demo]: https://aka.ms/0xDeCA10B-demo\n[blog1]: https://aka.ms/0xDeCA10B-blog1\n[overview-paper]: https://aka.ms/0xDeCA10B-paper\n[self-assessment-analysis-paper]: https://arxiv.org/abs/2009.06756\n","funding_links":[],"categories":["Blockchains for AI algorithms"],"sub_categories":["Blockchain projects for AI algorithms"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2F0xDeCA10B","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrosoft%2F0xDeCA10B","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2F0xDeCA10B/lists"}