Utilizing AI to Remove oceanic Plastic Waste-Part2

In this blog post, we will learn about the Naive Bayesian Classifier model, the classifier model that was used in detecting oceanic plastic waste in satellite data, and look at current methods to remove oceanic garbage.

Naive Bayesian Classifier

The Naive Bayesian classifier is a classifier model that is based on probability and inferential statistics. To understand the Naive Bayesian classifier, we need to know what conditional probability is, what the Bayesian theorem is, and what it means when two events are independent of each other.

Conditional Probability is the probability of one event occurring, given that another event has already occurred. For example, the conditional probability of event B occurring, given that event A has occurred, is written as P(B|A) and is read as “probability of B, given A”.

For instance, let's say that there are a number of cups and plates of various sizes in a cupboard. If A is the event where a randomly selected item from the cupboard is a cup and B is the event where the shape of the randomly selected item is cylindrical, P(B|A) is the probability where the selected object is a cup given that its shape is cylindrical and P(A|B) is the probability where the shape of the object is cylindrical, given that it is a cup.

The formula for conditional probability P(B|A) is as follows:

the formula for conditional probability P(B|A)

The Bayesian Theorem, to put it simply, is a theorem that lets us find P(A|B) using P(B|A), P(A), P(B). The formula for the theorem is as follows.

Bayesian Theorem

When two events are independent of each other when the occurrence of one event does not affect the probability of the other event. For example, let’s say that we roll a 6 sided die twice. Event A is the event where the first roll results in 1 or 2 or 3 and event B is the event where the second roll results in 6. Here, the P(A) is 1/2, and P(B) is 1/6. More importantly, P(B) doesn’t change whether A happened or not and the same applies to vice versa. In this case, events A and B are independent.

When two events A and B are independent, because the probability of B is the same whether or not A happened or not, the following equation is valid.

Now that you know the three fundamentals of inferential statistics you need to know in order to understand the Naive Bayesian Classifier, let’s see how the model actually make inferences.

Let’s say that we are training a naive Bayesian classifier that predicts whether a randomly selected object from the cupboard is a cup or a plate based on three features: its shape(cylindrical or rectangular), color(white or brown), and material(glass or ceramic). Let’s say that the shape of the object is x1, and the color of the object is x2, and the material of the object is x3. We can put all three of these features into one feature vector of X. Also, let’s say call the actual type of the object(cup or plate) y.

X is the feature space that includes the shape(x1), color(x2), and material(x3) of the object.

In naive Bayesian classifiers, it is assumed that all features are independent of each other. This is a very “naive” assumption(hence the name of the classifier) to make and isn’t actually the case in many real-life situations. If we assume that all features of the feature space above are independent of each other, we can get the possibility of P(y|X) like below.

When we train a naive Bayesian classifier, what we are actually doing is calculating all the probabilities above(P(x1|y), P(x2|y), P(x3|y), P(x1), P(x2), P(x3)

Following this formula, the probability that a randomly selected object from the cupboard that is cylindrical, brown, and made of ceramic is a cup, and the probability it is a plate is the same as below.

After calculating each probability, the classifier predicts the type of the object as the type of which the probability is higher(if P(cup|X)>P(plate|x), the classifier predicts the type of the object as ‘cup’)

While this type of naive Bayesian classifier is applicable for categorical features, we can’t use it with numerical or indiscrete features. While I would love to explain this in this post, I’m afraid this post already quite long. So, I recommend reading this if you’re interested in this.

Marine cleanup

So, we detected places that are likely to have marine debris floating around with FDI and confirmed that the detected debris is plastic garbage. So, what now? How do we actually clean up the detected plastic garbage in the ocean? Well, there are multiple ways many environmental agencies are currently using to scoop garbage out of water. One example of it is the ocean net created by the Ocean cleanup, an environmental group dedicated to removing plastic from the ocean. The sea net utilizes natural forces such as waves, winds, and currents to catch floating plastic waste.

The Ocean cleanup sea net. Image source: https://theoceancleanup.com/oceans/

While the sea net is a great idea, it requires someone to pilot a vessel and periodically collect the accumulated garbage caught in the net. This sets a limit on how many sea nets can be utilized at once and the total area the nets can cover, therefore, limiting how much total trash can be collected from the ocean. While there are many ways of overcoming this limit, we are going to look at how AI was used to go over the limit(The name of the blog is “Utilizing AI to Remove Oceanic Plastic” after all).

Wasteshark is an automated drone developed by RanMarine Technology that is designed to automatically detect and collect garbage in piers, harbors, and other coastal areas.

A picture of a Wasteshark drone. Image source: https://www.wasteshark.com/

Let’s imagine that we want to make an autonomous drone that detects garbage floating on the sea and collects them. What methods could we use to detect garbage from the ocean? One of the simplest ways to do that would be to attach an underwater camera to the drone and detect oceanic garbage from the images the camera takes. In the next blog post, we will learn the AI techniques we can use to detect garbage from underwater images.

Thank you for reading my blog post!

Andrew Chang is a Student Ambassador in the Inspirit AI Student Ambassadors Program. Inspirit AI is a pre-collegiate enrichment program that exposes curious high school students globally to AI through live online classes. Learn more at https://www.inspiritai.com/ .

High school student interested in AI and Programming

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store