Skip to content

A machine learning project that classifies blockchain transactions into categories such as sales, purchases, transfers, scams, and phishing attempts. The project leverages models like Random Forest, KNN, and AdaBoost, with advanced preprocessing techniques to improve accuracy and address class imbalance.

Notifications You must be signed in to change notification settings

OmniaOsama03/Transaction-Type-Prediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿง  Predicting Blockchain Transaction Types using ML Models

A machine learning project to classify blockchain transactions into sales, purchases, transfers, scams, and phishing attempts.


๐Ÿ“‹ Project Overview

This project explores the application of various machine learning models to predict transaction types within blockchain data. The dataset was sourced from Kaggle and contained ~78,600 records. The primary goal is to improve fraud detection in blockchain transactions using effective classification techniques.

๐Ÿš€ Features

โœ… Implemented multiple ML models for classification:
โ€ข Random Forest
โ€ข K-Nearest Neighbors (KNN)
โ€ข Gaussian Naive Bayes
โ€ข Decision Tree
โ€ข AdaBoost
โœ… Applied effective preprocessing techniques like: โ€ข Oversampling, Undersampling, Stratified Learning, and SMOTE
โ€ข Information Gain for feature selection
โ€ข Min-Max Normalization for feature scaling
โœ… Evaluated model performance using metrics like accuracy, precision, recall, and F1-score.

๐Ÿ—„๏ธ Dataset

  • Source: Kaggle Blockchain Dataset
  • Size: ~78,600 records
  • Attributes: Various transaction details, including timestamps, regions, and behavioral patterns.

Data Imbalance Challenge: The dataset had a skewed distribution with legitimate transactions heavily outnumbering fraudulent ones. Techniques such as oversampling, undersampling, and SMOTE were implemented to mitigate this issue.

๐Ÿ” Data Preprocessing

  • Dropped Irrelevant Features: Removed attributes like timestamp, sending_address, and receiving_address.
  • Handling Missing Values: Used median imputation for numerical values.
  • Categorical Encoding: Applied Label Encoding to variables such as location_region, purchase_pattern, age_group, and anomaly.
  • Feature Scaling: Used Min-Max Normalization to ensure consistent feature scaling.

โš™๏ธ Models & Hyperparameter Tuning

Model Key Hyperparameters Best Accuracy
AdaBoost n_estimators, learning_rate 72.9%
Gaussian Naive Bayes var_smoothing 69.2%
KNN n_neighbors, weights 97.8%
Random Forest n_estimators, min_samples_split 97.9%

โœ… Best-performing Model: Random Forest Classifier

๐Ÿ“Š Results & Analysis

  • Random Forest achieved the highest accuracy of 97.9% and demonstrated consistent performance across various configurations.
  • KNN closely followed with an accuracy of 97.8%, excelling particularly in 'purchase' and 'sale' transactions.
  • The AdaBoost and Gaussian Naive Bayes models struggled with certain transaction types, such as 'phishing' and 'scam'.

๐Ÿ”ฎ Future Improvements

๐Ÿ“ˆ Exploring additional ensemble models like XGBoost and Gradient Boosting.
๐Ÿงน Investigating advanced preprocessing techniques for better feature extraction.
๐Ÿง  Improving model performance for minority class predictions through enhanced sampling techniques.

๐Ÿค Contributors

  • Omnia Osama Ahmed
  • Sara Imad Hamdan
  • Nour Bashar Soukieh

๐Ÿ“„ Course Work

This project was developed for the course Artificial Intelligence (CSC406) In Abu Dhabi Uniersity.


๐Ÿ’ป Built with โค๏ธ for secure digital transactions in the Metaverse!

About

A machine learning project that classifies blockchain transactions into categories such as sales, purchases, transfers, scams, and phishing attempts. The project leverages models like Random Forest, KNN, and AdaBoost, with advanced preprocessing techniques to improve accuracy and address class imbalance.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published