I'm excited to share another project that’s close to my heart! This time, I’ve tackled a challenge many parents face: how tough it can be to respond quickly when their baby cries in the middle of the night. Waking up and getting a bottle ready during those bleary-eyed moments can feel overwhelming. With this project, I aim to take some of that stress away. I’ve created a system that uses a tiny machine learning model, trained with Edge Impulse software, to detect a baby’s cry. When that happens, it automatically activates a bottle preparation machine. So, by the time parents wake up, the bottle is all set and perfectly warmed for feeding!
In model, we need to follow the below steps In Edge Impulse.
To begin, we will create a database and label the sample data as "Baby cry" and "room noise".Subsequently, we will initiate the model training process using Edge Impulse. Based on the outcomes of the validation, it may be necessary to adjust the training parameters or incorporate additional datasets, followed by retraining the model to enhance its performance. Once the model has been successfully trained and validated, achieving an acceptable level of accuracy, we will proceed to deploy it on the Portenta H7 hardware utilizing the Arduino library.
To connect the Arduino Portenta H7 board to the EI account, please follow the steps outlined in the link below.
After installing the firmware, open the command window/Terminal (MacOs) and type the following daemon command:
edge-impulse-daemon
Once the device is connected, navigate to the Data Acquisition section.
Begin collecting audio data by recording the audio through Portenta H7. Here I recorded Baby cry sound from YouTube and room noise in edge impulse tool and labelled it as 'Baby cry' and 'Room noise'.
Model training in Edge ImpulseIn the Create Impulse section, please set the Preprocessing block as MFCC and select "Classification" as the learning block.
Then generate the features and visualise to get high level overview of each labels.
In the NN settings, configure the training cycles as 100 and learning rate as 0.005
In the Neural Network section, configure the layers as indicated.
I have used reshape layer to convert the audio data to 1D array and applied 1D convolution layer for model training. For improving the accuracy, I have used the drop out layer as well.
The model achieved an accuracy of 98.2% during the training phase, which is sufficient to proceed to the next step.
During the testing phase, the model is evaluated using new datasets that were not incorporated in the training process. The Model achieved 100 % which is sufficient for hardware deployment.
After successfully verifying the trained model, deploy it back to the Arduino Portenta H7.
However, we won't be deploying it directly to the Arduino Portenta H7 just yet, as we need to add more logic on top of the machine learning prediction.
Once the model is downloaded, follow these steps to import the library into the Arduino IDE:
Importing library in Arduino IDE:1. Open your Arduino IDE, go to **Sketch** > **Add File**, and select the downloaded file.
2. Once imported, navigate to **Examples** > **SSmart_AI_Bottle_Preparation_Inferencing** > **Portenta_H7** > **Portenta_h7_microphone**.
After detecting the "Baby Cry" sound, the SW will check the window time ( 2 hours). If the previous activation time is more than 2 hours (window time), then it activates the Bottle Preparation Machine.
I have incorporated custom logic into this library to activate specific General Purpose Input/Output (GPIO) pins to turn ON/OFF the Bottle Preparation Machine.
ConclusionThis TinyML model, using the Inferencing method through the Edge Impulse tool, automates the critical tasks faced by every parents. These ML models can be utilized in various use cases, such as bouncers for baby.
Edge Impulse Project

_uOW364MAan.jpg?auto=compress%2Cformat&w=48&h=48&fit=fill&bg=ffffff)











Comments