Labeling data after recording

Edge AI Lab

tags
edge-ai-lab

After collecting data for a specific class in a separate file, add a class column to the dataset with a constant integer representing that class. Additionally, ensure that the sensor reading columns are properly named.

  1. Open the CSV in VS Code, Excel, LibreOffice, or Python.
  2. Add a class column.
  3. Name sensor reading columns as follows:

    • acc_x
    • acc_y
    • acc_z
    • gyro_x
    • gyro_y
    • gyro_z
  4. Label each row according to your gestures.

    For example:

    acc_x,acc_y,acc_z,gyro_x,gyro_y,gyro_z,class
    0.1,0.0,9.8,0.02,0.01,0.00,0
    -0.2,0.5,9.7,0.04,0.05,0.02,0
    -0.3,0.6,9.7,0.05,0.06,0.03,0
    

    Where 0 is the IDLE gesture.

    acc_x,acc_y,acc_z,gyro_x,gyro_y,gyro_z,class
    0.2,0.0,9.8,0.02,0.01,0.08,1
    -0.14,0.5,9.7,0.04,0.05,0.01,1
    -0.3,0.6,9.7,3.05,0.09,0.03,1
    

    Where 1 is the UNKNOWN gesture.

  5. Proceed with labeling all 8 gesture classes:

    • Swipe right: 2
    • Swipe left: 3
    • Double knock: 4
    • Double thumb tap: 5
    • Rotation clockwise: 6
    • Rotation counter-clockwise: 7

    Note

    Classes must start from 0. For example, if you are training a model to predict swipe, rotate, tap, encode them as 0, 1, 2. Save the encoding dictionary for future reference.