The entire history of Computer Vision explained one core concept at a time.
The Evolution of Convolutional Neural Networks
Introduction to CNNs
- The traditional method for training neural networks involved flattening images into pixel values, which discarded essential 2D spatial information.
- In 1989, Yann LeCun and his team introduced Convolutional Neural Networks (CNNs), preserving the 2D nature of images and enabling spatial processing.
- This video explores the history of CNNs in image classification, from early research to modern architectures competing with attention mechanisms and vision transformers.
Understanding Convolution Operations
- The convolution operation is central to CNN functionality; it involves scanning a filter across an image to produce a feature map that highlights patterns.
- Multiple filters are trained in a convolution layer, each extracting different features such as corners or lines from the input image.
- Stacking multiple convolution layers forms a deeper network capable of complex feature extraction by transforming input channels into new sets of feature maps.
Key Techniques in CNN Architecture
- Each convolution layer performs two functions: spatial filtering through convolution and combining multiple input channels into new output channels.
- Research has focused on modifying these techniques to enhance model performance; the original 1989 paper demonstrated training nonlinear CNNs using backpropagation.
Inductive Bias in CNN Design
- Inductive bias refers to introducing specific rules into the learning process, guiding models toward human-like understanding when classifying images.
- Unlike feedforward networks that treat pixels independently, CNN designs leverage parameter sharing for local pattern recognition, making them less data-hungry.
Advancements with LeNet-5 Model
- In 1998, LeCun's team published the LeNet-5 model—a seven-layer CNN that utilized max pooling for downsampling by selecting maximum values from sliding windows.
- Each neuron’s local receptive field connects only to a small region of the input image; deeper layers access larger regions due to increased receptive fields through successive convolutions.
The Evolution of Neural Networks and CNNs
Early Challenges in Neural Networks
- Researchers in the early 2000s found neural networks to be computationally expensive and data-hungry, leading to issues with overfitting where models memorized training data instead of generalizing.
- Traditional machine learning algorithms like Support Vector Machines (SVM) were preferred due to better performance on smaller datasets and lower computational demands.
The Impact of ImageNet
- The introduction of the ImageNet dataset in 2009, containing 3.2 million annotated images across over 1,000 classes, revolutionized model training.
- From 2010 to 2017, the ILSVRC competition showcased advancements in model performance; initially dominated by traditional methods until CNNs took over starting in 2012.
Breakthrough with AlexNet
- AlexNet, introduced by Dr. Geoffrey Hinton in 2012, achieved a top-five error rate of just 17.7%, marking a significant leap forward for CNN technology.
- AlexNet utilized multiple kernel sizes (11x11, 5x5, and 3x3), allowing it to capture more global patterns compared to previous models that only used smaller kernels.
Key Innovations in AlexNet
- With over 60 million trainable parameters, AlexNet employed dropout regularization to prevent overfitting by randomly turning off neurons during training.
- It replaced traditional activation functions with ReLU (Rectified Linear Unit), which improved optimization speed significantly compared to tanh functions.
Advancements Post-AlexNet: GoogleNet
- In 2014, GoogleNet achieved a top-five error rate of just 6.67% using the Inception module that combined parallel convolution layers with different kernel sizes.
- The Inception module efficiently mixed low-level and medium-level features while reducing dimensionality through one-by-one convolutions before applying larger spatial filters.
Efficient Channel Mixing Techniques
- One-by-one convolutions are used for channel mixing without spatial filtering; they allow efficient dimensionality reduction before applying larger kernels like 3x3 or 5x5.
- This method reduces the number of trainable weights significantly while maintaining effective feature extraction capabilities within the network architecture.
Understanding Convolutional Neural Networks and Innovations in Deep Learning
The Efficiency of 3x3 Kernels
- Larger kernels like 5x5 or 7x7 are less efficient than using multiple 3x3 kernels. A two-layer network with 3x3 kernels has the same receptive field as a single 5x5 layer.
- Using three 3x3 layers is equivalent to one single 7x7 layer but requires fewer parameters: one 5x5 filter trains 25 weights, while two 3x3 filters train only 18 weights.
Internal Covariate Shift and Batch Normalization
- Deep neural networks face internal covariate shift, where earlier layers' training affects later layers' input distributions.
- Batch normalization normalizes inputs to have zero mean and unit standard deviation, allowing faster convergence (up to 14 times) and enabling higher learning rates.
Challenges with Deep Networks
- Adding many new layers to a shallow network can paradoxically decrease training accuracy due to difficulties in training deep networks.
- ResNets were introduced by Microsoft in 2015 to address these challenges, allowing stable training of very deep networks (up to 150 layers).
Residual Learning in ResNets
- ResNets utilize residual blocks where the original input is added back to the output, simplifying the learning process by focusing on residual features rather than final outputs.
- This architecture allows gradients to flow more easily during backpropagation, mitigating issues like vanishing gradients.
Advancements with DenseNets
- DenseNets enhance information flow by connecting earlier layers directly with later ones; each layer contributes additional feature maps for improved performance.
- Each layer in DenseNet has direct access to gradients from the loss function at the final layer, facilitating better gradient propagation throughout the network.
MobileNet Architecture Innovations
- MobileNet separates filtering spatial information and combining channels into distinct operations using depth-wise convolution followed by pointwise convolution.
- This separation significantly reduces weight count while maintaining performance efficiency.
Enhancements in MobileNet V2
- MobileNet V2 introduces linear bottlenecks and inverted residual connections for improved dimensionality reduction without losing valuable information through activation functions like ReLU.
- Inverted residual connections allow shortcuts between bottleneck layers, optimizing information retention during processing.
The Rise of Transformers in NLP
- While advancements were made in computer vision through CNN architectures, significant developments occurred simultaneously within natural language processing via Transformers and attention mechanisms.
Vision Transformers vs. CNNs: A Comparative Analysis
Introduction to Vision Transformers
- The video discusses the concept of self-attention methods that enhance each channel of a feature map by making it contextually aware of global properties across all input channels.
- Vision Transformers (ViTs) are introduced as models that can outperform state-of-the-art Convolutional Neural Networks (CNNs) in image classification tasks.
Mechanism of Vision Transformers
- Input images are divided into fixed-size, non-overlapping patches, which are then embedded into vectors using either CNN or linear layers.
- These patch embeddings receive positional encodings and are processed through a self-attention-based Transformer encoder, allowing for contextual awareness across the entire image.
Differences Between CNNs and Transformers
- Unlike CNNs, which utilize inductive biases such as localizations and sliding kernels, Transformers rely on generality and raw computational power to model relationships between patches regardless of spatial distance.
- The promise of Transformers lies in their ability to leverage massive datasets effectively, potentially surpassing the performance benefits provided by CNN's inductive biases.
Introduction to Conex: A Hybrid Approach
- The video transitions to discussing Conex, a convolution-based network designed to outperform Transformer models without introducing major innovations but rather comparing strengths between CNN and Transformer architectures.
Key Features of Conex Architecture
- Conex employs a 4x4 convolution kernel with a stride of four for down-sampling images, mirroring the patching strategy used in ViTs.
- It utilizes depthwise separable convolutions inspired by MobileNet architecture while hypothesizing similarities between depthwise convolution operations and self-attention mechanisms.
Efficiency and Scalability Considerations
- By employing large 7x7 filters, Conex aims to capture broader spatial contexts akin to ViTs while maintaining localization advantages typical in CNN architectures.
- The architecture is noted for its computational efficiency due to depthwise separable convolutions and scalability for high-resolution images compared to the quadratic scaling issues faced by self-attention mechanisms in Transformers.
Conclusion: Future Directions in Computer Vision Research
- The discussion highlights an exciting future where both CNN and Transformer methodologies will compete, exploring whether inductive bias or generality will prove superior as advancements continue.