0% found this document useful (0 votes)
13 views

Satellite Instructions

Uploaded by

Rutuja Bhagat
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)
13 views

Satellite Instructions

Uploaded by

Rutuja Bhagat
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/ 3

Machine Learning Lab

(UE22CS352A)
Introduction
A Convolutional Neural Network (CNN) is a specialized type of artificial neural network designed
for processing grid-like data, particularly well-suited for tasks involving images and videos. CNNs
have been pivotal in the field of computer vision, driving advancements in image classification,
object detection, facial recognition, and more. At their core, CNNs employ convolutional layers
that apply filters to localized regions of input data, enabling them to extract hierarchical
features, starting from simple edges and textures and progressing to more complex shapes and
objects.

These networks also incorporate pooling layers to down sample feature maps and introduce
non-linearity through activation functions like ReLU. Typically, fully connected layers are used
for final predictions. CNNs can have varying depths with many layers, facilitating the learning of
intricate patterns.

PyTorch is a top choice for CNNs due to its simplicity, dynamic computation graph for flexible
model design, strong community support, and GPU acceleration, making it ideal for efficient and
effective development of CNN-based applications.

Task:
Complete the code for the functions whose skeleton has been provided.

You are provided with the following files:

1. CAMPUS_SECTION_SRN_Lab9.py
2. Test.py

CNN.py:
This file contains the following functions:

Function Name Input Output

__init__ self Initializes the CNN layers

forward x: tensor (image) Output after passing through


all layers
train model: CNN object, Trains the CNN and returns
train_loader: DataLoader the train accuracy

evaluate model: CNN object, Evaluates the model and


test_loader: DataLoader returns test accuracy and loss

You are expected to implement the architecture by completing the TODO sections
in the CAMPUS_SECTION_SRN_Lab9.py file

Test.py:
1. This will help you check your code.
2. Rename the file appropriately
3. Run the command python3 Test.py --ID CAMPUS_SECTION_SRN_Lab9.

Dataset:
The dataset you will work with is the Satellite Image Classification dataset, which contains
images of 4 different classes which includes cloudy areas, desert areas, green areas and water
bodies. There are about 1500 images per class. The CNN will apply convolutional layers, pooling
layers, and fully connected layers, and output the predicted class.

Important Points:
1. Do not make changes to the function definitions provided to you. Use the skeleton as it has
been given.
2. Do not modify the test file. Run it as is.
3. The functions must be designed to be independent of the dataset schema. Avoid hardcoding
values.
4. You may write additional helper functions.
5. You must use PyTorch to implement the CNN.

Submission Guidelines:
You are required to submit the following:

1. The Python solution file: CAMPUS_SECTION_SRN_Lab9.py


2. Screenshot of the test cases (all test cases in one screenshot):
CAMPUS_SECTION_SRN_Lab9.png

Please ensure that you remove all print statements before submission. Failing hidden test cases
will result in partial marks. The provided test cases are for reference only, and hidden test cases
will be similar.

You might also like