It’s one of society’s worst kept secrets: Most plastic thrown into the blue and green bins doesn’t actually get recycled. In fact, studies show that barely 5 percent of all plastic intended for recycling facilities makes it through the process and back into new products. There are a number of factors that contribute to this strikingly low number—including contaminated materials, water requirements, and discarded waste—but it’s a problem made even worse by the fact that the average American’s plastic waste consumption has increased 263 percent since 1980.

It’s a serious situation that needs a solution sooner than later, and researchers are on the hunt for an efficient and effective fix. As detailed in a paper published with Frontiers in Sustainability, a team at University College London has developed a new machine learning model capable of isolating compostable and biodegradable plastics from conventional varieties to improve recycling efficiency and accuracy.

[Related: Can recycling close the loop on EV batteries?]

Most of today’s plastics fall within a handful of categories possessing different chemical makeups—polyethylene (PET) and polypropylene (PP) compose the majority of drinking bottles and food containers, while low-density polyethylene (LDPE) can be found in items like plastic bags and packages. Meanwhile, compostable options featuring polylactic acid (PLA) and polybutylene adipate terephthalate (PBAT) are generally in tea bags, magazine wrappings, and coffee cup lids. Finally, biomass-derived plastics from palm-leaf and sugar cane are often used in other packaging needs.

Recycling and composting only works well when these variants are properly sorted and handled appropriately. Cross-contamination often dilutes efficacy, wasting valuable time and energy. To improve this, researchers developed a classification system based on hyperspectral imaging (HSI), which scans materials’ chemical signatures to produce a pixel-by-pixel description of samples. A machine learning (ML) program was then trained on this data, and subsequently employed to look at and sort individual pieces of plastic waste.

[Related: How to actually recycle.]

When plastic materials were larger than 10mm by 10mm, the team’s model achieved perfect accuracy in sorting. While the rates dropped—sometimes precipitously—depending on size and material, the ML program’s initial results show immense promise if honed and scaled up to meet industrial demands.

“The advantages of compostable packaging are only realized when they are industrially composted and do not enter the environment or pollute other waste streams or the soil,” Mark Miodownik, a professor of materials and society within UCL’s department of mechanical engineering and paper corresponding author, said in a statement, adding that they “can and will improve it since automatic sorting is a key technology to make compostable plastics a sustainable alternative to recycling.”