{"id":830557,"date":"2020-11-20T04:52:23","date_gmt":"2020-11-20T09:52:23","guid":{"rendered":"https:\/\/www.prime-wow.com\/?p=830557"},"modified":"2020-11-20T04:52:23","modified_gmt":"2020-11-20T09:52:23","slug":"classify-your-trash-with-raspberry-pi","status":"publish","type":"post","link":"https:\/\/www.prime-wow.com\/?p=830557","title":{"rendered":"Classify your trash with Raspberry Pi"},"content":{"rendered":"<p>Maker Jen Fox took to hackster.io to share a <a href=\"https:\/\/www.hackster.io\/jenfoxbot\/make-a-pi-trash-classifier-with-ml-e037a6\" target=\"_blank\" rel=\"noreferrer noopener\">Raspberry Pi\u2013powered trash classifier<\/a> that tells you whether the trash in your hand is recyclable, compostable, or just straight-up garbage.<\/p>\n<p>Jen reckons this project is beginner-friendly, as you don\u2019t need any code to train the machine learning model, just a little to load it on Raspberry Pi. It\u2019s also a pretty affordable build, costing less than $70 including a Raspberry Pi 4.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-blog-entry\"><img decoding=\"async\" loading=\"lazy\" width=\"800\" height=\"600\" src=\"https:\/\/www.prime-wow.com\/wp-content\/uploads\/2020\/11\/trash-01-800x600-1.jpe\" alt=\"\" class=\"wp-image-65683\" \/><figcaption>\u201cHaz waste\u201d?!<\/figcaption><\/figure>\n<\/div>\n<h2>Hardware:<\/h2>\n<ul>\n<li>Raspberry Pi 4 Model B<\/li>\n<li>Raspberry Pi Camera Module<\/li>\n<li>Adafruit push button<\/li>\n<li>Adafruit LEDs<\/li>\n<\/ul>\n<figure class=\"wp-block-embed-youtube aligncenter wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\">\n<div class=\"wp-block-embed__wrapper\">\n<\/div><figcaption>Watch Jen giving a demo of her creation<\/figcaption><\/figure>\n<h2>Software<\/h2>\n<p>The code-free machine learning model is created using <a href=\"https:\/\/youtu.be\/jyz0ArPEsj4\" target=\"_blank\" rel=\"noreferrer noopener\">Lobe<\/a>, a desktop tool that automatically trains a custom image classifier based on what objects you\u2019ve shown it. <\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-blog-entry\"><img decoding=\"async\" loading=\"lazy\" width=\"800\" height=\"465\" src=\"https:\/\/www.prime-wow.com\/wp-content\/uploads\/2020\/11\/garbagetest-bottlecapclose-correctcrop_ITKwIr1ktH-800x465-1.jpg\" alt=\"\" class=\"wp-image-65735\" \/><figcaption>The image classifier correctly guessing it has been shown a bottle cap<\/figcaption><\/figure>\n<\/div>\n<h2>Training the image classifier<\/h2>\n<p>Basically, you upload a tonne of photos and tell Lobe what object each of them shows. Jen told the empty classification model which photos were of compostable waste, which were of recyclable and items, and which were of garbage or bio-hazardous waste. Of course, as Jen says, \u201cthe more photos you have, the more accurate your model is.\u201d<\/p>\n<h2>Loading up Raspberry Pi<\/h2>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"555\" height=\"555\" src=\"https:\/\/www.prime-wow.com\/wp-content\/uploads\/2020\/11\/rpi-camera_Kya8CiMMAt.jpg\" alt=\"Birds eye view of Raspberry Pi 4 with a camera module connected\" class=\"wp-image-65738\" \/><figcaption>The Raspberry Pi Camera Module attached to Raspberry Pi 4<\/figcaption><\/figure>\n<\/div>\n<p>As promised, you only need a <a href=\"https:\/\/github.com\/microsoft\/TrashClassifier\/blob\/master\/rpi_trash_classifier.py\">little bit of code<\/a> to load the image classifier onto your Raspberry Pi. The Raspberry Pi Camera Module acts as the image classifier\u2019s \u201ceyes\u201d so Raspberry Pi can find out what kind of trash you hold up for it.<\/p>\n<p>The push button and LEDs are wired up to the Raspberry Pi GPIO pins, and they work together with the camera and light up according to what the image classifier \u201csees\u201d.<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"487\" height=\"555\" src=\"https:\/\/www.prime-wow.com\/wp-content\/uploads\/2020\/11\/wheredoesitgo_bb_z38UaGg2dZ.jpg\" alt=\"\" class=\"wp-image-65740\" \/><figcaption>Here\u2019s the fritzing diagram showing how to wire the push button and LEDS to the Raspberry Pi GPIO pins<\/figcaption><\/figure>\n<p>You\u2019ll want to create a snazzy case so your trash classifier looks good mounted on the wall. Kate cut holes in a cardboard box to make sure that the camera could \u201csee\u201d out, the user can see the LEDs, and the push button is accessible. Remember to leave room for Raspberry Pi\u2019s power supply to plug in. <\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"479\" height=\"299\" src=\"https:\/\/www.prime-wow.com\/wp-content\/uploads\/2020\/11\/cover-3_92s2r4atAh-edited.jpg\" alt=\"\" class=\"wp-image-65744\" \/><figcaption>Jen\u2019s hand-painted case mounted to the wall, having a look at a plastic bag<\/figcaption><\/figure>\n<\/div>\n<p>Jen has tonnes of other projects on <a href=\"https:\/\/www.hackster.io\/jenfoxbot\" target=\"_blank\" rel=\"noreferrer noopener\">her Hackster profile<\/a> \u2014 check out the <a href=\"https:\/\/www.hackster.io\/jenfoxbot\/micro-bit-magic-wand-ad32b2\" target=\"_blank\" rel=\"noreferrer noopener\">micro:bit Magic Wand<\/a>.<\/p>\n<p>The post <a rel=\"nofollow\" href=\"https:\/\/www.raspberrypi.org\/blog\/classify-your-trash-with-raspberry-pi\/\">Classify your trash with Raspberry Pi<\/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\/classify-your-trash-with-raspberry-pi\/\" target=\"_blank\" rel=\"noopener noreferrer\">Classify your trash with Raspberry Pi<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Maker Jen Fox took to hackster.io to share a Raspberry Pi\u2013powered trash classifier that tells you whether the trash in your hand is recyclable, compostable, or just straight-up garbage. Jen reckons this project is beginner-friendly, as you don\u2019t need any &hellip; <a href=\"https:\/\/www.prime-wow.com\/?p=830557\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":830558,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[77,110],"tags":[5],"class_list":["post-830557","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\/830557","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=830557"}],"version-history":[{"count":0,"href":"https:\/\/www.prime-wow.com\/index.php?rest_route=\/wp\/v2\/posts\/830557\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.prime-wow.com\/index.php?rest_route=\/wp\/v2\/media\/830558"}],"wp:attachment":[{"href":"https:\/\/www.prime-wow.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=830557"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.prime-wow.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=830557"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.prime-wow.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=830557"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}