
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).
| Features | Classical | Deep Learning |
|---|---|---|
| Transformation T | Hand-crafted by humans using domain expertise | Automatically learned directly from data pairs during training |
| Tuning | per image (thresholds, , gains) | none during inference |
| Parameters | Fixed values (e.g., Sobel, Laplacian, Gaussian masks) | Trainable weights & biases updated via backpropagation |
| Adaptability | Rigid; static response regardless of dataset | Highly adaptable; optimizes for specific downstream tasks |
| Feature Extraction | Low-level primitives (edges, blurs, corners) | Hierarchical (edges textures complex shapes objects) |
| Computational Cost | Low (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