Building Ensemble Models with Web Services on Microservice Architecture

Máté Szabó

Abstract


The combination of machine learning with web services is not rare, as it is a possible way to make the models reachable to other applications. For example a mobile or web application with recommendation feature can send requests to query the model’s prediction. The advantage of this method is that it does not require to use the same platform or programming language on the model and application side. This paper investigates the building of ensemble models with web services, in a complex microservice architecture based application. The ensemble models are special, because they rely on other pre-trained models, so they can act as a wrapper model. The advantage of this approach is that it is applicable to multiple models that are written in different programming languages. When we have these wrapper models, all of them can be accessed through web services, which leads to many small services that can be managed together in an application on microservice architecture. In this paper, we combine models from Scikit Learn, Tensorflow, Weka and Deeplearning4j libraries to show how models written in different languages can work together. We propose two similar architecture variants involving machine learning and microservices to combine models from different platforms. The gateway variant uses patterns like API gateway or backends for frontends, the direct variant uses direct access to web services. The integration of these into existing web applications is also presented considering the server or client side computing load. The analysis shows that both of them can be used, but with different software systems. The direct is preferred when the application partly relies on machine learning services and thus only using few of them, and the gateway is preferred when the application is dependent on these services.


Full Text:

PDF

References


(2022) The state of developer ecosystem in 2021 infographic. [Online]. Available: https://www.jetbrains.com/lp/devecosystem-2021/

(2022) Google trends. [Online]. Available: https://trends.google.com/trends/

M.-O. Pahl and M. Loipfinger, “Machine learning as a reusable microservice,” in NOMS 2018 - 2018 IEEE/IFIP Network Operations and Management Symposium, Taipei, Taiwan, Apr. 2018, pp. 1–7.

Y.-D. Bromberg and L. Gitzinger, “Droidautoml: A microservice architecture to automate the evaluation of android machine learning detection systems,” in IFIP International Conference on Distributed Applications and Interoperable Systems, Valletta, Malta, Jun. 2020, pp. 148–165.

J. L. Ribeiro, M. Figueredo, A. Araujo, N. Cacho, and F. Lopes, “A microservice based architecture topology for machine learning deployment,” in 2019 IEEE International Smart Cities Conference (ISC2), Casablanca, Morocco, Oct. 2019, pp. 426–431.

D. C. Attota, V. Mothukuri, R. M. Parizi, and S. Pouriyeh, “An ensemble multi-view federated learning intrusion detection for iot,” IEEE Access, vol. 9, pp. 117 734–117 745, Aug. 2021.

P. Salza, E. Hemberg, F. Ferrucci, and U.-M. O’Reilly, “ccube: a cloud microservices architecture for evolutionary machine learning classification,” in Proceedings of the Genetic and Evolutionary Computation Conference Companion, Berlin, Germany, Jul. 2017, pp. 137–138.

J. Gruendner, T. Schwachhofer, P. Sippl, N. Wolf, M. Erpenbeck et al., “Ketos: Clinical decision support and machine learning as a service–a training and deployment platform based on docker, omop-cdm, and fhir web services,” PloS one, vol. 14, no. 10, p. e0223010, Oct. 2019.

M. Chippa, A. Priyadarshini, and R. Mohanty, “Application of machine learning techniques to classify web services,” in 2019 IEEE International Conference on Intelligent Techniques in Control, Optimization and Signal Processing (INCOS), Virudhunagar , India, Apr. 2019, pp. 1–7.

H. Alipour and Y. Liu, “Online machine learning for cloud resource provisioning of microservice backend systems,” in 2017 IEEE International Conference on Big Data (Big Data), Boston, MA, USA, Dec. 2017, pp. 2433–2441.

H. Chang, M. Kodialam, T. Lakshman, and S. Mukherjee, “Microservice fingerprinting and classification using machine learning,” in 2019 IEEE 27th International Conference on Network Protocols (ICNP), Chicago, IL, USA, Oct. 2019, pp. 1–11.

H. Harms, C. Rogowski, and L. L. Iacono, “Guidelines for adopting frontend architectures and patterns in microservices-based systems,” in Proceedings of the 2017 11th Joint Meeting on Foundations of Software Engineering, Paderborn , Germany, Sep. 2017, pp. 902–907.

J. A. Valdivia, A. Lora-Gonzalez, X. Lim ´ on, K. Cortes-Verdin, and ´ J. O. Ocharan-Hern ´ andez, “Patterns related to microservice architecture: ´ a multivocal literature review,” Programming and Computer Software, vol. 46, no. 8, pp. 594–608, Dec. 2020.

H. Chawla and H. Kathuria, “Implementing microservices,” in Building Microservices Applications on Microsoft Azure. Berkeley, CA, USA: Springer, 2019, pp. 21–41.

K. S. P. Reddy, Beginning Spring Boot 2: Applications and microservices with the Spring framework. Berkeley, CA, USA: Apress, 2017.

F. Eibe, M. A. Hall, and I. H. Witten, “The weka workbench. online appendix for data mining: practical machine learning tools and techniques,” in Morgan Kaufmann. Amsterdam, Netherlands: Elsevier, 2016.

D. Team et al., “Deeplearning4j: Open-source distributed deep learning for the jvm,” Apache Software Foundation License, vol. 2, no. 82, 2016.

F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel et al., “Scikit-learn: Machine learning in python,” the Journal of machine Learning research, vol. 12, pp. 2825–2830, Oct. 2011.

M. Abadi, P. Barham, J. Chen, Z. Chen, A. Davis, J. Dean et al., “Tensorflow: A system for large-scale machine learning,” in 12th USENIX symposium on operating systems design and implementation (OSDI 16), Savannah, GA, USA, Nov. 2016, pp. 265–283.

M. Grinberg, Flask web development: developing web applications with python. Sebastopol, CA, USA: O’Reilly Media, Inc., 2018.

Q. Zhang, H. Chu, M. Li, and X. Hu, “A unified api gateway for high availability clusters,” in Proceedings 2013 International Conference on Mechatronic Sciences, Electric Engineering and Computer (MEC), Shenyang, China, Dec. 2013, pp. 2321–2325.

J. Bai, F. Lu, K. Zhang et al. (2019) Onnx: Open neural network exchange. [Online]. Available: https://github.com/onnx/onnx




DOI: https://doi.org/10.31449/inf.v48i7.4918

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 License.