Skip to main content

Building AI-Powered Applications

PREVIOUS CHAPTER



Chapter 3 | Building AI-Powered Applications



of the latest natural language processing developments, or spend countless hours over the hottest  vision developments. It would be a losing battle. By the time this book is in your hands, the content  of such a discussion would already be obsolete. As such, we will focus on some of the underlying core concepts that are more likely to outlast any specific technique, architecture, or tool.

We will take a broad view, starting from the fundamental question of what any AI technology would need, and present  a framework that divides things into  techniques,  capabilities, and  applications and  allows you  to  navigate between those three different areas and draw connections, to help you make better  informed choices.


What AI Needs
In the previous chapter we referred to AI as the process of delegating decision- making to machines. Let’s work through an example in this section to uncover what it is we might need in order to achieve such delegation.

You have been tasked with introducing automation to your company. A review has taken place, and it has been decided that it would be worthwhile to automate the process of evaluating expense claims submitted by employees. Software is now to decide whether the claims should be accepted or contested. It is a task that the finance team hates, but it is necessary to ensure that expenses are kept in check and only the right things go through. You don’t know how to get started, so you decide to go talk to the two people in the finance team who deal with this activity.

The first  person  you talk to, let’s call her Mary, says that  they have a very precise process they follow. Mary looks at each incoming receipt and catego- rizes it as travel, entertainment,  education,  etc.  Mary then  considers  the totals spent as well as the individual line items and cross-references  those to what the person submitting the receipt was supposed to be doing at the time, as well as any rules surrounding their and their team’s maximum spending levels across categories. If all rules pass, Mary will approve the expense.

The second person, let’s call him Donovan, stands back in amazement upon hearing that description and says: “Wow! That is incredibly thorough, but I find that  the rules change so often or are so unclear that  I  can’t  keep up. What I do is size up the person submitting their expenses and make a quick judgement call about  their  overall reliability and the  overall amounts  that come in. I also keep a record  of who tends to have complaints at year-end audits about their expenses or not. If they generally don’t cause trouble and I think they are reliable, I just assume that they are doing the right thing. If they tend to get into trouble often, I will  push back and have them double-check themselves, just in case.”
The AI-Powered Workplace     33



“Hold on!” says Mary in shock. “But that way you can end up doing duplicate work or wrongly categorizing things.” “Yeah,  I won’t lie,” answers Donovan. “It can happen and some people will complain, but I save so much time not worrying about every little detail that it all ends up being efficient in the end.”

You go away and think about what you’ve heard. Mary has a very precise set of rules that she applies and can exactly explain how every decision is reached. Donovan seems to depend on past data and past behavior to make a quick determination about whether  they should investigate further or not. While Donovan might miss a few things or end up with some duplicate work, the overall result is very efficient. Mary relies on having a clear as possible under- standing of the governing rules at any given moment, while Donovan feels the rules are never clear enough, so he instead relies on the data going in (expense claims) and out (audit results) to make judgement calls.

Where does this leave things in terms of how you could build your automated system? It needs to make decisions. That much you are sure of. It seems that you can either explicitly list all the rules, like Mary does, or you can somehow teach it to look at past data and use that to base its decisions on, like Donovan does. Your AI system needs a way to make a determination, based on some inputs, about  what the  appropriate  outputs  are. It needs a way to  reason about the world, but it turns out there are different ways of doing this.

Well, you are in good company. This is exactly the conundrum that AI research- ers have been grappling with for decades. The first approach is what we would describe as a model-driven approach. There is a clear model of how the world behaves, with explicit rules and regulations that govern it. We collect all the data input points, pass them through our set of rules, and make a determina- tion. The second approach is a more data-driven approach. It recognizes that often we simply can’t explicitly list all the rules. All we know is what data went in and what data came out of the system, and we attempt  to build programs that replicate that input/output relationship. We will not be able to explicitly articulate exactly why an expense was accepted or contested,  but we trust that data will guide the way.

There is, perhaps, a third way to solve the expense claim problem. We could use a combination of the two approaches that tries to benefit from the efficiency of the data-driven approach while retaining the clarity and reliability of the model- driven one. Before we look at how we might do that, though, let us explore model-driven and data-driven AI a bit further.


Model-Driven and Data-Driven AI
There is any number of borders one can draw around AI work. From formal logics to statistics, evolutionary or emergent  behavior approaches, and the wild and crazy world of deep neural nets, the  ways you can describe and
34   Chapter 3 | Building AI-Powered Applications



combine AI technologies are endless. Perhaps one of the most important and long-lasting distinctions, however,  is that  between  data-driven and model- driven AI.


Model-Driven AI

Model-driven AI describes techniques that depend on explicit descriptions of a domain, the relationships between entities in that domain, and the rules that govern the overall behavior.

This approach is particularly relevant when a domain requires deep expertise that can be expressed in definitive rules. One example of a model-based sys- tem is the use of Newtonian classical mechanics to model movement in the real world. We already have a clear set of equations that can help us predict in which way the  application of force  on a physical object  will cause that object to move given the surrounding conditions. There is no need to seek some alternative way of learning what will happen. Since we have a good enough model of what happens in the world, we can use that.


SO NEWTON’S RULES ARE AI!?

I am well aware that I keep challenging what you may have typically considered as
AI. That is precisely the point.

AI is no single thing. Just like math, it is a collection of techniques. The objective is to enable us to build machines that can help us make useful deductions about the behavior of real-world objects and automate decision-making. It’s best not to limit the range of possible solutions to any single technique or group of techniques.

Imagine a world where Newton’s laws where not understood but, amazingly, data-driven machine learning was deeply understood. Equipped only with the tools of neural nets and data analysis, you can picture scientists recording hundreds of thousands of runs of apples falling from trees to collect data in order to correctly train a predictive neural net model of how the apples would bounce off the ground. Newtonian physics manages to do it with a small set of easy to understand equations. This is precisely the difference between model-driven decision making and data-driven decision- making.1






1 As a further, small side note, in case you are curious to see if neural nets could make such predictions, there is actual work in that direction. In a paper called “Discovering Physical Concepts     with    Neural    Networks,”    researchers     explored    this    idea    exactly. Raban Iten, Tony Metger, Henrik Wilming, Lidia del Rio, and Renato Renne, “Discovering Physical Concepts with Neural Networks,” https://arxiv.org/abs/1807.10300, 2018.
The AI-Powered Workplace     35



There are many domains in which we need experts to describe the reasoning behind decision-making processes. Consider the task of making a diagnosis for many diseases. Although data plays a key role, it needs to start  from a knowledge base of medical understanding that the system can use. Companies such as Babylon Health and Ada, which are changing the healthcare landscape by offering large-scale automated  primary healthcare, employ specialists to build up their models of the medical domain.

Model-based AI is also essential when you need a clear path from inputs to the decision the AI system took. As we will discuss further on, one of the biggest challenges of heavily data-driven systems is the lack of transparency of how the system went from inputs to  outputs.  With model-driven AI, that process is often much more explicit.

Where  model-driven AI fails us, however, is when we have to  deal with situations wherein  we cannot  explicitly state  what the  decision-making process  was that  we ourselves used to  get to  a result. Try this experi- ment: what set of rules would you use to build a system that can recognize a cat whenever it sees one?

Using model-driven techniques, we might start  by saying that a cat is a four- legged animal (what are the rules for  describing an animal?), with two  eyes (what are eyes?), a nose and a mouth. A cat is furry (except when not) and kind of medium-sized (except when not and, by the way, compared to what?). A model-based system would look at an image, deconstruct  it into lines and shapes and colors, and then compare against the set of rules we’ve supplied about how lines and shapes and colors combine in the world to give us different animals.

As you can probably already guess, this approach falls apart quickly. There are so  many rules to  describe  and so  many edge cases, that  a model-driven approach is not sufficient. This is where data-driven AI steps in.


Data-Driven AI

With data-driven AI, instead of describing rules or providing straightforward mathematical formulas, we build systems that can derive the appropriate rules themselves. We essentially take a step back from trying to model a solution and build a system that can discover a solution on its own. It does this by analyzing large amounts of data that (most frequently) has already been anno- tated with the “correct” and “wrong” examples of the thing we are trying to learn. The principle is incredibly simple, but the resulting systems are some of the most complex we have created.
36   Chapter 3 | Building AI-Powered Applications



In order to train a system to correctly identify cats, we “show” it a large num- ber of pictures (with and without cats) and let it know when it guessed cor- rectly. At every turn, the system uses a number of techniques to realign itself so that it is more likely to guess correctly again. This process is repeated until it is reliably guessing things correctly.

This is what neural networks  do, and after  decades  of research  we have reached a level of sophistication and complexity in the architecture that means that, for certain domains, we can have impressively reliable predictions.

There were two turning points along this path that exemplify the achievements of what are called deep neural networks and what they need in order to work.


Standing on the Shoulders of Data

The first turning point was about data.

In 2009, Professor Fei-Fei Li and her group released a dataset called ImageNet.2
It is an annotated  database of over 14 million objects. The dataset  distin- guishes specific objects and places them in about 1,000 categories such as animal (~2.8 million examples), bird (~800,000 examples), food  (~1 million examples), and people (~ 1 million examples).

The ImageNet data sparked an annual competition for who would be able to build an algorithm that performed best in predicting what objects were in an image.

Up until 2011, the best performing algorithm got to about a 25% error  rate. One out of four times it got it wrong. Then a new algorithm was introduced that changed things definitively.


Give Me Enough Data and the Right Algorithm and I Will Move the World

Geoffrey Hinton and his group published a seminal paper in 2012,3 wherein they introduced a series of improvements to deep convolutional neural networks. Through these changes they achieved an error rate of 17%, a significant improve- ment. The neural network had 60 million parameters and 650,000 neurons. It used the work of Andrew Ng et al.4 (which we mentioned in Chapter 1), taking advantage of GPUs’ to efficiently handle all this complexity.


2 ImageNet, www.image-net.org/
3 Alex Krizhevsky,  Ilya Sutskever, and Geoffrey E. Hinton, “ImageNet Classification with Deep  Convolutional Neural  Networks”  in Neural  Information Processing Systems 25 (NIPS, 2012).
4 Rajat Raina, Anand Madhavan, and Andrew  Y.  Ng, “Large-Scale Deep  Unsupervised Learning using Graphics Processors” in Proceedings of the 26th International Conference on Machine Learning (ICML, 2009).
The AI-Powered Workplace     37



This new approach marked a qualitative step change. Over the next few years the error  rate went down to just a few percentage points. Some hailed that as neural networks getting better  than humans (since we get it wrong about
5% of the time). Cooler  minds reminded people that the competition  only needs to be accurate across 1,000 categories, whereas humans can recognize a much bigger range of categories as well as complex context.

The point, however, is that  deep neural networks  finally got us to  a point where  we could do interesting things reliably enough, in ways that  model- based AI cannot support.

The deal does  not  come  without  costs.  We  sacrifice a lot  of clarity and explainability along the way. We don’t actually know why those 650,000 neu- rons light up in a particular way (and neural nets nowadays can be orders of magnitude bigger). There is no chain of decisions to point to. We don’t know what features from the input data are the ones that are determining specific choices. This can present  important  ethical and legal challenges, as we will explore in subsequent chapters.


Techniques, Capabilities, and Applications
As I am sure you can begin to see, there is a dizzying array of techniques and approaches to solving the problem of delegating decision-making capabilities to software.

In order to try and bring some order to thinking and rein in all the disparate approaches under a simple model, I break down the task of building AI-powered applications into three parts.

It starts with the techniques that enable us to reason about the world either by allowing us to explicitly model an aspect of intelligence or by helping us discover it. These techniques are divided into model-driven or data-driven.

Techniques combine to  provide capabilities. Capabilities are specific sys- tems that  empower  us to  understand  an aspect of the  world or  to  effect change. Capabilities are things such as machine vision, speech processing, and natural language processing. Whether  model-based, data-based, or a hybrid combination, a capability is a “super-power” that a machine has that enables it to do something.
38   Chapter 3 | Building AI-Powered Applications



Finally, capabilities  combine to give us complete applications. An application is the finished tool to which we ultimately delegate decision-making powers. It is our expense claims adjudicator, our chatbot virtual assistant, our financial markets predictor, etc.

The  relationships  between  techniques,  capabilities, and  applications are illustrated in Figure 3-1. To me, this provides a clear way to  differentiate between different levels of work within AI. Obviously,  within a business set- ting we ultimately care about the applications that are enabled. For those applications, we need specific capabilities—specific ways of understanding and changing the world. These capabilities are made possible because, at the level of AI, researchers are working on a whole host of different techniques from  logic-based reasoning  to  data-driven  deep  learning architectures. Identifying where  to  focus while not  losing sight of the  bigger picture  is crucial. Too often, people are stuck on a single technique (typically neural networks because that is what gets talked about most) and forget that what really counts is a solid capability or a finished application. Vice-versa, a busi- ness may be calling for an application to be built without realizing that the necessary capabilities are simply not there, so they would need to be invest- ing in primary research  to  develop the techniques that  could lead to  the necessary capabilities.
The AI-Powered Workplace     39





Figure 3-1.   From techniques to capabilities and applications
40   Chapter 3 | Building AI-Powered Applications


Experts and Machines Working Together
In the next couple of chapters we will look more closely at some of these capabilities and techniques, but before we dive in, let us return to the applica- tion we have to build for this chapter: our expense claims adjudicator.

Ultimately, what we need is a combination of approaches. We need model-driven knowledge representation  that encapsulates the core rules and regulations. We can then back that up with data-driven decision-making that references past data to uncover patterns that our explicit model does not capture faithfully enough.

Real-world AI applications  are almost always a combination of a model-driven approach together with a data-driven approach. Mapping technology is one of my favorite examples. Consider the Google Maps application on your phone. On one hand, you have a very explicit representation  of roads, buildings, and the rules that govern how you can get from A to B based on road signals, speed limits, etc. On  the  other  hand, Google Maps relies heavily on data- based predictions to reason about what is the best course to take given the time of day, inputs from other users, etc.

Every project needs to ensure that it understands the problem and objectives, takes into account the knowledge of experts who deal with the subject every day, and formulates a plan about how to make best use of all the tools avail- able. If an explicit model can be derived, it can provide the most efficient path from question to answer. Sometimes, however, the features are so many and the process so unclear, that only a data-centric approach can work.

At each step, we must be realistic about the feasibility of either approach. Is it a fool’s errand to try and build a model of a situation that is simply too com- plex to describe with rules? How much data will we need, what is the state of the data we currently have, and how reliable will the end result be? How can we prove to ourselves that we are heading in the right direction? How can we build fail-safes in the solution by combining techniques?

Over the next few chapters we are going to delve into these questions as we explore more specific technologies and discuss how you can formulate a strategy that exploits AI for your workplace.


NEXT CHAPTER

Comments

Popular posts from this blog

What is BLACK WINDOWS 10 V2 windows based penetration testing os,and what are its features.Download link inside

                         Black Windows 10 V2

Mechatronics notes btech. GATE Notes.