Skip to main content

Fighting Plastic Pollution in Oceans with Deep Learning

Created on July 18|Last edited on September 2

Introduction


Plastic pollution in oceans represents a serious threat to our ecosystem and, according to a study conducted by Science Advances in 2021, rivers are the primary conduits for plastic waste to the oceans. For this reason, marine scientists and experts agree that keeping rivers, riverbanks, and deltas clean is one of the most effective strategies for protecting our oceans.
AI-powered systems can play a key role in designing effective and efficient solutions to intercept plastic waste floating on the surface of the river before it reaches the open ocean. And to encourage and accelerate the development of solutions, the Kili’s community has annotated (and made publicly available) a large dataset of images representing floating plastic in streams.
As part of the global effort to preserve the beauty, health, and uniqueness of our planet, I took on the challenge to fine-tune a transformer-based model on the Kili’s dataset. Specifically, this report illustrates the progress made so far and shows how transformers represent a promising approach to developing AI solutions that combat plastic in rivers, keeping them out of our oceans.

The Dataset

A few notes about the dataset: 
  • After removing the samples images without annotated plastic waste, the Kili's dataset contains nearly 4000 images split across a train, validation, and test sets.
  • The bounding boxes provide the location of plastic and non-plastic litter floating on the surface of streams.
  • Each annotated object belongs to one of the following categories: PLASTIC_BOTTLE, PLASTIC_BAG, OTHER_PLASTIC_WASTE and NOT_PLASTIC_WASTE.
You can take a look at the data below:

id
image
1
train
2
validation
3
test
split

In terms of class distribution, there is definitely a predominance of the PLASTIC_BOTTLE class over the others. This situation of class imbalance is likely to have negative consequences on the model's ability to detect and correctly classify the minority classes.

Run: worldly-lake-31
1


Training

I fine-tuned a pre-trained DETR model on the Kili's dataset. Specifically, 30 epochs using the following hyperparameters:
learning_rate = 1e-4
learning_rate_backbone = 1e-5
weight_decay = 1e-4
batch_size = 8
The plots below show the training and validation losses. The model's loss is made up of three major components:
  • the loss_ce is the traditional cross-entropy loss and it is used to assess the model's ability to assign the right label to the detected objects;
  • the loss_bbox and loss_giou measure the model's ability to locate objects and place the bounding boxes in the right position.
The ups and downs that characterized the train losses (blue lines) are a clear sign of the instability of the learning process. Despite this erratic behavior, the validation losses (orange lines) follow a slow but steady downward trend.

Run: dandy-sponge-28
1


Evaluation

By scrolling through the ground truth and predicted pictures, it is crystal clear that the fine-tuned DETR has a hard time detecting the minority classes identified with the EDA. Conversely, when it comes to spot plastic bottles, the most represented object in the dataset, the results are extremely promising. The model is able to correctly detect most of the plastic bottles in scenes, even the ones far in the distance that might easily fool humans and be mistaken for simple leaves or innocent animals.

Run: absurd-voice-30
1


Conclusion

In this report I showed how deep learning models, in particular a transformer-based architecture, can support our efforts to mitigate the pollution of oceans with plastic waste and preserve unaltered the fragile multifaceted ecosystems that make our Planet so unique.
In terms of next steps, among the various ideas going through my mind, I'm curious to see how the model performs after collapsing the various classes into a single representing a general waste. I am also interested in exploring different hyperparameters combinations to see if I can get a more smooth and stable learning process.
If you have any comment, suggestion or question, please feel free to share your thoughts in the comment section below.
Thanks for taking the time to read this report 💚.
Kurian Benoy
Kurian Benoy •  
Really awesome work!. These tables are a pleasure to watch
Reply
Iterate on AI agents and models faster. Try Weights & Biases today.
File<(table)>