No one enjoys hearing their baby cry, especially when it occurs in the middle of the night or when the parents are preoccupied with another task. Unfortunately, switching on a motorized baby swing requires physically getting up and pressing a switch or button, which is why Manivannan Sivan developed one that can automatically trigger whenever a cry is detected using machine learning.
Sivan began his project by first gathering real world samples of crying sounds and background noise from an Arduino Portenta H7 and Vision Shield before labeling them accordingly in the Edge Impulse Studio. From here, he created a simple impulse which takes in time-series audio data and generates a spectrogram which is then used to train a Keras neural network model. Once fully trained, the model could accurately distinguish between the two sounds about 98% of the time.
Beyond merely classifying the sounds from the two onboard microphones, Sivan’s custom program also sets a relay to activate for 20 seconds if crying has been detected, after which it turns off until crying is recognized again. He hopes to use this project as a convenient way to assist busy parents with the difficult task of calming a crying baby without the need for constant manual intervention. You can read more about it here on the Edge Impulse blog.