
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 13 Issue: 04 | Apr 2026 www.irjet.net p-ISSN: 2395-0072
![]()

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 13 Issue: 04 | Apr 2026 www.irjet.net p-ISSN: 2395-0072
Morchid Laila1, , Haung Lianli*
1 School of Intelligent and connected vehicle, Hubei University of Automotive Technology, Shiyan 442002, China
*Associate Professor, Hubei University of Automotive Technology, Shiyan 442002, China
Abstract - Machine learning (ML) is increasingly being used to defend digital financial systems from fraudulent transactions; nevertheless, achieving high detection accuracy in real-time and on a wide scale remains challenging. This paper describes a Kafka-based machine learning pipeline for real-time analysis of financial transaction streams. The suggested pipeline uses Apache Kafka for distributed streaming and tests four classification approaches: Logistic Regression, Random Forest, XGBoost, and a hybrid soft-voting ensemble. A dataset of 209,715 transactions under imbalanced fraud scenarios was used to evaluate performance. Significant differences can be observed in the results. Logistic regression demonstrated limited applicability for severely imbalanced fraud detection, with an accuracy of 88.7% and a fraud recall of 0.042. Random Forest performed the best overall, with 97.6% accuracy, 0.886 F1 score, and 0.994 AUC-ROC. XGBoost achieved 93.9% accuracy, with a competitive balance of precision (0.711) and recall (0.825). The hybrid voting classifier maintained low-latency inference while boostingresilience inaKafka-basedstreamingcontext,with 96.7% accuracy, an F1 score of 0.838, and an AUC ROC of 0.984. These findings indicate that combining Kafka-driven streaming with ensemble machine learning is an efficient andscalablesolutionfor real-time financialfrauddetection, particularly in high-volume transaction scenarios where detectionperformanceandreactiontimearecritical.
Key Words: Real-Time Digital Transactions Fraud Detection Machine Learning, Logistic Regression, Random Forest, XGBoost, Hybrid Voting Classifier, ApacheKafka,DataPipeline,FraudRisks.
Digital payment systems have become important to modern financial activity, with card-present transactions (in-person) at points of sale and card-not-present transactions (online) via electronic and mobile platforms accounting for the majority of currency exchanges [1] These channels provide speed, convenience, and accessibility to millions of users every day; however, they have become more vulnerable to fraudulent activity, making fraud detection a key concern for financial institutions. Traditional rule-based detection methods, includingone-timepasswordssentviaSMS(OTPs),mobile transactionauthorizationnumbers(mTANs)[2],U-Shields [3], and biometric authentication [4], have improved
identity verification; however, research shows that many mobile banking applications still contain exploitable vulnerabilities [5]. This demonstrates that despite the current protections, the evolving nature of fraud requires advancedandflexibledetectionsystems.
Machine Learning (ML), a dynamic and data-driven method that can learn complex behavioral patterns and adapt more effectively than static rule-based systems,has been recognized to address these issues.The successful results of XGBoost, Random Forest, and Logistic Regression in detecting fraud are widely acknowledged. While Logistic Regression stands out for its interpretability and computational efficiency [6], Random Forestusesensemblelearningforrobustprediction[7][8] XGBoostachieves superior recall and F1 score, which are vital for identifying infrequent fraudulent transactions. The program is particularly good at handling highly imbalanced datasets. Combining these models to form a Hybrid Voting Classifier further improves predictive accuracy and provides an effective defense against fraudulentactivityinbothswipeandonlinepayments.
For real-time fraud detection, where quick decisionmaking is required to reduce losses and maintain consumer confidence, a solid and scalable data infrastructure is vital. This function is performed by ApacheKafka,a distributed messaging platformoriginally developed by LinkedIn, which facilitates high-throughput and low-latency data streams. Kafka ensures fault tolerance, scalability, and resilience by segmenting data intotopics anddistributing theseacross multiplebrokers. To guarantee reliability, producers append transaction messages to topics, consumers fetch them for processing, and leaders replicate data to followers. Kafka enables the ongoingingestion,processing,anddisseminationofonline and swipe transactions within fraud detection frameworks. This capability allows for seamless integration with machine learning models designed for anomalydetectionandreal-timeanalysis[13][9]
This project provides a Kafka-based, real-time fraud detection system that combines Logistic Regression, Random Forest, XGBoost, and a Hybrid Voting Classifier into a single pipeline. The system collects and analyzes transaction streams, classifies events in real time, and constantly updates models using past data to increase accuracy. By focusing on both swipe and online

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 13 Issue: 04 | Apr 2026 www.irjet.net p-ISSN: 2395-0072
transactions, the system handles the dual difficulty of processing high-frequency in-person payments while also safeguardingremotedigitalchannels.
Fraud detection in financial transactions has gained prominenceduetotherisingpopularityofdigitalpayment systems and the increasing sophistication of fraudulent activities. Traditional rule-based systems, which depend onestablishedheuristics,arenotverygoodatfindingnew typesoffraudbecausetheycan'tapplywhattheyknowto attacksthatareneworchangeable[10].Forexample,rulebased techniques frequently fail when fraudsters significantly alter transaction characteristics, rendering such systems ineffective for modern, high-frequency digital transactions [11]. To address these constraints, machine learning approaches have been extensively studiedforfrauddetection.LogisticRegressionisasimple linearmodelthatcanfindbigpatterns,butitdoesn'twork well with datasets that aren't balanced, like when there aren't many fraudulent transactions [12]. Non-linear models like Random Forest and XGBoost are better at finding complicated patterns in transaction data. Random Forestisbetterathandlingnoise,andXGBoostisbetterat dealing with unbalanced datasets through gradient boosting [13][14]. Support Vector Machines (SVMs) and NeuralNetworkshavealsobeenemployedtoidentifynonlinear separations and high-dimensional correlations, although these models can be computationally intensive andslowtoinfer[15][16].
Ensemble and hybrid models, which use many classifiers, have been better at balancing precision and recall, especially when the classes in the dataset are very different from each other [17]. These methods reduce the likelihood of false negatives while maintaining high precision,whichisessentialinfinancialsystemsthatneed to find a balance between fraud detection and user experience. In our research, we used a Kafka-driven realtime pipeline with a hybrid Voting Classifier that combined Logistic Regression, Random Forest, and XGBoost. This approach enables continuous transaction ingestion, real-time preprocessing, and rapid scoring, ensuring the low-latency replies required for highfrequency transaction monitoring [18][19]. Our dataset contains 209,715 transactions, with approximately 11.8% being fraudulent, making the detection task very difficult. In baseline tests, Logistic Regression achieved exceptionally high precision (0.9923) but extremely low recall (0.042), indicating a limited ability to detect all fraudulent transactions [20]. Random Forest achieved a recall of 0.8037 and an AUC-ROC of 0.9939, indicating a high capacity to detect fraud while maintaining precision [21].XGBoostachieveda balancedF1-scoreof0.7641and an AUC-ROC of 0.9609, demonstrating its competence in managing unbalanced data [22]. Our hybrid Voting Classifierincreasedperformanceevenfurther,reachingan
F1-score of 0.838 and an AUC-ROC of 0.984, illustrating the benefit of integratingcomplementary modelswithin a streamingcontext Error! Reference source not found..
When compared to previous studies, our approach shows clearandmeasurablegainsinavarietyofdimensions.For example, research using batch processing with Random Forest or XGBoost, such as Error! Reference source not found.and Error! Reference source not found., found highprecisionscoresrangingfrom0.90to0.95.However, these models frequently had much lower recall rates, ranging from 0.60 to 0.75, indicating that a large percentage of fraudulent transactions were overlooked. This limitation is crucial in real-time applications, since undetected fraud can result in immediate financial losses. Furthermore, batch-processing methods impose latency by requiring adequate data to make predictions, making them unsuitable for high-frequency transaction monitoring.
Other prior works leveraged ensemble techniques, including combinations of Random Forest, Logistic Regression,orXGBoost[23],toincreasedetectionmetrics like F1-score. These studies produced F1-scores of up to 0.83, indicating a better balance of precision and recall. However, their structures were primarily intended for offline analysis and did not include streaming data pipelines. As a result, while these models work well on static datasets, they cannot manage continuous, highvolume transaction streams in real time. Furthermore, while some algorithms increased recall by utilizing techniquessuchasSMOTEforclassbalance[16],theystill relied on batch inference and did not achieve the lowlatency, high-throughput performance required in operationalfrauddetectionsystems.
On the other hand, our work combines the distributed streaming capabilities of Apache Kafka with a hybrid Voting Classifier that incorporates Random Forest, XGBoost, and Logistic Regression. There are numerous advantages to this architecture. First, Kafka eliminates batch processing delays by enabling continuous transaction input and processing. Second, the hybrid ensemble makes use of the complementing capabilities of its component models: XGBoost helps to provide strong performance in situations with unbalanced data, Random Forestenhancesrecall,andLogisticRegressionguarantees excellent precision. In actuality, this integration helped our system exceed the majority of previous models in terms of detection rate and the ratio of false positives to false negatives, achieving a high F1-score of 0.838 while maintainingarecallof0.7252.
By closely studying the results of prior studies, the benefits of our system become clear. Studies such as [24]Error! Reference source not found. found adequate accuracyandprecisionmeasuresbutfrequentlyneglected recallorlatencyissues. Modelsbasedonneuralnetworks

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 13 Issue: 04 | Apr 2026 www.irjet.net p-ISSN: 2395-0072
or deep learning [25][26] produced great accuracy but were computationally demanding, making them unsuitable for real-time streaming at scale. Ensemblebased methods [27][28] increased detection rates but lacked streaming capabilities, limiting their utility in continuous monitoring applications. In contrast, our Kafka-drivenhybridmethodnotonlyachievescompetitive or higher performance in traditional metrics (precision, recall, and F1-score), but it also handles operational constraints such as low-latency inference, scalability, and flexibility to changing fraud patterns. Overall, the combination of streaming architecture and hybrid ensemble learning provides a robust, scalable, and highly successful method of real-time fraud detection, distinguishingitfrompreviousresearch.
The fraud detection workflow combines real-time transaction processing with powerful machinelearning to accurately detect anomalies. Transactions, whether cardpresent (swipe) or card-not-present (online), begin in the streaming layer driven by Apache Kafka. A consumer component collects these streaming events and sends them to a preprocessing module, where raw transaction attributes are standardized, encoded, and converted into feature vectors appropriate for modeling. These vectors are then analyzed using a machine learning engine that includesLogisticRegression,RandomForest,andXGBoost algorithms. The results of these models are integrated using a hybrid soft-voting ensemble to get final fraud probability scores. Based on these predictions, the decision layer routes legitimate transactions to normal processing and suspect transactions to an alert and reporting subsystem. The architecture supports both offline training and model evaluation, as well as real-time scoringandcontinuousmonitoringinaproductionsetting, accordingto Figure 1

Swipe Transactions (Card-Present): These occur at physical points-of-sale (POS) terminals. The customer produces a card, and the transaction is completed via magnetic stripe or chip-based authentication. These transactionscontainavarietyofproperties,including:
Transaction Amount
Merchant Category
Timestamp
Terminal ID
Cardholder Information
Online Transactions (Card Not Present): These transactions take place via e-commerce platforms or digitalpaymentmethods,withoutthephysicalpresenceof a card. In addition to the same qualities as swipe transactions,onlinetransactionsinclude:
IP Address
Device ID
Geolocation
Browser/App Identifiers
A time-stamped series of transactions is created by continuously recording both swipe and online transactions:
wherex1,x2,.....,xnareindividualtransactionvariablessuch asamount,merchantcode,timestamp,deviceID,location, etc. Online transactions use behavioral or network-based indicators, such as IP address or Device ID, to distinguish betweenlegitimateandfraudulentactivity.
Both swipe and online transactions are captured continuously, forming a time-stamped sequence of transactions:
3.1 Transaction Generation
Thefirststepinthefrauddetectionpipelineistogenerate and capture transactional data, which will be used as the system'sprimaryinput.Transactionsaredividedintotwo types:card-present(swipe)andcard-not-present(online).
where Tₖ represents each transaction in the sequence, and m represents the total number of transactions in a given observation period. This sequential representation is crucial for stream-based processing, as it enables the system to detect fraud patterns as transactions occur in real-time.
By categorizing and collecting these transactions, the system ensures that all essential transactional attributes are available for preprocessing and machine learning analysis,resultinginsuccessfulfrauddetection.
3.2 Data Collection
Thesecondstageofthefrauddetectionsystementailsthe systematic gathering and organization of transactional data. These transactions, whether through card-present (swipe) or card-not-present (online) channels, are consolidated into a single Data Source Repository. This

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 13 Issue: 04 | Apr 2026 www.irjet.net p-ISSN: 2395-0072
repository serves as the foundation for the rest of the frauddetectionpipeline'sprocessingandanalysis.
Each transaction is saved as a structured record with multipleattributes,includingbutnotrestrictedto:
Identifiers: TransactionID,date,clientID,cardID
Transactional Details:Amount,cardchipusage
Merchant Information: Merchant ID, merchant city, merchant state, postal code, merchant category code (MCC)
Error Categories: Common errors such as Insufficient Balance, incorrect PIN, Technical Glitch, incorrect ExpirationDate,FalseCardNumber
Richer analysis during preprocessing and machine learning model training is made possible by this structured format, which guarantees that every transaction's contextual and financial features are recorded. The system can effectively manage massive amounts of data while preserving crucial information for fraud detection by recording transactions in an organized fashion.
Formally,thedatasetcanberepresentedasacollectionof transactionvectors:
whereSrepresents the stream of transaction events, andM (Ti) denotes the message corresponding to transaction Ti
A producer component is responsible for publishing transaction events to the appropriate topic, while one or more consumer applications subscribe to these topics to retrieve messagesin real time. The consumer process can berepresentedas:
where each transactionTiis a multidimensional vector of attributes. For the dataset used in this study n=12, including both numerical variables (e.g., transaction amount) and categorical variables (e.g., merchant city, errortype).
The consolidated Data Source Repository not only gives a consistentpictureofall transactional activities, butitalso enables scalability. It provides easy connection with Apache Kafka's streaming layer, ensuring real-time transaction ingestion and the ability to perform both offlineanalysisandonlinemodeltraining.Thisconnection allows for the efficient processing and storing of highfrequencytransactiondata.
The system's fundamental distributed streaming platform is Apache Kafka, which allows for real-time financial transaction ingestion and processing. Kafka manages the continuous publishing and consumption of transaction events, ensuring high throughput, low latency, and fault toleranceacrossthepipeline.
Inthisstage,alltransactioneventscollectedfromthedata repository are published to Kafka topics, which act as logical channels for data streams. Each new transaction recordTi is serialized and appended to the topic as a message,formingacontinuous,orderedlogofevents:
where denotestheconsumerprocessthatretrievesthe messageandforwardsthetransactionforpreprocessing.
Kafka's separating method distributes data across several brokers, enabling horizontal scalability. This approach allows downstream programs to process transaction streamsinparallel,suchasfrauddetectionmodels.Kafka's replication function protects data integrity by storing copies of messages across many brokers, preventing data lossintheeventofafailure.
Furthermore, Kafka Streams offers real-time processing and analysis by allowing the consumer to handle transactions as they arrive, making it possible to continuously monitor both card-present and card-notpresent transactions for fraud detection. Kafka's built-in characteristicsforhigh-throughputandfaulttoleranceare critical to system stability, especially in contexts with millionsoftransactionsperday.
Using Kafka, the system can efficiently manage data flow and ensure that all transaction events are available for real-timescoringand fraud detectionwithoutintroducing thedelaysassociatedwithbatch-processingapproaches.
Once transaction events are published to Kafka topics, a consumerapplicationsubscribestothemandreceivesthe recordsinrealtime.Theconsumeractsasanintermediary between raw transaction data and the machine learning engine. Each transaction is processed and converted to a model-readyformatforsubsequentanalysis.
Preprocessing Steps: Data Cleaning and Validation: Incomplete or malformed records, such as missing values orinvalidIDs,areidentifiedandcorrectedordiscarded.
Transactionerror(e.g.,InsufficientBalance,incorrectPIN) are detected and converted into structured categorical features.

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 13 Issue: 04 | Apr 2026 www.irjet.net p-ISSN: 2395-0072
Feature Engineering:
Numerical Features: Continuous variables, such as transaction amount, are normalized to reduce skewness andensureconsistencyinscale.
Categorical Features: Variables such as merchant city, errors, or cardholder details are transformed using onehot encoding or embedding techniques, making them suitableformachinelearningmodels.
Derived Features: New features, such as transaction frequency or average spending amount over a time window, are created to capture additional insights that help distinguish fraudulent behavior from legitimate transactions.
Feature Vector Construction:
Each transactionTiis represented as a highdimensional feature vector:
wherexjcorresponds to a preprocessed attribute (e.g.,Transactionamount,merchantcode,location,orerror type). This vector representation allows the machine learning models to effectively detect patterns and anomaliesindicativeoffraud.
Stream Alignment:
Preprocessed transaction vectors are aligned with Kafka’s message offsets to ensure the proper order and timing for real-time analysis. This step is crucial for stream-based processing, where maintaining the correct sequence of transactions is vital for detecting fraud in the rightcontext.
Micro-Batching:
For high-throughput scenarios, microbatching techniques may be applied to process multiple transactions simultaneously. This method enhances the speedofscoringwhileensuringthatlatencyisminimized, allowingforefficientparallelprocessing.
The machine learning engine is at the center of the fraud detectionsystem,assessingeachpreprocessedtransaction to determine its probability of being fraudulent. This engine combines several machine learning techniques, including Logistic Regression (LR), Random Forest (RF), and Extreme Gradient Boosting (XGBoost). These models aremergedintoahybridsoft-votingensembletoimprove thesystem'soverallforecastaccuracyandrobustness.
Logistic Regression (LR)
LogisticRegressionisemployedasabaselinelinear classifierthatestimatestheprobabilityoffraudbasedona logisticfunction: where:
P(y=1∣X)istheprobabilitythattransactionXisfraudulent arethemodelcoefficients.
are the transactions features (e.g., transactionamount,merchanttype).
LR is preferred for its interpretability and simplicity, which makes it simple to determine which features have the greatest influence on the model's predictions. However, it struggles with highly imbalanced datasets sinceitpreferstofocusonthemajorityclass.
Random Forest (RF)
RandomForest,anensembleofdecisiontrees,isutilized tocapture nonlinear feature interactions andimprove classificationstability.Eachdecisiontree (X)istrained onabootstrapsampleofthedatawithrandomfeature selection.Theoverallpredictionisobtainedbyaveraging theprobabilities
wherekis the number of trees, and (X)is the output of thek-Thdecisiontree.
Random Forest increases classification stability by averaging predictions from numerous trees, lowering the possibility of overfitting. This model is resistant to noise and can handle imbalanced datasets well. Its recall in detecting fraudulent transactions is especially high, makingitsuitedforuseinfrauddetectionsystems.
Extreme Gradient Boosting (XGBoost) XGBoost is incorporated to leverage gradient boosting with regularization, enabling the model to sequentially correct errors of weak learners. For iteration t, the predictionisupdatedas:
ˆ ˆ where:
ˆ isthepredictionatiterationt isthenewweaklearner(tree)addedtothemodel,

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 13 Issue: 04 | Apr 2026 www.irjet.net p-ISSN: 2395-0072
ηisthelearningrate.
XGBoost's ability to manage imbalanced datasets via boosting, as well as its flexibility to fine-tune model parameters (such as learning rate and depth), make it extremely useful in fraud detection. It frequently outperforms established algorithms, such as Logistic Regression,indetectingsubtlepatternsindicativeoffraud.
To combine the strengths of individual models, a softvoting ensemble is implemented. In this approach, each model(LR,RF,andXGBoost)producesaprobabilityscore indicating if a transaction is fraudulent. These scores are thencombinedtomakeafinalprediction:
̂ ensemble=argmax ∑ )
where:
is the probability score from modeli(LR, RF, or XGBoost),
is the weight assigned to modelibased on its performance(accuracy,recall,etc.),
m isthetotalnumberofmodelsintheensemble.
The ensemble enhances precision, recall, and F1-score by integrating the strengths of Logistic Regression, Random Forest,andXGBoost,resultinginfewerfalsepositivesand negatives. The ensemble approach finds the right mix between detecting fraud (high recall) and reducing customerdisturbance(highprecision).
The decision layer in the fraud detection pipeline is responsible for transforming the machine learning ensemble's predictions into actionable results. Once the models (Logistic Regression, Random Forest, and XGBoost) have made their predictions, the hybrid softvoting ensemble aggregates these probabilities to get a finalverdictonwhetheratransactionisfraudulent.
To make a final choice, the ensemble's aggregated probability is compared to a specified thresholdτ. If the probabilityisgreaterthanthethreshold,thetransactionis labeledasfraudulent;otherwise,itisconsideredvalid.
isthepredictedprobabilityfrommodel
is the weight assigned to the model (based on performance)
τisthedecisionthreshold,
m is the total number of models in the ensemble, This decision threshold can be adjusted to prioritize either
precision or recall:
Lowering increases recall (detecting more fraudulent transactions) but may increase false positives (legitimate transactionsflaggedasfraudulent).
Raising increasesprecision(reducingfalsepositives)but mayresultinmissedfrauds(lowerrecall).
Operational Action:
Once a decision is made, the system takes appropriate actionbasedontheclassification:
Legitimate Transactions: These transactions are routed to the normal processing pipeline, allowing users to completetheirtransactionswithoutinterruption,ensuring aseamlesscustomerexperience.
Fraudulent Transactions: Transactions classified as fraudulent are flagged and routed to an alert and reporting subsystem,wheretheycaneitherbereviewed by analysts or subjected to automated interventions, such as:
Transaction Blocking: Temporarily blocking the transactiontopreventfinanciallosses.
Verification Requests: Requesting additional verification fromtheusertoconfirmthelegitimacyofthetransaction.
Account Suspension: Suspending the account if fraudulentbehaviorisdetectedoveraperiod.
where:

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 13 Issue: 04 | Apr 2026 www.irjet.net p-ISSN: 2395-0072
A range of measures were used to evaluate the effectiveness of the implemented fraud detection models, which included Random Forest, XGBoost, Logistic Regression, and the Hybrid Voting Classifier. This study focused not only on prediction accuracy, but also on operational efficiency, including latency and throughput, allofwhicharecrucialforreal-timefrauddetection.
4.1 Evaluation Metrics
Accuracy: Accuracy
Where:
TP:TruePositives
TN:TrueNegatives
FP:FalsePositives
FN:FalseNegatives
Precision: Precision
TP:TruePositives
FP:FalsePositives
Recall (Sensitivity): Recall
TP:TruePositives
FN:FalseNegatives
F1-Score: F Precision Recall Precision Recall
Where:
Precision and Recall arethepreviouslydefinedmetrics.
AUC-ROC: Area under the Receiver Operating Characteristiccurve,computedusingintegration:
Evaluation Setup: Theevaluationwasconductedusingalocalsetupwiththe followingconfiguration:
Hardware: Apple M1, 8-core CPU, 7-core or 8-core GPU, 16-core Neural Engine, with 8GB unified memory (configurableto16GB)and256GBSSD.
Software: The system was powered by Ubuntu with Apache Kafka for real-time data streamingsimulation,ensuringarealisticenvironmentfor high-frequencyfinancialtransactionprocessing.
The results of the evaluation showed that Random Forest outperformed all models with an AUC of 0.9939, maintaininghigh precision (0.9864) and recall (0.8037) This combination of high accuracy and recall makes Random Forest the best performer in terms of fraud detectioninimbalanceddatasets.
The Hybrid Voting Classifier also performed strongly, achieving an F1-score of 0.838 and an AUC-ROC of 0.9840, demonstrating the benefit of combining multiple modelstobalanceprecisionandrecalleffectively.
In contrast, Logistic Regression consistently underperformed, especially in terms of recall (0.042), indicating that it struggles with detecting fraudulent transactionsinhighlyimbalanceddatasets.
The XGBoost model demonstrated strong performance with an accuracy of 0.9399, an AUC of 0.9609, and a competitive recall of 0.8251,showcasingitseffectiveness in handling imbalanced data while capturing complex fraudpatterns.
Visualization Techniques:
To provide a visual understanding of model performance, thefollowingtechniqueswereused:
Confusion Matrices: These matrices offered a clear breakdown of True Positives, True Negatives, False Positives, and False Negatives, allowing for a detailed understandingofeachmodel'sclassificationaccuracy.
ROC Curves: ROC curves for each model were plotted to assess their discriminatory power. Random Forestachieved the highest AUC, followed by the Hybrid Voting Classifier
Where:
TPR isthe True Positive Rate
FPR isthe False Positive Rate
Precision-Recall Curves: PR curves were used to evaluate how well each model balanced precision and

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 13 Issue: 04 | Apr 2026 www.irjet.net p-ISSN: 2395-0072
recall, particularly in the case of highly imbalanced datasets.
Receiver Operating Characteristic (ROC) curves were generated for each model to demonstrate its capacity to distinguish between fraudulent and legal transactions. Figure 2 displaystheROCcurvesforallfourmodels.




Figure 2. ROCCurvesofRandomForest,XGBoost,Logistic Regression,andHybridVotingClassifier
TheRandomForestmodelhadthehighestAreaUnderthe Curve (AUC) score of 0.9939, showing almost flawless classificationbetweenclasses.TheHybridVotingClassifier came in close second with an AUC of 0.9840, indicating strong ensemble performance. XGBoost also fared well, with an AUC of 0.9609, whilst Logistic Regression lagged with an AUC of 0.7708, indicating lesser classification performance.Thesechartsillustratethetrade-offbetween True Positive Rate (TPR) and False Positive Rate (FPR), emphasizingthesuperiorperformanceofensemble-based and tree-based models in this real-time fraud detection system.
To further understand model performance in scenarios with class imbalance, Precision-Recall (PR) curves were examined. Figure 3 presentsthePRcurvesforallmodels. These curves plot Precision against Recall, emphasizing the models’ ability to correctly identify fraudulent transactionswhileminimizingfalsealarms.


International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 13 Issue: 04 | Apr 2026 www.irjet.net p-ISSN: 2395-0072


3. Precision-RecallCurvesofRandomForest, XGBoost,LogisticRegression,andHybridVotingClassifier
The Random Forest and Hybrid Voting Classifier maintained high Precision across varying Recall values, illustrating their robustness in handling the imbalanced dataset, where fraud constitutes only a small fraction of totaltransactions.LogisticRegression,however,showeda steeper drop in Precision at higher Recall values, suggesting limited reliability in capturing all fraudulent instanceswithoutincurringmorefalsepositives.
Confusion matrices were generated to provide a detailed breakdown of model predictions, offering a direct view of True Positives (TP), True Negatives (TN), False Positives (FP),andFalseNegatives(FN).


5. ConfusionMatrixofHybridVotingClassifier


International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 13 Issue: 04 | Apr 2026 www.irjet.net p-ISSN: 2395-0072


Figure 7. ConfusionMatrixofLogisticRegression
Random Forest Confusion Matrix
True Positives (TP):19,875
True Negatives (TN):184,710
False Positives (FP):275
False Negatives (FN):4,855
The Random Forest model achieved strong performance with minimal misclassification, maintaining a low false positive rate and false negative rate
Hybrid Voting Classifier Confusion Matrix
True Positives (TP): 17,935
True Negatives (TN):184,845
False Positives (FP):140
False Negatives (FN):6,795
While the Hybrid Voting Classifier performed well in classification, it had a slightly higher false negative count than Random Forest, highlighting the inherent trade-offs in ensemble models. Nonetheless, it efficiently balances frauddetectionwithlowfalsealarms.
XGBoost Confusion Matrix
True Positives (TP): 20,405
True Negatives (TN):176,709
False Positives (FP):8276
False Negatives (FN):4325
XGBoost demonstrates strong fraud detection capability with high true positives, but generates more false positives, reflecting a trade-off between recall and precisioninimbalanceddatascenarios.
Logistic Regression Confusion Matrix
True Positives (TP): 1038
True Negatives (TN):184,985
False Positives (FP):0
False Negatives (FN):23,692
The Logistic Regression achieved perfect precision but extremely low recall, missing most fraudulent transactions, making it unsuitable for imbalanced fraud detectiontasks.
To provide a clear comparison summary of all models, Table 1 includes essential evaluation variables such as Accuracy, Precision, Recall, F1-Score, and AUC-ROC. Random Forest emerged as the best-performing model, with the greatest AUC (0.9939) and good Precision (0.9864)andRecall(0.8037).Thiscombinationhasrobust detection capacity with low misclassification, making it idealforreal-timefrauddetectioninimbalanceddatasets.
The Hybrid Voting Classifier also performed well, using ensemble learning to successfully balance Precision and Recall. While its Recall (0.7252) was significantly lower than Random Forest's, its excellent Precision (0.9923) provides accurate detection of fraudulent transactions with few false alarms. XGBoost, while slightly behind in overall performance, maintained competitive accuracy (0.9399) and AUC-ROC (0.9609), demonstrating good predictive skills, particularly for catching complicated non-linearpatternsindata.

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 13 Issue: 04 | Apr 2026 www.irjet.net p-ISSN: 2395-0072
LogisticRegression,ontheotherhand,persistentlyunderperformedacrosseverymeasure,withaparticularlypoorRecall (0.042) despite excellent Precision (1.0). This demonstrates its limits in detecting fraudulent transactions in highly imbalanceddatasets,stressingthesuperiorityoftree-basedandensembletechniquesforoperationaluse.
Table 1. ComparativeEvaluationofFraudDetectionModels
Notes
Bestoverall,minimal misclassification
Hybrid
Classifier
Logistic Regression
Strongensemble performance,balances
Precision/Recall
Competitiveaccuracy, capturescomplexpatterns
Underperformson imbalanceddata,higher misclassification
These results collectively indicate that tree-based and ensemble models, particularly Random Forest and Hybrid Voting Classifier, are better suited for real-time fraud detection tasks. Their performance highlights not only accuracy but also interpretability and operational reliability, making them optimal candidates for deployment in high-volume financial transactionmonitoringsystems.

Figure 8. ComparativePerformanceofFraudDetection ModelsAcrossEvaluationMetrics
Figure 8 presents a comparative visualization of the performance metrics for all evaluated models. Random Forest and the Hybrid Voting Classifier achieve the best overall performance, with high accuracy, AUC-ROC, and balanced precision and recall. XGBoost demonstrates strong recall but lower precision, while Logistic Regression shows perfect precision but extremely low recall, confirming its limitations in handling imbalanced datasets.
In this paper, we present a scalable and efficient fraud detection system for financial transactions that combines Apache Kafka for real-time data streaming with machine learning models such as Logistic Regression, Random Forest, XGBoost, and a Hybrid Voting Classifier. The system uses ensemble learning to integrate the strengths of separate models, resulting in a better balance of precision and recall. According to the experimental results, Random Forest outperforms the other models with 97.6% accuracy, 0.8037 recall, and an AUC-ROC of 0.9939,makingitparticularlyusefulfordetectingfraudin imbalanceddatasets.
The Hybrid Voting Classifier, while partially trailing Random Forest in Recall (0.7252), achieves a high Precision (0.9923), highlighting the benefits of ensemble models in minimizing false alarm rates. XGBoost, with 93.99% accuracy and an AUC-ROC of 0.9609, strikes a greatbalancebetweenaccuracyandrecall,demonstrating its effectiveness in collecting complicated patterns, particularly in imbalanced fraud detection tasks. Logistic Regression,ontheotherhand,hadsubstantiallimits,with a recall of 0.042, underperforming tree-based models, reflecting the difficulties in addressing fraud detection in highlyimbalanceddatasets.
Our Kafka-driven pipeline guarantees low latency transaction processing, making it ideal for high-frequency transaction scenarios. The system's scalability enables real-time fraud detection without causing substantial

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 13 Issue: 04 | Apr 2026 www.irjet.net p-ISSN: 2395-0072
delays, which is critical for financial systems that handle highnumbersoftransactions.
Comparing our approach with prior works, we show that whilepreviousmodelsachievedhigh precision,theyoften suffered from low recall or latency issues, making them lesssuitableforreal-timeapplications.Additionally,many previous models lacked the ability to scale for highvolume transaction environments. Our system, by contrast, offers both high predictive accuracy and scalability, making it a robust and efficient solutionforreal-timefrauddetection.
[1]. Sharma, S. ( 0 6). A detail comparative study on e-banking VS traditional banking. International JournalofAppliedResearch, (7),30 -307.
[2]. Xu, H. Y. ( 0 7). China’s Internet Financial Risks and Countermeasures. In International Conference on Financial Management, Education andSocialScience(FMESS 0 7).
[3]. Akinyede, R. O., & Esese, O. A. ( 0 7). Development of a secure mobile e-banking system. International Journal of Computer (IJC), 6( ), 3-4 .
[4]. Reaves, B., Scaife, N., & Bates, A. ( 0 5). Analysis of Branchless Banking Applications in the Developing World. In 4th USENIX Security Symposium.
[5]. Rajput, Q., Khan, N. S., Larik, A., & Haider, S. ( 0 4). Ontology based expert-system for suspicious transactions detection. Computer and InformationScience,7( ), 03.
[6]. Quah, J. T., & Sriganesh, M. ( 008). Real-time credit card fraud detection using computational intelligence. Expert systems with applications, 35(4), 7 - 73 .
[7]. Abdelhamid, D., Khaoula, S., & Atika, O. ( 0 4, January). Automatic bank fraud detection using support vector machines. In The International Conference on Computing Technology and Information Management (ICCTIM) (p. 0). Society of Digital Information and Wireless Communication.
[8]. Melo-Acosta, G. E., Duitama-Munoz, F., & AriasLondono, J. D. ( 0 7, August). Fraud detection in big data using supervised and semi-supervised learning techniques. In 0 7 IEEE Colombian conference on communications and computing (COLCOM)(pp. -6).IEEE.
[9]. Baesens, B., Van Vlasselaer, V., & Verbeke, W. ( 0 5). Fraud analytics using descriptive, predictive,andsocialnetworktechniques:aguide to data science for fraud detection. John Wiley & Sons.
[10]. Ozohu, M. M., & Uchenna, O. L. ( 0 ). Comparative Analysis of Selected Machine Learning Algorithms Based On Generated Smart Home Dataset. European Journal of Computer ScienceandInformationTechnology,9(4),4 -53. [11]. Niu,X., Wang,L., &Yang,X. ( 0 9). Acomparison study of credit card fraud detection: Supervised versus unsupervised. arXiv preprint arXiv: 904. 0604.
[12]. Teguh, S., Muhammad Rafli, A., Haldi,B., M Rezqy, N.R.,Usman,S.,&Noor,A.( 0 4).Comparisonof Logistic Regression, Random Forest, SVM, KNN Algorithm for Water Quality Classification Based on Contaminant Parameters. Journal of Data Science, 0 4(48), -7.
[13]. Carcillo,F.,DalPozzolo,A.,LeBorgne,Y.A.,Caelen, O., Mazzer, Y., & Bontempi, G. ( 0 8). Scarff: a scalable framework for streaming credit card fraud detection with spark.Information fusion,4 , 8 - 94.
[14]. Araujo, M., Almeida, M., Ferreira, J., Silva, L., & Bizarro, P. ( 0 7, June). Breachradar: Automatic detection of points-of-compromise. InProceedings of the 0 7 SIAM International ConferenceonDataMining(pp.56 -569).Society forIndustrialandAppliedMathematics.
[15]. Branco, B., Abreu, P., Gomes, A. S., Almeida, M. S., Ascensao, J. T., & Bizarro, P. ( 0 0, August). Interleaved sequence RNNs for fraud detection. InProceedings of the 6th ACM SIGKDD international conference on knowledge discovery &datamining(pp.3 0 -3 09).
[16]. Hong, X., Zheng, C., & Zilberman, N. ( 0 4). Innetwork machine learning for real-time transactionfrauddetection.
[17]. Almalki, F., & Masud, M. ( 0 5). Financial Fraud Detection Using Explainable AI and Stacking Ensemble Methods.arXiv preprint arXiv: 505. 0050.
[18]. Yelleti,V.( 0 5).ROSFD:RobustOnlineStreaming Fraud Detection with Resilience to Concept Drift inDataStreams.arXivpreprintarXiv: 504. 0 9
[19]. Ikermane, M., Mohy-eddine, M., & Rachidi, Y. ( 0 4, December). Credit Card Fraud Detection: Comparing Random Forest and XGBoost Models with Explainable AI Interpretations. InInternational Conference on Electrical Systems and Smart Technologies(pp. 6- 35). Cham: SpringerNatureSwitzerland.
[20]. Sundaravadivel, P., Isaac, R. A., Elangovan, D., KrishnaRaj, D., Rahul, V. L., & Raja, R. ( 0 5). Optimizing credit card fraud detection with random forests and SMOTE.Scientific Reports, 5( ), 785 .
[21]. Theodorakopoulos, L., Theodoropoulou, A., Tsimakis, A., & Halkiopoulos, C. ( 0 5). Big datadriven distributed machine learning for scalable

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
credit card fraud detection using PySpark, XGBoost,andCatBoost.Electronics, 4(9), 754.
[22]. Khatri, S., Arora, A., & Agrawal, A. P. ( 0 0, January).Supervisedmachinelearningalgorithms for credit card fraud detection: a comparison. In 0 0 0th international conference on cloud computing, data science & engineering (confluence)(pp.680-683).IEEE.
[23]. Liu,C.,Tang,H.,Yang,Z.,Zhou,K.,&Cha,S.( 0 5). Big Data-Driven Fraud Detection Using Machine Learning and Real-Time Stream Processing.arXiv preprintarXiv: 506.0 008.
[24]. Zhu, M., Zhang, Y., Gong, Y., Xu, C., & Xiang, Y. ( 0 4). Enhancing credit card fraud detection a neural network and smote integrated approach. arXivpreprintarXiv: 405.000 6.
[25]. Singh, G., Singh, P., & Singh, M. ( 0 5). Advanced Real-Time Fraud Detection Using RAG-Based LLMs.arXivpreprintarXiv: 50 . 5 90
[26]. Sheng, S., & Ling, C. X. ( 005, October). Hybrid cost-sensitive decision tree. InEuropean conference on principles of data mining and knowledge discovery(pp. 74- 84). Berlin, Heidelberg:SpringerBerlinHeidelberg.
[27]. Ahmadi, S. ( 0 3). Open AI and its impact on fraud detection in financial industry.Journal of Knowledge Learning and Science Technology ISSN: 959-6386(Online), (3), 63- 8 .
[28]. Islam, R., Mazumdar, S., & Islam, R. ( 0 4, May). AnExperimentonFeatureSelectionUsingLogistic Regression. In 0 4 5th Information Communication Technologies Conference (ICTC)(pp.3 9-3 4).IEEE.
Volume: 13 Issue: 04 | Apr 2026 www.irjet.net p-ISSN: 2395-0072 © 2026, IRJET | Impact Factor value: 8.315 | ISO 9001:2008