A dog is man's best friend. But more often than not, the relationship isn't bilateral. A true friend listens, and with PUPPI we are planning to enable that for more people than ever before.For the longest of times, guide dogs have been a pillar onto which people with all kinds of disabilities have been able to support themselves with. But specifically for the hearing impaired, the primary method through which a dog communicates with us is out of the picture.PUPPI is a tiny, portable and easy to use device, meant to identify a dog's different moods through sound analysis. Puppi is small enough that it can be carried clipped onto one's shirt, or even attached to your guide dog's collar. Our app's easy-to-use interface categorizes different moods in a fast and intuitive way, giving the user not only the possibility of quickly gauging the detected stimulus, but also to determine how confident our model is in its decision.The project is spearheaded and mentored by our lecturer at the University of Electrotechnical Engineering, Luka Mali.
How?Puppi consists of three elements. At its core is the PuppiMachineLearningModel which performs an analysis of sound data collected by the Arduino Nano 33 BLE Sense device's microphone, with the findings being sent to the PuppiMobileApp via Bluetooth.
The Machine Learning modelBuilt using Edge Impulse, the model is built to distinguish between and detect three categories of sounds: barks, growls and whines, while also containing a fourth category for when none of target sounds is detected.
The learning data was procured from a wide range of sources with varying qualities and a broad range of background noise levels.
The Arduino boardVia a library, the fore-described model is implemented into an Arduino sketch which waits for a Bluetooth connection and then begins the classification loop.
void loop()
{
bool m = microphone_inference_record();
if (!m) {
ei_printf("ERR: Failed to record audio...\n");
return;
}
signal_t signal;
signal.total_length = EI_CLASSIFIER_SLICE_SIZE;
signal.get_data = µphone_audio_signal_get_data;
ei_impulse_result_t result = {0};
EI_IMPULSE_ERROR r = run_classifier_continuous(&signal, &result, debug_nn);
if (r != EI_IMPULSE_OK) {
ei_printf("ERR: Failed to run classifier (%d)\n", r);
return;
}
Results are sent on every loop iteration via a simple integer value between 0 to 3.
if (central.connected()) batteryLevelChar.writeValue(BT_result);
The board itself also displays the result using its color LED, where red signifies a bark, green a growl and blue a whine.
int BT_result = 0;
if (result.classification[2].value < result.classification[0].value
&& result.classification[2].value < result.classification[1].value
&& result.classification[2].value < result.classification[3].value) {
if (result.classification[0].value > result.classification[1].value
&& result.classification[0].value > result.classification[3].value
&& result.classification[0].value > 0.65) {
digitalWrite(RED, LOW);
digitalWrite(GREEN, HIGH);
digitalWrite(BLUE, HIGH);
BT_result = 1;
} else if(result.classification[1].value > result.classification[0].value
&& result.classification[1].value > result.classification[3].value
&& result.classification[1].value > 0.65) {
digitalWrite(RED, LOW);
digitalWrite(GREEN, LOW);
digitalWrite(BLUE, HIGH);
BT_result = 2;
} else if(result.classification[3].value > result.classification[0].value
&& result.classification[3].value > result.classification[1].value
&& result.classification[3].value > 0.65) {
digitalWrite(RED, HIGH);
digitalWrite(GREEN, HIGH);
digitalWrite(BLUE, LOW);
BT_result = 3;
} else {
digitalWrite(RED, HIGH);
digitalWrite(GREEN, HIGH);
digitalWrite(BLUE, HIGH);
}
} else {
digitalWrite(RED, HIGH);
digitalWrite(GREEN, HIGH);
digitalWrite(BLUE, HIGH);
}
The AppLastly, the app, built using MIT App Inventor, first searches for the Puppi Arduino device and then displays the data it receives in the form of a cursor on a wheel.
Our app has a very simple interface, containing only a connection status indicator and the aforementioned wheel, where red represents barking, green represents growling and blue whining.
Comments