AI Glossary / Deep learning / Intermediate
Convolutional neural network
Definition
A convolutional neural network, or CNN, is a neural network that uses convolutional layers to learn patterns through local connections and shared filters. It is especially associated with images, but related architectures also process sequences and other structured arrays. A CNN combines these learned responses with further processing to produce outputs such as class scores, locations, or pixel-level predictions. Its capabilities depend on its architecture, training data, and evaluation, not simply on carrying the CNN label.
What it means
In an image, nearby pixels usually have a meaningful relationship. A small filter can respond to a local pattern, and reusing it across positions allows the same kind of pattern to be detected elsewhere. Later layers can combine earlier responses over wider regions.
This hierarchy is a useful design idea, but it should not be interpreted too literally. A network does not necessarily progress through neatly named stages of edges, parts, and objects in a way that explains every prediction. Learned representations can also exploit irrelevant backgrounds or other shortcuts present in the training data.
How it works
Prepare an input with the expected dimensions, channel order, and numerical scale. Convolutional layers produce feature maps. Nonlinear activations let the network express relationships beyond a sequence of linear operations. Pooling or strided operations may reduce spatial dimensions, depending on the architecture.
A task-specific output component converts the learned representation into the required prediction. During supervised training, a loss compares predictions with targets, and backpropagation supplies gradients for updating parameters.
Evaluate on appropriately separate examples. Architecture and training choices affect what the network can learn, while preprocessing and deployment conditions affect whether it receives inputs comparable to those used during development.
Three practical examples
1. Image classification: a warehouse team trains a model to identify package categories from photographs and checks performance on images captured under actual handling conditions.
2. Pixel-level analysis: an inspection project uses a convolutional architecture to mark regions of interest, evaluating the location and extent of predicted regions rather than only whole-image accuracy.
3. Time-series study: researchers use one-dimensional convolutional processing to examine recurring local patterns in sensor sequences, with evaluation separated by relevant time periods or equipment units.
Think of it this way
Think of a sequence of inspection stations: early stations record local patterns, and later stations combine those records into a task-specific judgment. The analogy is limited because neural stages are learned numerical operations, not people with explicit checklists. A station's apparent response to a familiar pattern does not establish that the whole network uses it for the reason a person expects.
Worked example
Consider a CNN receiving an 8-by-8 grayscale image, represented as 8 × 8 × 1 values. Its first convolution uses two 3-by-3 filters, stride one, and no padding. Each filter produces a 6-by-6 map, so the output shape is 6 × 6 × 2.
Each filter has nine weights and one bias, giving 2 × 10 = 20 trainable parameters in that layer. The same weights are reused at all spatial positions.
After a ReLU activation, a 2-by-2 pooling operation with stride two reduces the representation to 3 × 3 × 2. Flattening gives 18 values. A dense output layer with three class scores uses 18 × 3 weights and three biases, or 57 parameters.
This toy model therefore has 77 parameters across those two learned layers; the stated ReLU, pooling, and flattening operations add none. The calculation illustrates shape and parameter accounting, not an architecture recommendation or a claim that the model has learned useful recognition.
Illustrative case study
Fictional case: Image Quay develops a CNN to recognize reusable containers. Training photographs place each container type against a different colored backdrop. The test split is drawn randomly from the same photography sessions, so early results appear encouraging.
When staff photograph containers on mixed backgrounds, predictions become unreliable. The team creates an evaluation split that separates sessions and backgrounds, then reviews the data-collection design. No revised accuracy is claimed. The case illustrates that a CNN can learn the statistical cues available to it even when those cues do not match the intended object identity.
Common misconceptions and mistakes
A CNN does not understand an image in the same way a person does. Successful classification alone does not establish semantic understanding or reliable behavior outside the tested conditions.
Convolution does not guarantee invariance to every shift, rotation, or scale change. Stride, boundaries, pooling, training examples, and later layers influence the result.
Pooling and dense layers are common components, but they are not mandatory in every CNN. Many architectures organize their outputs differently.
Finally, high accuracy on a convenient random split can hide leakage or shared capture conditions. The split must reflect the intended use and likely sources of variation.
Business use
Start a CNN project by defining the prediction and its operational consequences. A model that assigns one label per image solves a different problem from a model that must locate a defect precisely. Set evaluation criteria accordingly.
Plan representative data collection, including difficult cases, background changes, and expected image quality. Compare with suitable pretrained or simpler baselines before committing to custom training. At deployment, preserve preprocessing and track performance under changing conditions. The practical value comes from dependable task behavior within a maintained workflow, not from the architecture's reputation alone.
People also ask
Can CNNs process data other than images?
Yes. Convolution can be applied along one, two, or more dimensions when local structure and parameter sharing are appropriate.
Does every CNN need a dense classification layer?
No. The output design depends on the task; some networks produce spatial outputs or use other aggregation methods.
Are CNN filters manually specified?
In ordinary neural training, their values are learned. Fixed filters may be deliberately included, but that is not required by the architecture.
Check your understanding
A CNN recognizes products accurately only against the backgrounds used in training. What should the team investigate before calling it reliable product recognition?
Answer: Whether it relies on background cues, and how it performs on independently collected images with varied backgrounds. The evaluation must isolate the intended object distinction from accidental capture conditions.
Related terms
- Convolutional layer
- Feature map
- Kernel
- Pooling
- Receptive field
- Data augmentation
- image classification
- semantic segmentation
Learn next
trace the worked model's shapes after every operation and explain why filter sharing limits its parameter count. Then design a test split for a real image task that separates relevant capture sessions, objects, or environments rather than relying only on random image selection.
More in Deep learning
- Contrastive Hebbian learning - Contrastive Hebbian learning is a neural learning approach that adjusts connections using differences between activity relationships in two network states.
- Contrastive Learning - Contrastive learning trains a representation by comparing examples and encouraging relationships that match a defined notion of similarity.
- Convolutional deep belief network - A convolutional deep belief network, or CDBN, is a hierarchical probabilistic model that combines deep belief network ideas with convolutional weight sharing.
- Cover's theorem - Cover's theorem, in pattern recognition, concerns the capacity of linear decision surfaces to separate labeled points and how nonlinear feature...
- Deconvolutional Network - A deconvolutional network, in the historical sense used by the supplied ontology, is an unsupervised model that learns hierarchical image representations by...
- Deep Active Learning - Deep active learning combines deep neural models with a process for selecting which examples should receive labels next.
Sources
TensorFlow, Convolutional Neural Network tutorial: https://www.tensorflow.org/tutorials/images/cnn — primary documentation consulted for a convolutional base, activations, pooling, and classification training.
Google, Machine Learning Glossary: https://developers.google.com/machine-learning/glossary#convolutional_neural_network — primary terminology reference. The worked architecture and fictional case are original teaching examples; they do not reproduce the tutorial's model or report experimental performance.
Previous: Convolutional layer Next: Convolutional operation