You might have the cutting edge AI features but it is hard to know how useful it will be before letting your users beta test your prototype. You can build fast, deploy and deliver your app and iterate without writing any code, using AI Builder and Power Platform.
This article explains what Power Platform is, as well as go through a step by step process to create an application that detects objects from photos using Power Apps and AI Builder. Check out the video below to see the app we will build to detect different Mixed Reality Headsets such as HoloLens version 1 and 2 Augmented Reality and Virtual Reality headsets and their hand controllers.
What is Power Platform?
Power Platform is a set of tools, API's and SDK's that helps you analyze your data and build automations, applications and virtual agents with or without having to write any code.
What are Power Apps?
Power Apps, allows you to create applications with a drag and drop UI and easy integration of your data and 3rd party APIs through connectors.
A connector is a proxy or a wrapper around an API that allows the underlying service to talk to Microsoft Power Automate, Microsoft Power Apps, and Azure Logic Apps. It provides a way for users to connect their accounts and leverage a set of pre-built actions and triggers to build their apps and workflows. For example, you can use the Twitter connector to get tweet data and visualize it in a dashboard or use the Twilio connector to send your users text messages without having to be an expert in Twitter or Twilio APIs or having to write a line of code.
What is AI Builder?
AI Builder is one of the additional features of Power Apps. With AI Builder, you can add intelligence to your apps even if you have no coding or data science skills.
What are some of the use cases for AI Builder?
- Detect objects from images
- Analyze your customers' sentiment from feedback
- Detect keywords from text
- Extract specific information about your business from text
Is AI Builder the right choice?
Great question! There are so many tools out there and many ways to do the same thing. How do you know which one is the right solution before investing time and effort?
I have a rule of thumb when I want to build something, use whatever is available and easy to use first. When your needs exceed what the tool you are using covers, look into another solution or building it yourself.
Use the tool easiest to get started when you are building your idea. When your needs exceed the capabilities of the tool you are using, find a solution that enables you. Don't invest in building things from scratch before you know it is worth it to do so.
For example, if you have an app idea, it is better to have a prototype running as easily as possible. You can test your ideas before investing your time into building custom designed UI or features. In our specific case, you can first prototype your app with the drag and drop UI of Power Apps and using prebuilt AI models. When your specific needs surface, such as recognizing a particular object or keyword, you can invest your time into creating your custom models to train for the object or keyword detection.
Can I use Power Apps and AI Builder for production?
Yes you can. As any tool that does things magically, AI Builder in Power Apps comes with a cost. That does not mean you can't try your ideas out for free.
What will my production app cost?
If you want to go to production with Power Apps, it is a good idea to consider the costs. Thankfully there is an app for that. AI Builder Calculator lets you input what AI tools you will need and how many users will be accessing your app's AI features and gives you the price it will cost you.
What are preview features?
AI Builder was released for public preview on June 10, 2019 in Europe and the United States. Preview release features are subject to change and may have restricted functionality before the official release for general availability. Preview releases are not meant for production use. You can try them out and influence the final product by giving feedback.
The General Availability (GA) release will occur in a phased manner, with some features remaining in preview status while others are released for GA. You can check out the release status on the AI Builder documentation.
What is Object Detection?
AI Builder Object detection is an AI model that you can train to detect objects in pictures. AI models usually require that you provide samples of data to train before you are able to perform predictions. Prebuilt models are pre-trained by using a set of samples that are provided by Microsoft, so they are instantly ready to be used in predictions.
Object detection can detect up to 500 different objects in a single model and support JPG, PNG, BMP image format or photos through the Power Apps control.
How to try out Object Detection capabilities?
You can try out and see how object detection works before having to create and accounts or apps yourself on the Azure Computer Vision page.
What can you do with Object Detection?
-
Object counting and inventory management
-
Brand logo recognition
-
Wildlife animal recognition
How to detect objects from images?
- To start creating your AI model for your app, sign in to Power Apps and click on AI Builder on the left hand menu. Select Object Detection from the "Refine Model for your business needs" option.
-
Name your new AI model with a unique name. Select Common Objects and proceed to next section.
- Name the objects that you are going to detect.
- Upload images that contain the object you will detect. To start with you can upload 15 images for each object.
- Make sure each object has approximately the same amount of images tagged. If you have more examples of one object, the training data will be likely to detect that object when it is not.
- Tag your objects by selecting a square that your object is in and choosing the name of the object.
- Once you are done, choose Done Tagging and Train. Training process will take some time.
- If you choose to not use an image or clear any tags, you can do that at any time by going back to your model under the AI Builder on the left hand side menu and choose your model and choose edit.
- AI Builder will give you a Performance score over 100 and a way to quickly test your model before publishing. You can edit your models and retrain to improve your performance. Next section will give you some best practices to improve your performance.
How to Improve Your Custom Model Performance?
Getting the best model performance for your business can be an iterative process. Results can vary depending on the customizations you make to the model, and the training data you provide.
To help facilitate this process, AI Builder allows you to have multiple versions of your model so you can use your model and continue to improve it at the same time.
What are some best practices for training for object detection?
- Use diverse images to train with all possible use cases. For example if you are training your data to detect a VR headset, use images of the headset used in different environments as well as the out of the box images. If you only train with images with people wearing the headset, your model would not recognize images of the same device when it is in its box.
- Use images with a variety of backgrounds. Photos in context are better than photos in front of neutral backgrounds.
- Use training images that have different lighting. For example, include images taken with flash, high exposure, and so on.
-
Use images of objects in varied sizes. Different sizing helps the model generalize better.
-
Use images taken from different angles. If all your photos are from a set of fixed cameras such as surveillance cameras, assign a different label to each camera. This can help avoid modeling unrelated objects such as lampposts as the key feature. Assign camera labels even if the cameras capture the same objects.
How to share your models?
By default, only you can see the models you create and publish. This feature allows you to test them and use them within apps and flows without exposing them.
If you want others to use your model, you can share it with specific users, groups, or your whole organization.
How to use your Custom Vision model in a Power App?
Once you are happy with your model's performance, you can add it to a new app by choosing Use model and New app.
You will be redirected to Power App editor and an Object Detection component that uses your model will be added automatically. In the editor, you can add new pages to navigate, design and customize your pages.
Once you are happy with the design, you can publish and share your app. You can use your new app by downloading Power Apps from Apple, Android or Microsoft stores. Once you sign in, your app will be listed in the mobile Power Apps.
What's next?
Now you have your app's prototype, you can add more features, get feedback and test your app.
Should I keep using my power app or rebuild it?
When your needs change, you can consider refactoring your application to a serverless backend and a custom built UI. If the app is working fine for you and your users, you can continue using and improving overtime using Power Apps.
What would be the changes that require the upgrade? There are two possibilities for the changed requirements for your app:
- Feature
- Budget
How to create a custom feature for Power Apps?
Ready made tools are always limited to the features the product team decides to include. If you are writing custom code, you can add any feature that you need. Thankfully, for the features that are not implemented yet, it is always possible to author a custom connector that you can use with or without Power Apps.
A connector is a proxy or a wrapper around an API that allows the underlying service to talk to Microsoft Power Automate, Microsoft Power Apps, and Azure Logic Apps. It provides a way for users to connect their accounts and leverage a set of pre-built actions and triggers to build their apps and workflows.
Check out the list of Power Apps Connectors and how to build a custom connector yourself.
How to compare costs for Power Apps and Logic Apps?
Once you start using your app, you will have a better idea about the number of users accessing AI capabilities and the number of images that you need to train. You can use AI Builder Cost Calculator and Logic App Cost Calculator to compare options. You can check any other service price through Azure Product Cost Calculator.
Additional Resources
- Artificial Intelligence for Developers
- Cognitive Services Overview
- Power Apps Free Trial
- List of Power Apps Connectors
- AI Builder Release Status
- AI Builder Cost Calculator
- Computer Vision Overview
Leave a comment below for your AI application use cases and the tutorials you would like to see.
You can use pre-trained models to: