Validated Patterns

Introduction

The medical diagnosis pattern integrates multiple Red Hat and Open Source technologies together to create an AI/ML workflow that is able to identify signs of pneumonia in x-ray images. Within this demo a dashboard is automatically created that provides the CPU and Memory metrics for the pod running the risk assessment application. The dashboard also provides visual representation of the AI/ML workflow from the images being generated at the remote medical facility to running through the image anonymizer, it also includes the image being scanned along with statistics from the workflow - indicating the probability in which a patient may or may not have pneumonia.

aiml pipeline

We simulate the function of the remote medical facility with an application called the image-generator.

Enabling the Grafana based dashboard

The Grafana dashboard offers a visual representation of the AI/ML workflow, including CPU and memory metrics for the pod running the risk assessment application. Additionally, it displays a graphical overview of the AI/ML workflow, illustrating the images being generated at the remote medical facility.

This showcase application is deployed with self-signed certificates, which are considered untrusted by most browsers. If valid certificates have not been provisioned for your OpenShift cluster, you will need to manually accept the untrusted certificates using the process below.

  1. Accept the SSL certificates on the browser for the dashboard. In the OpenShift Container Platform web console, go to the Networking > Routes for All Projects. Click the URL for the s3-rgw.

    s3-rgw route

    Ensure that you see XML and not the access denied error message.

    storage rgw route

This showcase application does not have access to a x-ray machine hanging around that we can use for this demo, so one is emulated by creating an S3 bucket and hosting the x-ray images within it. In the "real world" an x-ray would be taken at an edge medical facility and then uploaded to an OpenShift Data Foundations (ODF) S3 compatible bucket in the Core Hospital, triggering the AI/ML workflow.

To emulate the edge medical facility we use an application called image-generator which when scaled up will download the x-rays from S3 and put them in an ODF S3 bucket in the cluster, triggering the AI/ML workflow.

Turn on the image file flow. There are couple of ways to go about this.

  1. Go to the OpenShift Container Platform web console and change the view from Administrator to Developer and select Topology. From there select the xraylab-1 project.

  2. Right-click on the image-generator pod icon and select Edit Pod count.

  3. Up the pod count from 0 to 1 and save.

Alternatively, you can have the same outcome on the Administrator console.

  1. Go to the OpenShift Container Platform web console under Workloads, select Deployments for the Project xraylab-1.

  2. Click image-generator and increase the pod count to 1.

Viewing the Grafana dashboard

Access the Grafana dashboard to view the AI/ML workflow. Carry out the following steps:

  1. In the OpenShift Container Platform web console, select the nines menu and right click the Grafana icon.

  2. Within the grafana dashboard click the Dashboards icon.

  3. Select the xraylab-1 folder and the XRay Lab menu item.

dashboard

In the dashboard on the right we see the images that have been uploaded, processed and anonymized. Images in the processed view have been through the AI/ML pipeline and images in the lower third are images that have been stripped of Personally Identifiable Information or PII.

In the lower middle section of the dashboard we can see the distribution of images that are normal, unsure or pneumonia has been detected. We can also see the number of risk assessment containers running as well as the cpu and memory metrics for the pods.

Summary

You did it! You have completed the deployment of the medical diagnosis pattern! Hopefully you are getting ideas of how you can take advantage of our GitOps framework to deploy and manage your applications.

The medical diagnosis pattern is more than just the identification and detection of pneumonia in x-ray images. It is an object detection and classification model built on top of Red Hat OpenShift and can be transformed to fit multiple use-cases within the object classification paradigm. Similar use-cases would be detecting contraband items in the Postal Service or even in luggage in an airport baggage scanner.

For more information about Validated Patterns, visit our website.