{"id":13651685,"url":"https://github.com/rezahsnz/mlg","last_synced_at":"2026-01-24T04:33:49.599Z","repository":{"id":190009099,"uuid":"360931690","full_name":"rezahsnz/mlg","owner":"rezahsnz","description":"mlg: A decentralized CNN classification service based on Golem.","archived":false,"fork":false,"pushed_at":"2022-02-04T09:23:21.000Z","size":573,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-13T17:39:32.365Z","etag":null,"topics":["cnn","golem","keras"],"latest_commit_sha":null,"homepage":"","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/rezahsnz.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":null,"support":null,"governance":null}},"created_at":"2021-04-23T15:41:06.000Z","updated_at":"2024-03-23T14:18:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"d7ff78fc-1b5e-464b-ac12-5d7e6e176e3b","html_url":"https://github.com/rezahsnz/mlg","commit_stats":null,"previous_names":["rezahsnz/mlg"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rezahsnz/mlg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rezahsnz%2Fmlg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rezahsnz%2Fmlg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rezahsnz%2Fmlg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rezahsnz%2Fmlg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rezahsnz","download_url":"https://codeload.github.com/rezahsnz/mlg/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rezahsnz%2Fmlg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28711536,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T23:51:44.727Z","status":"online","status_checked_at":"2026-01-24T02:00:06.909Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cnn","golem","keras"],"created_at":"2024-08-02T02:00:51.535Z","updated_at":"2026-01-24T04:33:49.560Z","avatar_url":"https://github.com/rezahsnz.png","language":"Python","funding_links":[],"categories":["Archive","Apps"],"sub_categories":["Apps","Deep Learning"],"readme":"\n\u003ch1 align=\"center\"\u003eCNN predict services on top of Golem\u003c/h1\u003e\n\n## Theme\nThe basic idea is to distribute popular CNNs pre-trained with ImageNet datasets across Golem provider nodes. Once we have enough images(CNNs) on the board, then we setup an HTTP REST API server that collects predict requests. At regular times, say every 10 minutes, a script is invoked to batch requests and have them sent to the nodes for prediction. Once the requests are fulfilled, the results are recorded on the db and ready to be queried.  \n\n## Available models\nThe following models are available to be used:  \n- DenseNet121\n- DenseNet169\n- DenseNet201  \n- ResNet50\n- ResNet101\n- ResNet152  \n- ResNet50V2\n- ResNet101V2\n- ResNet152V2  \n- VGG16\n- VGG19 \n- NASNet_large\n- NASNet_mobile\n- XCeption  \n- Inception_V3  \n- Inception_ResNet_V2  \n\n## Batching\nThe batching script is invoked at regular times to look for any pending requests. The pending requests are then grouped by their models and divided into chunks of 16 to make sure that the payload(task data) a provider receives is capped at 64mb(with max 2mb per request data for HTTP POST). Grouping followed by request chunks introduces a hierarchy of task paralellization that improves the scalablility of the server while making sure that each node receives enough payload to be worth the time it spends loading the large images. At times of low demand, however, the nodes might not receive enough requests. \n\n\n## Invocation\nTo ask for a predicttion on some image file, one can make a simple cURL call:  \n`curl -X POST -F image=@kitten.jpg 'BASEURL/requestPrediction/[model]'`  \nThis schedules the request for prediction and a request_id is generated. The Caller can then query for the results using a call like this:  \n`curl -X POST 'BASEURL/readPrediction/[request-id]'`  \nA typical result for a previsouly requested prediction is either `null`(as being not picked up yet) or an array of predicted classes.  \n\n\n## Caveat\nPlease note that as we are in the beta phase and running the testnet nodes so you might experience difficulties.\n\n# setup\nThe provided scripts are for reference only.\n\n## Refrences\n- [Golem](https://golem.network)  \n- [Keras applications](https://github.com/keras-team/keras-applications)  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frezahsnz%2Fmlg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frezahsnz%2Fmlg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frezahsnz%2Fmlg/lists"}