Computer Science · Topic 10

Artificial Intelligence Fundamentals

Explore how artificial intelligence systems learn from data, recognize patterns, make predictions, generate content, and support decision-making.

1. What Is Artificial Intelligence?

Artificial intelligence (AI) is a field of computer science concerned with creating systems that perform tasks commonly associated with abilities such as perception, language processing, reasoning, planning, and decision-making.

Examples of AI

AI is a broad field. Not every automated program uses AI, and not every AI system learns from data after it has been deployed.

2. AI, Machine Learning, and Deep Learning

These terms are related, but they do not mean exactly the same thing.

Artificial Intelligence The broad field of building systems that perform tasks associated with intelligent behaviour.
Machine Learning A branch of AI in which systems learn patterns from data to make predictions, decisions, or representations.
Deep Learning A branch of machine learning that uses neural networks with multiple processing layers.
Artificial Intelligence
        |
        └── Machine Learning
                 |
                 └── Deep Learning

This diagram shows a common conceptual relationship. AI also includes approaches that do not rely on machine learning, such as rule-based reasoning and some search and planning methods.

3. How Does Machine Learning Work?

Machine learning uses data and an algorithm to build a model that can perform a task, such as classifying an image or estimating a value.

Collect data
     |
     v
Prepare and inspect data
     |
     v
Choose a model and learning method
     |
     v
Train the model
     |
     v
Evaluate on separate data
     |
     v
Deploy, monitor, and improve

Important terms

A model's output depends on its design, training data, and input. Training does not automatically guarantee that its predictions will be accurate.

4. Main Types of Machine Learning

Supervised learning

The model learns from examples containing inputs and known target answers.

Example: Training a model on labelled pictures of cats and dogs so it can classify new pictures.

Unsupervised learning

The model looks for structure or patterns in data without relying on labelled target answers for every example.

Example: Grouping customers into clusters based on similarities in their activity.

Reinforcement learning

An agent learns to choose actions by interacting with an environment and receiving rewards or penalties according to a defined objective.

Example: Training an agent to play a game by rewarding actions that improve its long-term score.
Type Learning signal Example task
Supervised Known target answers Classifying emails as spam or not spam
Unsupervised Patterns in data Grouping similar documents
Reinforcement Rewards from actions Learning a game-playing strategy

5. Neural Networks

An artificial neural network is a machine-learning model built from connected computational units commonly called neurons. These units combine inputs using adjustable parameters and activation functions.

Input layer
     |
     v
Hidden layer(s)
     |
     v
Output layer

Layers in a simple network

Training a neural network

During training, the network's predictions are compared with a training objective. An optimization method adjusts its parameters to reduce the chosen loss function.

A common training method for neural networks uses backpropagation to calculate gradients and an optimizer to update parameters.

Neural networks are inspired loosely by biological neurons, but artificial neurons are mathematical computational units, not realistic copies of brain cells.

6. Generative AI

Generative AI refers to AI systems that produce new content, such as text, images, audio, video, or computer code.

Examples of generated content

Text Explanations, summaries, drafts, and dialogue.
Images Illustrations, concept art, and visual designs.
Audio Speech, music, and sound effects.
Code Code suggestions, examples, and explanations.

Large language models

A large language model (LLM) is trained on large amounts of text and other suitable data to model patterns in language. Many LLMs generate text by predicting likely next tokens based on the context and their learned parameters.

A token may represent a word, part of a word, punctuation, or another unit of text. Tokens are not always the same as words.

Fluent language is not proof of factual accuracy. Generative AI can produce incorrect claims, invented references, or misleading explanations, so important information should be checked.

7. Algorithms Used in AI

Different problems require different algorithms. No single method is best for every AI task.

Choosing an algorithm involves considering the task, amount and quality of data, computational cost, interpretability, and how success will be measured.

8. Data Quality and Model Evaluation

The quality of data strongly influences what a model learns. Missing values, incorrect labels, unbalanced examples, and unrepresentative samples can lead to poor results.

Training, validation, and test data

Overfitting and underfitting

Overfitting The model learns details or noise in the training data and performs poorly on new examples.
Underfitting The model fails to capture important patterns, performing poorly even on the training task.

Common evaluation measures

Accuracy alone can be misleading when classes are highly imbalanced. The best evaluation measure depends on the real-world consequences of different kinds of errors.

9. AI Applications

Healthcare Supporting image analysis, research, and some clinical workflows under appropriate professional oversight.
Education Helping create practice material, explanations, and learning support.
Science Finding patterns in complex datasets and assisting research.
Agriculture Supporting crop monitoring, plant-disease detection, and resource planning.
Transport Estimating traffic, planning routes, and assisting driver-support systems.
Accessibility Supporting speech recognition, captions, translation, and image descriptions.

AI is most useful when its performance is appropriate for the task and its limitations are understood by the people using it.

10. Limitations and Responsible AI

AI systems can be powerful, but they also have limitations. Responsible development includes evaluating their effects on people and society.

Important challenges

Good practices when using AI

11. Knowledge Check

Try answering each question before revealing the answer.

1. What is the relationship between AI, machine learning, and deep learning?

AI is the broad field, machine learning is one branch of AI, and deep learning is a branch of machine learning that uses neural networks with multiple layers.

2. What is the difference between supervised and unsupervised learning?

Supervised learning uses examples with known target answers. Unsupervised learning looks for patterns or structure without requiring target labels for every example.

3. What does a model learn during training?

Depending on the method, it adjusts parameters or constructs a representation that captures useful patterns from the training data.

4. What is generative AI?

AI that generates content such as text, images, audio, video, or code.

5. What is overfitting?

When a model fits the training data too closely, including noise or accidental details, and struggles to generalize to new data.

6. Why should training and test data be kept separate?

A separate test set helps estimate how well the model performs on unseen data, provided it is not repeatedly used to tune the model.

7. Why should AI-generated information be verified?

AI systems can produce inaccurate or misleading outputs even when the responses sound convincing.

Key Takeaways