Deep Learning
Deep learning is a branch of machine learning that uses neural networks with many layers. These layers learn representations directly from data, making deep learning especially useful for images, language, audio, and multimodal systems.
What is a kernel or filter in a CNN?
A kernel or filter in a CNN is a small matrix of learnable weights that slides across an input to detect local patterns. The terms kernel and filter are often used interchangeably, although in some contexts a filter may refer to the full set of kernels applied across all input channels. How it works Suppose a CNN uses a 3 × 3 kernel on an image. The kernel is placed over a small 3 × 3 region of the input. Its values are multiplied with the corresponding input values, and the results are added together. This produces one output value. The kernel then moves to the next position and repeats the operation: Input region × Kernel weights → Sum → Feature map value What does a kernel learn? During training, the values inside the kernel are learned automatically. Different kernels can learn to respond to different patterns, such as: Horizontal or vertical edges Corners Textures Color transitions More complex visual patterns in deeper layers Why are multiple filters used? A convolutional layer usually contains many filters. Each filter produces its own feature map, so the layer can detect several different types of patterns from the same input. For example: Input → Filter 1 → Feature map 1 Input → Filter 2 → Feature map 2 Input → Filter 3 → Feature map 3 Why are filters efficient? The same filter weights are reused across different positions of the input. This weight sharing greatly reduces the number of parameters compared with connecting every input value to every neuron. For the broader operation, see “What is convolution in deep learning?” . For how filters are used inside a layer, see “What is a convolutional layer?” . In short, a kernel or filter is a small learnable set of weights that scans an input to detect local patterns and create feature maps.
What is stride in a convolutional neural network?
Stride in a convolutional neural network (CNN) is the number of positions a filter moves across the input each time it performs a convolution. It controls how densely the filter scans the input and directly affects the size of the resulting feature map. How stride works If the stride is 1, the filter moves one position at a time: Position 1 → Position 2 → Position 3 → ... If the stride is 2, the filter moves two positions at a time: Position 1 → Position 3 → Position 5 → ... A larger stride means the filter examines fewer positions. How does stride affect output size? Smaller stride: produces a larger feature map and preserves more spatial detail. Larger stride: produces a smaller feature map and reduces computation. For example, using a larger stride can downsample an image or feature map without using a separate pooling layer. Why is stride important? Stride affects: The spatial resolution of feature maps. The amount of computation required. How much detail is preserved. How quickly the network reduces image width and height. Most convolutional layers use a stride of 1 when preserving spatial detail is important, while a stride such as 2 is often used when downsampling is desired. Stride works together with kernel size and padding to determine the output dimensions of a convolutional layer. For related concepts, see “What is a kernel or filter in a CNN?” and “What is padding in a CNN?” . In short, stride controls how far a convolutional filter moves at each step, affecting both the size of the output feature map and the amount of computation performed.
What is padding in a CNN?
Padding in a CNN means adding extra values around the border of an input before applying a convolution. It is mainly used to control the spatial size of the output feature map and to make sure edge pixels are not ignored too quickly. Why is padding needed? Without padding, a convolutional filter can only be placed where it fits completely inside the input. As a result, the output becomes smaller after each convolution. For example, applying a 3 × 3 filter to a 5 × 5 input with stride 1 and no padding produces a 3 × 3 output. What happens with padding? Padding adds extra values around the border, commonly zeros. A simplified example is: Original input → Add border values → Apply convolution This allows the filter to process locations near the edges more fully. Common padding types Valid padding: no padding is added, so the output becomes smaller. Same padding: enough padding is added so the output usually keeps the same height and width when stride is 1. Why does padding matter? Padding can help: Preserve spatial dimensions across convolutional layers. Keep information near image boundaries. Give architects more control over feature map size. Allow deeper CNNs to avoid shrinking spatial dimensions too quickly. Padding works together with kernel size and stride to determine the output dimensions of a convolutional layer. For related concepts, see “What is a kernel or filter in a CNN?” and “What is stride in a convolutional neural network?” . In short, padding adds extra border values around an input so convolution can better handle edge regions and control the size of the resulting feature map.
What is a feature map in a CNN?
A feature map in a CNN is the output produced when a convolutional filter is applied across an input. Each feature map shows where a particular learned pattern appears and how strongly the filter responds at different spatial locations. How is a feature map created? A convolutional filter slides across the input and computes a response at each position. Those responses are arranged into a new grid: Input → Filter → Feature map If a convolutional layer contains multiple filters, it produces multiple feature maps. For example: Filter 1 may respond strongly to vertical edges. Filter 2 may respond to horizontal edges. Filter 3 may respond to textures or other local patterns. Each filter therefore contributes a different channel to the layer’s output. What happens in deeper layers? Early feature maps often represent simple visual patterns such as edges and color transitions. Deeper feature maps can represent more complex structures formed by combining information from earlier layers. A simplified progression is: Edges → Textures → Shapes → Higher level features Why are feature maps important? Feature maps allow a CNN to preserve where useful patterns appear while progressively transforming raw input into more meaningful representations. Their spatial size is affected by settings such as kernel size, stride, and padding . For related concepts, see “What is a kernel or filter in a CNN?” , “What is stride in a convolutional neural network?” , and “What is padding in a CNN?” . In short, a feature map is the spatial output of a convolutional filter, showing where the learned pattern represented by that filter is detected in the input.
How do CNNs recognize objects in images?
CNNs recognize objects in images by learning a hierarchy of visual features , starting with simple local patterns and gradually combining them into more complex representations. 1. Early layers detect simple patterns The first convolutional layers usually learn features such as: Edges Corners Color transitions Simple textures These patterns are detected by learned filters and represented as feature maps. 2. Deeper layers combine features As information moves through deeper layers, the network combines simple patterns into more complex structures. A simplified progression is: Pixels → Edges → Textures → Shapes → Object level features For example, a network recognizing a cat may gradually learn patterns related to fur, ears, eyes, and overall shape. 3. Spatial information is progressively summarized Convolutions, activation functions, and operations such as pooling or strided convolution transform the feature maps while preserving the most useful information. This allows the network to become less sensitive to small shifts while focusing on stronger patterns. 4. Final layers make the prediction After the CNN has extracted high level features, the final layers convert those representations into class scores or probabilities. For image classification, the class with the strongest final prediction may be selected as the model’s output. How does the CNN learn these features? The filters are not manually programmed. During training, backpropagation adjusts their weights so the network becomes better at reducing its loss on labeled examples. For the building blocks, see “What is a kernel or filter in a CNN?” , “What is a feature map in a CNN?” , and “How does a CNN work?” . In short, CNNs recognize objects by learning increasingly complex visual features across layers and using the final learned representation to predict what the image contains.
What is image classification in deep learning?
Image classification is a deep learning task where a model looks at an image and predicts which class or category the image belongs to. For example, given an image, the model might predict: Cat Dog Car Airplane How image classification works A deep learning model, often a Convolutional Neural Network (CNN), processes the image and learns visual patterns from the pixels. During training, the model sees labeled examples such as: Image → Correct class It learns to associate visual features with the correct category. What happens during prediction? When a new image is provided, the model produces scores or probabilities for the possible classes. For example: Cat: 0.85 Dog: 0.10 Rabbit: 0.05 The class with the highest score is typically selected as the prediction. What does the model learn? Early layers may learn simple features such as edges and textures, while deeper layers combine those features into more complex visual patterns. This is why CNNs are commonly used for image classification. See “How do CNNs recognize objects in images?” for the feature learning process. Where is image classification used? Common applications include: Medical image categorization Product recognition Plant or animal species identification Document and scene classification Quality inspection Image classification predicts a label for the whole image . It is different from object detection, which also identifies where objects are located. In short, image classification assigns an image to one of several predefined categories based on visual patterns learned from labeled training examples.
What is object detection in deep learning?
Object detection is a deep learning task that identifies what objects are present in an image and where they are located . Unlike image classification, which assigns a label to the whole image, object detection can find multiple objects and usually draws a bounding box around each one. What does an object detector predict? For each detected object, the model typically predicts: Class: what the object is. Location: where the object appears, usually as bounding box coordinates. Confidence score: how certain the model is about the detection. For example: Person → bounding box → 0.94 confidence Car → bounding box → 0.88 confidence How does object detection work? A deep learning model first extracts visual features from the image, often using a CNN or another vision backbone. It then uses those features to predict object classes and locations. Modern detectors are commonly grouped into approaches such as: One stage detectors: predict objects directly in a single detection pipeline. Two stage detectors: first generate candidate regions and then classify and refine them. Examples of object detection model families include YOLO, SSD, and Faster R CNN. Where is object detection used? Common applications include: Autonomous driving Surveillance Robotics Retail analytics Medical imaging Industrial inspection Object detection is different from image segmentation , which predicts object regions at the pixel level rather than only placing bounding boxes around them. For the whole image task, see “What is image classification in deep learning?” . The pixel level task is covered separately in “What is image segmentation in deep learning?” . In short, object detection finds and classifies multiple objects in an image while also predicting where each object is located.
What is image segmentation in deep learning?
Image segmentation is a deep learning task that assigns a class or label to individual pixels in an image. Instead of only identifying what is present in the image, segmentation also shows the exact region occupied by an object or category. How image segmentation works A segmentation model takes an image as input and produces a pixel level output, often called a segmentation mask . For example: Input image → Segmentation model → Pixel level mask Pixels belonging to the same object or class are grouped together in the output. Main types of image segmentation Semantic segmentation: assigns every pixel to a class, such as road, car, sky, or person. Instance segmentation: separates different objects even when they belong to the same class. For example, if an image contains three people: Semantic segmentation labels all three as person. Instance segmentation distinguishes person 1, person 2, and person 3 separately. How is segmentation different from classification and object detection? Image classification: predicts a label for the whole image. Object detection: predicts object classes and bounding boxes. Image segmentation: predicts object or class regions at the pixel level. This makes segmentation useful when precise object boundaries matter. Where is image segmentation used? Common applications include: Medical imaging Autonomous driving Satellite and aerial imagery Robotics Industrial inspection Background or foreground separation For related tasks, see “What is image classification in deep learning?” and “What is object detection in deep learning?” . In short, image segmentation labels pixels so a model can identify not only what appears in an image, but the exact regions where objects or classes are located.
What is sequence modeling?
Sequence modeling is the process of building models that learn patterns from ordered data, where the position and order of elements matter. Examples of sequence data include: Words in a sentence Audio samples over time Stock or sensor measurements Events in a user activity history Why is sequence order important? In sequential data, the meaning of one element can depend on what came before or after it. For example, in the sentence: The dog chased the cat changing the word order changes the meaning. A sequence model therefore tries to capture relationships across different positions in the sequence. What can sequence models do? Sequence models can be used for tasks such as: Predicting the next element in a sequence Classifying an entire sequence Translating one sequence into another Forecasting future values Generating text or audio Common sequence modeling architectures Different neural network architectures can model sequences, including: RNNs LSTMs GRUs Transformers RNN based models process sequence information recurrently, while Transformers use attention to model relationships between sequence positions more directly. For the recurrent approach, see “What is a recurrent neural network (RNN)?” . For the attention based approach, see “What is the attention mechanism?” . In short, sequence modeling is the task of learning relationships in ordered data so a model can understand, predict, classify, or generate sequences.
What is sequence-to-sequence learning?
Sequence to sequence learning is a deep learning approach that maps one input sequence to another output sequence. It is useful when both the input and the output are ordered sequences, and their lengths may be different. Simple example In machine translation: English sentence → Model → French sentence The input sequence and output sequence contain different words and may have different lengths. How does sequence to sequence learning work? A traditional sequence to sequence model often has two main parts: Encoder: reads the input sequence and converts it into an internal representation. Decoder: uses that representation to generate the output sequence step by step. A simplified flow is: Input sequence → Encoder → Internal representation → Decoder → Output sequence Modern sequence to sequence systems often use attention so the decoder can focus on the most relevant parts of the input while generating each output element. Where is sequence to sequence learning used? Common applications include: Machine translation Text summarization Speech recognition Question answering Conversational systems What architectures are used? Sequence to sequence models can be built with: RNNs LSTMs GRUs Transformers Transformer based sequence to sequence models are widely used because attention lets them model relationships across the sequence without relying only on recurrent processing. For the general idea of ordered data, see “What is sequence modeling?” . For the architectural pattern, see “What is an encoder decoder architecture?” . In short, sequence to sequence learning transforms one ordered sequence into another, commonly using an encoder to understand the input and a decoder to generate the output.