It's time to add machine learning to your toolbox

It's time to add machine learning to your toolbox

AI and machine learning are often thought of as something magical. We marvel at software that can do things that used to be the stuff of science fiction, and programs that are able to learn exactly what we want them to.

But when we get used to these technologies, they are no longer seen as AI, becoming something routine instead. Often enough, we even come to expect these features. We expect services to be tailored to our needs and to understand what we want.

There has been a great deal of hype surrounding AI and machine learning this past year. This article is an attempt to help you get past the hype so that we can start using these technologies in practice. If you have not already started looking at machine learning, it’s about time you did. These technologies are no longer methods that only the Internet giants and research institutions are able to harness. There are now numerous technologies out there that are both easy to use and tried and tested. In many cases, reading handwritten text, classifying images and finding patterns in data is no longer particularly difficult or expensive to do.

Cloud services

One of the easiest ways to get started on machine learning is to use ready-made services. These days, new services are popping up almost every week. Among the largest are GoogleIBMMicrosoft and Amazon, but there are other players too, such as HavenOnDemand or BigML. Amazon has various APIs for specific tasks like image recognition and text-to-speech. They also have a more general API for classification and prediction.

Open source

Until recently, developments in this field were spurred on primarily by the academic world. The legacy is a culture of openness where programmers share their techniques, code and even datasets to run tests against. But now Google, Facebook, Microsoft, Baidu and others are investing heavily in machine learning, and are positioning themselves by releasing open frameworks. They are relatively easy to get started with, and have good documentation and code samples.

If you are having a hard time choosing among these frameworks, it can be a good idea to start by using Keras. Keras is a library that functions as a simple API layer on top of other frameworks. At present, it is capable of running on top of both Theano and Google’s TensorFlow. Google has said that it will be made an official TensorFlow API. Microsoft also has plans to add Keras support to its Cognitive Toolkit.

A good way to learn about and tinker with some of these frameworks is to visit the social network, Kaggle. Kaggle is a community that organises competitions to solve various machine-learning problems. The members of Kaggle upload, share and discuss solutions. As a company or organisation, you can also arrange for a competition to be hosted by them; the solutions submitted can help you identify better solutions to your business problems.

Blue robot

Open models and open data

The most common techniques in use today are based on something called supervised learning. What this means is that you train the system with lots of examples of input data and the expected output value. For example, if you want to train the system to recognise different species of butterfly, you need to have lots of pictures of butterflies, plus information about which species appears in each picture. Huge volumes of data are often needed to train a neural network, and the data needs to be properly annotated. This may be a barrier if there is no easy way to collect the data that is needed.

But there are many pre-trained models available for a variety of common problems, such as reading handwritten text. There are also several models available that have been given basic training but that can be customised to your own particular needs by continuing to train them on your own datasets. For example, there are many models available for image recognition that have been trained on the ImageNet open dataset. They can be trained further to make them really good at recognising specific things. And not nearly as much training data is required to do so. A hundred or so samples may be sufficient.

Another option that may work in some cases is to make use of services like CrowdFlower or CrowdAI. They can help you gather data or annotate data through paid crowdsourcing.

Managing uncertainty

The line between a service that is annoying and one that is really good is a thin one. I'm sure we've all sworn at voice recognition software when it didn't understand what were saying, or received an AI-powered movie recommendation that was not at all up your street. The technologies are getting better all the time, but systems based on machine learning are never without a certain amount of uncertainty. And this uncertainty needs to be constructively managed. For example, it may be important to make sure that the user interface does not promise too much, for example by making sure that the copy and graphics reflect the uncertainty in the results. For some types of systems, it may also be very important for the system to recognise when it needs to cede responsibility to a human being, and to clearly indicate when this happens.

Testing and debugging are hard work and time-consuming

In “Machine Learning: the high interest credit card of technical debt”, Peter Norvig describes, among other things, the difficulties inherent in testing systems based on machine learning.

It is often difficult to apply traditional function tests, i.e. along the lines of entering a value and verifying that the correct value is spit out. Given the uncertainty in these systems, the testing is more about measuring average error levels. And many systems are not deterministic either, meaning that it’s not certain that you will get the same answer to a given question twice.

One common approach taken is to split your sample data into training data and test data. The training data is used to train the system, while the test data is then used to validate how well the system performs. Another way to test the systems can be to run A/B tests on users so that you can evaluate how well one algorithm works compared to others. Regardless of the approach you take, it often takes a long time to train and then test the systems, so you will have to count on fairly long testing cycles to evaluate changes.

The fact that these systems are hard to test can sometimes be made up for by good monitoring. If you measure how well the system performs and perform continuous monitoring, this can be a good complement.

The way forward

Neural networks are very popular right now. But a lot of problems can be solved adequately using simpler algorithms as well. In the future, we will probably be seeing more technologies based on unsupervised learning – that is to say, technologies that identify patterns and learn things without requiring tonnes of annotated examples. The bulk of human learning works in this way.

To conclude, it should be noted that we still have a long way to go before AI achieves a level of general intelligence similar to that of humans. But AI has already made great strides when it comes to solving specific problems, and outstrips human ability in many cases. These specific technologies are also relatively easy to get started on, and we should get acquainted with them now so that we can add them to our toolbox and make use of them when needed.