The script is adapted to Sentinel-2 Level-1C images. It separates land from water using the Normalised Difference Water Index (NDWI). It displays land in natural colour. On the water, it should display the presence of plastic in the water on a dark blue/yellow scale, with dark blue representing no contamination. My prototype does not work reliably but it is a proof of principle in an emerging and pressing area with current, active research. It probably works best (gives the least false positives) around Lesbos, Greece, where most data originated from.
The author tested different machine learning methods (different versions of the support vector machine with linear, polynomial and radial basis function kernels), and selected the best found. For training, he labeled 115 pixels (13 with plastic, 102 without), and used all 12 bands which reach the bottom of the atmosphere as explanatory variables (B01, B02, B03, B04, B05, B06, B07, B08, B8A, B09, B11, B12). Plastic labeling comes from a study where researchers placed three 10m by 10m frames full of plastic material into the sea for a single overpass of Sentinel-1 and -2 satellites (2018-06-07, the beach of Tsamakia of Mytilene, N 39.10769, E 26.56523, WGS84).
Given more images of plastic (just more pixels!), more area in images that are known to contain no plastic, more effort spent labeling, and by testing a wider range of machine learning models, major improvements are possible. There is a research group working on this (Dr. Lauren Biermann, Plymouth Marine Laboratory, UK).
Bence Mélykúti, DPhil (Oxf)
Author’s visualisation shows the script detecting the three 10-by-10-metre patches of plastic that was placed on the water by researchers. This is the positive data used for the training. The same three patches are also seen on the Sentinel Hub EO Browser running the script. The script shows around the southeast tip of Lesbos island some vessels and an interesting pattern of three rows of some man-made structure off the coast. (All from the 2018-06-07 detection.)
 Konstantinos Topouzelis, Apostolos Papakonstantinou, Shungudzemwoyo P. Garaba. Detection of floating plastics from satellite and unmanned aerial systems (Plastic Litter Project 2018). Int J Appl Earth Obs Geoinformation 79 (2019) 175ñ183.
 Lauren Biermann, Victor Martinez Vincente, Sevrine Sailley, Aser Mata, and Christopher Steele. Towards a method for detecting macroplastics by satellite: examining Sentinel-2 earth observation data for floating debris in the coastal zone. Geophysical Research Abstracts Vol. 21, EGU2019-17469, 2019. European Geosciences Union General Assembly 2019.
 Jonathan Amos. Can you spot ocean plastic from space?, BBC News, 12 April 2019.
 Sentinel satellites track ocean plastic. Interview with Dr Lauren Biermann by Jonathan Amos. BBC News, 12 Apr 2019.