Image classification: a human-computer approach
About this lesson
In this learning sequence we explore the classification of images typically undertaken by an artificial intelligence (AI). One group of students creates images (representing a dataset) while another group of students creates rules (representing a machine learning algorithm) to classify the images, simulating the process of training an AI to classify images based on patterns.
Year band: 5-6
Curriculum Links AssessmentCurriculum Links
Technologies – Digital Technologies
Years 5–6
Design algorithms involving multiple alternatives (branching) and iteration AC9TDI6P02
Define problems with given or co-developed design criteria and by creating user stories AC9TDI6P01
Explain how digital systems represent all data using numbers AC9TDI6K03
Assessment
Achievement standard
By the end of Year 6, students develop and modify digital solutions and define problems and evaluate solutions using user stories and design criteria. They process data and show how digital systems represent data, design algorithms involving complex branching and iteration, and implement them as visual programs including variables.
Refer to Assessment task: Feral cat spotter [Word]
Learning map and outcomes
Learning intention
In order to understand the basic concept of how machine learning algorithms classify images, students explore patterns in data (images) and how they can be used to create rules (algorithms) that help classify new images.
Success criteria
Students will be able to:
- Explain the process of classifying images using machine learning.
- Create simple rules based on visual patterns to classify images.
- Apply these rules to classify new images accurately.
- Reflect on the similarities between their activity and how AI algorithms learn to classify images.
Preparation and materials
- Paper cut into card size for drawing images and writing labels
- Large sheets of paper and markers for the ‘Algorithms’ team to create rules
- Teaching slides to support this lesson.
Learning hook
Start with a relatable example to spark curiosity and connect to the broader concept of AI and image classification. Examples could include the following:
- A giraffe can be identified by its unique spot pattern.
- A person can unlock their phone using their face.
Animal recognition example: connection to AI
Explain that AI can learn to recognise patterns in images. Scientists can use images of giraffes taken in the wild and submitted by the public to monitor the population.
Facial recognition example: connection to AI
Help students understand that facial recognition in smartphones uses AI algorithms to analyse features like the distance between eyes and the shape of the face to create a unique ‘map’ of each person's face. This map is then compared to the stored map to unlock the device.
Learning input
Use this activity to begin to show how computers can be trained to recognise and classify images, just like humans can.
You can use the Teaching slides to support this lesson.
Train an AI to recognise birds
Ask students to draw simple pictures of birds on a small piece of paper and display them for the class to view. Prompt students, using questioning, to notice that even though the birds all look different, they have common features. Ask students what common features they notice. Expect responses such as beak, wings, tail, feathers and two legs.
Explain that an AI is trained on datasets to identify patterns. In this example, the training data is labelled ‘Bird’. The computer learns by using a special network made up of layers.
We can envisage an artificial neural network to look like this (slide5):
Slide 5: An artificial neural network. Courtesy, Digital Technologies Institute
This network consists of the following main parts:
Imagine the Eye is like a camera that takes a picture. This picture will be used by the computer to figure out the image.
This part is like a messenger. It takes the information from the Eye and sends it to the next layers of the system.
The first part is the Input layer. It takes the picture from the Eye and breaks it down into tiny dots called pixels.
Next is the Hidden layer. This is where the computer does some thinking. It looks for patterns in the picture to understand what it might be seeing. Each box here is like a tiny brain cell that helps with the thinking process.
The final part is the Output layer. It has boxes labelled ‘Bird’ and ‘Something Else’. These boxes will light up to show what the computer thinks it sees in the picture.
The lines connecting the nerve cells are like roads. They carry information from one part of the system to another. Some lines are of a different colour, showing that some information is more important or different.
These layers can learn to detect edges and basic shapes, which can help in identifying the outline of a beak or a wing. As the network goes deeper (this means it has more than one hidden layer), it learns to recognise more complex features and patterns, which could include specific textures or shapes associated with beaks, wings or other parts of a bird.
Image: Display of students’ bird drawings
Next display a typical picture of a bird. Ask students if they think the AI would predict that this is a bird.
Next show a bird not contained in the dataset, for example, a penguin. Ask students to decide if the AI trained on their dataset would predict that this is a bird. Ask them to explain their reasons. The AI might predict with a lower level of confidence that this is a bird.
Representations of a typical bird
Representations of a penguin
Images: Representations of a typical bird and a penguin
Learning input and construction
Use this activity to model the process of training an AI to recognise and classify images.
Explain that students will take on the role of a ‘human computer’ to model the process an AI carries out to classify images and predict what it ‘sees’.
Organise students into groups of four. Two students are the ‘Images’ team; the other two are the ‘Algorithm’ team.
Explain that the first part of the process is to create the training data.
- The Images team chooses 3–4 simple images to draw, such as a cat, dog, car, and tree. They draw these images on separate cards. They draw at least five examples of each, each on its own card.
- The Algorithms team then creates labels for each image group (‘cat’, ‘dog’, ‘car’, ‘tree’) on separate cards.
Explain that this next part of the process is training the AI.
- The Algorithms team uses the images and labels to identify distinguishing features (cats have whiskers, cars have wheels, trees have leaves). Based on these features, they create simple rules (if it has whiskers and triangle-shaped ears, it's a cat, if it has branches and leaves it’s a tree) and write them on large sheets of paper.
- While the Algorithm team is creating their rules for these images, the Images team is drawing variations of the original images, for example, different types of dogs and cats in different stances, different cars, and trees of different sizes. These are the ‘new’ images
Explain that this next part of the process is testing the AI.
- The Images team presents new images to the Algorithms team.
- The Algorithms team uses their rules to classify the new images.
- Discuss any misclassifications and refine the rules if necessary.
Differentiation (support)
- Provide ready-made images for students who have limited fine motor skills and find drawing an image challenging.
- Adjust groupings based on students' abilities and interests, ensuring that each group has a mix of strengths to support collaboration and learning from one another.
Differentiation (extension)
- Suggest that students choose images of similar objects, for example, car, bike, scooter and ambulance or kangaroo, wombat, koala and possum. Writing rules for similar objects can be more challenging.
- Write rules focused around the shape, for example: Is it ‘L-shaped’ with small circles at the bend and one end? If yes, I predict it is a scooter.
- Add a level of certainty to their prediction, for example: Is it made up of a small rectangle on top of a larger rectangle with a circle near each end? I predict that it is a car with a medium level of certainty.
Reflection
Lead a discussion on the activity, asking questions such as:
- How did creating rules help the Algorithms team classify the images?
- What challenges did the Algorithms team face in classifying the images?
- How is this activity similar to the way computers classify images using machine learning?
Explain that in our example we only used a small dataset. An AI is trained on a vast dataset and learns patterns from a diverse range of images to ensure accurate and reliable classification.
Follow up with the video Introduction to AI and machine learning.
Why is this relevant?
Having separate Images and Algorithms teams represents the distinct stages in the machine learning process. By separating these roles, the activity demonstrates the basic concept of how machine learning works: the algorithm learns patterns from the training data (images) to make predictions or classifications on new data.
- Images team: represents the dataset used to train the machine learning algorithm. In real-world scenarios, this dataset would consist of many labelled images. In the activity, the Images team creates a small set of images (for example, drawings of a cat, dog, car and tree) for the Algorithms team to learn from.
- Algorithms team: represents the machine learning algorithm. They study the images and labels provided by the Images team to identify patterns and create rules for classifying images. In a real machine learning scenario, this corresponds to the training phase, where the algorithm learns from the labelled dataset.
Resources
- Paper and markers to draw images
- Video: Introduction to AI and machine learning
- Giraffe spotter project
- Teaching slides
- Assessment task: Feral cat spotter [Word]