Behind the Scenes: Introduction to Artificial Intelligence with Brian Yu - Chapter 7 - Moving
Overview
Brian Yu explains how AI can plan movement from a starting point to a goal, progressing from depth-first search (DFS) and breadth-first search (BFS) to weighted-cost Dijkstra search and heuristic-guided A*. He then applies path planning to physical robots and cars, covering motion constraints, object geometry, continuous-space sampling, uncertain localization, region-based convolutional neural networks, lidar, and safety.
Key takeaways
- DFS can find a valid route but does not guarantee the shortest one; BFS guarantees the shortest route when each move has equal cost.
- Dijkstra’s algorithm finds a minimum-cost route by exploring locations in order of accumulated cost, making it suitable for roads weighted by time, distance, or tolls.
- A* uses a heuristic about distance to the goal to focus search and reduce exploration, though dead ends can still require backtracking.
- Physical motion planning must represent controllable state, such as a car’s wheel direction or a robot arm’s joint angles, and account for the full size of the moving object.
- Uncertain position estimates are better represented as probability distributions that sensor observations can refine, rather than as guaranteed exact coordinates.
- Autonomous systems can combine region-based CNN object detection with lidar distance measurements, but safety also depends on testing, redundancy, and handling failures.
Chapters
- A 5×5 maze models path planning with a lower-left starting cell, a blue-star destination, and red obstacle cells.
- The same problem appears in phone navigation, self-driving cars, and robot vacuums finding routes through a home.
- DFS chooses one available direction, continues along that path, and backs up to the most recent decision point when it reaches a dead end.
- After reaching the goal, the search can reconstruct the successful route by tracing parent positions back to the start.
- DFS can find a valid route while missing a shorter one because its first choice, such as going up rather than right, may be arbitrary.
- These rule-based search methods are examples of classical AI, predating the popularity of neural-network machine learning and still useful for navigation.
- BFS explores every reachable position one step from the start, then every position two steps away, continuing in order of path length.
- When it first reaches the destination at six steps in the example, BFS can guarantee that no shorter route exists.
- A road map can be modeled as nodes for locations and edges for connections, rather than as square grid cells.
- DFS can search this graph by following a route and backtracking; BFS can find the route with the fewest edges.
- Roads can have different costs, representing travel time, distance, tolls, or another quantity to minimize.
- Dijkstra’s algorithm repeatedly explores the reachable location with the lowest accumulated cost, rather than simply counting roads.
- In the example, the destination is reached with a total cost of nine by adding the costs of the selected edges.
- On a larger maze, Dijkstra’s algorithm finds a shortest-cost route but may examine many yellow-highlighted cells along the way.
- A correct, optimal answer is not necessarily efficient to compute, a key concern for navigation systems that must respond quickly.
- A* adds a heuristic that estimates which moves bring the search closer to the destination, such as preferring movement toward the goal’s row or column.
- The heuristic can reduce unnecessary exploration, while dead ends may still require backtracking and trying other routes.
- Unlike a fixed maze, real environments change: roads can close and new obstacles can appear.
- A navigation system must recalculate when a planned route becomes blocked and adapt when a newly opened route offers a better option.
- The discussion shifts from abstract pathfinding toward a toy-car demonstration of physical navigation constraints.
- A car cannot necessarily move into any adjacent open space: its wheels and turning direction constrain the motions it can perform.
- A path that looks open on a map may be too narrow for the vehicle’s physical size or shape.
- Real obstacles, including trees, pedestrians, bicycles, and other vehicles, are not idealized square grid cells.
- A car’s state must include more than its position; wheel direction affects which positions it can reach next.
- For a robotic arm, the angles of four joints determine the claw’s position, so planning must search over joint configurations and their resulting motion.
- A route for an object’s center may still cause a collision if the object itself is too large to fit through a gap.
- Approximating an irregular duck with a containing circle makes collision checking simpler; enlarging obstacles by the circle’s radius marks unsafe center positions.
- If the enlarged obstacles block a narrow opening, a safe route may instead go around the obstacles.
- Physical space has infinitely many possible positions, so one approach is to sample candidate points and connect them with collision-free paths.
- Points inside obstacles and connections that cross an obstacle or expanded gray safety region are rejected.
- If the sampled points do not produce a route, adding more samples can reveal a viable path.
- A grid can simplify irregular obstacles by marking any cell containing part of an obstacle as blocked.
- Large cells may conservatively hide a route that physically exists; subdividing blocked cells into four smaller cells can reveal a passage.
- Finer grids capture more obstacle detail but require more computation.
- A moving car may not know its exact position because motion estimates and sensor readings are uncertain.
- Instead of one certain location, a system can represent position as a probability cloud, like the uncertain-location circle shown by some phone maps.
- Sensor observations can improve the estimate over time, while each movement can add uncertainty that requires further sensing.
- Object detection must identify both what objects appear and where they are, such as drawing separate rectangles around several ducks, trees, or branches.
- A region-based convolutional neural network generates candidate image regions and classifies the pixels in each region.
- Evaluating a CNN for many proposed regions can be computationally expensive, motivating efficiency improvements.
- Lidar, or light detection and ranging, estimates the distance and direction of nearby objects by measuring how long emitted light takes to return.
- Combining lidar with cameras and other sensors gives a vehicle or robot more information about its surroundings.
- Because AI systems can make mistakes or lose sensor inputs, safe deployment requires extensive testing, redundancy, and plans for emergencies and failed predictions.
- The course recap revisits game-playing AI, prediction, recommendations, image and language understanding, generative AI, and physical navigation.
Transcript excerpt
0:00 navigate the physical world, too. So, if you think about applications like robotics or self-driving cars, there are lots of problems to solve. Hello world, and welcome back to an introduction to artificial intelligence. We've now seen many ways that we can
0:47 take AI and build it into our computers and our phones, and our goal today is going to be to bring AI even more so into the physical world, thinking about how we can get AI to move about and navigate the physical world, too. If you think about applications like robotics or self-driving cars, there are lots of problems to solve to make these kinds of technologies possible, and many different algorithms and ideas from AI that we can use to apply to these kinds of problems so that we can get AI that can move about and navigate the physical world. So, let's begin with a problem that we might call path planning. The idea of path planning is we want to set up a situation where AI can find a path, find some way to navigate from wherever it is right now to some goal, some destination wherever we want AI to get to. So, let me set up an example path
1:34 planning problem. I have here a 5x5 grid. Think of this is kind of like a maze that we might want our AI to be able to navigate within. And within this maze, there are some obstacles, some places we can't go. I'll go ahead and highlight those obstacles in red. So, think of these as walls or other kinds of obstacles, places where our AI can't go. And our AI has a starting point, some place they begin inside of this path planning problem. So, in this case, our AI will start over
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, CS50.