There are more than 6 million Android developers out there, and almost 3 million iOS developers. Now, these are huge numbers, and a lot of these developers do want to have access to building applications that leverage some sort of machine learning workload for increasing the abilities of their applications and adding more functionality.
However, the problem arises that not every mobile developer is a machine learning engineer, many of them even have not used or built anything with ML frameworks such as Tensorflow or PyTorch before.
Introducing Edge ImpulseBut, with the entry of Edge Impulse, things seem to change.
Edge Impulse is a low-code tool that allows anyone to develop AI solutions with the help of its web studio. It also has EON Tuner, which can deliver almost twice the performance without compromising too many hardware resources.
Developing the ML ModelDeveloping a machine learning model in Edge Impulse is pretty straightforward, let's take a look into how I built a model to classify Bacterial and Viral Pneumonia. The model can also classify whether the x-ray image even has the presence of Pneumonia or not.
We’ve retrieved the data from Paul Mooney’s Pneumonia Dataset on Kaggle and we’ve even collected some x-ray images from local doctors and hospital facilities.
Following are the blocks we've used in the impulse design procedure:
Next up, we've used the Transfer Learning block with MobileNet V2 96X96 0.2 for the creation of our ML model. Now to put it simply, Transfer Learning is a way a model trained on one task is repurposed on a second, related task as an optimization that allows rapid progress when modelling the second task.
We've used the MobileNet V2 96X96 0.2 model as to crop the image and focus on the x-ray rather than on its surroundings, moreover, it helps in increasing accuracy along with a bit faster processing time.
Also, I've used the famous EON Tuner for getting an accuracy of about 81% on my model.
EON Tuner levels up the accuracy of the NN Classifier with a minimal loss of only 0.50.
Download Android Studio and follow the steps mentioned in the Installer GUI for complete installation on your Computer.
Next up download the Android App zip file from the Google Drive link shared here.
Open Android Studio on your computer, and then click on the Open tab on the Android Studio pop-up page. Provide the location to the folder wherein you've saved the downloaded Android app.zip file.
Then open the app folder, then the java folder, and finally open the MainActivity and WebViewClientImpl files in the IDE.
Now in the MainActivity file move to line no. 94, you will find the URL of Edge Impulse's Mobile Browser testing site, here paste the API Key you've copied from the Edge Impulse Studio Keys dashboard.
Do the same in line no. 24 of the WebViewClientImpl file.
Once you've entered the API keys, now connect your Android device to your computer using a USB cable, once connected enable developer settings on your Android device and enable USB Debugging.
Now, hit that GreenArrow button and the app will be installed onto your device.
iOS/iPadOS App CreationFirst off get your iPad updated to the latest iPadOS release, then head over to App Store and install Kodika software on your iPad.
Once installed create an account or sign in if you already have an existing account on Kodika.
Once the sign-up process is completed, now click on the New Project option on the Kodika main screen. Give a name for your app and hit Create.
Next up we will add a NewScreen, for instance here we will call it "main".
Once the screen is created, we will select the Webview object from the Datasource tab.
And drag it to the middle of the simulated iPhone screen.
Now we will open the Edge Impulse Studio dashboard page on Safari, open our project's Deployment tab and select the Mobile option and click Build. It will then open up a QR Code along with a link to the site embedded in the QR Code.
Now copy the site's URL as shown below.
Then paste it into the URL section of the Web View Properties tab.
Now, click on the CODE tab and click on the AddProperty option.
Then select the name of the screen you've put earlier, here I've used "main".
On the next screen select One option.
Lastly, click on the SAVE option.
Once, the entire procedure is complete click on the GreenArrow to run the app on your iPad (or install it on your iPhone if you wanna test this on iPhone 11 or higher).
ConclusionThat's it, you've finally made a fully usable ML-powered mobile app that can run on any mobile device.
Feel free to experiment with this technology and share with us what mobile apps you've built using Edge Impulse on our socials (@edgeimpulse).
Comments