Skip to main content
LPetr.1
Senior
April 13, 2026
Question

LIS2DUX12 machine learning core advice

  • April 13, 2026
  • 1 reply
  • 132 views

Hello. I have LIS2DUX12 accelerometer and have sucessfully ran machine learning example from STMems (activity_recognition_for_mobile) on our custom hardware.

https://github.com/STMicroelectronics/STMems_Standard_C_drivers/blob/master/lis2dux12_STdC/examples/lis2dux12_mlc_activity_mobile.c

For our application, we need to be able to reliably detect when our device is being transported with a car but its not so straightforward. The few difficulties include:

1. The device orientation is not fixed

2. The device may shake gently or move very slowly during its normal application. This is perfectly fine and we should somehow not detect that. 

I have looked at different application_examples :
https://github.com/STMicroelectronics/STMems_Machine_Learning_Core/tree/master/application_examples

but not sure which would work best for us. If we cant find any suitable application example, we can try and train our own model with our own data.

I would appreciate if someone could share their insights and provide any feedback regarding our application. How should we handle different orientation problem and gentle shaking/slow movement?

1 reply

Federica Bossi
Technical Moderator
April 13, 2026

Hi @LPetr.1 ,

For your application, the LIS2DUX12 MLC is well-suited to detect car transport in an orientation-independent manner and to reject false positives from gentle shaking or slow movement. You should:

  • Use the norm of the accelerometer data and statistical features for orientation independence.
  • Leverage the MLC's false-positive rejection and debounce features.
  • Train your own model if existing examples do not meet your needs, using ST's tools for data collection, feature extraction, and decision tree generation.
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
LPetr.1
LPetr.1Author
Senior
April 14, 2026

First of all thanks for your response. Additionally, I forgot to mention that MCU will not be actively sampling the data since it will be in sleep mode. I only want to receive INT from the accelerometer when it detects the correct movement pattern.


Regarding your tips, could you be more precise please?

  • Use the norm of the accelerometer data and statistical features for orientation independence.

Could you elaborate a little bit more about how to achieve orientation independence? What kind of features exactly I should look into and what is "norm of the accelerometer data" ?

 

  • Leverage the MLC's false-positive rejection and debounce features

Could you also elaborate on this a little bit more? What features precisely are you talking about, could you point me in the right direction so I could look into this more on the LIS2DUX12 datasheet. Are there any examples available of these features in STMems example projects so I could look into more?