Bridging the gap between AI implementation and production
Darío Martínez
In the second edition of MONDAIS, I presented a cool presentation in this edition’s webinar “AI for safety-critical system”. I explained some concepts that, in my opinion, are crucial to understand if you wish to see a AI system in production. Let’s take a look at them:
1. Understand the difference between ML and traditional programming
In traditional programming, rules are manually formulated and coded by humans, in hundred of thousands of lines of code, to match a known desired output. On the other hand, in machine learning, the rules are extracted from historical data and represented by hundreds of weights and mathematical relations, written automatically by an optimisation process to optimise an objective function.
2. “Become one with data”
Data is the single point of success or failure of an AI product. Curating good training, testing and validation datasets is crucial. However, to perform this task, a good understanding of domain knowledge is required.
This means better understanding the training set. What makes certain instances truly interesting from the rest? What is the importance of certain feature? Do all the features cover every aspect of the problem?
Equally important is knowing how your data behaves over time. Will your data change? Have your data changed? Can you assume you data is stationary?
Data also needs to be assessed as complete. Do you have enough examples? Do you historical data cover every possibility? Do you need more data or even synthetic data?
3. Achieve realistic training sets
As you may already know, machine learning models need to be trained with the most realistic dataset possible. This sometimes means tweaking the data, or making it harder for the machine learning algorithm to learn. Furthermore, using a training set with worst case scenarios is often a good approach for safety critical systems.
Some easy data tweaks are:
- High label/examples imbalance: discard 95% of the label of a class.
- Noisy labels: perturb a % of the labels.
- Multi-Task solutions: add 10 any other labels.
- Incompleteness: add 1M of unlabeled cases.
4. Humans in the Loop
If machine learning is an automated optimisation, then what is the role of humans?
Well, there are multiple tasks to fill: labeling unseen examples, data and labels visualisation, feedback on labeled data and features, mislabeled examples, new data suggestions, disagreements mediation, features validation, model supervision and more.
However, some challenges may be introduced to the process by adding humans to the loop. Humans may introduce errors to labels and their contribution is based on previous experience, field knowledge or even personality. Furthermore, disagreements may arise, which are especially hard to solve as the problem gets more technical. Overcoming these challenges requires surprisingly sophisticated statistics.
5. Open the “black box”
In machine learning, and especially deep learning, interpretability is a huge issue. As models get more and more powerful, their algorithms become less interpretable. In this context, data visualisations are key. Visualising the training set, labels, predictions and features is a must for achieving model interpretability.
Some local techniques may study a small portion of the ML model, such as visualising the behaviour of a neural network layer. But there are also global techniques that aim to study machine learning models as a whole—for example, mapping the in/out of the complete neural network.
Furthermore, we already have all the tools needed to interpret models: saliency maps, occlusion maps, LIME, shapey values, NN Layer visualisers, features importance plots, partial dependency plots, etc. We just need to make good use of them, as both data scientists and regulators.