1. Home
  2. Explore
  3. Computer Science
  4. Vision Beyond Classification

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Vision Beyond Classification

Speaker 1Speaker 2

Vision Beyond Classification

17:46
0:00-17:46
  1. Maria

    Welcome, everyone. Today we're going beyond image classification and asking a bigger question: what would it take for a computer to genuinely understand a visual scene?

  2. Corey

    Classification is a useful starting point, but it gives us only a few words about an image. A classifier such as ResNet-50 might label a scene as “bicycle” and “garden,” and those labels can be correct while still missing most of what is happening.

  3. Maria

    Exactly. Imagine an image containing two bicycles and people positioned on them. One bicycle and person may even be upside down, which challenges our usual assumptions about how objects behave. To understand the scene, a system needs to know how each object is posed relative to the camera, how objects are positioned relative to one another, and where the camera itself is located.

  4. Corey

    And in this example, closer inspection reveals that the view is actually from above, taken by a drone over a garden. So the system has to go beyond naming objects. It has to parse relationships, viewpoints, orientation, and the structure of the entire scene.

  5. Maria

    That is the motivation for human-level scene understanding. It could support navigation for visually impaired people, virtual and augmented reality, robotics, and autonomous vehicles. Research in this direction may also help us understand how biological vision works.

  6. Corey

    The challenge is that there are many decisions. We might need object detection, pose estimation, camera-position estimation, and other tasks, and we have to decide how those tasks should interact. We also have to balance accuracy and efficiency, choose what information to provide as input and output, and decide whether to build in world knowledge or let a model learn end to end.

  7. Maria

    A useful way to organize the problem is to take the phrase “supervised image classification” and replace one word at a time. First, replace classification with other visual tasks. Then replace the single image with richer inputs such as image pairs or videos. Finally, replace strong supervision with weaker or self-supervised forms of learning.

  8. Corey

    Before the main tasks, two important examples are worth mentioning. Image captioning takes an image and generates a language description, such as “two beach chairs under an umbrella on the beach.” That description can be selected from a fixed list, but free-form language generation is more difficult and potentially more meaningful.

  9. Maria

    Another task is human pose estimation. The system detects and tracks key points on the human body so it can estimate people's positions in a scene. That is especially useful for applications such as interactive games.

  10. Corey

    The tasks we will focus on become increasingly detailed: object detection, semantic segmentation, and instance segmentation. Classification gives a sparse description of an image, while these tasks progressively add location and pixel-level detail.

  11. Maria

    Object detection combines two jobs. The system must classify each object and localize it with a bounding box. For every object, the output includes a class label, often represented as a one-hot vector, and four box parameters: the center coordinates, height, and width.

  12. Corey

    The training data therefore contains an RGB image and a list of objects. Each object has its class label and bounding-box coordinates, and different images can contain different numbers of objects.

  13. Maria

    The class prediction is a classification problem because its output is discrete. The box coordinates are different: they are continuous values. If the predicted box is too far left, too small, or too high, we want the model to receive feedback about the direction and size of the error.

  14. Corey

    That is why bounding-box prediction is treated as regression. A simple approach is to minimize a quadratic, or mean-squared, loss between the four predicted coordinates and the four ground-truth coordinates. Classification maps inputs to unordered categories, whereas regression maps them to continuous values that have an order.

  15. Maria

    Multiple objects create another difficulty: which predicted box should be compared with which ground-truth box? Matching each prediction to the nearest box can become messy. A common strategy is to first classify rough candidate regions and then refine their coordinates with regression.

  16. Corey

    One example is Faster R-CNN, a two-stage detector. Convolutional layers first create feature maps. A region proposal network examines predefined anchor locations and boxes with different scales and aspect ratios, assigning each candidate an objectness score: does this region contain an object or not?

  17. Maria

    The most promising candidates are kept, and their features are passed to a later stage that predicts the object class and refines the four box coordinates. The anchors discretize the possible center positions, scales, and ratios, while regression provides more precise locations.

  18. Corey

    There is an important training complication. Selecting and cropping only the top candidates is not differentiable, so gradients cannot pass through that selection operation. Faster R-CNN is therefore trained in two steps: first the region proposal network learns objectness, and then the larger detector uses those proposals for classification and regression.

  19. Maria

    A one-stage alternative is RetinaNet. Instead of first selecting regions and then refining them, it predicts object classes and box coordinates at multiple feature resolutions. The class head produces values related to the number of classes and anchors, while the box head predicts four coordinates for each anchor.

  20. Corey

    The problem with simply training on every possible box is that most boxes are background. Cross-entropy strongly penalizes incorrect predictions but decreases slowly even for examples that are already classified correctly. The huge number of easy background examples can overwhelm the useful learning signal.

  21. Maria

    One solution is hard-negative mining: train with positive examples and a subset of background examples, find the false positives, add those difficult negatives to the training set, and repeat. RetinaNet uses a simpler approach called focal loss, which downweights examples that are already classified confidently and concentrates learning on difficult examples.

  22. Corey

    Now consider semantic segmentation. A bounding box can include a great deal of background, especially for objects with unusual shapes or extended limbs. Semantic segmentation assigns a class to every pixel, so the output identifies exactly which pixels belong to a person, sheep, dog, or background.

  23. Maria

    This requires dense prediction: the output has the same spatial resolution as the input, with a probability distribution over classes at every location. Convolution and pooling normally reduce resolution to enlarge receptive fields and produce more abstract features, so the network also needs an upsampling or unpooling process.

  24. Corey

    Nearest-neighbor upsampling simply copies each activation into neighboring output locations, but that can create blobby results. Other approaches preserve the locations of maximum activations during pooling and use them during unpooling, or use transposed convolutions to learn an upsampling operation.

  25. Maria

    U-Net is a well-known encoder-decoder architecture for semantic segmentation, especially in medical imaging. The encoder repeatedly applies convolution, nonlinearities, and pooling to obtain abstract features. The decoder then upsamples those features until the output returns to the input resolution.

  26. Corey

    U-Net also uses long skip connections from encoder layers to decoder layers at matching resolutions. These connections restore high-frequency spatial details lost during pooling and make gradient propagation easier during training. The loss is usually cross-entropy averaged over all pixel locations.

  27. Maria

    Semantic segmentation still has a limitation when objects of the same class overlap. If two sheep touch, the output may simply be one connected region labeled “sheep,” without indicating where one instance ends and the other begins.

  28. Corey

    Instance segmentation addresses that by combining detection and semantic segmentation. It assigns pixels to classes while also distinguishing separate instances within the same class. Mask R-CNN is one example of an approach designed for this problem.

  29. Maria

    Evaluation also changes as the task becomes more detailed. Classification can use top-one accuracy, or top-five accuracy when several classes are difficult to distinguish. For detection and segmentation, intersection over union compares the overlap between the prediction and the ground truth by dividing their intersection by their union.

  30. Corey

    We do not simply evaluate detection with the same quadratic loss used to train box regression. That loss treats a ten-pixel error similarly for a large and a small object, even though ten pixels may be a tiny fraction of a large object and more than half of a small one. Directly optimizing intersection over union is also difficult because its maximum operations are not differentiable, although approximations have been proposed.

  31. Maria

    Benchmarks make progress comparable. Cityscapes is a semantic-segmentation benchmark centered on city scenes, while COCO provides annotations for several tasks, including object detection, semantic segmentation, and image captioning. Public evaluation platforms also allow models to be assessed by an objective third party.

  32. Corey

    A major practical technique across these tasks is transfer learning. Related visual tasks share useful features, so we should not always train from scratch. For example, an image classifier can provide the early layers of an object detector; we remove or replace the final classification layer, add modules suited to detection, initialize the shared layers from the classifier, and train or freeze them depending on the problem.

  33. Maria

    Transfer can happen across tasks or across domains. The Taskonomy work studied relationships among many visual tasks to ask which source tasks are useful for learning target tasks. In another example, a robotic hand learned to solve a Rubik's Cube by training in simulation and transferring to the real world.

  34. Corey

    That simulation-to-real transfer used automatic domain randomization. It combined extensive data augmentation with hard-negative mining so that the system encountered varied transformations and focused on especially useful examples. The goal was to make the learned behavior robust enough for the physical robot.

  35. Maria

    So far, we have treated a single image as the input. But motion provides valuable visual information. Studies of people who recovered sight later in life showed that they could use contours and color to separate simple objects, but struggled when objects overlapped or when scenes were more natural.

  36. Corey

    When the same kinds of objects were shown moving in different directions, those patients performed much better. Experiments with chicks reached a related conclusion: chicks exposed to temporally smooth motion learned representations that generalized to viewpoints they had not seen, whereas chicks shown shuffled frames tended to overfit the observed transformations.

  37. Maria

    This suggests that videos offer natural data augmentation. Real motion includes translation, changes in scale, three-dimensional rotation, camera movement, and lighting changes. Learning from those changes can help a model build representations that are robust to transformations.

  38. Corey

    One task based on image pairs is optical-flow estimation. Given two images, the system predicts where each pixel in the first image moved in the second. The output is dense and continuous: at every pixel, two values describe displacement in the horizontal and vertical directions.

  39. Maria

    FlowNet uses an encoder-decoder structure for this task. The encoder extracts features from the image pair, and the decoder upsamples them to the original resolution. It can be trained with a Euclidean distance between predicted flow and ground truth.

  40. Corey

    Because humans cannot realistically label the destination of every pixel, the Flying Chairs dataset generated training examples automatically. Real images were combined with rendered views of three-dimensional chair models, producing synthetic motion and exact flow labels. Although the scenes are unrealistic, the motion relationships are useful because pixels moving together can indicate that they belong to the same object.

  41. Maria

    For full videos, one simple strategy is to apply an image model independently to every frame. That can work reasonably well, but it ignores temporal smoothness. Predictions may flicker from one frame to the next because each frame is treated as unrelated to its neighbors.

  42. Corey

    A more video-specific approach uses three-dimensional convolutions. A video is treated as a volume with height, width, time, and color channels. The convolutional filters slide across space and time, producing spatiotemporal features, and the familiar ideas of stride, dilation, and padding extend to three dimensions.

  43. Maria

    Standard three-dimensional convolutions are non-causal because an activation at time t can depend on a future frame, such as frame t plus one. That is fine for offline processing, but real-time robotics or autonomous driving cannot use future frames. In those settings, a masked three-dimensional convolution can prevent the filter from looking ahead.

  44. Corey

    One task enabled by video input is action recognition. The input is a video volume, optionally with externally computed optical flow, and the output is an action label such as “cricket shot.” The Kinetics dataset was created for large-scale action recognition, with hundreds of thousands of videos and hundreds of action classes.

  45. Maria

    A strong model for this task uses two streams with different temporal resolutions. One processes frames more slowly but extracts richer features for relatively stable information, such as object categories. The other processes frames more quickly with fewer features, emphasizing fast changes and motion.

  46. Corey

    The two streams are combined to make the final prediction. This resembles the idea of a two-stream visual system in humans, and it parallels the multi-resolution feature hierarchies used in image detection and segmentation—except here the hierarchy is across time rather than only across spatial resolution.

  47. Maria

    Image classifiers can also initialize video models. A two-dimensional filter can be replicated along the time dimension to create a three-dimensional filter. That initialization makes sense because repeating a single image across time creates a valid video of a static scene; subsequent training can then learn actual motion.

  48. Corey

    Video models bring serious costs. Labels are harder to obtain, the memory requirement is much larger, three-dimensional convolutions can be slow, and the computation consumes substantial energy. The lecture notes that a current GPU used for these models can consume around one hundred watts, roughly ten times the power associated with the human brain.

  49. Maria

    Efficiency research therefore looks to both neuroscience and computer architecture. Parallel computation can increase throughput and reduce latency, just as pipelining in processors breaks large instructions into smaller operations that different units can execute at the same time.

  50. Corey

    Another idea is to exploit redundancy. Neighboring frames in a high-frame-rate video are often very similar, so the model may not need to process every frame at full resolution. The discussion connects this to human blinking: blinking cleans the eyes, but it may also reduce visual-processing activity and energy use because vision is one of the brain's most energy-demanding systems.

  51. Maria

    The final shift is beyond strong supervision. Pixel-level labels are tedious for images and far more tedious for videos. One possible compromise is to label only a few key frames and propagate those labels through time using the smoothness of video.

  52. Corey

    When exact target labels are unavailable, metric learning offers another strategy. Instead of learning a direct mapping from inputs to class labels or continuous values, the model learns distances in an embedding space. For example, images of the same person should be close together, while images of different people should be far apart.

  53. Maria

    Such an embedding can support image retrieval: project a new image into the embedding space and find its nearest neighbor. It may also help analyze high-dimensional medical data by revealing what makes examples similar or different, potentially including differences associated with disease.

  54. Corey

    Contrastive loss works with pairs. Same-person pairs are pulled together, while different-person pairs are pushed apart, but only until they exceed a chosen margin. The margin prevents the model from wasting effort pushing already-separated examples infinitely far away.

  55. Maria

    A fixed margin can still be restrictive because different classes may naturally have different amounts of variation. Triplet loss uses an anchor, a positive example, and a negative example, requiring the positive to be closer to the anchor than the negative by a margin. This relative comparison allows different classes to occupy regions with different sizes.

  56. Corey

    Hard-negative mining matters here too, because the choice of pairs or triplets strongly affects the learning signal. Selecting informative difficult examples can make the learned embedding more useful.

  57. Maria

    A particularly simple self-supervised approach defines the label automatically as “same image.” Take one image, apply different augmentations, and train the system to group those views together. Augmented views of another image should form a different group.

  58. Corey

    This avoids manually supplied labels, yet the resulting representations can approach the quality of representations learned with full ImageNet supervision. That is a major reason self-supervised and metric-learning approaches are important.

  59. Maria

    So, is vision solved? Not really. We have impressive systems for detection, segmentation, optical flow, and action recognition, but it is unclear what it means to solve vision in the broader sense of human-level scene understanding.

  60. Corey

    A model may perform well on one benchmark and fail when moved to another dataset. We also need systems that combine many abilities rather than performing only one task, and we need to understand which visual representations are useful for agents that must act in the world.

  61. Maria

    Future progress may require more model parallelism, better hardware, and methods that use less supervision. It is also still open whether representations such as semantic segmentation are sufficient for action, or whether representations based on key points and other structures are more useful for control.

  62. Corey

    The central takeaway is that learning vision from static labeled images may make the problem harder than it needs to be. Videos provide motion cues and natural variation, while self-supervised learning can reduce the labeling burden.

  63. Maria

    And the long-term goal is not merely a collection of separate visual predictors. It is an efficient, flexible visual system that learns from moving pictures, understands scenes at multiple levels of detail, and supports intelligent agents interacting with the real world in real time.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent