{"id":17429779,"url":"https://github.com/marph91/pocket-bnn","last_synced_at":"2025-04-16T02:19:44.017Z","repository":{"id":105040186,"uuid":"367583261","full_name":"marph91/pocket-bnn","owner":"marph91","description":"BNN-to-FPGA framework, written in VHDL and Python","archived":false,"fork":false,"pushed_at":"2021-07-16T11:52:30.000Z","size":158,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T04:05:00.836Z","etag":null,"topics":["bnn","cnn","cnn-architecture","deep-learning","fpga","hardware","image-processing","larq","python","ulx3s","vhdl"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marph91.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-15T08:53:24.000Z","updated_at":"2025-01-24T03:13:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"4af4c50e-2189-480f-8140-a2cba0516c0c","html_url":"https://github.com/marph91/pocket-bnn","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marph91%2Fpocket-bnn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marph91%2Fpocket-bnn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marph91%2Fpocket-bnn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marph91%2Fpocket-bnn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marph91","download_url":"https://codeload.github.com/marph91/pocket-bnn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249183485,"owners_count":21226207,"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":["bnn","cnn","cnn-architecture","deep-learning","fpga","hardware","image-processing","larq","python","ulx3s","vhdl"],"created_at":"2024-10-17T07:08:57.772Z","updated_at":"2025-04-16T02:19:44.010Z","avatar_url":"https://github.com/marph91.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pocket-bnn\n\npocket-bnn is a framework to map small Binarized Neural Networks (BNN) on a FPGA. It is based on the experience gained in [pocket-cnn](https://github.com/marph91/pocket-cnn). This is no processor, but rather the BNN is mapped directly on the FPGA. There is no communication needed, except of providing the image and reading the result.\n\n## Installation and Usage\n\nTo run a simple demo, execute the following commands:\n\n```bash\n# train a bnn\nmake model\n\n# generate a vhdl toplevel from the model\n# synthesize, PnR, generate bitstream\nmake bnn.bit\n\n# program the board\nmake prog\n```\n\nThe BNN will be accessible through UART. There is an example script, which can be used: `python playground/06_test_uart.py`. The result should be corresponding to the BNN test.\n\nThere are a few programs and python modules that need to be installed, like [LARQ](https://github.com/larq/larq) and the open source toolchain to program the ULX3S. For now, they need to be installed manually.\n\nA few stats for the example are:\n\n- Accuracy on Mnist: 75 %\n- Resource usage: 17276/41820 (41%) of TRELLIS_SLICE\n- Frequency: 25 MHz (Max. frequency: 132 MHz)\n\nIn simulation, the full BNN inference is done in less than 10 us at 100 MHz. More stats will follow, since this is the first example.\n\n## Documentation\n\nFor now, there is not much documentation. Some design decisions are documented at the [documentation folder](https://github.com/marph91/pocket-bnn/tree/master/doc). The [tests](https://github.com/marph91/pocket-bnn/tree/master/sim) might be useful, too.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarph91%2Fpocket-bnn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarph91%2Fpocket-bnn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarph91%2Fpocket-bnn/lists"}