{"id":21070711,"url":"https://github.com/microbit-foundation/cctd-ml-machine","last_synced_at":"2025-08-13T19:26:15.072Z","repository":{"id":183410506,"uuid":"585099371","full_name":"microbit-foundation/cctd-ml-machine","owner":"microbit-foundation","description":"GitHub Location for Aarhus University's Center for Computational Thinking and Design's ML-Machine application.","archived":false,"fork":false,"pushed_at":"2025-05-13T20:45:05.000Z","size":24679,"stargazers_count":8,"open_issues_count":21,"forks_count":13,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-13T21:44:48.104Z","etag":null,"topics":["education","learning","machine-learning","microbit"],"latest_commit_sha":null,"homepage":"https://ml-machine.org/","language":"Svelte","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/microbit-foundation.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"zenodo":null}},"created_at":"2023-01-04T10:12:17.000Z","updated_at":"2025-05-11T10:34:09.000Z","dependencies_parsed_at":"2023-12-25T10:28:49.609Z","dependency_job_id":"ba86c652-bd0c-4cae-adc4-7ffa9bb4555a","html_url":"https://github.com/microbit-foundation/cctd-ml-machine","commit_stats":null,"previous_names":["microbit-foundation/cctd-ml-machine"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microbit-foundation%2Fcctd-ml-machine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microbit-foundation%2Fcctd-ml-machine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microbit-foundation%2Fcctd-ml-machine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microbit-foundation%2Fcctd-ml-machine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microbit-foundation","download_url":"https://codeload.github.com/microbit-foundation/cctd-ml-machine/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254473864,"owners_count":22077189,"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":["education","learning","machine-learning","microbit"],"created_at":"2024-11-19T18:47:54.468Z","updated_at":"2025-08-13T19:26:15.046Z","avatar_url":"https://github.com/microbit-foundation.png","language":"Svelte","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ML-Machine\n\nML-Machine is a free and open-source interactive machine-learning platform, utilising external sensors to generate data,\nwhich it can be trained to recognise. This allows for gesture recognition by recording examples of gestures performed by\nthe user, which the platform can learn and subsequently recognise. The external sensors are provided by the micro:bit\nboards, which are communicated with through Bluetooth. When a gesture is recognised an auditory, visual or logical\nfeedback action is taken.\n\nTo learn to recognise a gesture, a label is created for which a set of example movements with the micro:bit\nis recorded. These recordings will be processed by a machine-learning algorithm to recognise future examples. To\ndifferentiate the recording and feedback process we allow for two micro:bits to be connected. One will act as a\nrecording, or input device and another will act as feedback, or output device.\n\n\u003cdiv style=\"margin-left: 10%; margin-right: 10%\"\u003e\n\u003cimg style=\"border-radius: 5px\" src=\"https://user-images.githubusercontent.com/6570193/236807377-5308b9c5-20e1-4a87-83cd-a2e0d822124b.png\" alt=\"\"\u003e\n\u003c/div\u003e\n\n## Building ML-Machine\n\nML-Machine can be found at [ML-Machine.org](https://ml-machine.org/) free to use.\nUsing the platform requires at least one micro:bit, but two is recommended, especially if you are planning on using any\nof the I/O feedback.\n\nYou can find the version on the main branch at [main.ML-Machine.org](https://main.ml-machine.org/). It will have the newest features but may not be stable and features will be removed or changed without any warnings so do not rely on this version.\n\n### Running the application locally\n\n#### Using NodeJS\nAlternatively the application can be run locally on your computer without compromising the capabilities of the software.c\n\n1. Ensure you have [nodejs](https://nodejs.org/) and the package manager [npm](https://www.npmjs.com/)\n2. Download or clone this repository\n3. In the terminal, run command `npm install` inside the project directory.\n4. Once installed, run `npm run dev` to launch the application.\n5. Access the application from http://localhost:5173/\n\nList of commands can be found below.\n\n#### Using Docker\n\nEither build the dockerfile and run it\n```\ndocker build -t ml-machine .\ndocker run -d -p 5174:8080 ml-machine\n```\n\nOr you can use the docker-compose.yml file we have provided\n\n```\ndocker compose up -d\n```\n\nAccess the application from http://localhost:5174/\n\n### ```npm run dev```\n\nThis starts the development environment using Vite. This should be used when developing as it supports hot-reload/live reload.\n\nWe recommend starting here.\n\n### ```npm test```\n\nRuns the test suite. Tests are driven by the framework [Vitest](https://vitest.dev/). Runs all tests inside the folder `./src/__tests__/`.\n\nIf you do not plan to contribute to the project, you may safely ignore this.\n\n### ```npm run check```\n\nRuns the svelte-check procedure. This will check for various usability issues, unused variables and checks types. This is seldom used, and equivalent checks are performed through Vite and Typescript. Use as a supplement when finalizing a commit. \n\n### ```npm run build```\n\nCreates a build for the application. Using Vite, the application will be built and placed in the `./dist/` folder.\n\nUse this if you are going to deploy the application on a webserver, or if you wish to use `npm start` to run the application.\n\n### ```npm start```\n\nThis starts a server, hosting the contents of `./dist/`. This folder is built by running `npm run build`.\n\nThis will expose the application to the network on the default port (5173).\n\n\n### Hex files\n\nPrograms on your micro:bit is contained inside the .hex format files. The files we use can be found in `./public/firmware/`.\nThe file must be uploaded to your micro:bit in order to use the application. \n\nNote: The application can upload the program to the micro:bit, there is no need for manual installation of hex files prior to launching the application.\n\nThe source code for these programs are written in c++ and can be found in the folder `./microbit/`. \n\nIf you wish to alter the micro:bit programs, you will need a few tools that depends on which micro:bit version you wish to build for. In the folder `./microbit/` lies a README.md with further instructions, which you can visit by clicking [here](./microbit/)\n\n## Using ML-Machine\n\n### Connecting your micro:bit\n\nThe micro:bit can be connected via Bluetooth. The micro:bit requires a specific firmware to be able to communicate with\nthe platform effectively. The firmware can be acquired as a .hex file which can be manually transferred using your PC's\nfile system, alternatively, if the micro:bit is connected via USB the platform can automatically upload the firmware to\nthe micro:bit directly.\n\n### Creating gestures and recording examples\n\nTo create a gesture go to the data tab through the menu on the left side of the page. Then click the big plus icon to\ncreate an empty gesture and give it a title.\n\nTo record an example ensure that a micro:bit has been connected and select the newly created gesture. Press either of\nthe buttons in the micro:bit and perform the gesture you wish to recognise immediately. You can do this as many times as\nyou would like. The more example you give for the gesture, the more confident the algorithm will be in recognising the\ngesture in the future.\n\n### Training the model\n\nTo train the predictive model on the given gesture examples, go to the trainer tab of the menu. Select the train model\noption and wait until it has finished. The time this takes is dependent on how many examples you gave each gesture and\nhow many gestures the model has to learn.\n\n### Recognising gestures\n\nThe model will attempt to predict which gesture is being performed immediately after training. Go to the model tab to\nconfigure the feedback actions, which will be taken when the model makes a prediction.\n\n### Configuring prediction and feedback\n\nIn the model tab several options become available once the model has been trained. These can be changed to alter the\nbehaviour of the platform and micro:bits.\n\n#### Confidence threshold\n\nDetermines how confident the model has to be for a feedback action to be taken for the given gesture. This is a slider\nlocated to the right of the label and can be adjusted to make the model more sensitive, the default value is 80%, and\ncan be changes for each gesture.\n\nImmediately besides it, a confidence-meter shows how confident the model currently is and will change as you perform\ngestures.\n\n#### Changing the LEDs for output micro:bit\n\nDetermines which LEDs on the display of the micro:bit will be lit up when the gesture is detected. This is\n\n#### Sound feedback\n\nDetermines which sound clip will be played when a gesture is recognised. Depending on which version of micro:bit you\nhave, the sound will be output on the speaker of the micro:bit or on your computer, if the micro:bit doesn't support\nspeaker audio.\n\n#### I/O feedback\n\nSelect the I/O pin you wish to turn on in response to a gesture detection. Combine this with circuitry to make gesture\nrecognition perform actions outside the platform such as turning on motors or LEDs.\n\n### Dependencies\n\nML-Machine utilises several packages, most notable of which are the following:\n\n- [Svelte](https://github.com/sveltejs/svelte) provides the web-development framework.\n- [Windi CSS](https://github.com/windicss/windicss) provides our styling tool.\n- [TensorFlow.js](https://github.com/tensorflow/tfjs) provides machine learning capabilities.\n- [Smoothie Charts](https://github.com/joewalnes/smoothie) and [chart.js](https://github.com/chartjs/Chart.js) provides\n  a visualisation kit.\n\n## Contributions\n\n#### Issues\n\nIf you experience an issue or have a question regarding the platform please do not hesitate to raise an issue. The\nmaintainers will answer to any issues raised as quickly as possible.\n\n#### Code contributions\n\nIf you have an improvement on you wish to share with please read the [contributing](CONTRIBUTING.md) page. There you\nwill find information about how to contribute. The maintainers will review the changes as soon as possible.\n\n### Credits\n\nML-Machine is a platform created by the Center for Computational Thinking and Design (see [CCTD.dk](https://cctd.au.dk)) at Aarhus University for empowering education in the emerging fields of technology and computation.\n\n## License\n\n[MIT](LICENSE) © Center for Computational Thinking and Design at Aarhus University and contributors.\n\nWe use dependencies via the NPM registry as specified by the package.json file under common Open Source licenses.\n\nThe repository includes forks of Lancaster's micro:bit-samples repositories for micro:bit [V1](https://github.com/lancaster-university/microbit-samples) and [V2](https://github.com/lancaster-university/microbit-v2-samples). They are MIT licensed.\n\n## Code of Conduct\n\nIn the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. Please see our code of conduct on the [contributing](CONTRIBUTING.md) page and Micro:bit Educational Foundation's [code of conduct](https://microbit.org/safeguarding/) which outlines our expectations for all those that participate in the community and details on how to report any concerns and what would happen should breaches occur.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrobit-foundation%2Fcctd-ml-machine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrobit-foundation%2Fcctd-ml-machine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrobit-foundation%2Fcctd-ml-machine/lists"}