Financial Fraud Training Output#

The Financial Fraud Training generates the model and configuration files shown under the following directory structure:

python_backend_model_repository
└── prediction_and_shapley
 ├── 1
    ├── embedding_based_xgboost.json
    ├── model.py
    ├── json_loader_writer.py
    ├── meta.json
    └── state_dict_gnn_model.pth
 └── config.pbtxt

Note: The python_backend_model_repository directory is created under the path specified by "output_dir" in the training configuration file.

Contents and Descriptions#

[comment:] You might want to put brief descriptions under your sect 2s.

python_backend_model_repository#

Root folder for your Triton Python backend models.


prediction_and_shapley#

A model repository folder inside python_backend_model_repository that contains model code and artifacts.

  • Version Subdirectory (1)
    This subdirectory represents version 1 of the model. Triton Inference Server requires each version of the model to reside in its own folder named with the version number.

    • embedding_based_xgboost.json
      Serialized XGBoost model file containing configuration and trained parameters for embedding-based predictions.

    • model.py Core Python script containing the model’s prediction logic and Shapley value calculations.

    • meta.json JSON file that defines the graph schema, including node types, edge types, and their relationships.

    • json_loader_writer.py Includes utility functions for reading the graph schema metadata file.

    • state_dict_gnn_model.pth PyTorch model file (using .pth extension) containing the trained weights for the GNN (Graph Neural Network) component.

  • config.pbtxt
    The configuration file required by the Triton Inference Server. It specifies details such as input/output tensor shapes, data types, and other model-related parameters.


How to Use#

[comment:] Brief intro before the steps?

  1. Deploy on Triton
    Mount python_backend_model_repository folder into your Triton Server. Make sure that the folder structure looks correct.

python_backend_model_repository
└── prediction_and_shapley
      ├── 1
         ├── ...
      └── config.pbtxt
  1. Check config.pbtxt
    Verify that config.pbtxt accurately reflects your model’s I/O specifications. Adjust any shapes, batch sizes, or other parameters as required.

  2. Start Triton Server
    Launch the Triton Inference Server (example command shown below; adapt paths and arguments as needed):

docker run --gpus "device=0" -d -p {HTTP_PORT}:{HTTP_PORT} -p {GRPC_PORT}:{GRPC_PORT} -v {HOST_MODEL_REPO_PATH}:/models --name tritonserver {TRITON_IMAGE} tritonserver --model-repository=/models --http-port={HTTP_PORT} --grpc-port={GRPC_PORT} --metrics-port={METRICS_PORT}
  1. Send Inference Requests Use an HTTP or gRPC client to send inference requests to Triton. The model automatically loads and serves both predictions and Shapley values, if requested. The following section details how to pass data to models deployed on Triton Inference Server.