Ranjit_jadhav Term Work Sem-II
Ranjit_jadhav Term Work Sem-II
By
RANJIT CHANDRAKANT JADHAV (41648)
SEAT NO :
SEM II
PCP CENTER
[Shree Ram College of Commerce, Bhandup]
SUB : AI & ML
Module 1: Introduction to AI
1. What is Artificial Intelligence (AI)?
○ Intelligent agents perceive their environment and take actions to achieve specific
goals.
○ They can be simple reflex agents or more complex ones with learning
capabilities.
○ These agents use sensors to gather data and actuators to perform actions.
○ Environment refers to the context in which the agent operates, while actuators
and sensors are the mechanisms through which the agent interacts with and
perceives its environment.
○ Propositional logic deals with propositions that can either be true or false.
○ Logical connectives like AND, OR, and NOT are used to build complex
expressions.
○ BFS is an uninformed search algorithm that explores all nodes at the present
depth level before moving on to nodes at the next depth level.
○ DFS can get stuck in deep or infinite branches if not properly managed.
○ It's memory-efficient compared to BFS but may not find the shortest path.
3. What is the A algorithm?*
○ A* is a heuristic search algorithm that finds the shortest path from a start node to
a goal node.
○ It combines the cost to reach the node and the estimated cost to the goal.
○ A* uses a priority queue to explore nodes with the lowest total cost.
○ Hill Climbing is a heuristic search algorithm that continuously moves towards the
direction of increasing value to find the peak or goal state.
○ It can get stuck in local maxima, failing to find the global maximum.
○ Variants like Steepest-Ascent Hill Climbing and Stochastic Hill Climbing address
some of its limitations.
○ It's the simplest form of a neural network and serves as a building block for more
complex networks.
2. What is Backpropagation?
○ Backpropagation is a supervised learning algorithm used for training neural
networks.
○ It calculates the gradient of the loss function with respect to each weight by the
chain rule.
○ It involves taking repeated steps in the opposite direction of the gradient of the
function at the current point.
○ It's widely used in training neural networks and other machine learning models.
○ MLPs are feedforward artificial neural networks with multiple layers of neurons.
○ They can model complex relationships in data and are capable of learning
non-linear functions.
○ They are foundational to deep learning and have applications in various domains.
○ It classifies a data point based on the majority class of its k nearest neighbors.
○ The distance metric, such as Euclidean distance, is used to find the nearest
neighbors.
○ The Apriori Algorithm is used for mining frequent itemsets and learning
association rules in transactional databases.
○ It predicts the probability that an instance belongs to a particular class using the
logistic function.
○ Each tree is trained on a random subset of the data, and their outputs are
averaged for regression or voted on for classification.
○ The bias-variance tradeoff refers to the balance between bias (error due to overly
simplistic models) and variance (error due to overly complex models).
○ High bias can lead to underfitting, while high variance can lead to overfitting.
○ The goal is to find a model with both low bias and low variance.
○ It alternates between estimating the missing data (E-step) and optimizing the
parameters (M-step).
○ EM is used in clustering and density estimation.
○ It finds the hyperplane that best separates data points of different classes.
○ SVM can handle both linear and nonlinear classification using kernel functions.
○ It uses a kernel function to compute the inner product between two points in the
feature space.
○ Common kernel functions include linear, polynomial, and radial basis function
(RBF) kernels.
4. What is AdaBoost?
○ It is effective for binary classification tasks and can be adapted for multi-class
problems.
○ PCA is widely used for exploratory data analysis and preprocessing before
machine learning.
1. Storage Limitations
o Very high-quality images consume a lot of storage space, leading
to the need for external drives or cloud subscriptions.
2. Risk of Loss or Corruption
o Digital files can be accidentally deleted, corrupted, or lost due to
hardware failure.
3. Quality Degradation with Compression
o Formats like JPEG use compression that can reduce image quality,
especially after multiple saves.
4. Privacy Concerns
o Easy sharing can lead to unauthorized distribution or misuse of
personal images.
5. Dependence on Technology
o Viewing or editing requires electronic devices and software, unlike
printed photos which can be seen without any tools.
6. Cost of Equipment
o High-end cameras, editing software, and storage solutions can be
expensive.
7. Over-Reliance on Editing
o Sometimes excessive digital manipulation can result in loss of
originality or authenticity of images.
For example:
Applications of Hue:
Image editing software allows users to adjust the hue to change colors in
photographs.
Hue analysis is important in computer vision tasks like object detection
and tracking.
Example:
It explains why our eyes are very sensitive to edges — crucial for
recognizing objects.
In digital imaging, it can sometimes cause unwanted artifacts (false
bands) when smooth gradients are rendered.
1. Image Enhancement
o Improve the contrast and visibility of features in an image.
2. Image Analysis
o Understand the brightness and contrast distribution.
o Detect underexposed (too dark) or overexposed (too bright)
images.
1. Histogram Equalization
o Redistributes pixel intensities so that the histogram becomes
more uniform.
o Enhances the global contrast of an image, especially when the
usable data is concentrated in a narrow range.
2. Histogram Stretching (Contrast Stretching)
o Expands the range of intensity values to cover the full spectrum
(e.g., 0 to 255), improving contrast.
3. Histogram Specification (Matching)
o Adjusts an image so that its histogram matches a specified
histogram (useful in pattern recognition and medical imaging).
Example:
Formula:
H(u,v)=1−e−D(u,v)22D02H(u,v) = 1 - e^{-\frac{D(u,v)^2}{2D_0^2}}
Where:
o D(u,v)D(u,v) is the distance from the origin of the frequency plane,
o D0D_0 is the cutoff frequency.
Features:
o Smoothly removes low frequencies without sharp cut-offs.
o Avoids ringing artifacts (blurring around edges).
Formula:
H(u,v)=11+(D0D(u,v))2nH(u,v) = \frac{1}{1 +
\left(\frac{D_0}{D(u,v)}\right)^{2n}}
Where:
o nn is the order of the filter (controls the sharpness of transition),
o D0D_0 is the cutoff frequency.
Features:
o Provides a smoother transition than an ideal filter,
o Order nn controls the steepness of the filter roll-off
Types:
1. Preprocessing
o Cleaning the input image (noise removal, binarization, resizing).
o Aligning or normalizing characters.
2. Segmentation
o Separating individual characters or words from the background.
3. Feature Extraction
o Identifying important details such as strokes, curves, or edges that
represent the character shape.
4. Classification
o Matching the extracted features against known characters using
machine learning models (like SVMs, Neural Networks).
5. Post-processing
o Correcting minor errors using dictionaries, grammar rules, or
context.
Techniques Used:
Template Matching
o Comparing the character image to stored patterns.
Machine Learning Approaches
o Support Vector Machines (SVM)
o k-Nearest Neighbors (k-NN)
Deep Learning Approaches
o Convolutional Neural Networks (CNNs) are very effective,
especially for complex handwritten text.
Hidden Markov Models (HMMs)
o Used in recognizing cursive handwriting where characters are
connected.
Applications:
Digitizing historical documents
Automatic number plate recognition (vehicles)
Bank check processing
Handwritten note recognition on mobile devices
Passport, ID card scanning
Challenges:
Morphological operations are mainly used on binary images (black and white),
but they can also be extended to grayscale images.
1. Erosion (⊖)
o Function: Shrinks or thins objects in the image.
o Effect:
Removes small white noises.
Breaks apart narrow connections between objects.
o How:
The structuring element slides over the image and erodes
away boundaries of foreground (white) regions.
2. Dilation (⊕)
o Function: Expands or grows objects in the image.
o Effect:
Fills small holes and connects nearby objects.
o How:
The structuring element slides over the image and adds
pixels to the boundaries of foreground regions.
3. Opening (∘)
o Opening = Erosion followed by Dilation
o Function: Removes small objects or noise while keeping the
overall shape intact.
o Use: Smoothens the contour of objects and breaks narrow
bridges.
4. Closing (•)
o Closing = Dilation followed by Erosion
o Function: Fills small holes and gaps inside objects.
o Use: Useful for closing small breaks or gaps in the contours.
Structuring Element:
A small pattern (like a 3×3 square, cross, or circle) used to probe the
image.
The choice of structuring element size and shape affects the result of the
operation.