Skip to main content
Skip to main content

AI and image recognition

Integrating Digital Technologies
Years 5-6

This lesson plan enables students to explore how computer vision, a subset of artificial intelligence (AI), is used in digital systems to recognise and classify an object with a certain level of confidence.

AI is the ability of machines to mimic human capabilities in a way that we would consider 'smart'. For a smart computer to ‘see’, it uses a combination of a camera as its ‘eyes’ and computer vision to understand and predict what it is seeing. It is very difficult for a computer to recognise objects accurately.

This lesson builds on How can an AI recognise what is sees? It focuses on image recognition that involves feature extraction, object detection and classification, and introduces the idea that computers store and use data using 0s and 1s.

This lesson was developed in collaboration with Dr Karsten Schulz, Digital Technologies Institute.


 



Learning hook

Introduction to image recognition

  1. Pose the question: How does a computer see? How does it know the difference between one object and another?

    Students write and draw their ideas.

  2. Discuss ways in which a machine can be considered smart as it performs human-like behaviours such as recognising speech, text, images and being able to reason.
  3. View the video Artificial Intelligence Explainers: Video 2: AI in our everyday life. It includes an example of an AI-based app that provides a person who is vision impaired with a commentary of objects in their immediate surroundings. The app uses the camera to ‘see’ and computer vision to recognise the objects.
  4. Other examples to get students to think creatively include:
    • Shark spotting: A drone fitted with a camera and using an AI system can spot a shark and send data to beach patrols to warn swimmers in the area. How might it tell a shark from a dolphin?
    • Weed spotting in Kakadu National Park: View the video about a project that combines Indigenous knowledge and AI technology. Para grass, an invasive weed, is choking precious wetlands. With the help of drones and AI technology, Traditional Owners are able to target these weeds and manage country. How does the AI in the drone know a weed from a wetland plant?
  5. Brainstorm ways an AI, using computer vision can help solve problems.

Discussion

How does a computer recognise a shark from a dolphin or weeds from native wetland plants?

  • When training an AI, images of the objects to be classified would be used through the process of supervised learning. Supervised learning is the process of the human providing the program with lots of examples of the object we want to identify, along with a label.
  • For an easy to understand explanation of this refer to the video Artificial Intelligence Explainers: Video 1: Introduction to AI & machine learning.
  • When referring to students’ brainstormed AI powered solutions, discuss what types of data would be required.

Learning input

What does a computer actually see?

Use this animated GIF sequence of zooming in on an image of a kangaroo to reveal RGB colour coding.

In reality, a computer sees images as individual picture elements (pixels). Use this pixel viewer to show that an image is made up of pixels. Each colour pixel in the image is made up of numbers that represent the colour as a combination of Red-Green-Blue (RGB). So the computer recognises a kangaroo, for example, based on a pattern of pixels and complex mathematical algorithms.

No wonder it is such a challenge for a computer to recognise an object accurately!

Image: Pixel viewer screen capture: Kangaroo – the zoom-in on the right image shows RGB for each pixel)


Learning demo

Data can be represented using whole numbers

  1. Provide students with a 5 x 7 grid and ask them to work out a way to code the squares in the grid so that someone else can represent the image.
  2. In pairs, students share each other’s code and see if they can re-create the image.

    Image: Image of 4 emojis represented as 5 x 7 pixels (black and white)

  3. Discuss the various ways used to code the image.

    Discuss that computers use 1s and 0s for all information in digital systems, text, images and audio.

  4. View this video, created by Byran Franklin, a teacher from Torrens Valley Christian School who created the resource to learn about binary numbers and representing 0 and 1 as black and white. The approach uses a spreadsheet, incorporating the skills of conditional formatting (if cell equals) and formatting cells.

Learning construction

Represent an object using coloured pixels

  1. Pose the question: How would an AI system represent an object?

    Explain that an AI would look for patterns. The patterns it sees in an image are made up of pixels (picture elements).

    In this task, students represent an image of an object as a pattern of pixels. The process is best done with a spreadsheet but can also be completed unplugged with a grid (e.g. 10 cm x 10 cm).

  2. Demonstrate three ways to represent an image by pixel. Each cell is a pixel. Each cell is colour coded. Share this pixel art of a butterfly represented in:
    • black and white (Black = 0, White = 1)
    • greyscale (Black = 0, Dark grey = 2, Light grey = 3, White = 1)
    • colour (Black = 0, White = 1, Light orange = 2, Dark orange = 3).

    Image: (Wanderer butterfly greenadelaide.sa.gov.au)

  3. Using a spreadsheet such as MS Excel, Number for iOS or Google Sheets, introduce how to use conditional formatting to automatically represent black and white if a cell contains either 0 or 1.

    The conditional formatting is ‘cell is equal to a value’. The same process can be repeated for other colours.

    Download this file for students to investigate conditional formatting.

    • A cell that contains a 0 (zero): format to be represented as a black (fill black)
    • A cell that contains a 1 (one): format to be represented as white (fill white)

Discussion

Have students share what they have learnt about AI and how images can be represented with whole numbers.

  • Discuss how well they represented an object using different coloured pixels using black and white only, greyscale (shades of grey, black and white) or a range of colours.
  • If using a spreadsheet to automate the process, what did they learn?
  • What did students learn about pixel size and the quality of the representation? (Smaller pixels enable a higher quality representation.)

Why is this relevant?

This lesson focuses on:

  • image recognition
  • classification.

In Digital Technologies, representing data refers to the way data is symbolised, visually treated or provided in audio. For students in years 5–6, the focus is on how data is represented using whole numbers. Using AI and image recognition provides a useful context to explore data representation. Representing data as whole numbers is a pre-cursor to representing numbers in binary (1 and 0s).

Image recognition is an area of AI that has many applications. For a computer to recognise what it sees, it needs input of data through a camera and some form of processing. Classification is a supervised learning technique used to group data based on attributes or features. Humans can provide labels on the data input for images. The machine then matches future data based on the similarity of the new data to predefined groups. Examples of the groups could be cars, traffic signals, people or bicycles.

Resources

  • Download this file for students to investigate conditional formatting.
  • Download this file for students to investigate conditional formatting and representing an image using coloured pixels (cells).
  • Find out more about conditional formatting and pixel art from the Deep Dive 2 recorded webinar (Primary).