This paper presents a comprehensive Online Fraud Detection System developed to identify and prevent suspicious online financial transactions in real time using machine learning and a Java-based enterprise backend. With the exponential rise in digital payments through online banking, UPI, digital wallets, and e-commerce platforms, financial fraud has emerged as a critical challenge for institutions and consumers alike. Traditional rule-based fraud detection systems are insufficient against continuously evolving fraud tactics, necessitating intelligent, adaptive solutions. The proposed system employs a layered architecture comprising a Spring Boot REST API backend, an Apache Kafka message-streaming pipeline, a Hibernate-managed MySQL database, and machine learning models integrated via the Weka and Smile libraries for Java. Algorithms including Logistic Regression, Decision Tree, Random Forest, and Support Vector Machine are evaluated and combined to classify transactions as genuine or fraudulent. The system analyzes transaction attributes such as transaction amount, geographic location, device fingerprint, IP address, time-of-day pattern, and user behavioral history. Upon detecting anomalous activity, real-time alerts are dispatched via the JavaMail API and the Twilio SMS SDK. Experimental results indicate that the Random Forest classifier achieves a classification accuracy of 96.3% with a false positive rate of 1.9% on benchmark datasets. The system is designed for seamless integration with existing banking infrastructure through standardized REST endpoints.
Introduction
The text describes the development of a Java-based real-time online fraud detection system designed to address the growing problem of digital financial fraud in platforms such as online banking, UPI, and digital wallets. While digital financial services have expanded rapidly, fraud incidents have also increased significantly, with attackers using techniques like phishing, SIM swapping, credential stuffing, and synthetic identity fraud. Traditional rule-based fraud detection systems are no longer effective because they are static and easily bypassed.
To overcome this, the paper proposes a machine learning-based adaptive fraud detection approach that identifies anomalies in transaction behavior rather than relying on fixed rules. Machine learning models can learn from evolving fraud patterns and be retrained to adapt to new threats, making them more robust and scalable.
The system is implemented entirely in Java, chosen for its enterprise-grade ecosystem, strong security features, multithreading capabilities, and seamless integration with tools like Spring Boot, Kafka, Weka, and Smile. This avoids the need for external Python services and ensures better performance and maintainability in financial environments.
System workflow includes four main stages:
Data ingestion using Apache Kafka to stream transaction data in real time
Preprocessing and feature engineering in Java
Fraud detection and classification using machine learning models (e.g., Random Forest)
Alert generation using email (JavaMail API) and SMS (Twilio)
Literature review highlights:
Previous research shows that:
Ensemble models and Random Forest perform well in fraud detection
Feature selection improves accuracy and efficiency
Class imbalance handling and concept drift are major challenges
Most existing systems are Python-based, creating deployment gaps in Java enterprise environments
This work addresses the gap by providing a complete Java-native end-to-end implementation suitable for real-world banking systems.
System architecture:
The system follows a layered design:
Data ingestion layer (Kafka-based streaming)
Processing and feature engineering layer
Detection and classification layer
Alert and response layer
Conclusion
This paper has presented a comprehensive Online Fraud Detection System that addresses the limitations of traditional rule-based fraud prevention through the application of machine learning and a production-grade Java enterprise architecture. The system integrates Apache Kafka for real-time transaction streaming, Spring Boot for the REST API and service layer, Weka for Java-native machine learning inference, Hibernate for database persistence, and the JavaMail and Twilio APIs for multi-channel alert dispatch. Among the four evaluated classifiers — Logistic Regression, Decision Tree, Random Forest, and Support Vector Machine — the Random Forest ensemble achieves the best performance with 96.3% accuracy and a 1.9% false positive rate on the benchmark dataset.
The choice of Java as the implementation language is deliberate and strategically motivated by the realities of banking system integration. A Java-native fraud detection engine eliminates the cross-language overhead and operational complexity of maintaining a separate Python inference service, enabling direct embedding into the transaction processing path of existing Java-based core banking systems. The system\'s layered architecture, configurable risk thresholds, and automated retraining pipeline are designed to meet the operational requirements of production financial environments where availability, auditability, and regulatory compliance are non-negotiable.
Future work will focus on LSTM-based sequential modeling, federated learning for privacy-preserving multi-institution training, graph neural networks for fraud ring detection, and blockchain-based audit trails. The proposed system represents a significant step toward making adaptive, machine-learning-driven fraud detection accessible and deployable within the Java-centric technology stacks that dominate the banking and financial services industry.
References
[1] L. Konsta, D. Dimitriou, A. Papathanasiou, and V. Liagkou, “Detecting Cyber Fraud in Banking Transactions via Machine Learning Techniques: Implications for Financial Stability,” FinTech, vol. 5, no. 1, 2026. DOI: 10.3390/fintech5010023.
[2] N. A. Ismail and E. Karaarslan, “A Dual-Path Generative Framework for Zero-Day Fraud Detection in Banking Systems,” arXiv preprint arXiv:2603.13237, 2026.
[3] M. S. Uddin, M. H. Amin, N. J. Ema, B. Uddin, T. Ahmed, and A. H. Zidan, “Multilingual Financial Fraud Detection Using Machine Learning and Transformer Models: A Bangla–English Study,” arXiv preprint arXiv:2603.11358, 2026.
[4] H. Khaleghpour and B. McKinney, “Leakage Safe Graph Features for Interpretable Fraud Detection in Temporal Transaction Networks,” arXiv preprint arXiv:2603.06632, 2026.
[5] W.-P. Khor, K.-O. M. Goh, C.-Y. Law, C. Tee, Y.-W. Sek, and R. Khan, “Enhancing Fraud Detection in Financial Transactions using LightGBM and Random Forest,” Journal of Informatics and Web Engineering, vol. 5, no. 1, 2026. DOI: 10.33093/jiwe.2026.5.1.14.
[6] K. H. Ahmed, S. Axelsson, Y. Li, and A. M. Sagheer, “A Credit Card Fraud Detection Approach Based on Ensemble Machine Learning Classifier with Hybrid Data Sampling,” Machine Learning with Applications, vol. 20, 2025. DOI: 10.1016/j.mlwa.2025.100675.
[7] N. J. Sarna, F. A. Rithen, U. S. Jui, S. Belal, A. Amin, T. K. Oishee, and A. K. M. Islam, “AI Driven Fraud Detection Models in Financial Networks: A Comprehensive Systematic Review,” IEEE Access, 2025.
[8] Sonam, I. Mazhar, and A. Sulthana, “Online Payment Fraud Detection Using Machine Learning Techniques,” IRE Journals, vol. 9, no. 6, 2025. DOI: 10.64388/IREV9I6-1713148.
[9] D. N. Narkhede and S. Jagtap, “Online Payment Fraud Detection Using Machine Learning in Python,” International Journal of Progressive Research in Engineering Management and Science (IJPREMS), vol. 5, no. 4, 2025.
[10] S. K. Vangibhurathachhi, “Machine Learning for Fraud Detection in Financial Transactions,” International Journal on Science and Technology (IJSAT), vol. 16, no. 1, 2025.
[11] A. K. Veldurthi, “The Role of AI and Machine Learning in Fraud Detection for Financial Services,” Journal of Computer Science and Technology Studies, vol. 7, no. 4, 2025. DOI: 10.32996/jcsts.2025.7.4.88.
[12] T. Albalawi and S. Dardouri, “Enhancing Credit Card Fraud Detection Using Traditional and Deep Learning Models with Class Imbalance Mitigation,” Frontiers in Artificial Intelligence, vol. 8, 2025. DOI: 10.3389/frai.2025.1643292.
[13] T. A. Khan, J. Tulsi, M. Alam, K. Kadir, K. M. Ali, and M. S. Mazliham, “Analysis and Visualization of Fraud Detection Patterns Through Data Mining and Classification Using MLP and Hybrid Deep Learning Model,” Egyptian Informatics Journal, vol. 32, 2025. DOI: 10.1016/j.eij.2025.100829.
[14] A. Jain, R. Kulkarni, and S. Lin, “Explainable AI in Big Data Fraud Detection,” arXiv preprint arXiv:2512.16037, 2025.
[15] P. Adhikari, P. Hamal, and F. B. Jnr, “Artificial Intelligence in Fraud Detection: Revolutionizing Financial Security,” International Journal of Science and Research Archive, vol. 13, no. 1, pp. 1457–1472, 2024. DOI: 10.30574/ijsra.2024.13.1.1860.