Machine learning (ML) and its applications are becoming increasingly accurate, slowly moving from research laboratories to real world applications. This is prompting many companies to invest in the creation of commercial ML products that can be used in everyday life. However, this transition brings with it countless new challenges and need for developing and putting robust ML applications into production quickly. Agile workflows are therefore becoming essential in the world of machine learning, allowing data scientists to focus on creating more reliable ML models rather than spending time on operations less related to the product's core. In this post I would like to present the benefits of an agile environment and what impact it could have on the workflow of a data scientist.
Thinking about how it has changed in the last years, the world of software development could provide a solution to these needs . Nowadays if it is true that software is everywhere and that the pace at which new applications are developed is rapid , great merit is attributed to the creation of tools that can automate different stages of the development lifecycle. In particular, concepts such as DevOps have allowed developers to focus mainly on a product's business core. The term DevOps - a compound of software development (Dev) and IT operations (Ops) - indicates a series of tools that allow to shorten development lifecycle, automating many of its steps. It facilitates the release of new code, automating testing, deployment and monitoring processes. Examples of DevOps tools that have now become standard in the software industry are Jenkins and Travis CI for releasing new software, JUnit for testing new code, as well as Docker and Kubernetes for containerising and orchestrating applications.
The development of new ML applications despite its peculiarities is comparable and similar in many respects to that of traditional software applications. For this reason the impact of DevOps in the ML field could be replicated by a set of similar tools, that are developed ad-hoc for machine learning development. This kind of tool is generally recognised under the name of MLOps. But what does this term mean? It indicates a series of practices and tools with the aim of increasing automation within the entire lifecycle of an ML application. It allows agile development life cycles that could accelerate the production of new applications, maintaining high quality of the product itself. Starting with the model just trained, MLOps tools could automate and speed up different stages of a data scientist workflow:
- Testing: Immediately after a model is trained, and about to be deployed, it needs to go through a phase of automatic tests to be evaluated. This stage is useful to get a different assessment than that of classical data science metrics (accuracy, AUROC, etc.), mainly in terms of fairness and possible bias of the model itself.
- Deploying: When the model is considered ready, it can be automatically put into production and distributed. Automating this step means making the model "transportable" and easy to deploy on different environments, for example containerising it (using Docker or other tools) and creating endpoints through which it can be queried.
- Monitoring: Once the model is "online" and accessible by external users, it can be monitored in real time in order to prevent malfunction. The monitoring phase can be seen from different points of view. Probably the two most important are those concerning cybersecurity and the prevention of possible model shifting: in the first case we refer to the recognition and safeguarding from possible attacks such as Adversarial Attacks and Model Cloning; in the second to keep certain parameters related to the accuracy and precision of the model under control, to prevent their possible performance degradation over time.
- Continuous Learning: Closely linked to monitoring phase is another crucial stage known as continuous learning. That is to automatically re-train the model periodically, to keep accuracy high. A monitoring phase capable of identifying instances different from those of the initial dataset, may be conducive to the creation of an "updated" dataset for re-training the model.
In conclusion, machine learning has certainly been one of the hot topics in the research world in recent years, with results that are leading to the creation of new commercial products. Hence the need to have more agile development life cycles, allowing the development of robust ML applications in shorter and shorter times. Needs of this kind have already been seen in the world of software development in recent decades and have led to the creation of DevOps tools, with huge benefits for developers. MLOps will play a fundamental and similar role in the coming years allowing the creation of new and increasingly sophisticated machine learning applications. The development of specific tools, able to speed up and automate the steps described in the previous paragraph, will determine the success of ML applications in the production and commercial fields.