6.3 Artificial intelligence (AI)

← Topic 6.2 RoboticsComputer Science contentsTopic 7.1 The program development life cycle →
Chapter 6 · Automated and emerging technologies

6.3 Artificial intelligence (AI)

Artificial intelligence is concerned with computers simulating intelligent human behaviour. For this topic, you need to understand the main characteristics of AI, recognise different categories of AI, and explain how expert systems and machine learning work.

Cognitive functionsNarrow, general & strong AIExpert systemsKnowledge & rules basesInference engineMachine learningDeep-learning extension

What you need to understand

The textbook treats AI as a combination of rules and data with the ability to reason, learn and adapt. Do not confuse AI with robotics: many robots simply repeat programmed physical tasks, while AI can exist entirely as software. In exam questions, identify what information the system uses, how it processes that information, and how the system learns or reaches a conclusion.

6.3.1

Introduction

Artificial intelligence (AI) is a branch of computer science concerned with simulating intelligent human behaviour using a computer. The source links this to the cognitive functions of the human brain: the mental processes used to gain knowledge and understanding through thought, experience and the senses.

AI systems can be measured against human abilities such as reasoning, speech and sight. The aim is not simply to carry out a fixed sequence of instructions, but to use data and rules in ways that imitate aspects of intelligent behaviour.

Key idea: AI is not the same as robotics. A physical robot may or may not contain AI, and an AI system does not need a physical robot body.
Check the meaning of AI and cognitive behaviour.
6.3.2

Characteristics of AI

The source describes AI as a collection of rules and data combined with the ability to reason, learn and adapt to external stimuli.

Narrow AI

A machine performs better than a human at one specific task.

General AI

A machine performs at a level similar to a human when doing a specific task.

Strong AI

A machine performs better than a human in many tasks.

Reasoning, learning and adaptation

Reasoning means drawing conclusions from given data or situations. The textbook uses deductive reasoning as an example: correct facts are built into rules, and those rules are then applied to other problems.

An AI system can improve by carrying out a sequence of steps, learning from the result and applying what it has learned when it meets the same or a new situation. This allows it to adapt to its surroundings. AI can also identify patterns in large amounts of data and use those patterns to make predictions.

Examples of AI

Textbook Figure 6.21 Smart home devices
Textbook Figure 6.22 Chatbots
Textbook research note: the source mentions the Turing Test as a method for testing a machine’s ability to match human intelligence, but it does not explain the test in detail within this topic.
Check AI categories, reasoning and examples.
6.3.3

AI systems

The textbook concentrates on two AI systems: expert systems and machine learning.

Expert system

A computer system that imitates the decision-making of a human expert by using stored knowledge and inference rules.

Machine learning

Training a computer with sample data so it can make predictions about new, unseen data without being specifically programmed for every new case.

Expert systems

An expert system is designed to mimic human knowledge and experience. It uses stored knowledge together with inference to solve a problem or answer a question that would normally require a human expert.

For example, in medical diagnosis the system can ask a sequence of questions about symptoms. Each answer affects the next question. The system compares the answers with its stored knowledge, applies rules, reaches a possible diagnosis and can provide suggested actions. The source also notes that an expert system may give a probability showing how confident it is in its conclusion.

Examples of expert-system applications

Advantages and disadvantages

AdvantagesDisadvantages
Can provide a high level of expertise and high accuracy.Users may need considerable training to use the system correctly.
Produces consistent results.Setup and maintenance can be expensive.
Can store very large quantities of facts and ideas.Responses may feel impersonal or inappropriate in some medical situations.
Can produce traceable logical solutions and diagnoses.The result is only as good as the facts and information stored in the system.
Can combine knowledge from several areas of expertise.Users may wrongly assume the system can never be wrong.
Usually gives a much faster response than waiting for a human expert.
Can provide unbiased analysis of the stored facts and give a probability for a proposed conclusion.

Structure of an expert system

Textbook Figure 6.23 Expert system structure

User interface

The method by which the user communicates with the expert system. The interaction may use dialogue boxes, prompts or other input methods. Questions are often Yes/No and depend on previous responses.

Inference engine

The main processing element. It gathers information from the user, searches the knowledge base for relevant data and applies inference rules from the rules base to reach a conclusion.

Knowledge base

A repository of facts about an area of expertise. The source describes it as a collection of objects and their attributes.

Rules base

A set of inference rules used by the inference engine. These rules commonly use logical IF … THEN … statements to connect facts and draw conclusions.

Explanation system

Shows the reasoning behind the system’s conclusion or recommendation. The textbook notes that the explanation system is shown in the figure but is not explicitly required by the syllabus.

Objects, attributes and inference rules

The knowledge base can store objects together with attributes that describe them. A sequence of answers can narrow down which object matches the evidence. The rules base then provides logical rules such as:

Example rule: IF continent = “South America” AND language = “Portuguese” THEN country = “Brazil”.

Setting up an expert system

  1. Gather information from human experts or reliable written sources.
  2. Create and populate the knowledge base.
  3. Create the rules base containing inference rules.
  4. Set up the inference engine that applies the rules and makes reasoned conclusions.
  5. Develop the user interface so the user and system can communicate.
  6. Test the system with cases whose outcomes are already known, compare the results and make any necessary changes.

Example: medical diagnosis

Textbook Figure 6.24 Use of an expert system

The input screen gathers symptoms by asking questions. The inference engine compares the responses with the knowledge base and applies the rules base. Once a match is found, the system can give the probable diagnosis, possible treatment or next steps. The output may be text or images, and the user can ask for more information to narrow the result.

Check expert-system structure and operation.

Machine learning

Textbook Figure 6.25 AI family

Machine learning is a sub-set of AI in which algorithms are trained using examples and learn from past experience. After training, the system can make predictions or decisions using new data. A major strength is the ability to process and analyse very large, complex data sets much faster than a person could.

Search engines learning from previous results

Textbook Figure 6.26 Search engine success or failure

A search engine can treat a result as successful when the user finds the required page near the top of the results, and less successful when the user must continue to later pages. By learning from previous searches, the search engine can improve which results it places first.

AI compared with machine learning

Artificial intelligenceMachine learning
Represents simulated intelligence in machines.Gets machines to make decisions by learning from data rather than being specifically programmed for every case.
Aims to build machines capable of behaving or thinking in human-like ways.Aims to train systems from acquired data so they can solve new problems.

Example 1: categorising email as spam

  1. Collect data about emails, such as message content, headers and sender information.
  2. Clean the data by removing unnecessary items such as common stop words and punctuation.
  3. Identify useful patterns, for example words that frequently occur in spam messages.
  4. Train a model using a data set of emails already known to be spam or not spam.
  5. Evaluate, fine-tune and then test the model using live messages.

Example 2: recognising a user’s buying history

The textbook describes collaborative filtering: the system compares the buying behaviour of customers. If two customers have made similar choices, the system can use those similarities to recommend an item one customer bought to the other customer. The same general idea can be used when generating a music playlist from previous preferences.

Example 3: detecting fraudulent activity

Textbook Figure 6.27 Machine learning model development
  1. Data collection: gather customer and transaction data, for example through a survey or web scraping.
  2. Data cleaning: remove redundant or poor-quality data that could lead to unreliable predictions.
  3. Exploration and analysis: identify the useful patterns and features in the data.
  4. Building a model: train the algorithm using real examples of purchasing behaviour.
  5. Model evaluation: test the model with known data and known outcomes, then modify it if it does not meet the required criteria.

After training, the system can flag unusual behaviour that differs from a customer’s normal pattern and may indicate fraud.

Textbook Figure 6.28 Expert-system question path

Figure 6.28 appears in the end-of-topic activity and reinforces how expert-system questions can branch according to earlier answers.

Check machine learning and its applications.

Extension: deep learning

The textbook includes this as an A Level extension, rather than a core IGCSE requirement. Deep learning is a sub-set of machine learning that organises algorithms into layers to form an artificial neural network. The network contains an input layer, one or more hidden layers and an output layer. The hidden layers process the input before it reaches the output.

Textbook extension artificial neural network diagram
Textbook extension pixel values used for deep learning

Artificial neural networks can be useful for complex visual tasks. The source gives face or object recognition as examples, where a system can analyse image pixels and learn patterns associated with an object. Large amounts of data are used to train the model. Known labelled data is then used for testing, and the network is adjusted until it gives sufficiently reliable outputs.

Textbook extension deep-learning training process

Machine learning compared with deep learning

Machine learningDeep learning
Uses algorithms to make decisions based on past data.Uses algorithms arranged as an artificial neural network.
Usually needs less training data than deep learning, although the amount can still be large.Typically requires very large training data sets.
Well suited to some classification tasks, such as spam email.Well suited to very complex non-linear tasks, such as visual processing.
Can solve a problem using separate modules that are later combined.Can solve a problem from beginning to end as one system.
May require less computing power for simpler tasks.Requires a large amount of computing power.
Testing can take a long time.The textbook states testing can take much less time.
Rules can make it clearer why each stage of a model was created.The system’s own internal reasoning may be difficult to explain, creating a “black box”.
Check the textbook deep-learning extension.

Topic 6.3 revision checklist

Define artificial intelligence and cognitive behaviour.
State that AI uses rules and data and can reason, learn and adapt.
Distinguish narrow AI, general AI and strong AI.
Explain how AI can learn from experience, identify patterns and make predictions.
Recognise examples including smart devices, chatbots, autonomous cars and facial-expression recognition.
Define an expert system and give suitable applications.
Discuss advantages and disadvantages of expert systems.
Explain the roles of the user interface, inference engine, knowledge base and rules base.
Explain objects, attributes and inference rules.
Describe how an expert system is set up and tested.
Explain how a medical expert system reaches and presents a diagnosis.
Define machine learning and distinguish it from AI in general.
Explain how search engines can learn from past results.
Explain machine-learning use in spam detection, buying recommendations and fraud detection.
Understand the model-development stages: collection, cleaning, analysis, building and evaluation.
Recognise deep learning as the textbook’s optional extension and explain the basic role of an artificial neural network.
Ready for a mixed Topic 6.3 check?
← Topic 6.2 RoboticsComputer Science contentsTopic 7.1 The program development life cycle →