Teaching an AI to recognise fractions
About this lesson
In this lesson plan, students represent fractions and use the Teachable Machine artificial intelligence (AI) to recognise quarter, half, three-quarters and full. This lesson was inspired by Libby Spencer, Classroom Teacher, Pilgrim School, South Australia.
Year band: 3-4
Curriculum LinksCurriculum Links
(AC V9.0)
Digital Technologies
Recognise different types of data and explore how the same data can be represented differently depending on the purpose AC9TDI4K03
Use the core features of common digital tools to create, locate and communicate content, following agreed conventions AC9TDI4P06
Use the core features of common digital tools to share content, plan tasks, and collaborate, following agreed behaviours, supported by trusted adults AC9TDI4P07
Identify what personal data is stored and shared in their online accounts and discuss any associated risks AC9TDI4P09
Mathematics
Year 3
Recognise and represent unit fractions, including 1 2 , 1 3 , 1 4 , 1 5 and 1 10 and their multiples in different ways; combine fractions with the same denominator to complete the whole AC9M3N02
Preparation
To begin this project, students will need some knowledge of fractions. Running this project after teaching a fractions unit as consolidation is recommended, but it could easily be conducted near the beginning.
Plan the fractions unit. For example, with this planning tool: https://www.mathematicshub.edu.au/search/fractions-year-3-planning-tool/
- Assess students’ prior knowledge. Ask: What is machine learning? What is artificial intelligence? Avoid prompting their answers at this stage – seeing what they have to say is often incredibly interesting.
- Discuss data representation, how data can be represented differently, and how AI recognises data. Talk about the storage of images and who has access to them, along with the ethics of AI.
Tools and resources needed:
- Teaching an AI to recognise fractions Slides (Powerpoint)
- White A4 paper
- Thick pointed colour markers – can be any colour, but images should initially be drawn in the same colour to avoid introducing a colour bias. Refer to the Learning reflection section at the end of this document for different colour options.
- Google Teachable Machine: Familiarise yourself with the Teachable Machine View the supporting videos.
- Note: Teachable Machine requires an internet connection, Google Chrome on Windows or Macintosh and a webcam. A version for iPad can be downloaded at TeachableMachine for mobile.
Image 1 shows the view of a project created in the Teachable Machine AI application. On the left, the classes are shown. Once the model is created and trained, a preview will be shown.
Image 1: Teachable Machine application screenshot
Safety
Privacy and personal information
Discuss the potential misuse of personal images when uploading images of ourselves or friends on websites. Instruct students not to record images of themselves or others via the webcam or uploading images.
The conditions of use for Teachable Machine state that images are not stored on external servers if the program is closed when completed and the project is not saved. If students close the tab, nothing is saved in their browser or on any servers. View the conditions when saving projects to the cloud on what data is stored and ‘who’ can view the model.
Risk assessment
Use this risk-assessment tool to assess risks and benefits before introducing any new online platforms or technologies.
Learning hook
Use the slides Teaching an AI to recognise fractions to guide the start of the lesson. Use slide 2 to demonstrate the Teachable Machine model that has been trained to recognise fractions represented as parts of a circle.
You will need a device with a camera, ideally connected to an interactive whiteboard to display to the class. Give students a brief demonstration and explain that they are going to teach an AI about fractions. Impress upon them that they will be the teacher and the AI will learn from them. Ask them how they would teach an AI to learn to recognise fractions. After a brief discussion outline the process of using images of a shape represented as a fraction.
Learning map and outcomes
In this lesson, students will:
- represent common unit fractions including 1 2 , 1 4 , 3 4 and 1 whole
- describe the process used to train a simple AI using machine learning and how it recognises fractions
- create, train and test their machine learning model using an online AI tool
- evaluate their model and describe how well it works.
Learning input
Use the slides 3–12 to outline the steps to train the AI model. Here is a summary of the steps:
- Select Get started, then select Image Project as students are teaching their AI based on images.
- For each Class add a label. For example, quarter, half, three-quarters and a whole. It is also useful to record a background for when no image is presented. These are the buckets into which students will be adding the training images via webcam.
- Select Webcam to record the correct images from the training images that students have cut into individual images. Record the images for each of their classes.
- When all images have been used for training, select Train Model.
- When training is complete select Preview. Students then test the model using the training images cut into individual images. If the model does not work as expected, students can retrain the model by adding their training images.
- Export Model enables students to have a copy of their model to refer to.
Learning construction
Give students access to Teachable Machine. They will need a device with a webcam. Remind students of safety and to avoid recording their image via the webcam. Working as a pair or small group is advisable to take turns and collaborate.
The first step is to create or collect data. Each pair or group needs to consider how they will teach their AI to recognise fractions. In the demonstration model, we trained the AI on full, half, quarter and three-quarters fractions using a circle as a representation. Each representation was drawn on an A4 sheet on white background.
Students may decide to use different representations. For example, they could use a square or a rectangle instead of a circle. They follow a similar process.
Students will notice that the AI will have a preference for one of the classes when no image is shown. This is often the case when a background (or control class) has not been added. Explain to students that they can add another class and call it ‘Background’. They record images of the background with no images or people in it and then retrain the model.
Differentiation
- Enabling prompts: How will you teach your AI about fractions? What data will you use to train your AI?
- Extending prompts: Can your AI recognise fractions represented as more than one shape? What data will you need to train the AI? What are the different ways the same data can be represented differently?
Once the students have tested their AI, they swap with another group to test each other’s AI.
With a partner, swap images and test the AI model with images representing common fractions. Observe the confidence bar. It tells us how well the AI believes it recognises the image. Is it correct? Is it certain? Are there cases when the AI is wrong? Students use a three-star or five-star rating and justify the rating they have given.
Optional: Some groups may want to test the AI on images it was not trained on to see what the AI recognises.
Learning reflection
Observe when the AI gets a result wrong. Discuss with the students what might be the underlying cause. Was the image shown in enough rotations? Was it too close or too far away from the camera? It is always possible to add more pictures to the AI classes and retrain the model.
Discuss the various representations used and their success.
- Discuss their use of different shapes, such as squares, rectangles, stars and circles.
- Refer to testing the AI. What happened if the AI model was tested with different shapes from those it was trained on? What does the AI do when it comes across a shape it has not been trained on? Is it biased towards the shape on which it was trained? Discuss the importance of training an AI on a diverse range of data to avoid bias.
- Does colour play a significant role in how well the AI detects a fraction? Can an AI that is trained on, for example, blue shapes, recognise yellow shapes? Again, it will most likely have a bias towards the colour it was trained on.
- What if the AI were trained with the wrong data (for example, full circle classified as half circle)?
Also discuss how we used the AI tool safely. What protocols did we set up to make sure an image of our face is not recorded by the webcam?