0% found this document useful (0 votes)
26 views3 pages

Data Warehouse

Uploaded by

Divya Zindani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views3 pages

Data Warehouse

Uploaded by

Divya Zindani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Convolutional Neural Networks (CNNs) are a class of deep learning algorithms widely used

for analyzing visual data such as images and videos. CNNs have shown exceptional
performance in computer vision tasks like image classification, object detection, and
segmentation. Unlike traditional neural networks, CNNs are specifically designed to
process grid-like data (such as images) through the use of convolutional layers that
preserve spatial relationships between pixels, allowing for efficient extraction of
hierarchical features.

#### 1. **Basic Architecture of CNNs**

A CNN consists of several types of layers that are stacked to build a complete model. The
core components of CNNs include:

- **Convolutional Layers**
- **Pooling Layers**
- **Fully Connected Layers**
- **Activation Functions**

##### a) **Convolutional Layer**

The convolutional layer is the fundamental building block of a CNN. It is responsible for
applying convolution operations to the input data. A convolution operation involves
sliding a filter (also called a kernel) over the input image and computing the dot product
between the filter and the input patch to generate a feature map.

Key aspects of the convolutional layer include:


- **Filter/Kernel**: A small matrix (e.g., 3x3 or 5x5) that is applied across the input image
to detect specific features such as edges, textures, and patterns.
- **Stride**: The step size by which the filter moves over the input. A stride of 1 means
the filter shifts by one pixel at a time. A larger stride reduces the size of the output feature
map.
- **Padding**: The process of adding extra pixels around the border of the input image to
ensure that the filter can cover the entire input, allowing the output size to remain the
same as the input. Common padding types include "valid" (no padding) and "same"
(padding added to preserve the input size).
For an image input \( I \) and a filter \( F \), the convolution operation is expressed as:
\[
S(i, j) = (I * F)(i, j) = \sum_m \sum_n I(i+m, j+n) \cdot F(m, n)
\]
where \( S(i, j) \) is the result of the convolution at position \( (i, j) \).

The output of the convolutional layer is a feature map (or activation map) that captures
local patterns from the input.

##### b) **Pooling Layer**

After the convolutional layer, a pooling layer is typically added to reduce the spatial
dimensions of the feature maps. This helps to decrease the computational load, reduces
the number of parameters, and controls overfitting by making the network more robust to
small shifts or distortions in the input data.

Two common types of pooling operations are:


- **Max Pooling**: The maximum value within a window (e.g., 2x2 or 3x3) is selected and
used in the output feature map. This operation captures the most prominent features
while reducing dimensionality.
- **Average Pooling**: The average of all values within the window is taken, producing a
smoother feature map compared to max pooling.

Pooling operations are applied independently to each feature map produced by the
convolutional layer, reducing the width and height while keeping the depth (number of
channels) the same.

##### c) **Fully Connected Layer**

After several convolutional and pooling layers, the high-level features extracted from the
input data are flattened into a 1D vector and passed through one or more fully connected
layers (dense layers). Each neuron in a fully connected layer is connected to every neuron
in the previous layer. These layers combine the extracted features to make predictions.

The fully connected layer operates similarly to a traditional neural network, where the
input is multiplied by weights, and a bias term is added:
\[
y = W \cdot x + b
\]
where \( W \) is the weight matrix, \( x \) is the input, and \( b \) is the bias.

The final layer of a CNN is often a fully connected layer followed by a softmax function to
produce class probabilities in classification tasks.

##### d) **Activation Functions**

Activation functions introduce non-linearity into the network, enabling it to model


complex relationships in the data. Common activation functions used in CNNs include:
- **ReLU (Rectified Linear Unit)**: The most widely used activation function in CNNs, ReLU
outputs \( \text{max}(0, x) \), ensuring that negative values are set to zero while keeping
positive values unchanged.
- **Sigmoid**: Outputs values between 0 and 1, often used in binary classification tasks.
- **Softmax**: Converts logits into probabilities, used in the output layer of multi-class
classification tasks.

You might also like