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.
How does a computer recognise a shark from a dolphin or weeds from native wetland plants?
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)
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)
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.
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.
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).
Image: (Wanderer butterfly greenadelaide.sa.gov.au)
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.
Up to this point we have used whole numbers to represent colour.
Computers use binary numbers which is made up of only 1s and 0s.
Use this Code.org Pixelation tutorial to explore how binary numbers can be used to represent colour in pixels. The initial tutorial starts with black (0) and white (1).
Take a step further moving from 0 and 1 to show greyscale (shades of black and white). To do this you need to select two bits per pixel (see image) with each cell able to be represented as 00, 01, 10 or 11. This enables black, dark grey, light grey and white).
Image: Code.org Pixel example: Koala represented in grey scale
Have students share what they have learnt about AI and how images can be represented with whole numbers.
This lesson focuses on:
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.