The Financial Fraud Detection (FFD) pipeline draws on a focused stack of data science, deep learning, and visualization libraries. The GAN-based data augmentation layer relies on TensorFlow 2.11 with its Keras API, while the six supervised classifiers are provided by scikit-learn, XGBoost, and LightGBM. Visualization of results and network architecture is handled by Matplotlib, Seaborn, Plotly, and visualkeras. The pipeline requires Python 3.8 or later; Python 3.10 was used during development.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Antisource/FFD/llms.txt
Use this file to discover all available pages before exploring further.
Installation
Install all required packages in a single command, or use the separate pinned-version command for TensorFlow to avoid resolver conflicts.Core Dependencies
| Package | Version | Purpose |
|---|---|---|
tensorflow | ==2.11 | GAN model building and training via the Keras API |
visualkeras | latest | Neural network architecture visualization |
numpy | latest | Numerical computing and array operations |
pandas | latest | Dataset loading, manipulation, and inspection |
scikit-learn | latest | Preprocessing, classifiers, evaluation metrics, and data splitting |
xgboost | latest | XGBoost gradient-boosted tree classifier |
lightgbm | latest | LightGBM gradient-boosted tree classifier |
seaborn | latest | Statistical data visualization (heatmaps, distribution plots) |
matplotlib | latest | General-purpose plotting and figure generation |
plotly | latest | Interactive visualizations (scatter plots, class distribution) |
All packages except
tensorflow and visualkeras are installed at their latest stable release. If you need a fully reproducible environment, pin every package to the version resolved during your first install by running pip freeze > requirements.txt after the initial setup.TensorFlow / Keras Modules Used
The GAN generator, discriminator, and combined model are assembled entirely through thetensorflow.keras API. The following sub-modules are imported by the notebook:
tensorflow.keras.layers
Input— defines the input tensor shapeDense— fully connected layerBatchNormalization— stabilizes GAN trainingLeakyReLU— activation function for generator/discriminatorDropout— regularization to reduce overfitting
tensorflow.keras.models
Model— functional API model container (GAN assembly)Sequential— sequential model container (classifier heads)
tensorflow.keras.optimizers
Adam— adaptive optimizer used for both generator and discriminator training
tensorflow.keras.initializers
RandomNormal— weight initializer for GAN layers, controls initial weight distribution
scikit-learn Modules
scikit-learn provides the complete preprocessing, classification, and evaluation infrastructure for FFD. The table below maps each imported module to its role in the pipeline:| Module | Imported Symbol | Role |
|---|---|---|
sklearn.preprocessing | StandardScaler | Standardizes features to zero mean and unit variance before model training |
sklearn.decomposition | PCA | Reduces feature dimensionality for visualization and GAN input |
sklearn.utils | shuffle | Randomly shuffles combined real + synthetic data before training |
sklearn.ensemble | RandomForestClassifier | Ensemble tree-based classifier |
sklearn.svm | SVC | Support Vector Machine classifier |
sklearn.neighbors | KNeighborsClassifier | K-Nearest Neighbours classifier |
sklearn.naive_bayes | GaussianNB | Gaussian Naive Bayes classifier |
sklearn.metrics | accuracy_score, precision_score, recall_score, f1_score, classification_report, confusion_matrix | Full suite of binary classification evaluation metrics |
sklearn.model_selection | train_test_split | Splits dataset into training and test sets |
XGBoost and LightGBM are imported directly via their own packages (
import xgboost as xgb, import lightgbm as lgb) rather than through scikit-learn wrappers, though both expose a scikit-learn-compatible fit / predict interface.