Project Demo
Project Repo
https://www.adammiltonbarker.com/projects/downloads/AI-Patient-Assistance.zipIntroduction
Solution
A well known field of Artificial Intelligence is voice recognition. These machine learning and deep learning models are trained to recognize phrases or keywords, and combined with the Internet of Things can create fully autonomous systems that require no human interaction to operate. As technology has advanced, it is now possible to run voice recognition solutions on low cost, resource constrained devices. This not only reduces costs considerably, but also opens up more possibilities for innovation. The purpose of this project is to show how a machine learning model can be deployed to a low cost IoT device (Arduino Nano 33 BLE SENSE), and used to notify staff when a patient needs their help. The device will be able to detect three keywords Doctor, Nurse, and Help. The device also acts as a BLE peripheral, BLE centrals/masters such as a central server for example, could connect and listen for data coming from the device. The server could then process the incoming data and send a message to hospital staff or sound an alarm.Hardware
- Arduino Nano 33 BLE Sense Buy
Platform
- Edge Impulse Visit
Software
Project Setup
Head over to Edge Impulse and create your account or login. Once logged in you will be taken to the project selection/creation page.Create New Project
Your first step is to create a new project. From the project selection/creation you can create a new project.Create Edge Impulse project
Choose project type
Connect Your Device
Connect device
flash_windows.bat, flash_mac.command or flash_linux.sh.
Edge Impulse firmware installed
edge-impulse-daemon
If you are already connected to an Edge Impulse project, use the following command:
edge-impulse-daemon --clean
Follow the instructions to log in to your Edge Impulse account.
Device connected to Edge Impulse
Data Acquisition
We are going to create our own dataset, using the built in microphone on the Arduino Nano 33 BLE Sense. We are going to collect data that will allow us to train a machine learning model that can detect the words/phrases Doctor, Nurse, and Help. We will use the Record new data feature on Edge Impulse to record 15 sets of 10 utterances of each of our keywords, and then we will split them into individual samples. Ensuring your device is connected to the Edge Impulse platform, head over to the Data Acquisition tab to continue.Data acquisition
Recorded sample
Data split
Split data
Main data
Data upload
Split Dataset
split-data.jpg
Recorded dataset
Create Impulse
Create Impulse
Add processing block
Created Impulse
MFCC Block
Parameters
Parameters
Generate Features
Generate Features
Generated Features
Training
Training
Training complete
Testing
Platform Testing
Test model
Test model results
On Device Testing
Live testing
Performance Calibration
Performance Calibration
Turn on perfcal
Perfcal settings
Perfcal configs
Versioning
Versioning
Versions
Deployment
Now we will deploy an Arduino library to our device that will allow us to run the model directly on our Arduino Nano 33 BLE Sense.Build
Build optimizations
Arduino library
Arduino IDE
Arduino library
Non-Continuous Classification
Non-continuous classification
Arduino IDE serial
Arduino Nano 33 BLE Sense
Continuous Classification
Continuous classification
BLE
This program acts as a BLE peripheral which basically advertises itself and waits for a central to connect to it before pushing data to it. In this case our central/master is a smart phone, but in the real world this would be a BLE enabled server that would be able to interact with a database, send SMS, or forward messages to other devices/applications using a machine to machine communication protocol such as MQTT.nRF Connect BLE
Conclusion
Here we have created a simple but effective solution for detecting specific keywords that can be part of a larger automated patient assistance system. Using a fairly small dataset we have shown how the Edge Impulse platform is a useful tool in quickly creating and deploying deep learning models on edge devices. You can train a network with your own keywords, or build off the model and training data provided in this tutorial. Ways to further improve the existing model could be:- Record more samples for training
- Record samples from multiple people