In the contemporary digital finance landscape, financial institutions are rapidly expanding their reach through internet banking, making electronic payment methods indispensable. This shift is driven by the competitive nature of the financial sector and the growing demand for convenient transaction methods (Bin Sulaiman, Schetinin & Sant, 2022). Financial Technology, or Fintech, leverages technology to refine and automate financial services, offering more efficient, accessible, and cost-effective solutions compared to traditional banking (Barbu et al., 2021). The fintech industry’s conceptual framework is illustrated in Figure 1, showcasing its innovative approach (VectorStock, 2007). Credit cards, a cornerstone of fintech convenience, offer consumers benefits like purchase protection against damage, loss, or theft (Weichert, 2017). The consistent increase in Mastercard issuances throughout 2022, reaching over a billion cards each quarter (Zen, 1966), alongside the nearly two billion Visa and Mastercard credit, debit, and prepaid cards in circulation by the end of 2022 (Nilson Report, 2024), underscores the dominance of card-based transactions. This convenience extends to bill payments, POS transactions, and digital money transfers, all powered by fintech platforms.
However, the surge in digital financial activities has been accompanied by a significant rise in credit card fraud. The lucrative and relatively low-risk nature of credit card fraud makes it a prime target for criminals (Kalmykova & Ryabova, 2016). Types of fraud range from online and offline counterfeiting to application fraud, all exploiting credit card details for illicit gains (Yang et al., 2019). Cyberattacks such as phishing, skimming, and identity theft are common tactics, resulting in financial losses for both customers and banks, alongside reputational damage from data breaches. To combat these threats, banks are increasingly turning to AI-based systems, particularly machine learning (ML) models, for fraud detection (Lacruz & Saniie, 2021). Training these ML models requires extensive data, ideally centralized for optimal performance. However, centralizing sensitive customer data amplifies data breach risks. Federated learning (FL) emerges as a solution, offering a privacy-preserving AI model that fosters collaboration without central data repositories, enhancing security and minimizing data exposure (Ashta & Herrmann, 2021; Cao, Yang & Yu, 2021). The integration of AI and ML within fintech is revolutionizing the industry, enabling sophisticated data analysis, refined risk assessments, and personalized financial services.
Fintech and Artificial Intelligence
The synergy between AI and fintech is driving innovation, empowering both consumers and businesses. This integration facilitates data-driven decision-making, operational efficiencies, and improved customer experiences within financial institutions. Data science provides the bedrock for fintech to surpass traditional institutions in decision-making speed and accuracy (Guo & Polak, 2021). AI applications are transforming sectors through risk assessment, automated customer service, and advanced fraud detection. Real-time processing of vast datasets allows AI to streamline operations, offer tailored financial advice, and ensure regulatory compliance. AI-powered trading algorithms and robo-advisors are automating investment strategies (Bayramoğlu, 2021). Beyond productivity gains, AI is pivotal in enhancing market safety and accessibility for both consumers and enterprises.
Machine learning, a subset of AI, enables software to improve predictive accuracy without explicit programming. ML algorithms are impacting various industries by enhancing customer service and expanding client engagement. Fintech, inherently dynamic and innovative, greatly benefits from advancements in information and communication technologies (Stojanović et al., 2021). ML is instrumental in extracting data insights and generating predictions. Data security and integrity are paramount in fintech. Traditional security measures are increasingly insufficient against the rising tide of digital transactions and sophisticated fraud. Consequently, ML has become a vital tool in the fintech industry’s defense against fraud. However, the application of ML in fintech is not without its hurdles (Kulatilleke, 2022). Data accessibility and quality are crucial for effective ML models. Access to reliable, representative datasets reflecting the full spectrum of fraudulent activities is essential. Furthermore, safeguarding data privacy and ensuring regulatory compliance are vital for protecting client information and maintaining trust within the fintech ecosystem. Cyberattacks and data breaches pose persistent threats to fintech, particularly in the banking sector. Fintech institutions are proactively adopting fraud detection tools and enhancing existing systems with ML algorithms to counter these threats and protect customer data (Long et al., 2020). Data breaches, involving unauthorized access to sensitive personal data, present a significant risk, whether perpetrated by external actors or insiders.
Federated Learning in Fintech for Privacy-Preservation
Federated learning (FL) offers a distributed machine learning paradigm that allows model training across decentralized devices or servers without data centralization. This approach is particularly valuable where data privacy is paramount, enabling collaboration among data owners to train a global model without sharing raw data. This section explores model aggregation techniques within FL.
Introduced by Google in 2017, FL prioritizes privacy and enhances data scientist efficiency (Dash, Sharma & Ali, 2022). By training models across decentralized devices like Linux servers, FL offers significant advantages in privacy, security, and reduces the need to transmit sensitive data to a central server (Li et al., 2020a). Instead of data, models are distributed to devices for local updates. FL empowers data scientists to work effectively with decentralized data while upholding privacy. This protects data privacy for banks and fintechs and lessens the risk of data breaches. Privacy is a key concern in FL, as malicious actors might impersonate model coordinators and use gradient-based attacks to infer user data (Yang, Fan & Yu, 2020). Within fintech, FL is a privacy-preserving technology that accelerates financial processes by enabling collaborative AI model training across decentralized devices. This facilitates real-time insights and decision-making without centralizing data (Dash, Sharma & Ali, 2022). This approach safeguards data privacy and minimizes data security breach risks (Yu et al., 2020). Integrating FL strategies in fintech offers numerous benefits. Its core goal is user privacy while improving data scientist efficiency. By using decentralized devices and servers with local datasets, scientists can train robust models and share statistical data analysis models, enhancing their ability to detect fraudulent activities.
Model Aggregation in Federated Learning
The FL aggregation process generally includes:
- Local Training: Each client trains a model locally using its private dataset.
- Model Update Sharing: Clients send their model updates to a central server.
- Model Aggregation: The central server aggregates updates into a new global model.
- Global Model Distribution: Clients receive the updated global model for further local training.
Through iterations, the global model progressively improves with each aggregation round, assuming a converging series.
Techniques for Model Aggregation
Several techniques are used to aggregate model updates from different clients:
-
Federated Averaging (FedAvg): The foundational method where the central server averages model updates, typically weighted by the number of data points each client holds. Mathematically:
wglobal = (1/N) ∑i=1N (niwi)
Where wglobal is the global model, ni is the data points in the i-th client’s dataset, wi is the update from the i-th client, and N is the total clients.
-
Homomorphic Encryption: Enhances privacy in secure aggregation by ensuring the central server only sees the final aggregated result, not individual updates.
-
Differential Privacy: Adds noise to model updates before transfer to the central server, masking sensitive client data.
-
Hierarchical Aggregation: Used in large networks, intermediate servers aggregate updates from client subsets before sending to the central server, improving communication efficiency and scalability.
Model aggregation is a cornerstone of FL, enabling collaborative AI model training while preserving client data privacy. Techniques like FedAvg, secure aggregation, and differential privacy are crucial. However, communication efficiency, client heterogeneity, and fault tolerance must be carefully managed for successful FL implementation.
Blockchain-Based Federated Learning for Fintech Security
Blockchain, a decentralized and distributed ledger, records transactions across a network, ensuring transparency and data immutability through secure data blocks. Blockchain-based FL combines FL benefits with blockchain’s security and credibility. This novel approach facilitates collaboration on ML models without data exposure, maintaining an immutable transaction and data transfer record (Nguyen et al., 2021). This addresses data privacy and regulatory constraints while enabling financial institutions to enhance services with machine learning (Rizinski et al., 2022). Blockchain-based FL improves financial model accuracy and efficiency by enabling data and information exchange among financial firms (Lu et al., 2019). Integrating diverse data sources allows for more detailed and accurate models for fraud detection, market trend prediction, and risk management (Li et al., 2020b).
Motivation for Blockchain Federated Learning in Fraud Detection
Federated learning aims to train ML models across distributed devices without centralizing user data. Only model updates are shared, enhancing user privacy. However, improper implementation can lead to privacy risks if model updates contain sensitive information or if malicious actors deduce user data from these updates (Mammen, 2021). Privacy-preserving methods in FL include secure aggregation, differential privacy, homomorphic encryption, and frameworks like Tensorflow Privacy (Tensorflow privacy (2021)). These techniques protect model updates and prevent user data reconstruction (Suvarna & Kowshalya, 2020; Yang et al., 2019; Singh et al., 2021). This research leverages ML within a privacy-preserving framework for credit card fraud detection. By addressing privacy security, risks, and governance, we enhance fraud detection while protecting sensitive client data using client-server blockchain FL. ML has significantly advanced fintech, notably in data-driven fraud detection.
Contribution: Blockchain-Based Federated Learning Framework
This study highlights the crucial role of smart contracts in blockchain-based FL for ensuring privacy during ML model training across decentralized devices like Linux servers, without raw data exchange. The key contributions are:
- Proposed Blockchain-based Federated Learning Framework: Offers continuous learning and improved fraud detection models while maintaining data privacy.
- Smart Contract Implementation for Privacy: Ensures privacy during ML model training and sharing.
- Global Federated Learning Model for Enhanced Fraud Detection: Combines multiple FL models to improve fraud detection techniques.
The article proceeds with a literature review, methodology, proposed framework details, use-case discussion, ML implementation overview, experimental results, and conclusions.
Literature Review: Advancements in Fintech Security and Federated Learning
This section reviews recent advancements in fintech security against counterfeit activities, focusing on cutting-edge research and innovative approaches. It explores the implementation of federated learning as a privacy-preserving technique to safeguard sensitive financial data while enabling collaborative model training, highlighting progress in securing fintech systems against fraud. Federated learning, conceived by Google in 2017, aims to support data scientists by addressing data privacy and security through collaborative model preparation, keeping sensitive data decentralized (Dash, Sharma & Ali, 2022). With emerging technologies, customer data security is paramount. FL acts as a protective layer over ML models, enhancing counterfeit transaction prediction securely. Long et al. (2020) examine FL in open banking for fraud prevention and data privacy, emphasizing its collaborative nature and potential to improve fraud detection without revealing raw data. Kagan (2020) outlines fintech’s evolution and impact, discussing key components, benefits, drawbacks, and regulatory needs for consumer protection and system stability, exploring peer-to-peer financing, robo-advisors, blockchain, digital payments, and mobile banking apps. Ogundokun et al. (2022) study FL’s application domains and blockchain integration, emphasizing privacy protection through collaborative model training without raw data exposure and blockchain’s role in decentralized data protection. Dash, Sharma & Ali (2022) focus on data protection in fintech, particularly PII, covering FL’s advantages in collaborative, model-based training, data security, and privacy, while addressing challenges like encryption and trust frameworks. Yang et al. (2019) propose FL for fraud detection (FFD), enabling banks to train models using local data and aggregate updates to create a shared FDS without compromising cardholder privacy. Bin Sulaiman, Schetinin & Sant (2022) explore blockchain’s challenges in fintech fraud detection, including slowdowns, scalability, energy usage, inefficiencies, and costs, also noting data complexity and privacy in ML. Varmedja et al. (2019) focus on ML algorithms for credit card fraud detection, using the Credit Card Fraud Detection dataset to analyze ML’s application against credit card theft. Rizinski et al. (2022) highlight ethical challenges of ML in fintech, including privacy, bias, transparency, and accountability, stressing the need for accountability mechanisms. Barbu et al. (2021) emphasize customer experience in fintech for fraud risk mitigation, focusing on user interface, ease of use, trust, transparency, and personalized services to build customer trust and prevent fraud, highlighting data security and privacy. Fernandez-Vazquez et al. (2019) identify security, scalability, legal, regulatory, privacy, and latency challenges in blockchain adoption in fintech, noting that solutions are still nascent and research is finance/banking-centric. Nelaturu, Du & Le (2022) explore blockchain applications in fintech, providing a taxonomy and implementation scenarios, and listing blockchain integration challenges.
The fintech landscape, encompassing online money transfers, crowdfunding, and investment management, underscores the critical importance of security and privacy, particularly via blockchain-based fintech applications. Baliker et al. (2023) review blockchain-based fintech advancements and emerging cyber threats. Raikwar et al. (2018) present a blockchain platform for automating insurance processes using smart contracts and Hyperledger Fabric. Blockchain integration in insurance enhances transaction execution, payment settlement, and security. Rapid 5G and B5G adoption has driven edge computing, enabling big data analytics and AI advancement through high-quality ML models, with privacy addressed via FL. Wan et al. (2022) propose blockchain-enabled FL and Wasserstein GAN-enabled differential privacy (DP) for decentralized, secure, and efficient model parameter protection in B5G networks. Dai (2022) introduces a blockchain-based decision system integrating FL and evolving CNNs for assemble-to-order services and Metaverses, focusing on optimal policy computation for blockchain smart contracts. Kollu et al. (2023) introduce a cloud-based intrusion detection system using IoT FL and smart contract analysis with route-based user authentication, showing 95% accuracy in simulations. Yang et al. (2022) propose a credit data storage mechanism with a deletable Bloom filter for consensus in training and computation, alongside authority control and credit verification contracts for secure model certification in FL. Wan et al. (2022) suggest merging blockchain-enabled FL with WGAN-enabled DP to protect edge device model parameters in B5G networks, using blockchain for decentralized FL and mitigating data falsification. Chatterjee, Das & Rawat (2023) offer an FL-empowered Recommendation Model (FLRM) leveraging FL and blockchain, where a central server manages aggregation and blockchain communication, with financial organizations keeping data on private blockchains. Noman et al. (2023) discuss using FL and blockchain for privacy-preserving healthcare data collaboration, achieving 88.10% testing accuracy for respiratory disease classification. Xiao et al. (2023) explore combining blockchain and FL for GDPR compliance, aiming to create legally compliant, user-friendly applications across data-dependent fields, enhancing data security and privacy within regulatory boundaries.
A summary of related surveys in Table 1 considers architecture design, privacy, and security measures, including client-server and peer-to-peer architectures, CIA traits, trust mechanisms, and governance. Some studies (Mothukuri et al., 2021; Yin, Zhu & Hu, 2021; Zhang et al., 2021; Lyu, Yu & Yang, 2020) examine ML and FL privacy concerns, while others (Jagarlamudi et al., 2023; Lyu et al., 2022) focus on privacy concerns, security measures, and risk assessment. Beutel et al. (2020) introduce Flower, a decentralized FL framework for large-scale experiments and diverse scenarios, focusing on data attribute privacy. Reina et al. (2021) present OpenFL, an open-source FL framework for privacy-focused collaborative ML training, emphasizing security in a centralized architecture compatible with TensorFlow and PyTorch. This literature review highlights fintech’s evolving landscape and the impact of FL and Blockchain in addressing data privacy, security, and collaboration challenges, enabling collaborative model training and fraud detection, while acknowledging challenges in privacy, communication efficiency, and security.
Table 1: Comparison of existing work for architecture and privacy.
Existing survey | Year | Client-server architecture | P2P Architecture | Privacy protection | Privacy-risk assessment | Privacy governance |
---|---|---|---|---|---|---|
Jagarlamudi et al. (2023) | 2023 | ✓ | ✓ | – | – | |
Lyu et al. (2022) | 2022 | ✓ | ✓ | ✓ | ✓ | |
Beutel et al. (2020) | 2020 | ✓ | ✓ | ✓ | ||
Deng et al. (2022) | 2021 | ✓ | ✓ | ✓ | ||
Reina et al. (2021) | 2021 | ✓ | ✓ | ✓ | ||
Rafi et al. (2024) | 2024 | ✓ | ✓ | ✓ | ||
Li et al. (2021) | 2021 | ✓ | ✓ | ✓ | ||
Our work | 2024 | ✓ | ✓ | ✓ | ✓ | ✓ |
DOI: 10.7717/peerj-cs.2280/table-1
Methodology: Data and Machine Learning Models
The research methodology, structured sequentially, is crucial and interconnected across segments, divided into:
- Dataset collection and exploratory data analysis.
- Machine learning model implementation in fintech.
Dataset Collection & Exploratory Data Analysis
To protect customer privacy, a credit card transaction dataset from Kaggle (Kartik2112, 2020) was used, consisting of labeled fraudulent and non-fraudulent transactions. This artificial dataset, generated using the Sparkov data generator, includes numerical and categorical features, with over 1.8 million instances and 20 attributes. Dimensionality reduction and attribute selection were performed for further analysis. Table 2 details variable descriptions and inclusion reasons.
Table 2: Feature description and reason for inclusion.
Feature name | Type | Description | Reason for inclusion |
---|---|---|---|
TransactionID | Categorical | Unique identifier for each transaction | Identifies each transaction uniquely |
TransactionDT | Numerical | Time from a reference datetime | Captures timing patterns of transactions |
TransactionAmt | Numerical | Transaction amount | Identifies unusual transaction amounts |
ProductCD | Categorical | Product code | Differentiates between types of transactions |
card1–card6 | Categorical | Payment card information (type, category, bank, etc.) | Provides detailed card information |
addr1, addr2 | Numerical | Address information | Helps detect location-based anomalies |
dist1, dist2 | Numerical | Distance between transaction and cardholder’s address | Identifies discrepancies in expected distances |
P_emaildomain | Categorical | Purchaser email domain | Identifies unusual email domains for fraud detection |
R_emaildomain | Categorical | Recipient email domain | Identifies unusual email domains for fraud detection |
C1–C14 | Numerical | Count features | Indicates frequency of transactions |
D1–D15 | Numerical | Time deltas between different interactions | Measures recency of transactions |
M1–M9 | Categorical | Match features (e.g., address match, card match) | Detects inconsistencies in transaction data |
V1–V339 | Numerical | Vesta engineered rich features | Complex features capturing various transaction details |
DeviceType | Categorical | Type of device used for transaction | Identifies device-related anomalies |
DeviceInfo | Categorical | Information about the device | Identifies device-related anomalies |
DOI: 10.7717/peerj-cs.2280/table-2
Data Collection and Splitting
The initial step involved gathering a relevant dataset from Kaggle, ensuring reliability and relevance to the research question. As shown in Fig. 2, the dataset originates from fintech sources, including credit card details and banking sector raw data, totaling over 1.8 million instances. The dataset is divided into a training file with approximately 1.3 million instances and a test file with nearly 0.5 million instances.
Figure 2: Splitting of dataset for training and testing machine learning models.
DOI: 10.7717/peerj-cs.2280/fig-2
Data Pipeline and Tools
The data pipeline includes discovery, preparation (cleaning, transforming, integrating), model planning (objectives, algorithm selection, architecture design), model building (training ML algorithms), operation (deployment and integration), and analysis (insight communication). Tools used include Python, Pandas, Sklearn, and Seaborn. A systematic, iterative approach was used to handle data collection challenges. For FL, Java Spring Boot was used with Swagger for API endpoint lookup.
Data Pre-processing and Exploratory Analytics
Data pre-processing involved cleaning, standardization, normalization, and missing data handling. Categorical features were encoded using OrdinalEncoder to reduce dimensionality and preserve interpretability. Numerical features were scaled using MinMaxScaler. Class imbalance was addressed using NearMiss under-sampling, specifically the NearMiss-1 variant. Exploratory data analysis (EDA) provided insights into data structure, trends, correlations, and patterns. Fraudulent transactions were identified and marked. Figure 3 shows target variable distribution before and after under-sampling. Figure 4 shows fraud incidence higher in females than males. Figure 5 illustrates credit card fraud across job categories, showing higher susceptibility in retail and hospitality.
Figure 3: Target variable distribution showing the balance achieved after under-sampling to address class imbalance in the dataset.
DOI: 10.7717/peerj-cs.2280/fig-3
Figure 4: Analysis of fraud distribution based on gender, highlighting variations in fraud incidence between different genders.
DOI: 10.7717/peerj-cs.2280/fig-4
Figure 5: Distribution of credit card frauds across various job categories, indicating different levels of fraud susceptibility in each category.
DOI: 10.7717/peerj-cs.2280/fig-5
Machine Learning Model Implementation for Fraud Detection
Six supervised ML models were implemented for credit card fraud prediction: decision tree (Safavian & Landgrebe, 1991), K-nearest neighbors (KNN) (Peterson, 2009), support vector machine (SVM) (Cortes & Vapnik, 1995), Random Forest (Breiman, 2001), naive Bayes (Rish, 2001), and logistic regression (Kleinbaum et al., 2002). These models were trained on labeled data to detect fraudulent transactions, enhancing customer protection and reducing fraud risks. Model parameters were versioned and stored on an organization server for client access, improving accuracy without data sharing. The dataset D was split into training (70%) and testing (30%) sets as follows:
(1) D = {Dtrain, Dtest} (70, 30)
Dtrain = [transaction1, transaction2, transaction3, …, transactioni] (i → 1:1.3e6)
Dtest = [transaction1, transaction2, transaction3, …, transactioni] (i → 1:0.5e6)
Decision Tree Model
The decision tree model (Safavian & Landgrebe, 1991) creates a flowchart-like structure for fraud detection, credit scoring, and risk assessment, recursively dividing data based on features. The Gini Index (Karabiber, 2021) was used for splitting, mathematically represented as:
(2) Gini(D) = 1 – ∑k=1n (pk)2
Where D is the dataset, K classes, pk is the probability of a sample belonging to class k, and n is the number of samples. Decision trees are interpretable, handle various data types, and capture nonlinear relationships, though overfitting is possible and addressed through pruning and ensemble methods.
K-Nearest Neighbors (KNN) Model
The KNN model (Peterson, 2009) classifies data points based on similarity to K-nearest neighbors, using Euclidean distance:
(3) d(Dtrain, Dtest) = √(∑i=1n (Dtrain – Dtest)2).
KNN is adaptive, distribution-free, and implemented using Scikit-learn, with cross-validation for optimal k selection.
Support Vector Machine (SVM) Model
The SVM model (Cortes & Vapnik, 1995) finds an optimal decision boundary, using a decision function:
(4) DecisionFunction: f(d) = (wTd + b)
Where w is the weight vector and b is the bias term. SVM handles linear and nonlinear relationships via kernels, effective in high-dimensional spaces and less prone to overfitting.
Random Forest Model
The Random Forest model (Breiman, 2001) is an ensemble approach integrating multiple decision trees trained on data subsets, reducing overfitting and capturing non-linear relationships.
Naive Bayes Model
The naive Bayes model (Rish, 2001) uses Bayes’ theorem with feature independence assumption:
(5) P(K|D) = [P(D|K)P(K)] / P(D).
Naive Bayes is computationally efficient, suitable for high-dimensional data, and useful for probability calculation and classification.
Logistic Regression
Logistic regression (Kleinbaum et al., 2002) examines relationships between independent factors and binary outcomes, predicting event probabilities. It is flexible, compatible with various data sources, and integral for fraud detection.
Proposed Blockchain-Based Federated Learning Framework
The proposed framework uses blockchain to establish a client-server model, as shown in Fig. 6. The server node manages learning models, while client nodes host financial applications. The server integrates trained models without data sharing. Sub-modules of the framework are detailed below.
Figure 6: Proposed framework architecture illustrating the client-server model using blockchain for secure and private federated learning.
DOI: 10.7717/peerj-cs.2280/fig-6
Server-Client Communication and Federated Server
Decentralized servers and clients communicate via APIs to synchronize models while protecting data. Only models are shared, not raw datasets, securing client nodes and preventing cyberattacks. Decentralized FL addresses data leakage by training models on private datasets. Six learning models were used: KNN, SVM, decision trees, naive Bayes, logistic regression, and Random Forest. The federated server aggregates trained models from clients, enabling clients to request and incorporate updated models. The blockchain-based federated server manages global model updates, retrieves and synchronizes models from clients, and verifies client legitimacy via security validation smart contracts, ensuring data privacy.
Security Validation and Authentication Contracts
Algorithm 1 represents the ‘Security Validation Contract’, using public keys (αi) and server-generated challenges (γi) for client authentication via LDAP (Howes, Smith & Good, 2003).
Algorithm 1: Security validation contract for authenticating client nodes.
Input: αi and γi |
---|
Where αi ← PublicKeys and γi ← FederatedChallenge |
Output: Legitimate or Not legitimate |
Step 1: Verify the legitimacy of client node |
Step 2: Send puzzle to the federated client |
Step 3: Receive the puzzle output |
Step 3.1: Compute SHA256(Puzzle) |
Step 3.2: β = SHA256(Puzzle) |
Step 4: Validation of β from blockchain |
Step 4.1: Validation is successful access grant |
DOI: 10.7717/peerj-cs.2280/table-12
Algorithm 2 represents the ‘Authentication and Sharing Agreement Contract’ for establishing authentication and model-sharing policies between servers and clients, using HTTPS (Cremers et al., 2017) and SSL/TLS (Oppliger, 2023; Krawczyk, Paterson & Wee, 2013). Figure 7 illustrates the workflow.
Algorithm 2: Authentication and sharing agreement contract workflow.
Input: Receive request |
---|
Output: Generate the policies and send it to the client nodes |
Step 1: Receive request from client nodes |
Step 2: Create JSON policy file (JSP) |
Step 3: Generate transaction and store in the blockchain |
Step 4: Send the transaction hash to the client nodes |
DOI: 10.7717/peerj-cs.2280/table-13
Figure 7: Workflow diagram of the authentication and sharing agreement contract, detailing the steps for policy creation and distribution.
DOI: 10.7717/peerj-cs.2280/fig-7
Federated Client Training Model Contract
Algorithm 3 represents the ‘Add Federated Client Training Model Contract’, managing client training models. Figure 8 shows the workflow for adding client models to the server. Figure 9 shows the synchronization smart contract workflow.
Algorithm 3: Add federated client training model contract workflow.
Input: Receive training model parameters |
---|
Output: Store the training model parameters |
Step 1: Receive training model parameters in json |
Step 2: Parse the message |
Step 3: Search the repository of particular model |
Step 4: If Search model is found |
Step 4.1: Call the synchronization contract |
Step 4.2: Else Create the new profile |
Step 5: Store the models in the blockchain |
DOI: 10.7717/peerj-cs.2280/table-14
Figure 8: Sequence diagram illustrating the process of adding a federated client training model to the federated server.
DOI: 10.7717/peerj-cs.2280/fig-8
Figure 9: Workflow of the synchronization smart contract used for updating models.
DOI: 10.7717/peerj-cs.2280/fig-9
Blockchain-Based Federated Clients and Smart Contracts
Decentralized client nodes (banks) train ML models locally for fraud detection. The federated server retrieves updated models, not raw data, from clients. Clients use six ML approaches: KNN, SVM, decision trees, naive Bayes, logistic regression, and Random Forest, storing local datasets and models. Clients share trained models, not data, with the federated server, which aggregates updates to refine a global model without sensitive information.
Local Trained Model and Smart Push/Pull Contracts
Algorithm 4 represents the ‘Add Local Trained Model Contract’, managing customer data repositories and local blockchain registrations.
Algorithm 4: Add local trained model contract workflow.
Input: Customer data |
---|
Output: Store the trained models |
Step 1: Validate the digital signature on customer data |
Step 2: If Successful validation |
Step 2.1: Convert the raw data in to CSV file |
Step 2.2: Perform data pre-processing technique |
Step 2.3: Trained data available learning model |
Step 3: Store the models in the blockchain |
Step 4: Else Return |
DOI: 10.7717/peerj-cs.2280/table-15
Algorithm 5 represents the ‘Smart Push and Pull Contract’ for pushing tuned parameters to the server and pulling aggregated models for client use.
Algorithm 5: Smart push and pull contract workflow for model updates.
Input: Tuned parameters with aggregated trained model |
---|
Output: Updated global model, Acknowledgment |
Step 1: Initiate ‘Push’ operation |
Step 1.1: Forward tuned parameters to federated server node |
Step 1.2: Include essential security parameters |
Step 1.3: Verify the digital signature |
Step 1.4: If Validation successful |
Step 1.4.1: Update global model with received parameters |
Step 1.4.2: Send acknowledgment of successful update |
Step 1.5: Else Terminate operation and notify failure |
Step 2: Initiate ‘Pull’ operation |
Step 2.1: Client request on-demand global parameters |
Step 2.2: Include security parameters in the request |
Step 2.3: Validate the digital signature on the request |
Step 2.4: If Validation successful |
Step 2.4.1: Send the requested aggregated trained model |
Step 2.5: Else Terminate operation and notify failure |
DOI: 10.7717/peerj-cs.2280/table-16
Security Layers for Privacy, Trust, and Governance
The blockchain-based FL system incorporates security layers to ensure privacy and trust:
- Encryption: Cryptographic techniques encrypt data transmitted between nodes.
- Privacy Security Measure: Noise is added to individual data samples before transmission.
- Privacy Security Risk: Trust-based secure aggregation protocols protect privacy during model update aggregation.
- Governance Mechanism: Client-server architecture governs the FL network and enforces privacy and security policies.
Use Case Discussion: Federated Fraud Detection
A use case tests the framework’s feasibility, where ClientNode-1 develops a fraud detection ML model using private customer data, predicts a fraud, updates the federated server and local blockchain with optimized hyperparameters. The server requests all connected ClientNodes to pull these updated hyperparameters, enhancing fraud detection capabilities across the network.
ML Implementation and Model Parameter Benchmarking
This work benchmarks a Federated Learning system preserving data integrity while allowing organizations to train ML models on their datasets. Each participant trains a local model, and a global model is created by combining local models, ensuring data security. Different ML models and parameters are used by each bank, tuned for optimal performance. Parameter-tuned models are aggregated at the federated server. Six ML models were implemented over five communication iterations (versions) between server and clients. Table 3 details ML models and parameter configurations across versions.
Table 3: Model parameter configurations and versions tested.
KNN model | Decision tree model |
---|---|
v1 | n_neighbors = 5, metric = ‘minkowski’, p = 2 |
v2 | n_neighbors = 5, metric = ‘minkowski’, p = 1 |
v3 | n_neighbors = 5, metric = ‘minkowski’, p = 2 |
v4 | n_neighbors = 10, metric= ‘minkowski’, p = 1 |
v5 | n_neighbors = 10, metric = ‘minkowski’, p = 2 |
Naive bayes model | SVM model |
v1 | var_smoothing = 1e-8 |
v2 | var_smoothing = 1e-8 |
v3 | var_smoothing = 1e-7 |
v4 | var_smoothing = 1e-5 |
v5 | var_smoothing = 1e-3 |
Logistic regression model | Random forest model |
v1 | fit_intercept = True, random_state = None |
v2 | fit_intercept = False, random_state = 50 |
v3 | fit_intercept = False, random_state = 100 |
v4 | fit_intercept = False, random_state = 42 |
v5 | fit_intercept = False, random_state = 42 |
DOI: 10.7717/peerj-cs.2280/table-3
Results and Performance Benchmarking Discussion
Results, summarized in Table 4, show the decision tree model achieved the highest test accuracy at 95.72%, followed by Random Forest at 95.07%. Naive Bayes and logistic regression showed moderate performance, while SVM and KNN performed less effectively. Table 5 details precision, recall, and F1-scores, again with decision tree and Random Forest outperforming other models. Table 6 lists the best parametric values for each model version.
Table 4: Train & test accuracy benchmark results for different models.
Model | Version | Train accuracy | Test accuracy |
---|---|---|---|
Decision tree | v4 | 100% | 95.72% |
Random forest | v1 | 99.99% | 95.07% |
Naive bayes | v1 | 84.67% | 83.78% |
Logistic regression | v2 | 79.86% | 79.24% |
SVM | v5 | 77.67% | 74.33% |
KNN | v2 | 80.76% | 69.46% |
DOI: 10.7717/peerj-cs.2280/table-4
Table 5: Precision, recall, and F1-score benchmark comparison.
Models | Version | F1-Score | Precision | Recall |
---|---|---|---|---|
Decision tree | v4 | 1 | 0.9603 | 0.9537 |
Random forest | v1 | 0.999 | 0.9624 | 0.9375 |
Naïve bayes | v1 | 0.8274 | 0.9354 | 0.7258 |
Logistic regression | v2 | 0.7896 | 0.825 | 0.7424 |
SVM | v5 | 0.7617 | 0.7806 | 0.6771 |
KNN | v2 | 0.788 | 0.7458 | 0.5908 |
DOI: 10.7717/peerj-cs.2280/table-5
Table 6: Best parametric values version for each model.
Model | Version | Parametric values |
---|---|---|
Decision tree | v4 | max depth = 75, random state = 42 |
Random forest | v1 | n estimators = 100, random state = None |
Naive bayes | v1 | priors = None, var smoothing = 1e-09 |
Logistic regression | v2 | fit intercept = False, random state = 50 |
SVM | v5 | shrinking = True, random state = 42 |
KNN | v2 | n neighbors = 5, metric = ’minkowski’, p = 1 |
DOI: 10.7717/peerj-cs.2280/table-6
Confusion matrices in Fig. 10 further support decision tree and Random Forest as top performers. Figure 11 and Figure 12 show training and testing accuracy across model versions. Figure 13 and Tables 7-11 analyze computational performance, showing decision trees, logistic regression, and naive Bayes with faster execution times, while KNN and decision trees require more memory. Random Forest and naive Bayes exhibit higher CPU utilization. Hyperparameter tuning is critical for framework performance optimization.
Figure 10: Confusion matrices visualizing the performance of each machine learning model in classifying fraudulent and non-fraudulent transactions.
DOI: 10.7717/peerj-cs.2280/fig-10
Figure 11: Training accuracy benchmark across different versions of machine learning models.
DOI: 10.7717/peerj-cs.2280/fig-11
Figure 12: Testing accuracy benchmark across different versions of machine learning models.
DOI: 10.7717/peerj-cs.2280/fig-12
Figure 13: Computational analysis benchmarking memory usage, CPU usage, and execution time for each hyperparameter version across different models.
DOI: 10.7717/peerj-cs.2280/fig-13
Table 7: Performance analysis for hyperparameter version 1.
Hyperparameter version 1 |
---|
Memory usage (%) |
DT |
KNN |
SVM |
LR |
NB |
RF |
DOI: 10.7717/peerj-cs.2280/table-7
Table 8: Performance analysis for hyperparameter version 2.
Hyperparameter version 2 |
---|
Memory usage (%) |
DT |
KNN |
SVM |
LR |
NB |
RF |
DOI: 10.7717/peerj-cs.2280/table-8
Table 9: Performance analysis for hyperparameter version 3.
Hyperparameter version 3 |
---|
Memory usage (%) |
DT |
KNN |
SVM |
LR |
NB |
RF |
DOI: 10.7717/peerj-cs.2280/table-9
Table 10: Performance analysis for hyperparameter version 4.
Hyperparameter version 4 |
---|
Memory usage (%) |
DT |
KNN |
SVM |
LR |
NB |
RF |
DOI: 10.7717/peerj-cs.2280/table-10
Table 11: Performance analysis for hyperparameter version 5.
Hyperparameter version 5 |
---|
Memory usage (%) |
DT |
KNN |
SVM |
LR |
NB |
RF |
DOI: 10.7717/peerj-cs.2280/table-11
Conclusions and Future Directions
This work presents a FL framework leveraging ML model exchange among entities, training models on individual datasets while preserving privacy and data integrity. This federated approach addresses data silos and privacy concerns of centralized training, enabling collective model improvement and enhancing fraud detection accuracy. Decision tree and Random Forest models showed superior performance in counterfeit detection. The framework effectively integrates blockchain and federated learning to enhance security and privacy in fintech fraud detection. Future work will explore scaling the framework with more banking nodes and further optimizing model performance and computational efficiency.
The key challenges addressed are:
- Federated learning framework implementation for reducing counterfeit chances.
- Implementation of diverse ML models by entities for faster, accurate fraud detection through collaborative learning.
In conclusion, this research successfully explored ML models for counterfeit detection, resolving client privacy and collaboration issues. The FL framework and multi-model deployment demonstrated effectiveness in improving counterfeit detection systems. Future fintech fraud detection will likely rely on ML and FL for enhanced security and customer protection.
Supplemental Information
Federated Client Dataset.
DOI: 10.7717/peerj-cs.2280/supp-1