{"id":4751,"date":"2022-12-01T19:24:58","date_gmt":"2022-12-01T19:24:58","guid":{"rendered":"https:\/\/dalelane.co.uk\/blog\/?p=4751"},"modified":"2022-12-14T11:15:31","modified_gmt":"2022-12-14T11:15:31","slug":"teaching-students-that-increasing-training-data-diversity-often-improves-accuracy","status":"publish","type":"post","link":"https:\/\/dalelane.co.uk\/blog\/?p=4751","title":{"rendered":"Teaching students that increasing training data diversity often improves accuracy"},"content":{"rendered":"<p><strong>This post was written for <a href=\"https:\/\/machinelearningforkids.co.uk\/stories\">MachineLearningForKids.co.uk\/stories<\/a>: a series of stories I wrote to describe student experiences of artificial intelligence and machine learning, that I\u2019ve seen from time I spend volunteering in schools and code clubs.<\/strong><\/p>\n<p>Students can make a Scratch project to play <a href=\"https:\/\/machinelearningforkids.co.uk\/worksheets\">Rock, Paper, Scissors<\/a>. They use their webcam to collect example photos of their hands making the shapes of &#8216;rock&#8217; (fist), &#8216;paper&#8217; (flat hand), and &#8216;scissors&#8217; (two fingers). Then they use those photos to train a machine learning model to recognise their hand shapes.<\/p>\n<p>I often have at least one enthusiastic (or impatient!) student keen to create their machine learning model as quickly as possible. They&#8217;ll hold their hand fairly still in front of the webcam, and keep hitting the camera button. The result is that they&#8217;ll take a large number of very similar photos.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/machinelearningforkids.co.uk\/static\/images\/stories-rockpaperscissors.png\" style=\"border: thin black solid\"\/><\/p>\n<p><!--more-->Other students will naturally create a range of different photos. They&#8217;ll take some photos of their left hand, and some photos of their right hand. They&#8217;ll take some photos of their hand held very close to the webcam looking large in the photo, and they&#8217;ll take some photos of their hand held far away from the webcam looking small. They&#8217;ll take photos of their hand in a variety of directions, and from a variety of angles.<\/p>\n<p>If left to experiment and encouraged to compare their projects, students will notice differences in the way that their different projects behave.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/machinelearningforkids.co.uk\/static\/images\/stories-rockpaperscissors-training-better.png\" style=\"border: thin black solid\"\/><\/p>\n<p>Projects trained with a wider variety of training examples often perform better. Their models make fewer mistakes and have a higher confidence score for hand shapes they recognise correctly.<\/p>\n<p>Projects trained with a very similar set of training examples make more mistakes, particularly when students play each other&#8217;s Rock, Paper, Scissors holding with their hand in a position or at an angle that was different to the way it was trained.<\/p>\n<blockquote style=\"font-size: 1.3em; line-height: 1.3em; font-family: Georgia, 'Times New Roman', Times, serif;\"><p>Letting students try each other&#8217;s project allows them to see that machine learning models trained with a wider variety of training examples perform better.<\/p><\/blockquote>\n<hr \/>\n<p><iframe loading=\"lazy\" style=\"border: thin black solid;\" width=\"450\" height=\"253\" src=\"https:\/\/www.youtube.com\/embed\/AAR0Q8X3J9E\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen=\"\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post was written for MachineLearningForKids.co.uk\/stories: a series of stories I wrote to describe student experiences of artificial intelligence and machine learning, that I\u2019ve seen from time I spend volunteering in schools and code clubs. Students can make a Scratch project to play Rock, Paper, Scissors. They use their webcam to collect example photos of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,3],"tags":[580,536],"class_list":["post-4751","post","type-post","status-publish","format-standard","hentry","category-school","category-tech","tag-machine-learning","tag-scratch"],"_links":{"self":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4751","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4751"}],"version-history":[{"count":0,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4751\/revisions"}],"wp:attachment":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4751"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4751"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4751"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}