Comparative analysis of deep learning performance for Python and C# using Keras

Keras를 이용한 Python과 C#의 딥러닝 성능 비교 분석

  • Lee, Sung-jin (Dept. of Computer Engineering, Busan University of Foreign Studies) ;
  • Moon, Sang-Ho (Dept. of Computer Engineering, Busan University of Foreign Studies)
  • Published : 2022.10.03

Abstract

According to the 2018 Kaggle ML & DS Survey, among the proportions of frameworks for machine learning and data science, TensorFlow and Keras each account for 41.82%. It was found to be 34.09%, and in the case of development programming, it is confirmed that about 82% use Python. A significant number of machine learning and deep learning structures utilize the Keras framework and Python, but in the case of Python, distribution and execution are limited to the Python script environment due to the script language, so it is judged that it is difficult to operate in various environments. This paper implemented a machine learning and deep learning system using C# and Keras running in Visual Studio 2019. Using the Mnist dataset, 100 tests were performed in Python 3.8,2 and C# .NET 5.0 environments, and the minimum time for Python was 1.86 seconds, the maximum time was 2.38 seconds, and the average time was 1.98 seconds. Time 1.78 seconds, maximum time 2.11 seconds, average time 1.85 seconds, total time 37.02 seconds. As a result of the experiment, the performance of C# improved by about 6% compared to Python, and it is expected that the utilization will be high because executable files can be extracted.

최근에 Kaggle ML & DS Survey에 따르면 기계 학습 및 데이터 과학을 위한 프레임워크에서 TensorFlow와 Keras의 비율이 각각 41.82%, 34.09%로 비중을 차지하고 있으며, 개발 프로그래밍의 경우 약 82%로 Python을 사용하는 것으로 나타났다. 상당수의 기계 학습 및 딥러닝의 구조가 Keras 프레임워크와 Python을 활용하고 있으나, Python의 경우에는 스크립트 언어인 관계로 인해 배포 및 실행을 Python 스크립트 환경에 제한되어 동작하므로 다양한 환경에서 동작하기 어려운 개연성이 있을 수 있다. 본 논문에서는 Visual Studio 2019에서 동작하는 C#과 Keras를 활용한 기계 학습 및 딥러닝 시스템을 구현하였으며, 세부적으로 Mnist 데이터셋을 활용하여 파이썬 3.8.2와 C# .NET 5.0 환경에서 20번의 테스트를 진행하였다. 테스트 수행 결과, Python은 최소 시간 1.86초, 최대 시간 2.38초, 평균 시간 1.98초 총 시간 39.53초가 소요되었으며, C#은 최소 시간 1.78초, 최대 시간 2.11초 평균 시간 1.85초 총 시간 37.02초가 소요되었다. 결론적으로 C#의 성능이 Python보다 6% 정도 향상되었음을 확인하였으며, 이를 통해 실행파일 추출이 가능하여 활용도가 높을 것으로 기대한다.

Keywords