Skip to content
MYZATECHSOLUTIONS
In progressAI & Intelligent Applications

Fraud Detection System

Credit-card fraud detection comparing supervised, unsupervised, and deep-learning models on a heavily imbalanced dataset, with a multi-agent layer planned.

Personal project

Overview

A machine-learning project on credit-card transactions where only 0.17% are fraudulent. It compares a Random Forest, an Isolation Forest, and an autoencoder trained only on normal transactions.

The problem

Fraud is rare, so a model can look accurate while missing most fraud. Detecting it needs careful data handling and the right evaluation metric.

The solution

Three approaches compared: Random Forest (supervised), Isolation Forest (unsupervised), and an autoencoder that flags transactions it reconstructs poorly.

A time-ordered train/test split and training-only scaling prevent information from the future leaking into training.

Architecture and workflow

  1. Transaction dataset (99.83% normal, 0.17% fraud)
  2. Chronological 70/30 split
  3. Scaling fitted on training data only
  4. Models: Random Forest, Isolation Forest, autoencoder (30-14-7-14-30)
  5. Evaluation with precision-recall AUC

Implementation details

  • Autoencoder trained only on normal transactions; reconstruction error used as the fraud signal.
  • Isolation Forest with a custom percentile threshold.
  • Only the time and amount features needed scaling.
  • Trained model and scaler saved for reuse.

Challenges and lessons learned

  • Avoiding data leakage with a chronological split instead of a random one.
  • Isolation Forest suffered from drift over time and sensitivity to the contamination setting.
  • Precision-recall AUC is the meaningful metric for this level of imbalance; accuracy is misleading.

Results

  • Autoencoder: fraudulent transactions had about 14 times the reconstruction error of normal ones.
  • Autoencoder PR-AUC of 0.154; at the 99.5th-percentile threshold, precision 0.17 and recall 0.68.

More work

  • Completed

    AI & Intelligent Applications

    WhatsApp AI Assistant

    WhatsApp bot that understands text and voice notes in English or Roman Urdu and replies in the same language, using Claude and Azure AI Speech.

    • Python
    • Flask
    • Meta WhatsApp Cloud API
    • Anthropic Claude API
    • +3 more
  • Completed

    AI & Intelligent Applications

    Web Research Agent

    Streamlit chat agent that answers questions with current, search-backed information using Claude's built-in web search tool.

    • Python
    • Anthropic Claude API
    • Claude web search tool
    • Streamlit
    • +1 more
  • Learning project

    AI & Intelligent Applications

    Azure AI Model Deployment Notebook

    Jupyter notebook that calls a model deployed on Azure AI Foundry, rebuilt with secure environment-based configuration.

    • Python
    • Jupyter
    • Azure AI Foundry
    • python-dotenv

Need something similar?

Tell me about your project and let's explore whether this kind of solution fits.

Start a Conversation