Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions content/patterns/mlops-fraud-detection/_index.adoc
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---
title: MLOps Fraud Detection
date: 2023-11-12
date: 2025-11-20
tier: sandbox
summary: This pattern demonstrates how Red Hat OpenShift Data Science and MLFlow can be used together to build an end-to-end MLOps platform. It demonstrates this using a credit card fraud detection use case.
summary: This pattern demonstrates how Red Hat OpenShift AI can be used to build an end-to-end MLOps platform. It demonstrates this using a credit card fraud detection use case.
rh_products:
- Red Hat OpenShift Container Platform
- Red Hat OpenShift Data Science
- Red Hat OpenShift Data Foundation
- Red Hat OpenShift AI
partners:
- IBM Fusion
industries:
- financial services
aliases: /mlops-fraud-detection/
Expand All @@ -17,11 +18,6 @@ links:
arch: https://www.redhat.com/architect/portfolio/architecturedetail?ppid=6
bugs: https://github.com/validatedpatterns/mlops-fraud-detection/issues
feedback: https://docs.google.com/forms/d/e/1FAIpQLScI76b6tD1WyPu2-d_9CCVDr3Fu5jYERthqLKJDUGwqBg7Vcg/viewform
ci: mfd
contributor:
name: Arslan Khan
contact: mailto:arskhan@redhat.com
git: https://github.com/arslankhanali
---
:toc:
:imagesdir: /images
Expand All @@ -34,4 +30,4 @@ include::modules/mfd-architecture.adoc[leveloffset=+1]
[id="next-steps_mfd-index"]
== Next steps

* link:mfd-getting-started[Deploy the management hub] using Helm.
* link:mfd-getting-started[Install this pattern.]
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
title: Explore this pattern
weight: 20
aliases: /mlops-fraud-detection/mfd-explore-this-pattern/
---
:toc:
:imagesdir: /images
:_content-type: ASSEMBLY
include::modules/comm-attributes.adoc[]

[id="rhoai-components"]
== {rhoai} components

Most components installed as part of this pattern are available in the {rhoai} (RHOAI) console. To navigate to this page, click the {rhoai} link in the application launcher of the OpenShift console.

.The RHOAI Link
image::/images/mlops-fraud-detection/mfd-rhoai-link.png[]

[id="kubeflow-pipeline"]
=== Kubeflow pipeline

The pattern installation automatically creates and runs a Kubeflow pipeline to build and train the fraud detection model. To view pipeline details in the RHOAI console, select the *Pipelines* tab.

.The pipelines tab
image::/images/mlops-fraud-detection/mfd-pipelines-tab.png[]

This tab displays the fraud-detection pipeline deployed as part of this pattern. To view the specific run that trained the initial model, select the *Runs* tab and then select the *job-run* item.

.The runs tab
image::/images/mlops-fraud-detection/mfd-runs-tab.png[]

The *Runs* page displays a diagram of the pipeline, which includes the following three major steps:

* Obtaining the training data.
* Training the model.
* Uploading the model to MinIO.

You can view the logs of any stage, such as the training stage, to monitor accuracy changes for each model training epoch.

.The job-run pipeline details
image::/images/mlops-fraud-detection/mfd-job-run-detail.png[]

[NOTE]
====
The source code for this pipeline run is available in the pattern repository at link:https://github.com/validatedpatterns/mlops-fraud-detection/blob/main/src/kubeflow-pipelines/small-model/train_upload_model.yaml[src/kubeflow-pipelines/small-model].
====

[id="kserve-model-serving"]
=== Kserve model serving

You can view the model deployment in the Model Deployments tab of the RHOAI console.

.The model deployment
image::/images/mlops-fraud-detection/mfd-model-deployments.png[]

[id="inferencing-application"]
== Inferencing application

The pattern installs a simple Gradio front end to communicate with the fraud detection model. To access the application, click the link in the application launcher of the OpenShift console.

.The inferencing application link
image::/images/mlops-fraud-detection/mfd-inf-app-link.png[]

You can manually configure transaction details in the form. The application includes two examples: a fraudulent transaction and a non-fraudulent transaction.

.Using the fraud example
image::/images/mlops-fraud-detection/mfd-inferencing-app.png[]

[IMPORTANT]
====
Due to the non-deterministic nature of the training process, the model might not always identify these transactions accurately.
====

[NOTE]
====
The source code for the inferencing application is available in the pattern repository at link:https://github.com/validatedpatterns/mlops-fraud-detection/blob/main/src/inferencing-app/app.py[src/inferencing-app].
====
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ include::modules/mfd-deploying-mfd-pattern.adoc[leveloffset=1]

= Next Steps

* link:../mfd-running-the-demo[Run the demo].
* link:../mfd-explore-this-pattern[Explore this pattern].
12 changes: 12 additions & 0 deletions content/patterns/mlops-fraud-detection/mfd-ibm-fusion.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: Fraud Detection on IBM Fusion
weight: 30
aliases: /mlops-fraud-detection/mfd-ibm-fustion/
---
:toc:
:imagesdir: /images
:_content-type: ASSEMBLY

== MLOPS credit card fraud detection on IBM Fusion

This pattern is deployed with IBM Fusion. For more details, see the link:https://community.ibm.com/community/user/blogs/saif-adil/2026/01/08/deploying-ai-driven-credit-card-fraud-detection[IBM Community Post].
16 changes: 0 additions & 16 deletions content/patterns/mlops-fraud-detection/mfd-running-the-demo.adoc

This file was deleted.

25 changes: 14 additions & 11 deletions modules/mfd-about-mlops-fraud-detection.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
:imagesdir: ../../images

[id="about-mlops-fraud-detection-pattern"]
= About the MLOps Fraud Detection
= About the MLOps Fraud Detection Pattern

NOTE: This pattern has been reworked for a modern RHOAI experience. To see the original pattern, check out the link:https://github.com/validatedpatterns/mlops-fraud-detection/tree/legacy[legacy branch].

MLOps Credit Card Fraud Detection use case::
* Build and train models in RHODS to detect credit card fraud
* Track and store those models with MLFlow
* Serve a model stored in MLFlow using RHODS Model Serving (or MLFlow serving)
* Deploy a model application in OpenShift that runs sends data to the served model and displays the prediction
* Build, train and serve models in RHOAI to detect credit card fraud
* Use Kubeflow pipelines in RHOAI for declarative model building workflows
* Store models in S3-compatible storage with Minio
* Serve ML models using Kserve on RHOAI

+
Background::
Expand All @@ -21,8 +23,9 @@ The model is built on a Credit Card Fraud Detection model, which predicts if a c

== Technology Highlights:
* Event-Driven Architecture
* Data Science on OpenShift
* Model registry using MLFlow
* Data Science on Red Hat OpenShift AI
* Declarative MLOps pipeline with Kubeflow
* ML model serving with Kserve

== Solution Discussion

Expand All @@ -33,7 +36,7 @@ This architecture pattern demonstrates four strengths:
* *Cost Efficiency*: By automating the detection process, AI reduces the need for extensive manual review of transactions, which can be time-consuming and costly.
* *Flexibility and Agility*: An cloud native architecture that supports the use of microservices, containers, and serverless computing, allowing for more flexible and agile development and deployment of AI models. This means faster iteration and deployment of new fraud detection algorithms.

== Demo Video

.Overview of the solution for credit card fraud detection
video::9Yx_XUOMMYI[youtube]
[INFO]
====
This pattern is based on the OpenShift AI tutorial for link:https://docs.redhat.com/en/documentation/red_hat_openshift_ai_cloud_service/1/html-single/openshift_ai_tutorial_-_fraud_detection_example/index[fraud detection].
====
24 changes: 5 additions & 19 deletions modules/mfd-architecture.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@

Description of each component:

* *Data Set*: The data set contains the data used for training and evaluating the model we will build in this demo.
* *RHODS Notebook*: We will build and train the model using a Jupyter Notebook running in RHODS.
* *MLFlow Experiment tracking*: We use MLFlow to track the parameters and metrics (such as accuracy, loss, etc) of a model training run. These runs can be grouped under different "experiments", making it easy to keep track of the runs.
* *MLFlow Model registry*: As we track the experiment we also store the trained model through MLFlow so we can easily version it and assign a stage to it (for example Staging, Production, Archive).
* *S3 (ODF)*: This is where the models are stored and what the MLFlow model registry interfaces with. We use ODF (OpenShift Data Foundation) according to the MLFlow guide, but it can be replaced with another solution.
* *RHODS Model Serving*: We recommend using RHODS Model Serving for serving the model. It's based on ModelMesh and allows us to easily send requests to an endpoint for getting predictions.
* *Application interface*: This is the interface used to run predictions with the model. In our case, we will build a visual interface (interactive app) using Gradio and let it load the model from the MLFlow model registry.
* *Data Set*: The dataset contains the data used for training and evaluating the model built in this tutorial. The dataset is sourced from the link:https://github.com/rh-aiservices-bu/fraud-detection/tree/main/data[github.com/rh-aiservices-bu/fraud-detection]
* *Kubeflow Pipeline*: The Kubeflow pipeline builds, trains, and uploads the model. The source for this pipeline is in the pattern repository at link:https://github.com/validatedpatterns/mlops-fraud-detection/blob/main/src/kubeflow-pipelines/small-model/train_upload_model.yaml[src/kubeflow-pipelines/small-model/train_upload_model.yaml]. Upon pattern installation, the system automatically runs this pipeline once to train the initial model.
* *S3 (Minio)*: Minio provides storage for the models and serves as the storage interface for the Kubeflow pipeline. While this pattern uses Minio for parity with the source tutorial, any S3-compatible storage solution is compatible.
* *Kserve Model Serving*: The pattern uses the Kserve model serving capabilities in Red Hat OpenShift AI (RHOAI) to serve models with an OpenVINO model server.
* *Application interface*: This interface runs predictions with the model. This pattern includes a visual interface (interactive application) built with Gradio that loads the model from Minio.

//figure 1 originally
.Overview of the solution reference architecture
Expand All @@ -39,15 +37,3 @@ Red Hat® OpenShift® AI is an AI-focused portfolio that provides tools to train

https://www.redhat.com/en/technologies/cloud-computing/openshift/try-it[Red Hat OpenShift GitOps]::
A declarative application continuous delivery tool for Kubernetes based on the ArgoCD project. Application definitions, configurations, and environments are declarative and version controlled in Git. It can automatically push the desired application state into a cluster, quickly find out if the application state is in sync with the desired state, and manage applications in multi-cluster environments.

https://www.redhat.com/en/technologies/jboss-middleware/amq[Red Hat AMQ Streams]::
Red Hat AMQ streams is a massively scalable, distributed, and high-performance data streaming platform based on the Apache Kafka project. It offers a distributed backbone that allows microservices and other applications to share data with high throughput and low latency. Red Hat AMQ Streams is available in the Red Hat AMQ product.

Hashicorp Vault (community)::
Provides a secure centralized store for dynamic infrastructure and applications across clusters, including over low-trust networks between clouds and data centers.

MLFlow Model Registry (community)::
A centralized model store, set of APIs, and UI, to collaboratively manage the full lifecycle of an MLflow Model. It provides model lineage (which MLflow experiment and run produced the model), model versioning, model aliasing, model tagging, and annotations.

Other::
This solution also uses a variety of _observability tools_ including the Prometheus monitoring and Grafana dashboard that are integrated with OpenShift as well as components of the Observatorium meta-project which includes Thanos and the Loki API.
Loading