Real-Time Object Detection With Spring Cloud Stream

DZone 's Guide to

Real-Time Object Detection With Spring Cloud Stream

Learn how, as a Java practitioner, you can leverage ML/DL to deliver richer business solutions to your customers via Spring Cloud Stream and Spring Cloud Data Flow.

· AI Zone ·
Free Resource

Machine learning and deep learning (ML/DL) have brought unprecedented abilities to the software engineering field. ML/DL allows you to reason about and to solve otherwise "un-programmable" tasks such as computer vision and language processing. That's why it's so exciting to so many people.

But as a Java practitioner, how can you leverage ML/DL to deliver richer business solutions to your customers? My goal is to show you how Spring Cloud Stream and Spring Cloud Data Flow can make this much easier for you.

Let's back up. The ML/DL paradigm works by making observations, running experiments, and using statistics to analyze the results from the experiments. Usually, the process is divided in two phases: model training on historical datasets and using the pre-trained models for predictive analytics at run-time (called ML inference). While most ML tools will help you through the tasks of data exploration, preparation, and model training, you are left on your own to figure out how to integrate and operationalize those tools.

Model inference for predictive analytics is the most common use of ML/DL in Java applications. You take a pre-trained (out-of-the-box) model and use it in your applications to do real-time predictions (e.g. fraud detection, vehicle predictive maintenance, or telco churn analysis).
The ML inference requires a portable format for exchanging models between the training and the inference phases. Several initiatives such as PMML, PFA, MLeap, and ONNX aim to a portable format.

Today, we will focus on TensorFlow, an emerging DL framework that has gained a lot of momentum. This success is partly due to the model serialization capabilities it provides. TensorFlow's pre-trained models can be serialized and reused across multiple programming languages, CPU and GPU processors, and platform architectures.

The remaining of this article will demonstrate how Spring Cloud Stream (SCSt) and Spring Cloud Data Flow (SCDF) significantly simplify the tasks of deploying and operationalizing pre-trained TensorFlow models. You can build upon these concepts to add ML/DL capabilities for your own business solutions.

An out-of-the-box, TensorFlow Processor is available to perform real-time predictive analytics using pre-trained TensorFlow models. Further extending upon this foundation, a use case's specific processors to perform Twitter Sentiment Analysis and Image Recognition are available for experimentation, too.

The new Object Detection processor provides out-of-the-box support for the TensorFlow Object Detection API. It allows for real-time localization and identification of multiple objects in a single image or image stream. The Object Detection processor uses one of the pre-trained object detection models and corresponding object labels.

Image title

The following example illustrates a Spring Cloud Data Flow streaming pipeline that predicts object types from the images in real-time.

Real-time Object Detection using Spring Cloud Data Flow

ai ,machine learning ,deep learning ,predictive analytics ,tensorflow ,real-time data analytics ,object detection ,spring cloud ,java ,spring cloud data flow

Published at DZone with permission of Christian Tzolov . See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}