Skip to main content
QUICK REVIEW

[Paper Review] Detecting Anomalies in Blockchain Transactions using Machine Learning Classifiers and Explainability Analysis

Mohammad H. Hasan, Mohammad Shahriar Rahman|arXiv (Cornell University)|Jan 7, 2024
Imbalanced Data Classification TechniquesComputer Science3 citations
TL;DR

This paper proposes an explainable anomaly detection framework for Bitcoin transactions using tree-based ensemble classifiers enhanced with a novel under-sampling technique (XGBCLUS) and SHAP-based explainability. It demonstrates that XGBCLUS improves TPR and ROC-AUC, while ensemble models outperform single classifiers in detecting rare malicious transactions with enhanced interpretability through feature importance and decision rules.

ABSTRACT

As the use of Blockchain for digital payments continues to rise in popularity, it also becomes susceptible to various malicious attacks. Successfully detecting anomalies within Blockchain transactions is essential for bolstering trust in digital payments. However, the task of anomaly detection in Blockchain transaction data is challenging due to the infrequent occurrence of illicit transactions. Although several studies have been conducted in the field, a limitation persists: the lack of explanations for the model's predictions. This study seeks to overcome this limitation by integrating eXplainable Artificial Intelligence (XAI) techniques and anomaly rules into tree-based ensemble classifiers for detecting anomalous Bitcoin transactions. The Shapley Additive exPlanation (SHAP) method is employed to measure the contribution of each feature, and it is compatible with ensemble models. Moreover, we present rules for interpreting whether a Bitcoin transaction is anomalous or not. Additionally, we have introduced an under-sampling algorithm named XGBCLUS, designed to balance anomalous and non-anomalous transaction data. This algorithm is compared against other commonly used under-sampling and over-sampling techniques. Finally, the outcomes of various tree-based single classifiers are compared with those of stacking and voting ensemble classifiers. Our experimental results demonstrate that: (i) XGBCLUS enhances TPR and ROC-AUC scores compared to state-of-the-art under-sampling and over-sampling techniques, and (ii) our proposed ensemble classifiers outperform traditional single tree-based machine learning classifiers in terms of accuracy, TPR, and FPR scores.

Motivation & Objective

  • To address the lack of interpretability in machine learning-based blockchain anomaly detection models.
  • To improve detection performance on highly imbalanced Bitcoin transaction datasets where anomalous cases are rare.
  • To develop a new under-sampling technique, XGBCLUS, that preserves critical minority-class instances for better model generalization.
  • To integrate SHAP and decision rules for transparent, human-interpretable explanations of model predictions.
  • To compare the performance of single tree-based classifiers against stacking and voting ensemble models in anomaly detection.

Proposed method

  • Proposes XGBCLUS, a novel under-sampling algorithm based on XGBoost that selects informative minority-class samples to balance imbalanced transaction data.
  • Employs tree-based ensemble classifiers (e.g., XGBoost, Random Forest) for anomaly detection, leveraging their robustness and interpretability.
  • Applies SHAP (Shapley Additive ExPlanations) to quantify the contribution of each transaction feature to the model’s prediction of anomalous behavior.
  • Derives human-readable anomaly rules from decision trees to explain classification decisions step-by-step.
  • Compares XGBCLUS against standard under-sampling (RUS, Near-Miss) and over-sampling (SMOTE, ADASYN) techniques using standard evaluation metrics.
  • Evaluates performance using accuracy, TPR, FPR, and ROC-AUC on a real Bitcoin transaction dataset with only 108 anomalous cases.
Figure 1 : Methodology of this study
Figure 1 : Methodology of this study

Experimental results

Research questions

  • RQ1Can a new under-sampling technique like XGBCLUS improve the detection of rare anomalous Bitcoin transactions compared to existing sampling methods?
  • RQ2How do ensemble classifiers (stacking and voting) compare to single tree-based models in detecting blockchain anomalies under data imbalance?
  • RQ3To what extent can SHAP values and decision rules enhance the interpretability of anomaly detection models in blockchain systems?
  • RQ4Which transaction features are most influential in identifying anomalous behavior, and how do they contribute to model decisions?
  • RQ5Does integrating explainability techniques like SHAP and rule extraction improve trust and validation of anomaly detection models in practice?

Key findings

  • XGBCLUS significantly improves the True Positive Rate (TPR) and ROC-AUC score compared to state-of-the-art under-sampling and over-sampling techniques.
  • Stacking and voting ensemble classifiers outperform individual tree-based models in terms of accuracy, TPR, and FPR, demonstrating superior generalization on imbalanced data.
  • The SHAP analysis identifies 'total_btc' as the most influential feature in detecting anomalous transactions, with high feature importance across multiple models.
  • Decision trees and derived anomaly rules provide a transparent, step-by-step explanation of model decisions, enabling domain experts to validate predictions.
  • The integration of XAI techniques (SHAP and rules) enhances model trustworthiness and supports auditability in blockchain security applications.
  • The proposed framework effectively handles extreme class imbalance, with only 108 anomalous transactions in the dataset, while maintaining high detection performance.
Figure 2 : Correlations among the features using Heatmap
Figure 2 : Correlations among the features using Heatmap

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.