CT017-3-1-IAI& Introduction to Artificial Intelligence
NLP COMPUTER VISION AND NEURAL NETWORK
(MACHINE LEARNING)
Module Code & Module Title Slide Title SLIDE 1
TOPIC LEARNING OUTCOMES
At the end of this topic, you should be able to:
1. Explain the concept of machine learning (ML)
2. Explain the concept of natural language processing (NLP)
3. Name at least one (1) process of NLP
4. Name all the layers of the basic structure of a neural network
5. Explain the concept of Convolutional Neural Networks (CNNs)
Module Code & Module Title Slide Title SLIDE 2
CONTENTS & STRUCTURE
1. Machine Learning (ML)
2. Natural Language Processing (NLP)
3. Natural Language Processing Process
4. Simple Neural Network
5. Convolutional Neural Networks (CNNs)
Module Code & Module Title Slide Title SLIDE 3
Recap From Last Lesson
• Write a Prolog predicate sibling(X, Y) which is true if X and Y are siblings. Assume
you have a parent predicate parent(P, C) which is true if P is a parent of C.
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 4
Recap From Last Lesson…cont.
• Answer
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 5
Machine Learning (ML)
• Machine Learning (ML) is a transformative branch of artificial intelligence (AI) that
focuses on developing systems that learn from and make decisions based on data.
• Unlike traditional programming, where humans explicitly define the rules,
• ML allows a system to learn and evolve based on experience.
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 6
Machine Learning (ML)…cont.
How does machine learning work?
• Data Ingestion: The first step in ML is gathering and preparing a dataset. This data
can be in various forms like text, images, or numbers.
• Model Training: Using algorithms, the machine is trained on this data. This process
involves the machine making predictions and adjustments until it can accurately
interpret and process the data.
• Testing and Validation: The model’s accuracy is tested using a separate set of data.
This step ensures the model can generalize its learning to new, unseen data.
• Deployment: Once validated, the model is deployed into a real-world environment
where it continues to learn and make decisions.
Module Code & Module Title Slide Title SLIDE 7
Machine Learning (ML)…cont.
Types of machine learning
1. Supervised Learning: The machine learns from labeled data, making predictions
based on known input-output pairs.
2. Unsupervised Learning: Here, the machine uses unlabeled data to find patterns and
relationships.
3. Reinforcement Learning: The system learns to make decisions by performing
actions and observing the results.
Module Code & Module Title Slide Title SLIDE 8
Machine Learning (ML)…cont.
Applications of machine learning
1. Personalized Recommendations: Used by companies like Netflix and Amazon to
suggest products or movies.
2. Fraud Detection: Financial institutions use ML to detect unusual patterns indicative
of fraudulent activities.
3. Natural Language Processing: Powers virtual assistants like Siri and Google
Assistant.
4. Healthcare: Used for predictive diagnostics and personalized medicine.
Module Code & Module Title Slide Title SLIDE 9
Natural Language Processing (NLP)
• Natural Language Processing (NLP) is a field of artificial intelligence that focuses on
the interaction between computers and human language.
• It involves enabling computers to understand, interpret, and generate human language
in a valuable and meaningful way.
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 10
Natural Language Processing (NLP)…cont.
• Some key aspects of NLP:
• Language Understanding: NLP involves the understanding of spoken or written
language. This includes tasks like speech recognition, sentiment analysis, and
language translation.
• Natural Language Generation: It involves generating natural language
from data. This can include tasks like summarizing a long
document, generating responses in a conversation, or
creating written content.
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 11
Natural Language Processing (NLP)…cont.
• Some key aspects of NLP:
• Machine Learning: NLP extensively uses machine learning algorithms to learn from
and adapt to human language patterns. The more data these algorithms are exposed to,
the better they become at understanding and generating language.
• Applications: Common applications of NLP include chatbots,
voice assistants like Siri and Alexa, automatic translation
services like Google Translate, and text analytics tools used
in business intelligence.
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 12
Natural Language Processing (NLP) Process
• The Natural Language Processing (NLP) process typically involves several stages,
each designed to handle different aspects of understanding and processing human
language.
• Here's a breakdown of these stages:
1. Text Preprocessing
2. Feature Extraction
3. Model Building
4. Natural Language Understanding
5. Natural Language Generation
6. Evaluation and Refinement
7. Application Integration
8. Continuous Learning Image credits: google.com
Module Code & Module Title Slide Title SLIDE 13
Natural Language Processing (NLP) Process…cont.
Text Preprocessing:
• Tokenization: This involves breaking down text into smaller units (like words).
• Normalization: This step includes converting text to a standard format (like
lowercasing).
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 14
Natural Language Processing (NLP) Process…cont.
Text Preprocessing:
• Lemmatization and Stemming: These processes reduce words to their base or root
form.
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 15
Natural Language Processing (NLP) Process…cont.
Text Preprocessing:
• Stop Word Removal: Frequently occurring words (like "the", "is", "at") which don't
add much semantic value are removed.
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 16
Natural Language Processing (NLP) Process…cont.
Text Preprocessing:
• Part-of-Speech Tagging: Each word in the text is assigned a part of speech (like noun,
verb, adjective).
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 17
Quick Review Question
What is the process of text pre-processing called?
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 18
Natural Language Processing (NLP) Process…cont.
Feature Extraction:
• Vectorization: This involves converting text into a numerical format so that it can be
processed by machine learning algorithms. Common methods include Bag-of-Words,
TF-IDF (Term Frequency-Inverse Document Frequency).
• Word Embeddings: Techniques like Word2Vec, GloVe, or BERT embeddings are used
to capture contextual relations between words.
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 19
Natural Language Processing (NLP) Process…cont.
Model Building:
Machine Learning Algorithms: Depending on the task (like classification, sentiment
analysis), various algorithms like Naive Bayes, SVM, or neural networks are used.
Training and Testing: The model is trained on a labeled dataset and then tested on
unseen data.
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 20
Natural Language Processing (NLP) Process…cont.
Natural Language Understanding:
Syntax Analysis: Understanding the grammatical structure of sentences.
Semantic Analysis: Deriving meaning and interpreting the context of sentences.
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 21
Natural Language Processing (NLP) Process…cont.
Natural Language Generation:
Text Generation: Based on the understanding, the system can generate human-like text.
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 22
Natural Language Processing (NLP) Process…cont.
Natural Language Generation:
Summarization: Creating concise summaries of larger text documents.
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 23
Natural Language Processing (NLP) Process…cont.
Evaluation and Refinement:
• Accuracy Assessment: Measuring the performance of the NLP model with metrics
like precision, recall.
• Error Analysis and Model Tuning: Refining the model to handle cases where it
doesn't perform well.
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 24
Natural Language Processing (NLP) Process…cont.
Application Integration:
• Implementation: Integrating the NLP model into applications like chatbots, voice
assistants, or text analytics tools.
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 25
Natural Language Processing (NLP) Process…cont.
Continuous Learning:
Feedback Loop: Incorporating user feedback and new data to continuously improve the
model's performance over time.
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 26
Quick Review Question
How many stages involves in natural language processing?
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 27
Neural Network
• A neural network layer is a fundamental building block of a neural network, which is
a computational model inspired by the way biological neural networks in the human
brain process information.
• A basic neural network has interconnected artificial neurons in three layers:
1. Input Layer
2. Hidden Layer
3. Output Layer
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 28
Neural Network …cont.
• A basic neural network has interconnected artificial neurons in three layers:
Input Layer
• Information from the outside world enters the artificial neural network from the input
layer. Input nodes process the data, analyze or categorize it, and pass it on to the next
layer.
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 29
Neural Network …cont.
• A basic neural network has interconnected artificial neurons in three layers:
Hidden Layer
• Hidden layers take their input from the input layer or other hidden layers. Artificial
neural networks can have a large number of hidden layers. Each hidden layer analyzes
the output from the previous layer, processes it further, and passes it on to the next
layer.
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 30
Neural Network …cont.
• A basic neural network has interconnected artificial neurons in three layers:
Output Layer
• The output layer gives the final result of all the data processing by the artificial neural
network. It can have single or multiple nodes. For instance, if we have a binary
(yes/no) classification problem, the output layer will have one output node, which will
give the result as 1 or 0. However, if we have a multi-class classification problem, the
output layer might consist of more than one output node.
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 31
Quick Review Question
How many layers are there in a simple neural network?
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 32
Convolutional Neural Networks (CNNs)
• Convolutional Neural Networks (CNNs) are a type of deep learning model primarily
used for processing data with a grid-like topology, such as images.
• The primary purpose of Convolutional Neural Networks (CNNs) is to process data
that has a grid-like topology, such as images, by automatically and adaptively learning
spatial hierarchies of features from the input data.
• These features can range from simple edges to complex objects.
Module Code & Module Title Slide Title Image credits: google.com
SLIDE 33
Convolutional Neural Networks (CNNs) …cont.
Some specific purposes and applications of CNNs:
Image Classification: CNNs are extensively used to identify objects, people, scenes,
and actions in images. They can classify images into various categories and are the
backbone of many image recognition systems.
Object Detection and Localization: Beyond just classifying images, CNNs can also
detect the presence and location of multiple objects within a single image, labeling them
with bounding boxes and classifying their types.
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 34
Convolutional Neural Networks (CNNs) …cont.
Some specific purposes and applications of CNNs:
Image and Video Analysis: CNNs are used in video surveillance, activity recognition,
and computer vision tasks in movies and media, such as applying visual effects.
Facial Recognition: They can identify and verify individuals based on their facial
features in photographs and videos, which is a critical component in security systems
and in various consumer applications like unlocking smartphones.
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 35
Convolutional Neural Networks (CNNs) …cont.
Some specific purposes and applications of CNNs:
Medical Image Analysis: In healthcare, CNNs help in analyzing various types of
medical images (like X-rays, MRIs) for diagnostics, detecting anomalies such as tumors
or fractures.
Autonomous Vehicles: CNNs are employed in self-driving cars for visual perception
tasks like detecting pedestrians, road signs, and other vehicles to navigate safely.
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 36
Convolutional Neural Networks (CNNs) …cont.
Some specific purposes and applications of CNNs:
Natural Language Processing: Although primarily used for image data, CNNs have
also been adapted for processing sequential data like text and speech for tasks such as
sentence classification, sentiment analysis, and language translation.
Enhancing and Restoring Images: They are used in applications like enhancing image
quality, colorizing black and white images, and restoring damaged photographs.
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 37
Convolutional Neural Networks (CNNs) …cont.
Some specific purposes and applications of CNNs:
Augmented and Virtual Reality: CNNs contribute to the real-time processing of
images and videos in augmented and virtual reality applications, enhancing the user
experience.
Robotics: In robotics, CNNs assist in object recognition and navigation, allowing robots
to interact intelligently with
their environment.
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 38
Convolutional Neural Networks (CNNs) …cont.
Some specific purposes and applications of CNNs:
Augmented and Virtual Reality: CNNs contribute to the real-time processing of
images and videos in augmented and virtual reality applications, enhancing the user
experience.
Robotics: In robotics, CNNs assist in object recognition and navigation, allowing robots
to interact intelligently with
their environment.
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 39
Quick Review Question
Name one (1) application of CNNs
Image credits: google.com
Module Code & Module Title Slide Title SLIDE 40
Question and Answer Session
Module Code & Module Title Slide Title SLIDE 41
Module Code & Module Title Slide Title SLIDE 42
Summary / Recap of Main Points
• ML, an important subfield of AI, focuses specifically on the ability of machines to
learn from data, make predictions and improve decision making over time.
• NLP is a branch of artificial intelligence that focuses on enabling machines to
understand, interpret, and respond to human language.
• Computer Vision is the field of AI that trains computers to interpret and understand
the visual world.
Module Code & Module Title Slide Title SLIDE 43
Summary / Recap of Main Points
• Neural Networks are a set of algorithms, modeled loosely after the human brain,
designed to recognize patterns.
• CNNs are a specialized type of neural network used primarily for processing data that
has a grid-like structure, such as images.
Module Code & Module Title Slide Title SLIDE 44
Wha To Expect Next Week
What
In Class Preparation for Class
• NLP Computer Vision and Neural • Searching Methods in AI
Network (Machine Learning) • AI
Module Code & Module Title Slide Title SLIDE 45