Inspiration

Each year, about 2.01 billion tons of trash is generated globally. To limit the amount of waste entering landfills, many people have started turning towards actions such as composting or upcycling materials. However, the most prevalent – and most misunderstood – technique to divert waste from landfills is simply recycling.

If done correctly, recycling allows us to break down and reuse items that would’ve otherwise ended up in a landfill. However, not everything is recyclable – and if an unrecyclable item is placed in a batch of recyclable materials, this may cause the entire batch to become unusable and sent to a landfill.

Recycling is so common that not many stop to think about what exactly is recyclable or not. Because of this, much of the nuance about the recyclability of a certain item or material that often gets glossed over. As a result of this, people may end up recycling materials that are not recyclable, yet seem like they should be (a phenomena named “wishcycling”).

The end result of this wishcycling is either extra time and money must be spent on filtering these nonrecyclable materials out of the recycling, or the entire batch of recycling must be sent to the landfill. In order to combat this phenomenon, we decided to create an educational platform designed to teach users to identify whether or not an item is recyclable through an interactive game. This way, we can spread awareness about the importance of knowing what is recyclable, and streamline the process of recycling by limiting the amount of non-recyclable waste that finds itself into recycling centers.

What it does

Our project is “Wecycle”, an educational platform that teaches users how to correctly identify an item as glass, paper, cardboard, plastic, metal, or trash. The website begins by allowing users to read through articles explaining to them exactly what is recyclable and what is not, as well as the nuances to this. It then quizzes users by taking pre-classified images from the TrashNet dataset and displaying it on the website, along with all of the aforementioned options. If the user correctly classifies the item, then they will receive 1 point. If the user incorrectly classifies the item, then they will receive no points. After iterating through a series of questions, the user’s final score is displayed.

How we built it

Wecycle has two major components: the website itself and the quiz that the user can take. The backend of the website was built with Node.js, and the frontend of the website was built with Bootstrap, HTML, and CSS. Upon entering the page, the user is greeted with an introduction to the mission WeCycle, as well as two links to an article explaining the nuances of what is recyclable and a quiz to test themselves. The homepage and the article were created mostly on the front end with graphics to help the user stay engaged while learning about recycling.

As for the quiz feature, this was much heavier on the backend. The way that this feature worked is that on the frontend, we had empty div sections for where the question, image, and answer options would appear. In the backend, we then wrote JavaScript functions that selected a random image from the TrashNet dataset and loaded it onto the website. We also wrote functions that determined whether or not the selection that the user made was correct, and kept a count of their score to display at the end of the quiz. At the end the user also has the chance to go back and see what questions they wrong and the correct answer for them

Challenges we ran into

The primary challenge we ran into was related to implementing our original idea, which included a machine learning algorithm. In this version of our project, we would train a machine learning algorithm to be able to identify images as either trash or recycling, and users could upload their own images and guess whether or not the item was recyclable.

Our IDE of choice for this project was Visual Studio Code, and while attempting to import TensorFlow and Keras, we kept on receiving a message that the import was unsuccessful. After multiple rounds of modifying our import code’s syntax, we read online that some people had run into issues with importing TensorFlow due to having an out of date version of the library. As such, we updated pip (the software used to install TensorFlow), TensorFlow, and Python itself.

When this still proved unsuccessful, we sought help from the mentors at Technica, who suggested that we try completely deleting and redownloading Python onto our computers. Due to having a slow WiFi connection, this proved to be a rather long process, and still did not give us any results.

We then decided to move our machine learning code into Google Colab, hoping that any import issues would be resolved by Colab itself. However, we then discovered that using Colab was not feasible, as we could not figure out how to integrate it into our website.

However, we were finally able to resolve this issue after discovering that the problem was not with us having incorrect syntax or an out of date version of TensorFlow, but rather, with VSCode itself. VSCode had flagged our imports as incorrect, and as a result, we had never tried actually running the code. However, these imports were perfectly fine, and the code was able to run as usual. We were successfully able to train a convolutional neural network on the trashNet dataset to classify images into six categories: paper, plastic, metal, glass, cardboard, and trash.

Our next issue came when we attempted to integrate this algorithm into our website, using Flask. Prior to this, our code for the website worked as intended, but after attempting to add in the algorithm, we kept on receiving various errors relating to importing frameworks that could not be resolved. (This time, the errors were runtime errors, rather than a false error flagged by VSCode. One example included the most recent release werkzeug.utils no longer being compatible with our code, due to changes to the API.)

Due to running low on time and being unable to resolve these issues, we decided to scrap the machine learning algorithm and instead, implement a quiz feature to our website. For this quiz feature, we randomly selected images from the TrashNet dataset, before proceeding to prompt the user to identify whether it is recyclable material or trash.

Accomplishments that we're proud of

This project tested our skills in web development, as well as our ability to condense projects in response to time and technology constraints. For the first iteration of our project, we learned how to use Flask and Bootstrap for our website, which functioned normally. We also learned how to use TensorFlow and Keras, which we used for the machine learning algorithm, which also worked correctly on its own. The only issue came when we tried to integrate the two programs together, and due to time constraints, we decided to simplify our program so we could have a working project. Although not ideal, we are proud of our resourcefulness and ability to condense a project and adapt to our constraints.

What we learned

As aforementioned, to build our initial website, we learned about the basics of Flask and Bootstrap. We also learned about how to utilize our resources when it came to troubleshooting issues. The majority of our issues could be solved by asking each other for help, but one of our biggest issues (importing TensorFlow) was one that we could not solve, even after an hour or two of guessing at the issue. Since we could not solve these issues on our own, we attempted to find answers on StackOverflow, which did not end up solving our specific problem. We then sought help from various mentors at Technica, who all came up with their own suggestions, which, unfortunately, also did not end up working.

However, since we were able to get various perspectives on what could be causing our issue, we were able to slowly narrow down the cause of our issue and once we had discovered that, then we could solve it. Although not the most enjoyable lesson to learn hands-on, it was still a valuable experience and taught us on how to collaborate with others, seek help, and create solutions based on the guidance of others.

What's next for Wecycle

The next step for Wecycle would be to expand its functionality to our original plan, which would have been:

  • Incorporating a machine learning algorithm, which would be able to allow users to take a photo of an item. The machine learning algorithm would then classify the item, and the website would prompt the user to identify what material the item was made of. For a correct guess, the user would receive 5 points, and for an incorrect guess, the user would receive 1 point (as an incentive to continue using the website even if they struggle initially, as the purpose of the website is to educate).
  • Implementing a login feature using OAuth, where users can create an account. This way, they can track their progress. This feature could also be useful for personalized recommendations, since the app can notify users that they are consistently miscategorizing a certain item or material.
  • Implementing “group” features, which would allow users to pool their points together. This feature would help create a sense of community, increase competitiveness, and, as a result, lead to more incentive for users to continue to use the site.
  • Implementing leaderboards, which can display the most prolific users or groups of the month. This would also foster more competitiveness, and encourage users to continue learning about what materials are and are not recyclable.
  • Refining the machine learning algorithm, which would allow for more accurate classifications on the website’s end.
  • Expand the amount of resources linked and feedback available for users if they misidentify a certain item, which would help them learn more about what is and is not recyclable.

All of these improvements of Wecycle would turn into a more robust program, as well as provide more incentive for users to continue using it and learning about what is and is not recyclable, which, ultimately, will help us prevent recyclable materials from ending up in landfills.

Built With

Share this project:

Updates