{"id":1042045,"date":"2022-08-10T10:17:38","date_gmt":"2022-08-10T14:17:38","guid":{"rendered":"https:\/\/www.prime-wow.com\/?p=1042045"},"modified":"2022-08-10T10:17:38","modified_gmt":"2022-08-10T14:17:38","slug":"classroom-activities-to-discuss-machine-learning-accuracy-and-ethics-hello-world-18","status":"publish","type":"post","link":"https:\/\/www.prime-wow.com\/?p=1042045","title":{"rendered":"Classroom activities to discuss machine learning accuracy and ethics | Hello World #18"},"content":{"rendered":"<p><em>In Hello World issue 18, available as a free PDF download, teacher Michael Jones shares how to use Teachable Machine with learners aged 13\u201314 in your classroom to investigate issues of accuracy and ethics in machine learning models.<\/em><\/p>\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"628\" data-id=\"78974\" src=\"https:\/\/www.prime-wow.com\/wp-content\/uploads\/2022\/08\/5999_HW_18_Web_Banner.jpg\" alt=\"Cover of Hello World issue 18.\" class=\"wp-image-78974\" \/><\/figure>\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"1577\" height=\"1386\" data-id=\"80925\" src=\"https:\/\/www.prime-wow.com\/wp-content\/uploads\/2022\/08\/Michael_Jones.jpg\" alt=\"Michael Jones.\" class=\"wp-image-80925\" \/><\/figure>\n<\/figure>\n<h2>Machine learning: Accuracy and ethics<\/h2>\n<p>The landscape for working with machine learning\/AI\/deep learning has grown considerably over the last couple of years. Students are now able to develop their understanding from the hard-coded end via resources such as <a href=\"https:\/\/machinelearningforkids.co.uk\/\" target=\"_blank\" rel=\"noreferrer noopener\">Machine Learning for Kids<\/a>, get their hands dirty using relatively inexpensive hardware such as the <a href=\"https:\/\/www.nvidia.com\/en-gb\/autonomous-machines\/embedded-systems\/jetson-nano\/\" target=\"_blank\" rel=\"noreferrer noopener\">Nvidia Jetson Nano<\/a>, and build a classification machine using <a href=\"https:\/\/teachablemachine.withgoogle.com\/train\" target=\"_blank\" rel=\"noreferrer noopener\">the Google-driven Teachable Machine resources<\/a>. I have used all three of the above with my students, and this article focuses on Teachable Machine.<\/p>\n<blockquote class=\"wp-block-quote\">\n<p>For this module, I\u2019m more concerned with the fuzzy end of AI, including how credible AI decisions are, and the elephant-in-the-room aspect of bias and potential for harm.<\/p>\n<p><cite>Michael Jones<\/cite><\/p><\/blockquote>\n<p>For the worried, there is absolutely no coding involved in this resource; the \u2018machine\u2019 behind the portal does the hard work for you. For my Year 9 classes (students aged 13 to 14) undertaking a short, three-week module, this was ideal. The coding is important, but was not my focus. For this module, I\u2019m more concerned with the fuzzy end of AI, including how credible AI decisions are, and the elephant-in-the-room aspect of bias and potential for harm.<\/p>\n<h2>Getting started with Teachable Machine activities<\/h2>\n<p>There are three possible routes to use in Teachable Machine, and my focus is the \u2018Image Project\u2019, and within this, the \u2018Standard image model\u2019. From there, you are presented with a basic training scenario template \u2014 see <a href=\"https:\/\/helloworld.raspberrypi.org\/issues\/16\" target=\"_blank\" rel=\"noreferrer noopener\">Hello World issue 16 (pages 84\u201386)<\/a> for a step-by-step set-up and training guide. For this part of the project, my students trained the machine to recognise different breeds of dog, with border collie, labrador, saluki, and so on as classes. Any AI system devoted to recognition requires a substantial set of training data. Fortunately, there are a number of freely available data sets online (for example, download a folder of dog photos separated by breed by accessing <a href=\"http:\/\/helloworld.cc\/dogdata\" target=\"_blank\" rel=\"noreferrer noopener\">helloworld.cc\/dogdata<\/a>). Be warned, these can be large, consisting of thousands of images. If you have more time, you may want to set students off to collect data to upload using a camera (just be aware that this can present safeguarding considerations). This is a key learning point with your students and an opportunity to discuss the time it takes to gather such data, and variations in the data (for example, images of dogs from the front, side, or top).<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"500\" height=\"349\" src=\"https:\/\/www.prime-wow.com\/wp-content\/uploads\/2022\/08\/image1-500x349-1.png\" alt=\"Drawing of a machine learning ars rover trying to decide whether it is seeing an alien or a rock.\" class=\"wp-image-76524\" \/><figcaption>Image recognition is a common application of machine learning technology.<\/figcaption><\/figure>\n<\/div>\n<p>Once you have downloaded your folders, upload the images to your Teachable Machine project. It is unlikely that you will be able to upload a whole subfolder at once \u2014 my students have found that the optimum number of images seems to be twelve. Remember to build this time for downloading and uploading into your lesson plan. This is a good opportunity to discuss the need for balance in the training data. Ask questions such as, \u201cHow likely would the model be to identify a saluki if the training set contained 10 salukis and 30 of the other dogs?\u201d This is a left-field way of dropping the idea of bias into the exploration of AI \u2014 more on that later!<\/p>\n<h2>Accuracy issues in machine learning models<\/h2>\n<p>If you have got this far, the heavy lifting is complete and Google\u2019s training engine will now do the work for you. Once you have set your model on its training, leave the system to complete its work \u2014 it takes seconds, even on large sets of data. Once it\u2019s done, you should be ready to test you model. If all has gone well and a webcam is attached to your computer, the Output window will give a prediction of what is being viewed. Again, the article in <a href=\"https:\/\/helloworld.raspberrypi.org\/issues\/16\" target=\"_blank\" rel=\"noreferrer noopener\">Hello World issue 16<\/a> takes you through the exact steps of this process. Make sure you have several images ready to test. See <strong>Figure 1a<\/strong> for the response to an image of a saluki presented to the model. As you might expect, it is showing as a 100 percent prediction.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"500\" height=\"390\" src=\"https:\/\/www.prime-wow.com\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-10-at-14.37.07-500x390-1.png\" alt=\"Screenshots from Teachable Machine showing photos of dogs classified as specific breeds with different degrees of confidence by a machine learning model.\" class=\"wp-image-80909\" \/><figcaption><strong>Figure 1<\/strong>: Outputs of a Teachable Machine model classifying photos of dog breeds. <strong>1a (left)<\/strong>: Photo of a saluki. <strong>1b (right)<\/strong>: Photo of a Samoyed and two people.<\/figcaption><\/figure>\n<\/div>\n<p>It will spark an interesting discussion if you now try the same operation with an image with items other than the one you\u2019re testing in it. For example see <strong>Figure 1b<\/strong>, in which two people are in the image along with the Samoyed dog. The model is undecided, as the people are affecting the outcome. This raises the question of accuracy. Which features are being used to identify the dogs as border collie and saluki? Why are the humans in the image throwing the model off the scent?<\/p>\n<p>Getting closer to home, training a model on human faces provides an opportunity to explore AI accuracy through the question of what might differentiate a female from a male face. You can find a model at <a href=\"http:\/\/helloworld.cc\/maleorfemale\" target=\"_blank\" rel=\"noreferrer noopener\">helloworld.cc\/maleorfemale<\/a> that contains 5418 images almost evenly spread across male and female faces (see <strong>Figure 2<\/strong>). Note that this model will take a little longer to train.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"500\" height=\"594\" src=\"https:\/\/www.prime-wow.com\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-10-at-14.23.44-500x594-1.png\" alt=\"Screenshot from Teachable Machine showing two datasets of photos of faces labeled either male or female.\" class=\"wp-image-80899\" \/><figcaption><strong>Figure 2:<\/strong> Two photo sets of faces labeled either male or female, uploaded to Teachable Machine.<\/figcaption><\/figure>\n<\/div>\n<p>Once trained, try the model out. Props really help \u2014 a top hat, wig, and beard give the model a testing time (pun intended). In this test (see <strong>Figure 3<\/strong>), I presented myself to the model face-on and, unsurprisingly, I came out as 100 percent male. However, adding a judge\u2019s wig forces the model into a rethink, and a beard produces a variety of results, but leaves the model unsure. It might be reasonable to assume that our model uses hair length as a strong feature. Adding a top hat to the ensemble brings the model back to a 100 percent prediction that the image is of a male.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-blog-entry\"><a href=\"https:\/\/www.raspberrypi.org\/app\/uploads\/2022\/08\/Screenshot-2022-08-10-at-14.30.08.png\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" loading=\"lazy\" width=\"800\" height=\"371\" src=\"https:\/\/www.prime-wow.com\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-10-at-14.30.08-800x371-1.png\" alt=\"Screenshots from Teachable Machine showing two datasets of a model classifying photos of the same face as either male or female with different degrees of confidence, based on the face is wearing a wig, a fake beard, or a tophat.\" class=\"wp-image-80902\" \/><\/a><figcaption><strong>Figure 3<\/strong>: Outputs of a Teachable Machine model classifying photos of the author\u2019s face as male or female with different degrees of confidence. Click to enlarge.<\/figcaption><\/figure>\n<\/div>\n<p>Machine learning uses a best-fit principle. The outputs, in this case whether I am male or female, have a greater certainty of male (65 percent) versus a lesser certainty of female (35 percent) if I wear a beard (Figure 3, second image from the right). Remove the beard and the likelihood of me being female increases by 2 percent (Figure 3, second image from the left).<\/p>\n<h2>Bias in machine learning models<\/h2>\n<p>Within a fairly small set of parameters, most human faces are similar. However, when you start digging, the research points to there being bias in AI (whether this is conscious or unconscious is a debate for another day!). You can exemplify this by firstly creating classes with labels such as \u2018young smart\u2019, \u2018old smart\u2019, \u2018young not smart\u2019, and \u2018old not smart\u2019. Select images that you think would fit the classes, and train them in Teachable Machine. You can then test the model by asking your students to find images they think fit each category. Run them against the model and ask students to debate whether the AI is acting fairly, and if not, why they think that is. Who is training these models? What images are they receiving? Similarly, you could create classes of images of known past criminals and heroes. Train the model before putting yourself in front of it. How far up the percentage scale are you towards being a criminal? It soon becomes frighteningly worrying that unless you are white and seemingly middle class, AI may prove problematic to you, from decisions on financial products such as mortgages through to mistaken arrest and identification.<\/p>\n<blockquote class=\"wp-block-quote\">\n<p>It soon becomes frighteningly worrying that unless you are white and seemingly middle class, AI may prove problematic to you, from decisions on financial products such as mortgages through to mistaken arrest and identification.<\/p>\n<p><cite>Michael Jones<\/cite><\/p><\/blockquote>\n<p>Encourage your students to discuss how they could influence this issue of race, class, and gender bias \u2014 for example, what rules would they use for identifying suitable images for a data set? There are some interesting articles on this issue that you can share with your students at <a href=\"http:\/\/helloworld.cc\/aibias1\" target=\"_blank\" rel=\"noreferrer noopener\">helloworld.cc\/aibias1<\/a> and <a href=\"http:\/\/helloworld.cc\/aibias2\" target=\"_blank\" rel=\"noreferrer noopener\">helloworld.cc\/aibias2<\/a>.<\/p>\n<h2>Where next with your learners? <\/h2>\n<p>In the classroom, you could then follow the route of building models that identify letters for words, for example. One of my students built a model that could identify a range of spoons and forks. You may notice that Teachable Machine can also be run on Arduino boards, which adds an extra dimension. Why not get your students to create their own AI assistant that responds to commands? The possibilities are there to be explored. If you\u2019re using webcams to collect photos yourself, why  not create a system that will identify students? If you are lucky enough to have a set of identical twins in your class, that adds just a little more flavour! Teachable Machine offers a hands-on way to demonstrate the issues of AI accuracy and bias, and gives students a healthy opportunity for debate.<\/p>\n<p><em><a href=\"https:\/\/twitter.com\/mikejonescstalk\" target=\"_blank\" rel=\"noreferrer noopener\">Michael Jones<\/a> is director of Computer Science at Northfleet Technology College in the UK. He is a Specialist Leader of Education and a CS Champion for the National Centre for Computing Education.<\/em><\/p>\n<h2>More resources for AI and data science education<\/h2>\n<p>At the Foundation, AI education is one of our focus areas. Here is how we are supporting you and your learners in this area already:<\/p>\n<ul>\n<li>Hello World issue 12 focuses on AI and machine learning education, with many practical resources, insightful interviews, and inspiring features from computer science educators. <a href=\"https:\/\/helloworld.raspberrypi.org\/issues\/12\" target=\"_blank\" rel=\"noreferrer noopener\">Download your free copy of issue 12 now<\/a>.<\/li>\n<li>In Hello World issue 16, the focus is on all things data science and data literacy for your learners. As always, you can <a href=\"https:\/\/helloworld.raspberrypi.org\/issues\/16\" target=\"_blank\" rel=\"noreferrer noopener\">download a free copy of the issue<\/a>.<\/li>\n<li>On <a href=\"https:\/\/helloworld.raspberrypi.org\/articles\/podcast\" target=\"_blank\" rel=\"noreferrer noopener\">our Hello World podcast<\/a>, we\u2019ve got episodes where we talk with practicing computing educators about how they bring AI, AI ethics, machine learning, and data science to the young people they teach.<\/li>\n<li>Since <a href=\"https:\/\/www.raspberrypi.org\/blog\/astro-pi-2021-news-rocket-launch-hardware\/\" target=\"_blank\" rel=\"noreferrer noopener\">we upgraded the Raspberry Pi\u2013based hardware<\/a> on board the International Space Station for the European Astro Pi Challenge, young people have better opportunities to use machine learning as part of the scientific experiments they write Python programs for during the Challenge. <a href=\"https:\/\/www.raspberrypi.org\/blog\/astro-pi-mission-space-lab-2021-22-the-results\/\" target=\"_blank\" rel=\"noreferrer noopener\">See what this teams taking part in this round of Astro Pi achieved and how you can get involved<\/a> in mentoring students at your school to take part in the next round starting in September.<\/li>\n<li>If you\u2019d like a practical introduction to the basics of machine learning and how to use it, <a href=\"https:\/\/www.futurelearn.com\/courses\/introduction-to-machine-learning\" target=\"_blank\" rel=\"noreferrer noopener\">take our free online course<\/a>.<\/li>\n<\/ul>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"500\" height=\"334\" src=\"https:\/\/www.prime-wow.com\/wp-content\/uploads\/2022\/08\/MaxGruber-Cecinest-pas-une-banane-2000x1334-1-500x334-1.jpg\" alt=\"An image demonstrating that AI systems for object recognition do not distinguish between a real banana on a desk and the photo of a banana on a laptop screen.\" class=\"wp-image-77986\" \/><\/figure>\n<\/div>\n<ul>\n<li>Computing education researchers are working to answer the many open questions about what good AI and data science education looks like for young people. To learn more, you can watch the recordings from our <a href=\"https:\/\/www.raspberrypi.org\/blog\/tag\/artificial-intelligence\/\" target=\"_blank\" rel=\"noreferrer noopener\">research seminar series focused on this<\/a>. We ourselves are working on <a href=\"https:\/\/computingeducationresearch.org\/projects\/ai-and-data-literacy-education\/\" target=\"_blank\" rel=\"noreferrer noopener\">research projects in this area<\/a> and will share the results freely with the computing education community.<\/li>\n<li>You can find a <a href=\"https:\/\/www.raspberrypi.org\/ai-ml-data-science-education-resources\/\">list of free educational resources<\/a> about these topics that we\u2019ve collated based on our research seminars, seminar participants\u2019 recommendations, and our own work.<\/li>\n<\/ul>\n<p>The post <a rel=\"nofollow\" href=\"https:\/\/www.raspberrypi.org\/blog\/classroom-activity-machine-learning-accuracy-ethics-hello-world-18\/\">Classroom activities to discuss machine learning accuracy and ethics | Hello World #18<\/a> appeared first on <a rel=\"nofollow\" href=\"https:\/\/www.raspberrypi.org\">Raspberry Pi<\/a>.<\/p>\n<p>&#013;<br \/>\n&#013;<br \/>\nSource: Raspberry Pi &#8211; <a href=\"https:\/\/www.raspberrypi.org\/blog\/classroom-activity-machine-learning-accuracy-ethics-hello-world-18\/\" target=\"_blank\" rel=\"noopener\">Classroom activities to discuss machine learning accuracy and ethics | Hello World #18<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Hello World issue 18, available as a free PDF download, teacher Michael Jones shares how to use Teachable Machine with learners aged 13\u201314 in your classroom to investigate issues of accuracy and ethics in machine learning models. Machine learning: &hellip; <a href=\"https:\/\/www.prime-wow.com\/?p=1042045\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":1042046,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[77,110],"tags":[5],"class_list":["post-1042045","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-rpi","category-unfiltered-rss","tag-rpi"],"_links":{"self":[{"href":"https:\/\/www.prime-wow.com\/index.php?rest_route=\/wp\/v2\/posts\/1042045","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.prime-wow.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.prime-wow.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.prime-wow.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.prime-wow.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1042045"}],"version-history":[{"count":0,"href":"https:\/\/www.prime-wow.com\/index.php?rest_route=\/wp\/v2\/posts\/1042045\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.prime-wow.com\/index.php?rest_route=\/wp\/v2\/media\/1042046"}],"wp:attachment":[{"href":"https:\/\/www.prime-wow.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1042045"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.prime-wow.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1042045"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.prime-wow.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1042045"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}