# bhupesh-debug/ml-finance-anomaly architecture

> Architecture diagram of the GitHub repository bhupesh-debug/ml-finance-anomaly, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bhupesh-debug/ml-finance-anomaly
- Repository: https://github.com/bhupesh-debug/ml-finance-anomaly
- Video tour (about a minute): https://gitdiagram.com/bhupesh-debug/ml-finance-anomaly/video

## Overview

This is an ERP financial-integrity monitor for auditors: transaction data is validated and transformed into features, analyzed for anomalies and segregation-of-duties conflicts, then surfaced for review. The README documents three modeling approaches, model evaluation, a REST prediction endpoint, and a Streamlit dashboard. Paths and capabilities below come from the README’s project structure; source implementations were not sampled. Accordingly, documented command-line data/model relationships are shown, while undocumented runtime wiring between the API, dashboard, and models is omitted.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_erp_data["ERP transactions"]
  node_synthetic_data["Synthetic transactions"]
  node_pipeline["Data pipeline"]
  node_processed["Processed data"]
  node_features["Feature engineering"]
end

subgraph group_analysis["Detection and evaluation"]
  node_isolation["Isolation Forest"]
  node_xgboost["XGBoost + SHAP"]
  node_autoencoder["Autoencoder"]
  node_sod["SoD conflict graph"]
  node_evaluation["Model evaluation"]
  node_model_file["Serialized model"]
end

subgraph group_delivery["Auditor tools"]
  node_api["Prediction API"]
  node_dashboard["Auditor dashboard"]
end

node_auditor(("Auditor"))

node_erp_data -->|"ingested by"| node_pipeline
node_synthetic_data -->|"generated by"| node_pipeline
node_pipeline -->|"writes data"| node_processed
node_processed -->|"model input"| node_isolation
node_processed -->|"model input"| node_xgboost
node_processed -.->|"transformed by"| node_features
node_features -.->|"feeds"| node_isolation
node_features -.->|"feeds"| node_xgboost
node_processed -.->|"analyzed by"| node_autoencoder
node_processed -.->|"checked for conflicts"| node_sod
node_isolation -.->|"evaluated by"| node_evaluation
node_xgboost -.->|"evaluated by"| node_evaluation
node_autoencoder -.->|"evaluated by"| node_evaluation
node_xgboost -.->|"may be serialized as"| node_model_file
node_auditor -->|"reviews flags"| node_dashboard
node_auditor -->|"submits prediction"| node_api

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_erp_data,node_synthetic_data,node_pipeline,node_processed,node_features toneBlue
class node_isolation,node_xgboost,node_autoencoder,node_sod,node_evaluation,node_model_file toneAmber
class node_api,node_dashboard toneMint
class node_auditor toneIndigo
```

## Components

### Data preparation

- **ERP transactions**
- **Synthetic transactions**
- **Data pipeline**
- **Processed data**
- **Feature engineering**

### Detection and evaluation

- **Isolation Forest**
- **XGBoost + SHAP**
- **Autoencoder**
- **SoD conflict graph**
- **Model evaluation**
- **Serialized model**

### Auditor tools

- **Prediction API**
- **Auditor dashboard**

### Other components

- **Auditor**

## Connections

- ERP transactions → Data pipeline: ingested by (evidence: `README.md`)
- Synthetic transactions → Data pipeline: generated by (evidence: `README.md`)
- Data pipeline → Processed data: writes data (evidence: `README.md`)
- Processed data → Isolation Forest: model input (evidence: `README.md`)
- Processed data → XGBoost + SHAP: model input (evidence: `README.md`)
- Processed data → Feature engineering: transformed by
- Feature engineering → Isolation Forest: feeds
- Feature engineering → XGBoost + SHAP: feeds
- Processed data → Autoencoder: analyzed by
- Processed data → SoD conflict graph: checked for conflicts
- Isolation Forest → Model evaluation: evaluated by
- XGBoost + SHAP → Model evaluation: evaluated by
- Autoencoder → Model evaluation: evaluated by
- XGBoost + SHAP → Serialized model: may be serialized as
- Auditor → Auditor dashboard: reviews flags (evidence: `README.md`)
- Auditor → Prediction API: submits prediction (evidence: `README.md`)
