This is a guest post by Julian Khoo, VP Product Development and Co-Founder at Joget Inc. Julian has almost 20 years of experience in enterprise software development, involving various products and platforms in application development, workflow management, content management, collaboration and e-commerce.
What used to be just a pipe dream in the realms of science fiction, artificial intelligence (AI) and Machine Learning (ML) are now mainstream technologies in our everyday lives with applications in image and voice recognition, language translations, chatbots, and predictive data analysis.
TensorFlow is arguably one of the most popular open source AI library for machine learning. Built by Google, TensorFlow is designed for, training, testing and deploying deep learning neural networks. Neural networks are used in a variety of applications, notably in classification problems such as speech and image recognition.
Containers and Kubernetes are key to accelerating the ML lifecycle as these technologies provide data scientists the much needed agility, flexibility, portability, and scalability to train, test, and deploy ML models.
Red Hat OpenShift is the industry's leading containers and Kubernetes hybrid cloud platform. It provides all the above benefits, and through the integrated DevOps capabilities and integration with hardware accelerators, OpenShift enables better collaboration between data scientists and software developers. This helps accelerate the roll out of intelligent applications across hybrid cloud (data center, edge, and public clouds).
Joget is an open source no-code/low-code application platform that empowers non-coders to visually build and maintain apps anytime, anywhere. By accelerating and democratizing app development, Joget is a natural fit for modern Kubernetes Hybrid Cloud platforms like Red Hat OpenShift.
In this example, we will look at incorporating a trained TensorFlow neural network model into a Joget Workflow app running on OpenShift to perform image recognition.
To illustrate the use of image recognition in an app, we’ll design a simple Joget app:
- A user uploads an image via a web interface
- The uploaded image will be labeled and classified based on the image recognized
- The workflow process then routes to different activities depending on the image label to recognize image correctly
For demonstration purposes, let’s assume we are looking for images of lions, because lions are awesome!
Example: Incorporate Image Recognition in a Joget App
Deploy Joget on OpenShift
In a previous article, we looked at deploying the Joget platform on OpenShift using the Red Hat OpenShift Certified Joget Operator. Follow the steps in Automating Low Code App Deployment on Red Hat OpenShift with the Joget Operator to setup the Joget environment.
Develop AI Image Recognition Plugin
The TensorFlow project provides a sample model and Java code for labelling images.
We encapsulated it into the AI Label Image plugin (a custom Joget process tool plugin) that provides configuration options to select the file upload field, and determine where to store the results.
Design App for Image Recognition and Classification
Using the Form Builder, a simple form is designed to upload a file.
The App Generator is then used to generate the full working user interface (UI).
Using the Process Builder, a simple process is designed to handle the activity routing based on the image classification upon form submission, as per the process diagram below.
The AI Label Image tool is mapped to the AI Label Image plugin developed earlier.
AI Image Recognition App in Action
Once the app is published, a user can select the Upload Image link to upload the image.
The trained neural network in the sample uses a pre-trained Inception model that recognizes about 1000 different image labels.
Uploading an image of a lion will route to the “Lion Activity.”
On the other hand, uploading a different type of image (such as the car below) will route to the “Non-Lion Activity.”
This small example serves to demonstrate the potential of harnessing AI/ML in your apps and workflow. Download the Joget app and plugin for this example, and get started with TensorFlow and Joget.
While this example on Joget Workflow uses a custom TensorFlow plugin, the upcoming next generation Joget DX bundles AI plugins as part of the core platform which will further simplify the integration of AI technology into your apps.
References (For Internal Use)