Data and training
Preparing a good dataset
The data you collect matters more than any setting. Here is how to collect data a model can learn from.
On this page
The idea in one minute
A model can only learn what your examples show it. A good dataset has:
- Enough examples of every label.
- Balanced labels: roughly the same number of examples for each one.
- Correct labels: every example has the right name.
- Variety: different people, places, lighting, devices and background noise.
- The real conditions: data recorded the same way the device will see it later.
Checklist
| Check | Why it matters | Tip |
|---|---|---|
| Enough examples | Too few and the model guesses | Start with 20–50 per label, add more if results are poor |
| Balanced labels | The model favours the label it sees most | If one label has 200 examples and another 20, record more of the small one |
| A "nothing" label | Teaches the model what to ignore | idle for Motion, noise for Audio, background images for Image |
| Clean labels | One wrong label teaches the wrong thing | Check a few random samples per label |
| Variety | The model must work outside your desk | Record different people and places |
| Same sensor and settings | A model trained on one sampling rate may fail on another | Keep the same device and frequency throughout |
A simple example
You want to recognise three gestures. Your first dataset:
| Label | Recordings | Problem |
|---|---|---|
| wave | 40 | – |
| circle | 38 | – |
| idle | 6 | Far too few |
The model will rarely predict idle, so it will call every small movement a gesture. Record about 30 more idle recordings, including small natural movements like typing or scratching, and train again.
Labels in PetalEdge
- Image: you draw a box around every object and give it a label.
- Motion: each recording gets one label. By default the label is the text before the first
.in the file name, sowave.01.csvbecomes wave. - Audio: each clip gets a label when you upload or record it.