Not a day passes without some mention in the popular press about the benefits and/or risks of artificial intelligence or machine learning. These two terms are used almost interchangeably in the media as it is often the case in scientific articles as well. The recent reinvention of neural networks has brought about an air of mystique to the whole field of machine learning. "They work, and nobody understands why", proudly say most researchers who have embraced deep neural networks.
I will argue that machine learning is nothing more than a programming construct, no more mysterious than for-loops or functional programming. As such, we should apply the same care to the development of software that uses machine learning as we do when developing any other software - applying best practices in software engineering and software testing.
Our mis-understanding of machine learning comes in part from the overly-simplistic way in which we are taught computer science in the first place. Algorithms are presented from a theoretical, discrete mathematical stand-point. Bubble sort is bad, heap sort is good because O(n2) is worse than O(n log n). Most algorithms are taught in a similar "one size fits all"way, with a careful analysis that explains in "big Oh" terms who the algorithm behaves as the size of the data increases, irrespective of what the data being processed are. Only the number of data objects matters, not their identity or their properties. The reality is a lot more messy. The performance of an algorithm frequently depends on the characteristics of the data it operates on. See, for example, discussion on choosing an appropriate sorting algorithm in this paper by Li et al.
How does one choose the right algorithms without knowing what the data being analyzed look like? Even if the correct algorithm is obvious for the programmer, its parameters may also need to be set in a data-driven manner. This is where machine learning comes in. The various approaches that commonly receive this label are just a way to use the data itself to help set algorithmic parameters, rather than relying on the programmer to make an educated guess. This paradigm revolutionized the field of speech recognition, where simple Hidden Markov Models (HMMs) where able to far outperform complex systems developed with the help of expert linguists. Similarly, deep neural networks perform amazing feats in image recognition without the help of experts in visual perception.
These achievements do not mean that the machines are intelligent (see a longer discussion in Parnas' article in the Communications of the ACM). They are simply able to automatically tune the parameters of a simple algorithm encoded by a human programmer. Deep Blue's chess program can beat the best human chess players in the world but cannot solve a "where's Waldo" puzzle that a 3-year old can ace in seconds. Siri and Alexa can understand basic spoken commands but are unable to play dominoes, at least until some human programs them to do so. This is not because of fundamental limits of machine learning, but because they cannot do what they were not programmed to do. Despite all the hype, machine learning is not a form of intelligence, it is just another tool in the hands of human programmers. When an image recognition algorithm can identify gay people from their pictures (see article here), or confuses African Americans for gorillas (see a story in Wired about this), it is not due to subtle signals the algorithm learned from the data but due to the biases of the humans who programmed it.
We must stop mystifying machine learning and start using this family of tools according to best practices that have long been developed in engineering and software engineering (argument also made by Kaplan in the Communications of the ACM). In many cases existing design principles and testing paradigms can already be applied. New ones may also need to be developed that are specific to machine learning method, providing opportunities for new research.
Like good craftspeople, we must start to understand how our tools work and start using them in a safe and effective way rather than sit and marvel in awe at their glory.