Optimization in convolutional networks (CNN)
Optimization in CNN
- Estimated duration
- 30 minutes
- Related questions
- 2
- Related algorithms
- 3
- Status
- Log in to track
Lesson objectives
- Identify the optimizable hyperparameters of a CNN.
- Design an HPO experiment for a convolutional network at a reasonable cost.
- Read the registered literature critically.
Explanation
Convolutional networks are sensitive to the learning rate, batch size, augmentation and regularization, and every evaluation is a costly training run.
What is usually optimized: the learning rate and its schedule, batch size, weight decay, Dropout, the number of filters and layers, kernel size, the augmentation policy, and which layers are frozen in transfer learning.
Reducing cost: training on part of the data or with fewer epochs during the search, then retraining the best configurations in full; using a pretrained architecture and tuning the classification head; and setting an explicit evaluation budget.
The lab repository has registered studies that used PSO to tune CNN hyperparameters in various fields (retinopathy, emotions from EEG, intrusion detection). Read the reported results with caution: many use a single split, and some lack strong baselines or statistical tests.
Mathematics
Approximate budget
\text{Cost} \approx FEs \times E \times \frac{|D|}{B}\times t_{step}E epochs, B batch size.
Python code
# PyTorch-style search space for a CNN (sampled by any optimizer)
space = {
'lr': ('log', 1e-5, 1e-1),
'batch_size': ('choice', [16, 32, 64, 128]),
'weight_decay': ('log', 1e-6, 1e-2),
'dropout': ('float', 0.0, 0.6),
'filters': ('int', 16, 128),
}Simplified teaching code that works with NumPy only; for research experiments use a documented library and fix the random seed.
Practical exercise
Open the CNN model card in the Explorer and review the registered studies and the evidence status of each relationship.
Common mistakes
- Comparing an optimized model with a default architecture without equivalent tuning of the baseline.
- Reusing the test set to choose the best epoch.
Summary
For CNNs, restrict the space to the influential hyperparameters, reduce the cost, and compare with tuned baselines.
References
There are no references recorded for this lesson.
Short quiz
2 questions are chosen at random from 2 questions linked to this lesson, and the quiz is graded on the server.
Links within the lab
- Algorithms
- Models
- Optimization types
- Related lessons
- In the paths
