This post starts with an introduction to the most fundamental building block of representation for different types of unimodal data, and then takes a deeper dive into image representations, covering Convolutional Neural Networks (CNNs), Region-based CNNs (R-CNNs), and CNN visualization techniques.
Representations are the foundational building blocks for unimodal deep learning. Each data type, whether it is an image, acoustic signal, or text has unique characteristics that require tailored processing methods. For example, visual data is typically processed as arrays of pixels, while language, before LLMs, relies on structures like bag-of-words or one-hot vectors.
Extracting features from visual data has evolved significantly over the past decades, progressing from image gradients, edge detection, histograms of oriented gradients, and optical flow to Convolutional Neural Networks (CNNs).
Using a fully-connected network (MLP) for visual representation is computationally inefficient because the number of learnable parameters grows with the size of the input image. Specifically, a 1-channel image with a resolution of size $480\times720$ requires 480*720*n learnable parameters, where n is the number of kernel neurons.

Convolutional layers leverage sliding windows and weight sharing to efficiently extract local features from images. Their key advantages include:
To encourage feature abstraction and summarization, pooling layers are employed. Therefore, a typical CNN architecture stacks multiple convolutional layers, each followed by a non-linear activation function and a pooling layer. This pattern is repeated multiple times to learn increasingly abstract feature representations. The extracted features are then passed to one or more fully connected layers (MLP), which perform the downstream task, such as image classification.
For localization tasks like object detection and segmentation, region proposal algorithms are employed to identify hundreds of potential regions, and then a CNN model takes as input those regions to locate objects in an image.
Selective Search [Uijlings et al., IJCV 2013] is one of the most popular region proposal algorithms. It first applies Efficient Graph-Based Image Segmentation to partition an image into regions, and then applies the Hierarchical Grouping Algorithm to recursively group similar neighboring regions in a bottom-up manner, generating region proposals at multiple scales.



The feature maps generated by the final convolutional layer encode the high-level representation learned by CNNs. Over the years, several techniques have been developed to visualize and interpret these learned representations, including:
Compared with fully connected networks (MLPs), CNNs offer several key advantages for image representation, including: parameter efficiency, translation invariance, and high-level visual abstraction.
For localization tasks like object detection and segmentation, region proposals are employed to identify candidate object regions before passing them to a CNN detector.
To visualize the high-level visual representations learned by CNNs, CAM and Grad-CAM generate class-specific heatmaps that highlight the image regions most influential to a CNN's prediction.