STMicroelectronics/STMems_Machine_Learning_Core

Regrading empty drff file generation

Closed this issue · 1 comments

MrZMN commented

Hi, I've met a weird issue. My target is to classify two types of motions. In my design, each motion is covered in 1.7 s and I want the MLC of my sensorTile.box to recognise it during this period.

To do this, I follow the tutorial in this repo. One of the main steps is to generate an .arff file. I have the following settings:

  • First, I have multiple log files (.csv files), where each file contains 354 samples (given an ODR of 208 Hz, 354 = 1.7 * 208) and each sample has ACC_XYZ and GYRO_XYZ attributes. These log files can be loaded successfully in Unico GUI. I've also attached one of the log files here Walk_1.csv
  • After loading and labelling them in Unico GUI, I configure as follows:
  1. MLC ODR = 26 Hz
  2. Accelerometer 16 g + 208 Hz ODR, gyroscope 2000 dps + 208 Hz ODR
  3. Window length = 52
  4. Features are simple means and variations. No filters applied

And when reaching the .arff file generation step, the software generates an almost empty file, which only contains the .arff headers but no data (i.e., the feature values and labels after the '@DaTa' sign are missing), as shown below.

@relation 'MLC'
@attribute F1_MEAN_on_ACC_X numeric
@attribute F2_MEAN_on_ACC_Y numeric
@attribute F3_MEAN_on_ACC_Z numeric
@attribute F4_MEAN_on_GY_X numeric
@attribute F5_MEAN_on_GY_Y numeric
@attribute F6_MEAN_on_GY_Z numeric
@attribute F7_VAR_on_ACC_X numeric
@attribute F8_VAR_on_ACC_Y numeric
@attribute F9_VAR_on_ACC_Z numeric
@attribute F10_VAR_on_GY_X numeric
@attribute F11_VAR_on_GY_Y numeric
@attribute F12_VAR_on_GY_Z numeric
@attribute class {walk, nowalk}

@data

This is very confusing. When I reduce the configuration of ODR of accelerometer and gyroscope (e.g., 208 Hz -> 104 Hz), the problem magically vanishes. Therefore, the problem seems to be that my log files do not have sufficient samples? However I don't see such requirements from any of the manuals.

I hope I've made myself clear. And I really appreciate it if anyone could give an answer about this. Thanks a lot!

Hello,
The are two things to consider in this case:

  • MLC_ODR is set to 26 Hz and sensor ODR is set to 208 Hz, thus the MLC is decimating data with a factor 8.
  • Window length is set to 52, so the features are computed every 52 samples

Considering the two points above it not possible computing a feature with just 354 samples in the data logs.
The suggestion is acquire longer data logs, or alternatively use higher MLC_ODR and lower window length