Uppsats

Neural Network in Java using DeepLearning4J framework vs. Python using TensorFlow framework: Trade-offs Between Execution Speed, Resource Consumption, and Developer Efficiency : A Comparative Benchmark and User Evaluation Study

Kandidat-uppsats

KTH/Skolan för elektroteknik och datavetenskap (EECS)

Publicerad: 2025

Språk: Engelska

Sammanfattning

Programmers face challenges when choosing between Java (using DeepLearning4J) and Python (using TensorFlow) for neural network deployment, particularly when performance, resource utilization, and developer efficiency must be balanced. This study aims to provide data-driven guidance to support language selection for AI where performance, scalability, or system integration are critical. To investigate this, identical neural networks ranging from easy to hard complexity, including convolutional architectures were implemented in both languages using the MNIST dataset. Performance metrics such as training time, inference latency, and memory consumption were collected under controlled conditions. Developer-oriented metrics including code complexity and implementation effort were also measured. The results indicate that TensorFlow, leveraging GPU acceleration, offers significantly faster training speeds, particularly for more complex models. In contrast, DeepLearning4J on CPU achieved lower inference latency than TensorFlow for the dense models, whereas GPU-accelerated TensorFlow delivered sub-millisecond calls on the convolutional neural networks (CNN). While Python implementations required fewer lines of code and similar levels of cyclomatic complexity, both frameworks produced models with comparable accuracy, showing a variance of no more than 0.5 percent, but with differences in training time and memory usage. The training time showed that TensorFlow outperformed DeepLearning4J in most neural network complexities, and that DeepLearning4J outperformed TensorFlow by using less memory. These findings suggest that TensorFlow is well suited for rapid prototyping with GPU support, whereas DeepLearning4J may be more appropriate for resource efficient, CPU-based deployment in enterprise environments.

Utforska vidare

Liknande uppsatser

Uppsatser med liknande ämnen och nyckelord.