MLOps: using machine learning efficiently
Do you understand how AI works? Now it's time to learn how to implement AI models efficiently, in day-to-day practice: self-learning, self-directed, yet controlled. You can achieve this thanks to MLOps: a bundle of good practices that allows you to automate and optimise the entire AI process. Axel-Jan Rousseau (UHasselt, VAIA) explains how this works.
Why MLOps?
Imagine this: you have a great idea for an app. Based on that one photo you took at a restaurant, you want to generate a recipe, including a shopping list. Your data scientists started working with all sorts of scripts and interactive notebooks, and after weeks of toil you have an AI model that can recreate even the tastiest dishes. But how do you get this model off your PC and into the hands of your users?
You need to get your model on a server or in the cloud, set up API access, ensure scalability, et cetera. Everything seems to be working, and users are happy. That is until: TikTok influencers suddenly invent yet another new food trend, and users upload pictures en masse to find out how to make this dish themselves at home. But your model has never seen this dish before and can't handle it at all! To ensure the quality of your app, you will have to collect new data and go through all the previous steps again manually. If only there was a way to tackle this process in a structured and automated way!
That’s when MLOps or Machine Learning Operations comes in handy.
What is MLOps?
Machine Learning Operations is a combination of the software terms Machine Learning (ML) and Development Operations. MLOps specifically describes the best practices and guidelines to deploy and manage AI and machine learning models in a streamlined way. This takes into account the full lifecycle of AI and ML models, from data cleaning and training the model to deployment and monitoring results.
Life cycle of a Machine Learning system
- Data preparation: The data being used often comes from various sources and still contains noise and errors. (Think of a contacts list with two notations for phone numbers and people without surnames). Cleaning up that data is the first important step. This involves a lot of data engineering:
- converting the raw data into the right format;
- making the data more useful for training ML models using feature engineering (e.g. converting order data into preferred purchase days per customer).
- Modelling: We choose the best algorithm and train the model. We also fine-tune the hyperparameters, which are properties of the model itself, such as number of layers, how much data is processed per step, number of iterations, etc. And then you start testing the model, fine-tuning it, testing it again – until we are sure it achieves the intended results.
- Rollout: We roll out the model in the production environment so that actual users can work with it. We do this in the right cloud infrastructure so that the application can also collaborate with more users, now or in the future.
- Monitoring and maintenance: Once live, we will continue to monitor and check the performance of the model. Otherwise, the model may start working less well over time due to ‘data drift’, a phenomenon where the data and the relationship between inputs and outputs change over time. For example, a machine-learning model that provides fashion advice will quickly become obsolete as trends change. Once a drift is noticed, we resume the life cycle, but with newer data.
Automation with MLOps
We can of course perform all these steps manually, but the goal of MLOps is to automate as much as possible! Using modular code for data and modelling, we can work out an automated pipeline for this ML system. This allows us to experiment easier and faster, while ensuring that we can copy and reuse the same system. We can also automatically retrain the models, provided we also have good tests for data and model validation and code. This in turn is possible using continuous integration and deployment (CI/CD), good practices from the DevOps world. If the new model then performs better and passes all tests with flying colours, it can even be put into production, without additional manual intervention.
The benefits of MLOps
- Efficiency and productivity: You no longer need to perform repetitive tasks yourself every time. This saves time and costs, and there is a smaller chance of making mistakes. So, you can experiment faster and transfer your modifications to production.
- Reproducibility: Automated workflows ensure that the way models are trained, evaluated, and deployed remains consistent. As a result, results are reproducible, and data and model versioning can be applied.
- Improved control: By systematically monitoring the systems, you gain a clearer insight into model performance. It also allows you to detect data or model drift, and enables continuous model training so that your model is always up-to-date.
Find out more
Machine Learning into Practice: Deep Dive into MLOps
hands-on workshop - Ghent - UGain, UGent, VAIA, Flanders AI EDIH
Data Quality: the Key to Trustworthy AI in Care
For AI to truly support patients and healthcare professionals, the data needs to be right. But how do you ensure high data quality in a complex healthcare setting – and keep it that way? Jens Declerck from i-HD points the way.
How to make AI reliable and transparent
A transparent AI system creates support, strengthens trust and keeps risks manageable. Eulaly Vanroelen from Thomas More shows you the way to a fair AI system in 7 practical steps.
Axel-Jan Rousseau
Dr. Axel-Jan Rousseau is an AI Expert for VAIA and a Postdoctoral Researcher at Hasselt University. Specializing in trustworthy computer vision, his work focuses on model calibration, ensuring AI systems provide reliable, statistically sound predictions.
He is also one of the coordinators for the Data Science track for FLAMES and develops AI-driven decision support systems for biomedical imaging and MS diagnosis. He holds a PhD in AI (2024) and Master's degrees in both AI and Industrial Engineering.
Related courses
Introduction to Supervised learning with Python