People counting with a ranging sensor
Count the number of people passing through a door using a Time-of-Flight sensor.
For example purposes, we have taught an AI library how to distinguish human vs animal and to be able to detect when one or several people are entering or leaving a room without any camera. This approach can easily be adapted to many other use cases.
Approach
When a person enters the field of the Time of fight, it triggers the sensor. We concatenate 32 signals of the sensor at a frequency of 15Hz (the maximum) to capture the direction (In or out)
We binarized the distances captured by the time of flight because we dont need information about the height of the person that passes
We created datasets for 4 classes. 1000 signals for both a single person going in and going out. And 400 signals for both 2 people going in and 2 people going out
Finally, we created an 'N-Class classification' model (4 classes) in NanoEdge AI Studio and tested it live on a NUCLEO_F411RE (with a X-NUCLEO-53L5A1 add-on board)
Sensor
Data
Signal length 2048 (32 successive 8x8 matrix)
Data rate 15 Hz
Results
3 class classification:
98.14% accuracy, 27.1 KB RAM, 229 KB Flash
Green points represent well classified signals. Red points represent misclassified signals. The classes are on the abscissa and the confidence of the prediction is on the ordinate
Resources
Model created with NanoEdge AI Studio
A free AutoML software for adding AI to embedded projects, guiding users step by step to easily find the optimal AI model for their requirements.
The STM32 family of 32-bit microcontrollers based on the Arm Cortex®-M processor is designed to offer new degrees of freedom to MCU users. It offers products combining very high performance, real-time capabilities, digital signal processing, low-power / low-voltage operation, and connectivity, while maintaining full integration and ease of development.