Saturday, 20 December 2025

Introduction to Artificial Intelligence – Training a Simple Model

 



Introduction to Artificial Intelligence – Training a Simple Model

Artificial Intelligence can sound mysterious, but at its heart it’s built on ideas students already know: patterns, data, graphs, and feedback. In this introduction, we strip AI back to first principles by training a very simple model—no coding background required.


What do we mean by “training” an AI model?

Training is simply the process of showing a computer examples, letting it make predictions, and then correcting it when it gets things wrong. Over time, those corrections improve its accuracy.

Think of it like teaching a student to estimate the height of a tree from its shadow:

  • You give several examples (shadow length → tree height)

  • The student guesses

  • You say how far off they were

  • They adjust their method next time

That loop—predict → check → adjust—is the core of machine learning.


A simple example: predicting exam scores

Imagine we want to predict a student’s exam score based on hours of revision.

Hours of revisionExam score (%)
140
250
360
468
575

We might start with a simple rule:

Score = (hours × 10) + 30

This is our model. It won’t be perfect, but it gives us a starting point.


How the model learns

  1. Make a prediction
    For 3 hours:
    Predicted score = (3 × 10) + 30 = 60%

  2. Compare with the real result
    Actual score = 60%
    Error = 0 (perfect!)

  3. Adjust if needed
    If predictions are consistently too high or too low, we tweak the numbers.

After many examples, the model settles on values that minimise the overall error. That process—reducing error step by step—is called training.


Key ideas students should remember

  • Data: The examples we train the model on

  • Model: A rule or equation that makes predictions

  • Prediction: The model’s output

  • Error (loss): How wrong the prediction is

  • Training: Repeating predictions and corrections to reduce error

At GCSE and A-Level, this links directly to:

  • Graphs and lines of best fit

  • Averages and spread

  • Iterative improvement

  • Cause-and-effect reasoning

AI is not magic—it’s applied maths and logic at scale.


Why this matters in school science and maths

Understanding how a simple model learns helps students:

  • Demystify headlines about “AI taking over”

  • See real-world applications of algebra and graphs

  • Develop critical thinking about data quality and bias

  • Build confidence with modern technology

At Hemel Private Tuition, we often teach AI ideas using familiar experiments and datasets, so students focus on understanding—not buzzwords.


The Next Step: Training a Model to Classify Images (Cats vs Dogs)

Once students understand training a simple numerical model, the natural progression is to ask:

Can a computer learn from pictures instead of numbers?

Yes—and this is where image classification comes in.


What does “classifying images” mean?

Image classification means teaching a computer to look at an image and decide which category it belongs to.

In our example, there are just two classes:

  • 🐱 Cat

  • 🐶 Dog

The model’s job is simple:

Given a new image, decide whether it is more likely to be a cat or a dog.


Step 1: Images must become numbers

Computers don’t “see” images the way we do.
An image is actually a grid of pixels, and each pixel has numbers attached to it.

For a colour image:

  • Each pixel has Red, Green, and Blue (RGB) values

  • Each value is usually between 0 and 255

So an image becomes a very large table of numbers.

This links nicely to:

  • Matrices in maths

  • Grids and coordinates

  • Data representation in computer science


Step 2: The model looks for patterns, not animals

The model is not told what a cat or dog is.

Instead, during training it starts to notice patterns such as:

  • Fur texture

  • Edges and shapes

  • Ear positions

  • Contrast between background and subject

Early layers might detect:

  • Straight and curved lines

  • Light vs dark regions

Later layers combine these into more complex features.

At school level, you can explain this as:

The computer learns which patterns usually appear in cat photos and which appear in dog photos.


Step 3: Training works just like before (predict → check → adjust)

The training loop is exactly the same idea as before:

  1. Show the model an image

  2. Model predicts: “cat” or “dog”

  3. Check the label (we already know the correct answer)

  4. Calculate the error

  5. Adjust the model slightly

This is repeated thousands of times using many images.

The only difference from the simple maths model:

  • The model has many more adjustable values

  • The maths happens automatically behind the scenes


Step 4: Testing with new images

Once trained, the model is tested using images it has never seen before.

This is crucial:

  • A model that memorises training images is useless

  • We want generalisation, not memory

Example output:

  • Cat: 92%

  • Dog: 8%

The model chooses the highest probability.


Key concepts students should remember

TermMeaning
Training dataImages the model learns from
LabelsThe correct answers (cat / dog)
FeaturesPatterns the model detects
ModelThe system making predictions
Accuracy% of correct classifications
OverfittingWhen a model memorises instead of learning

Why cats vs dogs is such a good teaching example

  • Clear, familiar categories

  • Easy to understand success and failure

  • Shows limits of AI (misclassified images are often interesting)

  • Links maths, computing, biology (vision), and ethics

Students quickly realise:

AI doesn’t understand animals — it recognises patterns in data.


Classroom-friendly ways to explore this (no coding required)

  • Sort printed images by hand → discuss “features”

  • Use an online image classifier demo

  • Compare correct vs incorrect classifications

  • Change the dataset and see accuracy change

  • Discuss bias (e.g. only fluffy cats, only small dogs)

This fits beautifully into:

  • GCSE Computer Science

  • A-Level Computer Science

  • STEM enrichment sessions

  • Cross-curricular maths & science lessons


The big idea

Training an image classifier is just a scaled-up version of what students already know:

Patterns → predictions → feedback → improvement

Once that clicks, AI stops being intimidating—and starts being understandable.

No comments:

Post a Comment

Introduction to Artificial Intelligence – Training a Simple Model

  Introduction to Artificial Intelligence – Training a Simple Model Artificial Intelligence can sound mysterious, but at its heart it’s buil...