How to Utilize Python Machine Learning Models

Ever trained a new model and just wanted to use it through an API straight away? Sometimes you don't want to bother writing Flask code or containerizing your model and running it in Docker. If that sounds like you, you definitely want to check out MLServer. It's a Python-based inference server that recently went GA, and what's really neat about it is that it's a highly-performant server designed for production environments. That means that, by serving models locally, you are running in the exact same environment as they will be in when they get to production.

This blog walks you through how to use MLServer by using a couple of image models as examples.

Image Classification Using SingleStore DB, Keras, and Tensorflow

Abstract

Image classification can have many practical, valuable and life-saving benefits. The "Hello World" of image classification is often considered MNIST and, more recently, Fashion MNIST. This article will use Fashion MNIST and store the images in a SingleStore DB database. We'll also build an image classification model using Keras and Tensorflow and store the prediction results in SingleStore DB. Finally, we'll build a quick visual front-end to our database system using Streamlit that enables us to retrieve an image and determine if the model correctly identified it.

The SQL scripts, Python code and notebook files used in this article are available on GitHub. The notebook files are available in DBC, HTML and iPython formats.

Efficient Model Training in the Cloud with Kubernetes, TensorFlow, and Alluxio

Alibaba Cloud Container Service Team Case Study

This article presents the collaboration of Alibaba, Alluxio, and Nanjing University in tackling the problem of Deep Learning model training in the cloud. Various performance bottlenecks are analyzed with detailed optimizations of each component in the architecture. Our goal was to reduce the cost and complexity of data access for Deep Learning training in a hybrid environment, which resulted in an over 40% reduction in training time and cost.

1. New Trends in AI: Kubernetes-Based Deep Learning in The Cloud

Background

Artificial neural networks are trained with increasingly massive amounts of data, driving innovative solutions to improve data processing. Distributed Deep Learning (DL) model training can take advantage of multiple technologies, such as:

Machine Learning Orchestration on Kubernetes Using Kubeflow

MLOps: From Proof Of Concepts to Industrialization

In recent years, AI and Machine Learning have seen tremendous growth across industries in various innovative use cases. It is the most important strategic trend for business leaders. When we dive into a technology, the first step is usually experimentation on a small scale and for very basic use cases, then the next step is to scale up operations. Sophisticated ML models help companies efficiently discover patterns, uncover anomalies, make predictions and decisions, and generate insights, and are increasingly becoming a key differentiator in the marketplace. Companies recognise the need to move from proof of concepts to engineered solutions, and to move ML models from development to production. There is a lack of consistency in tools and the development and deployment process is inefficient. As these technologies mature, we need operational discipline and sophisticated workflows to take advantage and operate at scale. This is popularly known as MLOps or ML CI/ CD or ML DevOps. In this article, we explore how this can be achieved with the Kubeflow project, which makes deploying machine learning workflows on Kubernetes simple, portable, and scalable.

MLOps in Cloud Native World

There are Enterprise ML platforms like Amazon SageMaker, Azure ML, Google Cloud AI, and IBM Watson Studio in public cloud environments. In the case of an on-prem and hybrid open-source platform, the most notable project is Kubeflow.

Streaming Machine Learning With Kafka-Native Model Server

Apache Kafka became the de facto standard for event streaming across the globe and industries. Machine Learning (ML) includes model training on historical data and model deployment for scoring and predictions. While training is mostly batch, scoring usually requires real-time capabilities at scale and reliability. Apache Kafka plays a key role in modern machine learning infrastructures. The next-generation architecture leverages a Kafka-native streaming model server instead of RPC (HTTP/gRPC) calls:

This blog post explores the architectures and trade-offs between three options for model deployment with Kafka: Embedded model into the Kafka application, model server and RPC, model server, and Kafka-native communication.

Getting Started With PyTorch – Deep Learning in Python

Are you trying to design a model using machine learning? 

If yes, PyTorch will be the right choice in that case. This article will help you understand the basics of deep learning and the concept of PyTorch. In the beginning, we will explain what PyTorch is & the advantages of using it for your projects. The article will end with a quick comparison between PyTorch and NumPy using an example.

Autograd: The Missing Machine Learning Library

Wait, people use libraries other than TensorFlow and PyTorch?

Ask a group of deep learning practitioners for their programming language of choice and you’ll undoubtedly hear a lot about Python. Ask about their go-to machine learning library, on the other hand, and you’re likely to get a picture of a two library system with a mix of TensorFlow and PyTorch. While there are plenty of people that may be familiar with both, in general commercial applications in machine learning (ML) tend to be dominated by the use of TensorFlow, while research projects in artificial intelligence/ML mostly use PyTorch. Although there’s significant convergence between the two libraries with the introduction of eager execution by default in TensorFlow 2.0 released last year, and the availability of building static executable models using Torchscript, most seem to stick to one or the other for the most part.

Deep Learning with Spring Boot and DJL

Overview

This is another post on Spring Boot that will show how to build a sample web application using Deep Java Library (DJL), an open-source Deep Learning library for Java to diagnose COVID-19 on X-ray images.

The sample app is a Spring Boot based version of DJL's similar COVID-19 example and it has a simple static HTML page built using Twitter Bootstrap and JQuery where users can submit an image URL to a REST api where the DJL library will download the image and predict if it's an X-ray image of lungs infected with COVID-19 or not.

Apache Kafka and Machine Learning in Pharma and Life Sciences Industry

This blog post covers use cases and architectures for Apache Kafka and Event Streaming in Pharma and Life Sciences. The technical example explores drug development and discovery with real time data processing, machine learning, workflow orchestration and image / video processing.

Use Cases in Pharmaceuticals and Life Sciences for Event Streaming and Apache Kafka

The following shows some of the use cases I have seen in the field in pharma and life sciences:

Fake News’ Foe: Machine Learning and Twilio

Fake news has become a huge issue in our digitally-connected world and it is no longer limited to little squabbles — fake news spreads like wildfire and is impacting millions of people every day.

How do you deal with such a sensitive issue? Countless articles are being churned out every day on the internet — how do you tell real from fake? It's not as easy as turning to a simple fact-checker which is typically built on a story-by-story basis. As developers, can we turn to machine learning?

Breezing Through Support Vector Machines

When we add "Machine" to anything it looks cool... perhaps due to an assumption made about the introduction of both "intelligence" and "automation" hinted by the use of such a term.

So, let's take that out and we are back to old, classical vector algebra. It's like a person with a bunch of sticks to figure out which one to lay where in a 2-D plane to separate one class of objects from another, provided class definitions are already known. 

Eye Disease Detection Using TensorFlow and Azure’s CustomVision.ai

Eye Disease Detection Using TensorFlow and Azure's CustomVision.ai

Synopsis

Globally, more than 1 billion people are affected by vision impairment or blindness due to unaddressed cataracts (65.2 million), glaucoma (6.9 million), and retina disease (3 million).

Proposed here is the development of an AI-based system that uses the Azure Cognitive Services CustomVision tool to predict the probability of the existence of one of these chronic conditions in an eye scan.

Use Configuration-Based Dependency Injection on TFLearn to Improve Iterative Deep Learning Development Process

How deep is your learning?
You may also like: Deep Learning and the Artificial Intelligence Revolution (Part 1)

Introduction

Deep learning has been proven as a key benefit to all aspects of business development. By using the deep learning frameworks, such as TFLearn, a deep learning library featuring a higher-level API for TensorFlow, we can quickly develop and train a model to perform accurate and intuitive cognitive tasks.

To develop a good deep learning model is an iterative process consisting of steps and sub-tasks which require big collaborations from the teams of data scientists, machine learning engineers, and IT deployment support.

AI Writing Prompts

Take a look at these AI writing prompts!

Ever struggle with what to write? No worries, we've got you covered. Here's a list of AI prompts and article ideas to help cure your writer's block. Take a moment, check out the prompts below, pick one (or more!), and get to writing.

Also, please feel free to comment on this post to bounce around ideas, ask questions, or share which prompts you're working on. 

TensorFlow.js and Custom Classifiers

TensorFlow.js and Custom Classifiers
TensorFlow.js and Custom Classifiers

I've noticed that most samples out there for image classification with TensorFlow.js use an existing model that has wrappers that make it easy to pass an image to them to see the classification for that image. One thing missing is an easy way to see how to get a custom image passed to a custom classifier to get the results. I.E. How do I format the input to a model?

So, I'm taking a Cats vs Dogs model, trained with the notebook here, and I've converted it to TensorFlow.js using the tensorflowjs libraries in Python.

TensorFlow 2.0: Dynamic, Readable, and Highly Extended

TensorFlow 2.0 Introduction

Considering learning a new Python framework for deep learning? If you already know some TensorFlow and are looking for something with a little more dynamism, you no longer have to switch all the way to PyTorch thanks to some substantial changes coming as part of TensorFlow 2.0. In fact, many of the changes in 2.0 specifically address the alleged shortcomings of TensorFlow.

With eager execution by default, you no longer have to pre-define a static graph, initialize sessions, or worry about tensors falling outside of the proper scope when you get over-zealous in your object-oriented principles. TensorFlow still has about 3 times the user base of PyTorch (judging from the repositories on GitHub referencing each framework), and that means more extensions, more tutorials, and more developers collaboratively exploring the space of all possible code errors on Stack Overflow. You’ll also find that despite the major changes starting with TensorFlow 2.0, the project developers have taken many steps to ensure that backwards compatibility can be maintained.