Introduction: Classifying Plastic Objects Using Machine Learning

Every year, around 300 million tons of plastic is created for daily use. Half of these created plastics is used for single-use products like cups, straws, cutlery and more. Plastic is being used daily which also means that plastic is being thrown away daily. Consequently, this will cause environmental harm since plastic sticks around for ages. Plastic can therefore threaten wildlife, spread toxins, and contribute to global warming. Almost all plastics are made from chemicals that come from the production of planet-warming fuels. Based on the above, it would be wise to invest in researching plastic sorting and reusing plastic. Especially now it is urgently needed since global warming is accelerating.

There are several ways of reducing environmental harm. One way is to reduce the amount of plastic in the environment by reducing, reusing, or recycling plastic. By doing so, it reduces the need for new plastic to be created and new plastic products to be manufactured. It takes more energy to create plastic from scratch than reforming old materials and recycle them. Therefore, recycling and reusing materials like plastic, is an important factor when trying to reduce the environmental harm.

The project 'Classification of Plastics' focusses on detecting various types of plastic by using image processing. The embedded engineering students of the HAN are working on creating a prototype of a sorting-machine which can detect different types of plastic by using a camera. The plastics will be provided on a conveyor belt.

The main goal of this project is to provide a “cooking recipe” of the sorting machine which may be made public. The goal of this recipe is to provide acquired knowledge to the outside world.

Supplies

Hardware supplies:

  • 1x Stepper Motor
  • 1x uEye Camera (UI-6210SE-C-HQ Rev.3)
  • 1x uEye Camera powercable (CK.0040.2.18500.00)
  • 1x Niryo's Conveyor Belt with motor controller
  • 5x White drywall plates(1m x 1m)
  • 8x aluminium profile (20x20)
  • 12x M6 screws
  • 4x Cube connector (20x20) 3 bars
  • 1x Woodplank (64cm x 46cm)
  • 1x Non-reflective black plastic sheet (44.5cm x 39cm)
  • 4x LED strips (White)
  • 1x AC Adapter IP20 (XY-1201000-E) or any other 12V led power supply
  • 1x NVIDIA Jetson nano
  • 1x NVIDIA Jetson nano power supply
  • 5x Green LED (3mm, misty, flat head LED)
  • 5x Resistor (1 000 Ohm)
  • 5x Resistor (47 000 Ohm)
  • 5x NPN Transistor (2N3904)
  • 1x Ethernet Cable
  • 1x Temporarily Keyboard
  • 1x Temporarily computer mouse
  • 1x Temporarily HDMI-cable
  • 1x Temporarily screen with HDMI support

Software supplies:

  • IDE (choose of your choice)
  • OpenCV 4.6.0
  • Python 3.8 - 3.10
  • IDS drivers

Step 1: Create Drywalls

Cut the drywalls in the following shapes (see pictures for measurements):

  • 2x Wall
  • 2x Wall with opening
  • 1x Roof
  • 4x Walls for the camera box with the size 15cm x 15cm
  • 1x Roof for the camera box

Step 2: Attach LED Strips to Walls

Attach all one of the LED strips to each of the four walls. Approximately 30 cm from the ground.

Step 3: Create Aluminium Frame

  • Cut 8 aluminium profiles with a length of 44.5cm
  • Connect the aluminium profiles together with the screws and cube connector as follows (picture)

Step 4: Assemble Walls and Frame

  • Unscrew the top part of the frame and then slide the drywalls between the frame. Make sure the two walls with the opening for the conveyor-belt are opposite side from each other
  • Slide the roof drywall between the top part of the frame
  • Screw the frame back together


Step 5: Create Camera Box

  • Glue together the small box made out of the 4 mini walls and the roof.


Step 6: Assembly Camera Box With Frame

  • Glue the camera box on top 15x15 size square hole in the frame

Step 7: Place Converyor Belt

  • Lay down the non-reflective black plastic sheet on the bottom of the box and place the conveyor so that the begin and the end of the conveyor belt are in line with the two openings.

Step 8: Connect the Motor Controller

First connect the Conveyor Belt motor to the Conveyor connection interface on the control box. Then, plug the power supply adapter to the Control Box

.

Step 9: Connect the NIVIDIA Board and LEDs

Connect the circuit according to the picture

Step 10: Installing Software

In this section is described how to get the Plastic Sorting project up and running. To use the project there are a couple things needed to be installed first. First you need a copy of Python 3.8-3.10. To check if it is already installed on your system you can use:

python --version

After that is done, the neccesary libraries need to be installed. Run this command from the root directory of the git repository /plastic-sorting-2022/. This can be done using:

pip install -r requirements.txt

And finally build the code from /plastic-sorting-2022/ with the following command:

pip install -e .

Next up we need to install the drivers for the camera. First go to this link and download the IDS Software Suite. Then extract the zip file and run the installer. Select type of installer recommended and click next.

Step 11: Installing IDS Software

Next up we need to install the drivers for the camera. First go to this link and download the IDS Software Suite. Then extract the zip file and run the installer. Select type of installer recommended and click next.

Step 12: Run the Demo

Run the file: demo_live_classification.py on your python installation. For example we used:

python310 demo_live_classification.py

And with that, your setup is finished! Have fun with detecting objects on a running conveyor-belt