Machine Learning

Convolutional Neural Network (CNN)

A convolutional neural network is a deep learning model that scans images with small learned filters to detect edges, textures, and shapes, making it the standard architecture for visual recognition tasks.

What is a convolutional neural network?

A convolutional neural network (CNN) is a neural network designed for data arranged in a grid, above all images. Instead of connecting every pixel to every unit, it slides small filters across the image. Each filter is a few pixels wide and learns to respond to one local pattern, such as a vertical edge or a patch of a particular color. The output of a layer of filters is a set of feature maps showing where each pattern appears.

Stacking layers builds from simple to complex. The first layer finds edges, the next combines them into corners and textures, and later layers respond to parts such as a bottle cap or a weld seam. Pooling layers shrink the maps between stages so the network tolerates small shifts in position, and a final set of fully connected layers turns the features into a decision.

How a convolutional neural network works

The filters are the learned weights. During training on labeled images, backpropagation adjusts each filter until the patterns it detects are useful for the task. Because one filter is reused across the whole image, a CNN has far fewer parameters than a fully connected network of the same reach and learns from fewer examples. The same idea applies to one-dimensional data such as vibration signals, where the filter slides along time, and to three-dimensional medical scans.

Convolutional neural networks in practice

A bottling line fills forty thousand bottles an hour. A camera above the conveyor photographs each cap, and a CNN trained on a few thousand labeled images classifies it as sealed, cross-threaded, or missing. The model was fine-tuned from a network pre-trained on ImageNet, which cut the labeling effort from months to days. It runs on an industrial computer beside the line and triggers a rejector within the time the bottle takes to travel one meter. In healthcare, the same architecture marks suspicious regions on pathology slides for a pathologist to review first.

What to watch for

  • Lighting, camera position, and product changes alter the images, so collect training data under production conditions and retrain when the line changes.
  • Rare defects need deliberate collection or synthetic examples, because a model that has seen three cracked caps cannot learn what cracks look like.
  • Ask for results on images from a different day or shift, since models score well on pictures taken in the same session as the training set.

← Back to AI Glossary