We can use a Covolutional Neural Network (CNN) to learn filters directly from data during training. These feature maps are learned, and this CNN acts as a feature extractor, with these new feature maps are the channels in the hidden layers. The filters are the learnable weights/parameters in the network.

This method is vastly different from the hard-coded way of using filters.

CNN Training vs Inference

  • the full forward pass in the network (stacked convolutional layers) is represented as

When to use which?

We have 2 methods, Classical (hand-designed) and Deep Learning (using CNN).

FeaturesClassicalDeep Learning
Transformation THand-crafted by humans using domain expertiseAutomatically learned directly from data pairs during training
Tuningper image (thresholds, , gains)none during inference
ParametersFixed values (e.g., Sobel, Laplacian, Gaussian masks)Trainable weights & biases updated via backpropagation
AdaptabilityRigid; static response regardless of datasetHighly adaptable; optimizes for specific downstream tasks
Feature ExtractionLow-level primitives (edges, blurs, corners)Hierarchical (edges textures complex shapes objects)
Computational CostLow (no training required)High (requires dataset, GPU compute, and optimization time)
  • in practice, we would perform both classical pre-processing +learned models combined
  • we usually run the classical baseline first, and see if it is worth the cost of running deep learning models