get any
Free ebooks from Code With OJ
What would be a definition of AI? In general, it means a machine that exhibits some characteristics of intelligence—thinking, reasoning, planning, learning, and adapting. It can also mean a software program that can simulate thinking or reasoning. Let’s try some examples: a robot that avoids obstacles by simple rules (if the obstacle is to the right, go left) is not an AI. A program that learns by example to recognize a cat in a video, is an AI. A mechanical arm that is operated by a joystick is not AI, but a robot arm that adapts to different objects in order to pick them up is AI.
WThere are two defining characteristics of artificial intelligence robots that you must be aware of. First of all, AI robots learn and adapt to their environments, which means that they change behaviors over time. The second characteristic is emergent behavior, where the robot exhibits developing actions that we did not program into it explicitly. We are giving the robot controlling software that is inherently non-linear and self-organizing. The robot may suddenly exhibit some bizarre or unusual reaction to an event or situation that seems to be odd, or quirky, or even emotional. I worked with a self-driving car that we swore had delicate sensibilities and moved very daintily, earning it the nickname Ferdinand after the sensitive, flower loving bull from the cartoon, which was appropriate in a nine-ton truck that appeared to like plants. These behaviors are just caused by interactions of the various software components and control algorithms, and do not represent anything more than that.
Most of AI as practiced today is not new. Most of these techniques were developed in the 1960s and 1970s and fell out of favor because the computing machinery of the day was insufficient for the complexity of the software or number of calculations required, and only waited for computers to get bigger, and for another very significant event – the invention of the internet. In previous decades, if you needed 10,000 digitized pictures of cats to compile a database to train a neural network, the task would be almost impossible—you could take a lot of cat pictures, or scan images from books. Today, a Google search for cat pictures returns 126,000,000 results in 0.44 seconds. Finding cat pictures, or anything else, is just a search away, and you have your training set for your neural network—unless you need to train on a very specific set of objects that don't happen to be on the internet, as we will see in this book, in which case we will once again be taking a lot of pictures with another modern aid not found in the 1960s, a digital camera. The happy combination of very fast computers; cheap, plentiful storage; and access to almost unlimited data of every sort has produced a renaissance in AI.
We have to set some limits on how far we can hear – there is a limit on how sensitive our microphone can be. I'm suggesting six feet as a maximum distance. We may revisit this later. When you come to a requirement like this, you can ask the customer "Why six feet?". They may say, "Well, that sounds like a reasonable distance". You can ask, "Well, if it was five feet, would that be a failure of this function?". And the user might respond, "No, but it would not be as comfortable". You can continue to ask questions on distances until you get a feeling for the required distance (how far away to not fail), which might be three feet in this case (so that the child does not have to bend over the robot to be heard), and the desired distance, which is how far the user wants the function to work. These are important distinctions when we get around to testing. Where is the pass-fail line for this requirement?
Now we are going to do some detailed analysis of what the robot needs to do by using the storyboard process. This works like this: We take each of our two tasks and break them down as completely as we can based on the answers to all of our W questions. Then we make a picture of each step. The pictures can be either a drawing or a word picture (a paragraph) describing what happens in that step. I like to start the decomposition process by describing the robot in terms of a state machine, which for the first problem may be a good approach to understanding what is going on. You are probably familiar with state machine diagrams, but just in case: a state machine diagram describes the robot’s behavior as a series of discrete states, or sets of conditions that define what actions are available to the robot:
Each state is an event or events that cause the state to change. These are called transitions. To get from the off state to whatever is next, some event has to occur – like the human operator turning on the power. We'll call that transition event power applied. Now what state are we in? There is some amount of time to get the computer booted and the programs loaded (Initializing). Once everything boots up and initializes, the robot will be ready to accept commands. Let's call this state STANDBY. The robot is just sitting waiting for instructions. Now we want to start cleaning the room. I send a command to the robot to Begin Cleaning, which changes the state to – what? What do we need to happen next? We could define a state called cleaning, but that would encompass a lot of complex functions and we would not learn much from that. We need the robot to look around itself for toys. If it does not find a toy, it needs to drive forward – avoiding obstacles – and then look again. If it does find a toy, then it needs to position itself within reach of the robot arm to grab the toy. So in the state machine diagram we add the transition Begin Cleaning, which changes the state from STANDBY to Looking for Toys. Now we can add two more transitions: one called Toy=no and one called Toy=yes. The Toy=no branch goes to a state called drive ahead, where the robot moves forward – while avoiding obstacles – and then goes back to the Look for Toys state and tries again to find a toy.
Francis X. Govers