A user define data with multi-labeling

Question/Issue:
I am new user using EdgeImpulse I have a time series csv file
num, col, row, inpx, inpy, angx, angy, X,Y,Tilt,A
num is the receive data number
col,row inpx,inpy angx,angy is input data
X,Y Tilt,A is ouput data
Could you help me how to set up the multi label data?

Project ID:
51409478
Context/Use case:
[Provide context or use case where the issue is encountered]

Steps Taken:

  1. CSV wizard
  2. upload the my data include .jason file
  3. jason file fail to upload

Expected Outcome:
the data still has one label call X other Y , AZ and tile are not included

Actual Outcome:
[Describe what actually happened]

Reproducibility:

  • [X ] Always
  • [ ] Sometimes
  • [ ] Rarely

Environment:

  • Platform: [e.g., Raspberry Pi, nRF9160 DK, etc.]
  • Build Environment Details: [e.g., Arduino IDE 1.8.19 ESP32 Core for Arduino 2.0.4]
  • OS Version: [e.g., Ubuntu 20.04, Windows 10]
  • Edge Impulse Version (Firmware): [e.g., 1.2.3]
  • To find out Edge Impulse Version:
  • if you have pre-compiled firmware: run edge-impulse-run-impulse --raw and type AT+INFO. Look for Edge Impulse version in the output.
  • if you have a library deployment: inside the unarchived deployment, open model-parameters/model_metadata.h and look for EI_STUDIO_VERSION_MAJOR, EI_STUDIO_VERSION_MINOR, EI_STUDIO_VERSION_PATCH
  • Edge Impulse CLI Version: [e.g., 1.5.0]
  • Project Version: [e.g., 1.0.0]
  • Custom Blocks / Impulse Configuration: [Describe custom blocks used or impulse configuration]
    Logs/Attachments:
    [Include any logs or screenshots that may help in diagnosing the issue]

Additional Information:
[Any other information that might be relevant]

Hello @hwtseng1976 first of all welcome to the Edge Impulse community!

I see that your issue is related on uploading the csv. Do you need to use JSON on your data?

Related to the multi label data, did you read the multi-label data docs we have here? Multi-label data - Edge Impulse Documentation

Please share more details on how do you need to label your data? Feel free to share more details so we will be able to help you more!

Thanks!

Thanks, Finally we apply Keras expert mode to enable multi ouput machine learning.

  1. define the map function
    def reformat_data(features, labels):
    new_features = tf.cast(features[:16], tf.float32)

    強制將所有參與拼接的數值轉為 float32

    new_labels = tf.concat([
    tf.cast(tf.reshape(labels, [1]), tf.float32),
    tf.cast(features[16:19], tf.float32)
    ], axis=0)
    return new_features, new_labels
  2. map the data in the correction postion

This is False by default.

ENSURE_DETERMINISM = args.ensure_determinism

this controls the batch size, or you can manipulate the tf.data.Dataset objects yourself

BATCH_SIZE = args.batch_size or 32
if not ENSURE_DETERMINISM:
train_dataset = train_dataset.shuffle(buffer_size=BATCH_SIZE*4)

train_dataset = train_dataset.map(reformat_data)
validation_dataset = validation_dataset.map(reformat_data)
train_dataset=train_dataset.batch(BATCH_SIZE, drop_remainder=False)
validation_dataset = validation_dataset.batch(BATCH_SIZE, drop_remainder=False)

  1. change the model as 16 input and 4 output
  2. change the loss function based on the requiremnet and print the mse for the 4 ouput.
  3. use TensorBoard to check the MSE V.S. Epoch
1 Like

Thanks for sharing your solution @hwtseng1976

Let us know if you have any other questions!