Machine learning is really important to unlock those features which were quite difficult to achieve before introduction to machine learning however the amount of expertise it requires is a matter of concern for many. So how about getting the ability to add machine learning capabilities to either android or iOS apps without having much experience in training the model or deploying them.
Firebase Machine Learning
The platform which provides solutions to many problems now has a dedicated service for cloud-based machine learning, it’s firebase. Earlier firebase had a service called ML Kit which offered on-device and on-cloud machine learning capabilities to the mobile app but now it got its own standalone SDK for all on-device machine learning and on-cloud remains on firebase platform with the service named firebase machine learning.
On-Device vs On-Cloud Machine Learning
Well the major difference between both of them is where the model is hosted and place of inference. In the case of on-device machine learning the model has to be download on the device before the APIs could fetch the result (do inference) whereas with on-cloud the inference happens on the cloud so you have to send data and get the result through API for that you should have a working internet connection on the device.
If you care about privacy and speed then on-device is really a good option however if you care more about higher accuracy then on-cloud is the best option.
Firebase ML Capabilities
Currently, firebase offers the following machine learning capabilities
- Recognize Text
- Label Images
- Recognize Landmarks
Apart from these ready-to-use cloud-based APIs, you can train your own image classification model using AutoML Vision Edge through firebase console or host your pre-trained tflite model on firebase.
ML Kit Capabilities
All on-device machine learning is still a part of ML Kit, the major difference is that now it’s a standalone SDK so you need not have to register your project on firebase, following are the capabilities offered by ML Kit
- Barcode scanning
- Face Detection
- Image Labeling
- Object Detection and Tracking
- Text Recognition
- Language Id
- On-Device Translation
- Smart Reply
The best part is that as it’s an on-device machine learning so you either use it one time or a million times it’s going to be free as inference (prediction by model) happens on your mobile device.
Migrating from firebase ML Kit
There are changes in the dependencies and the APIs for inference.
Following is the link for migrating your android or iOS app to ML Kit
Migration Guide | ML Kit | Google Developers
On June 3, 2020, we made some changes to ML Kit for Firebase to better distinguish the on-device APIs from cloud based…
With the division between on-device machine learning by ML Kit and on-cloud by firebase, it becomes easy for the developers to target what they really want to use. However, switching between on-device and on-cloud will not be as easy as before as APIs changes are required for it.