0% found this document useful (0 votes)
6 views7 pages

Unit 4 Deep Learning Model:: Introduction To Cnns

Uploaded by

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

Unit 4 Deep Learning Model:: Introduction To Cnns

Uploaded by

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

UNIT 4 Deep Learning Model:

Introduction to CNNs:
1. What is CNN?

A Convolutional Neural Network (CNN) is a type of deep learning model,


mainly used to analyze images and videos. CNNs help computers recognize
patterns in visual data, making them great for things like identifying objects in
photos or detecting faces. By scanning an image with small filters (tiny grids),
CNNs can detect basic features like edges or colors and then combine these to
recognize more complex shapes and objects over time.

2. What are the Four Layers of CNN?

CNNs have four main types of layers that work together to recognize features
in images:

 Convolutional Layer: This layer applies filters (small grids) that move
across the image to detect features, like edges or colors, which are
called feature maps. This is how CNNs start to "see" parts of the image.
 Activation Layer: After the convolution layer, an activation function (like
ReLU, which replaces negative values with zero) is used. This adds
flexibility, allowing the CNN to learn more complex patterns.
 Pooling Layer: This layer reduces the size of the feature maps, making
the network faster and helping it focus on the most important parts.
Pooling keeps the main details but reduces the amount of data to
process.
 Fully Connected Layer: At the end, this layer takes everything the
network has learned about the image and uses it to make a final
decision, like identifying an object or classifying an image.

3. Why is the Pooling Layer Used in CNN?

The pooling layer is important because:


 It Reduces Data Size: Pooling makes the feature maps smaller, which
makes processing faster and uses less memory.
 Prevents Overfitting: Pooling helps reduce the chances that the network
will "memorize" details that aren't important, making it more reliable for
new images.
 Keeps Key Features: Pooling keeps the main parts of the data, so the
network can still recognize the most important features.

Pooling often keeps only the largest values in small sections of the feature map
(called max pooling). This helps CNNs focus on the strongest patterns, like
edges or textures, that are important for recognizing objects.

Explain CNN Architecture?

Convolutional Neural Network consists of multiple layers like the input layer,
Convolutional layer, Pooling layer, and fully connected layers.

A typical CNN architecture includes the following main layers, arranged in a


sequence:

1. Input Layer
 This is where the image data is fed into the network.
 The input is usually a 3D matrix with dimensions representing the
height, width, and color channels of the image (e.g., for a 32x32
RGB image, the input dimensions would be 32x32x3).
2. Convolutional Layer (Conv Layer)
 The first convolutional layer applies filters (small grids of numbers)
that slide across the input image.
 Each filter detects certain features, like edges or textures,
producing an output known as a feature map.
 The number of filters determines the depth of this layer's output.
For example, if there are 32 filters, the output will be a 32-channel
feature map.

3. Activation Layer
 After each convolution, an activation function (usually ReLU) is
applied to introduce non-linearity, allowing the network to learn
complex patterns.
 The ReLU(Rectified Linear Unit) function replaces all negative
values in the feature map with zero, making the model more
robust and easier to train.

4. Pooling Layer
 After some convolutional and activation layers, a pooling layer is
added to down sample the feature maps.
 Max pooling is common, where each filter takes the maximum
value in a small area, typically 2x2 or 3x3. This reduces the size of
the feature map and helps the network focus on the most
important features.
 Pooling makes the model faster and reduces the chances of
overfitting.
5. Flattening Layer
 After the final pooling layer, the feature maps are flattened into a
1D vector.
 This "flattened" vector is used as input for the fully connected
layers, allowing the network to make final predictions.
6. Fully Connected Layer (FC Layer)
 The fully connected layer takes the flattened vector and connects
it to a series of neurons (like a standard neural network layer).
 This layer combines the learned features to make the final
decision, like recognizing an object in the image.
7. Output Layer
 The output layer provides the final classification result.
 For a classification task, a softmax activation function is typically
used, which converts the output into probabilities for each class.
 If it's a binary classification, a sigmoid activation is often used to
get a probability score between 0 and 1.

What is a Pooling Layer and Explain types of Pooling


Layer?
1. Pooling is a key layer in Convolutional Neural Networks (CNNs) used to
reduce the size of feature maps generated by convolutional layers,
making it faster and more efficient to process images.
2. The pooling operation involves sliding a two-dimensional filter over each
channel of feature map and summarising the features lying within the
region covered by the filter.

For a feature map having dimensions nh x nw x nc, the dimensions of output


obtained after a pooling layer is

(nh - f + 1) / s x (nw - f + 1)/s x nc


where,
 nh - height of feature map
 nw - width of feature map
 nc - number of channels in the feature map
 f - size of filter
 s - stride length

Types of Pooling

There are different methods for summarizing information within each region,
and each type of pooling has a specific role in CNNs.

1. Max Pooling

 How it Works: For each small region, max pooling selects the largest
value (or most prominent feature).
 Purpose: It captures the strongest feature in each area, making the CNN
focus on the most critical parts, like edges and corners.
 When to Use: It’s especially helpful in tasks like object recognition,
where we want to capture the main details of an object.

2. Average Pooling

 How it Works: This pooling takes the average of all values in a region.
 Purpose: Instead of focusing only on the strongest feature, it considers
the overall information in the area, which can keep more context about
the image.
 When to Use: Average pooling is often used in tasks that need more
precise details, like image segmentation (separating objects in an image)
or object detection.
3. Global Pooling

 How it Works: Instead of pooling small regions, global pooling


summarizes each channel of the feature map into a single value (either
by taking the maximum or the average of the entire feature map).
 Purpose: It reduces the feature map to a very compact form, where
each channel ends up as just one value.
 When to Use: Global pooling is usually applied just before the final layer
in a CNN, to give a very high-level summary for the final decision.

CNN Application:

Convolutional Neural Networks (CNNs) are widely used in various fields due to
their powerful feature extraction capabilities. Here are some of the primary
applications of CNNs:

1. Image Classification

 Example: Classifying images into categories like cats, dogs, or flowers.


 Use Case: CNNs are highly effective at learning the unique features of
different objects, making them ideal for identifying objects in images
and sorting them into categories.

2. Object Detection

 Example: Detecting pedestrians, vehicles, or animals within images.


 Use Case: Used in real-time applications such as autonomous vehicles
and surveillance, CNNs help identify and locate objects within a scene by
learning patterns and distinguishing different parts of images.

3. Image Segmentation

 Example: Separating objects like people or cars from the background.


 Use Case: Commonly used in medical imaging, autonomous driving, and
satellite imagery, segmentation helps isolate regions in an image,
assisting in locating objects and their boundaries precisely.
4. Face Recognition

 Example: Unlocking phones or verifying identity through facial features.


 Use Case: CNNs can detect and compare facial features to recognize or
verify people. This is used in security systems, social media tagging, and
personalized advertising.

5. Medical Image Analysis

 Example: Detecting tumors, fractures, or other medical anomalies in


scans.
 Use Case: CNNs are used to analyze X-rays, MRIs, and CT scans, assisting
doctors in diagnosing diseases by identifying patterns in medical images,
such as detecting cancer cells or measuring organ sizes.

6. Self-Driving Cars

 Example: Detecting road signs, pedestrians, and lane markings.


 Use Case: In autonomous vehicles, CNNs help process real-time visual
data to make driving decisions. They detect and interpret road elements,
obstacles, and other vehicles, enabling the car to respond accordingly.

7. Weather Forecasting and Satellite Imaging

 Example: Detecting weather patterns in satellite images.


 Use Case: CNNs analyze weather maps and satellite images to identify
and predict patterns like hurricanes, cloud cover, and other
meteorological phenomena.

8. Gaming and Virtual Reality (VR)

 Example: Real-time object detection for gesture recognition in VR.


 Use Case: CNNs detect gestures and movements, enabling interactive
experiences in gaming and VR by recognizing user actions and
translating them into the virtual environment.

You might also like