Unsupervised Credit Card Fraud Detection Using Autoencoder-Based Anomaly Detection on Highly Imbalanced Transaction Data - Mursalim Mursalim; Sutriawan Sutriawan; Nimas Ratna Sari; Nur Wahyu Hidayat; Zumhur Alamin (Indonesian Applied Research Computing and Informatics, 2025)
Credit card fraud detection is a critical problem in the financial sector, primarily due to its direct correlation with financial liability and the preservation of user integrity. A major challenge in fraud detection is the extreme class imbalance, where fraudulent transactions are rare compared to legitimate ones, causing supervised approaches to require sufficient labeled fraud data and often become biased toward the majority class. This study proposes an unsupervised anomaly detection approach based on an Autoencoder to identify fraudulent transactions in highly imbalanced credit card transaction data. The Autoencoder is trained exclusively on normal transactions to learn representative patterns of legitimate behavior. During inference phase, transactions exhibiting elevated reconstruction error relative to established norms are designated as anomalies, indicative of potential fraud. The experiments use the Credit Card Fraud Detection dataset from Kaggle, containing 284,807 transactions: 284,315 normal (99.828%) and 492 fraudulent (0.172%). The workflow includes numerical feature normalization for the Time and Amount attributes, splitting normal data into training and validation sets, selecting an anomaly threshold based on the reconstruction error distribution, and evaluating performance using metrics suitable for imbalanced data such as precision, recall, and F1-score. The results indicate that the proposed unsupervised Autoencoder offers an effective alternative when labeled fraud examples are limited, by detecting deviations from normal transaction patterns through reconstruction behavior.