-
Notifications
You must be signed in to change notification settings - Fork 2
[POC- DO NOT MERGE] Use heatmap to fingerprint recording data #273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Model accuracy can be highly variable due to non-determinism. This change improves the consistency of the trained model.
Process data page uses a 50:50 split of the data plot and fingerprint
Preview build will be at |
A demo of a different layout where we can compare the live fingerprint with the 'average' fingerprints for each class/action. The average data is never something we pass into the model, and it's representation is a bit misleading, but it is useful in seeing how the current action/gesture compares to the recorded data: https://github.com/microbit-foundation/ml-trainer/assets/95928279/c0201a89-8b4e-4e17-bb81-3d0379387630 |
Hello @Karlo-Emilo, we've been playing with the idea of generating a fingerprint that can represent a recording, or rather the processed recording data that actually gets passed to the model, which is generated by the filters. It's essentially a different take on the filters view of the upstream ML Machine app. Details of the changes we've made in this branch are documented in the PR description above. We'd love to hear your thoughts on this if you have time to play with the review branch here -> https://review-ml.microbit.org/fingerprinting-vertical. Please can you also share with Magnus? I was unable to find him on GitHub. I've also added a link to screen capture in a comment above that was recorded from a different version of this fingerprinting branch, but the comparison between live and recorded data is really easy to see in this video. |
Hi @microbit-robert, I am back from the holidays. It sounds super interesting! However, I cannot connect a micro:bit in the preview version you link to. I am told that I use a micro:bit V1 even though I use a V2. I have tried different (identical versioned) micro:bits. I have not tried to update the firmware. This is one of the micro:bits:
It looks cool in the video. As you mention in the comment, the average representation can be misleading as it may not represent what the model is doing. The model looks at patterns across multiple features. So, the value of a given feature is interpreted differently depending on the other features. For example, this makes it possible for the model (with enough complexity and data) to detect a circle independently of the orientation of the micro:bit. However, this is very complex for children/students to understand. With more simple models, the average may provide an adequate representation of what is going on in most cases. I like the fingerprint visualization of the recordings. It looks good and is more comprehensible. It is really interesting to work with these different representations of the data. We will teach in a high school math class at the end of August to explore how to make the math in the models more comprehensible. We may also be able to test some of your ideas if you have a working prototype. I can, however, not promise anything before we have planned the lessons. We have also experimented with using just one axis and fewer filters to visualize a KNN model. You can see what Malthe is currently working on here: microbit-foundation#484 Will you add @r59q (Malthe) and @Magniswerfer (Magnus) to the conversation? |
Thanks for checking it out. I have re-tested with v2.00 and it seems OK to me. Please could you provide details about how it fails, perhaps with some screenshots so we can identify what's going on? It's interesting that sometimes we're able to see visually the differences in x, y, z data between classes whereas the model can't and vice versa. Any progress on explaining visually why that's the case would be useful, but you can't show something without explaining it, and then it gets complicated. I'll have a proper look at the KNN visualization next week, but at a glance it also looks pretty cool. |
The image recognition representation is cool. If we could do the same with the fingerprint, I think that would be really valuable. We are very interested if you are able to test the fingerprint idea in the classroom. Please can you let us know what you need from us to make that a realistic possibility, if of course, it fits into your planning and schedule? |
I think I have identified the reason for my earlier connectivity issues. I may have used the Brave browser. My bad; I hope you have not spent too much time investigating the issue. |
Ahh, OK. This was brought to our attention recently microbit-foundation/python-editor-v3#1189 |
@Karlo-Emilo Just to let you know that we are aiming to make this PR this week. |
The output data of the ML filters for each recording are used to plot heatmaps which are effectively fingerprints of the data we pass into the ML model for training and inference. The fingerprints use filter outputs normalized to 0..1, the ML model still uses the non-normalized values and is not impacted by these changes.
These fingerprints are displayed for each recording in the "Process data" page (shown via animation after clicking the "Process data button). The fingerprint of the mean of the filters applied to all recordings for each action is displayed in the same box as the action name. If a micro:bit is connected, the live data is also displayed as a fingerprint at the right hand side of the bottom panel next to the x/y/z traces.
These fingerprints are effectively an alternative visualization to the filters view in the upstream ML Machine app.
More discussion is required regarding the UI/UX and education content impact. We could merge the process data and train model pages and possible re-enable the ability to toggle individual filters.