# Hyperspectral Classification of Recyclable Plastics in Industrial Setups

Georgios Alexakis, Michail Maniadakis

► To cite this version:

Georgios Alexakis, Michail Maniadakis. Hyperspectral Classification of Recyclable Plastics in Industrial Setups. 19th IFIP International Conference on Artificial Intelligence Applications and Innovations (AIAI), Jun 2023, León, Spain. pp.416-428, 10.1007/978-3-031-34111-3_35. hal-05449786

HAL Id: hal-05449786

https://inria.hal.science/hal-05449786v1

Submitted on 9 Jan 2026

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons CC BY 4.0 - Attribution - International License
<figure><img src="image_2.png" /></figure>

ifip

International Federation for Information Processing

This document is the original author manuscript of a paper submitted to an IFIP
conference proceedings or other IFIP publication by Springer Nature. As such, there
may be some differences in the official published version of the paper. Such
differences, if any, are usually due to reformatting during preparation for publication or
minor corrections made by the author(s) during final proofreading of the publication
manuscript.
# Hyperspectral Classification of Recyclable Plastics in Industrial Setups

Georgios Alexakis and Michail Maniadakis(✉)

Foundation for Research and Technology Hellas, Heraklion, Crete, Greece
{geosalexs,mmaniada}@ics.forth.gr

**Abstract.** The development of the circular economy has attracted significant research interest in recent years. The present work explores the use of HyperSpectral Imaging (HSI) sensors and Machine Learning (ML) techniques for the categorization of recyclable plastics in challenging industrial conditions. Specifically, we present the pipeline for the pre- and post- processing of the spectral signals and we compare four well-known classifiers in categorizing plastics into seven material types, according to the international standards of the circular economy and material recycling in particular. The obtained results show that hyperspectral technology can contribute to the successful categorization of plastics in industrial conditions.

**Keywords:** Hyperspectral Imaging · Machine Learning · Classifier · Industrial Application · Material Recovery

## 1 Introduction

Waste management is a significant global issue which we hope to successfully address by following the circular economy model. Essentially, the recycling of materials is where the loop is closed for circular waste management. The sorting of post-consumer waste in different material types is a complicated and expensive task that, to date, has been mostly done manually. However, in recent years there have been several activities focused on automating the treatment of recyclables for material recovery, which leverage recent advances in artificial intelligence and robotics [1, 7, 9, 10].

Interestingly, the classification of recyclables into different material types can be significantly enhanced by HyperSpectral Imaging (HSI) sensors that collect a whole spectrum at each individual pixel of an image [4, 8]. Hyperspectral cameras have the ability to collect data outside the human "visible spectrum" which

<footnote>This work is co-financed by the European Union's Horizon Europe Research and Innovation program under project RECLAIM GA: 101070524, and additionally by the European Union and national resources of Greece and Cyprus within the framework of the INTERREG V-A Cooperation Program "Greece - Cyprus" 2014-2020, project InterRecycle MIS: 5047863.</footnote>
greatly enhances our observation capacity. Especially, when it comes to the clas-
sification of recyclables, HSI enables the direct identification of the material from
which each package is made.

While very different recyclable materials, for example paper and aluminum,
have distinct “spectral signatures” (i.e. the variation of reflectance of a mate-
rial with respect to wavelengths) which facilitates sorting. However, when we
turn to plastics, things are much more complicated [3], because plastics share
common material characteristics which makes their spectral signatures simi-
lar, and thus the distinction between them is very challenging. Nevertheless,
recycling applications assume the classification of plastics into 7 sub-categories
namely Polyethylene Terephthalate (PET), High Density Polyethylene (HDPE),
Polyvinyl Chloride (PVC), Low Density Polyethylene (LDPE), Polypropylene
(PP), Polystyrene (PS), and Others.

Recent works have investigated the combined use of hyperspectral imaging and Artificial Intelligence to categorize plastics in controlled laboratory environments [3, 4, 8]. The present study explores the applicability of hyperspectral imaging in a real material recovery facility which can be largely affected by weather conditions and humidity, while at the same time, plastic recyclables suffer from uncontrolled dirt. In particular, we compare four well-known supervised classification algorithms in identifying and classifying plastics in waste streams. The obtained results verify the applicability and the potential of hyperspectral imaging for sorting recyclable plastics in real world industrial applications. From a methodological perspective the current work highlights the importance of pre- and post- processing steps that are essential to reveal the value of spectral data and make them useful in for industrial applications.

By moving hyperspectral imaging to the particularly challenging domain of
recyclable categorization the present work aims to provide valuable guidelines
that facilitate the wider use of hyperspectral imaging in a range of different
industrial applications.

2 Experimental Setup

A key objective of the present study is the development of a hyperspectral imag-
ing approach for plastics classification, which would be applicable in real material
recovery facilities. To meet this requirement, we exploit the industrial research
setup that is available at the Heraklion MRF on the island of Crete, Greece.
This setup is open on two opposite sides and therefore 24/7 connected to the
open space, which means our approach has to deal with significant fluctuations
in air-humidity and dirt, which is known that both affect hyperspectral imaging.

The experimental configuration used in the present study consists of three
main parts (see Fig. 1). The first is the hyperspectral camera and the illumination
unit, as the sensing part of the equipment. The second is the conveyor belt, that
carries recyclable materials for sorting (the current work focuses on plastics).
The last part is the computer that actually processes the acquired hyperspectral
data to classify the observed objects in different material types.
The hyperspectral imaging camera is a Specim FX17e which has been installed 1.2 m above the conveyor belt. The camera is in fact a line scanner that scans vertically to the flow of the belt. An industrial 80 cm wide conveyor belt is used to transfer recyclables at a constant speed, which in our case is set to 35 cm/s. The illumination unit consists of 4 × 500 W Quartz, 8550 Lumens halogen lamps that are positioned 40 cm above the conveyor belt with 45° inclination, so that the acquired data is minimally affected by the variations of ambient light. We use an industrial fan-less PC that can safely operate in humid and dirty environments. The processing of the hyperspectral data is summarized below.

<figure><img src="image_3.png" /><figcaption>Fig. 1. Overview of the experimental setup</figcaption></figure>

## 3 Hyperspectral Processing Pipeline

Given that the implemented system is applied in industrial conditions, it is crucial to enhance its robustness against potential variations in the operating environment, such as ambient lighting, air humidity, dust/dirt and other parameters that cannot be fully controlled. Similar to previous works [6], we have implemented a pipeline for processing hyperspectral images that consists of seven steps, as illustrated in Fig. 2. The implementation of the relevant modules is summarised in the following sections.

### 3.1 Image Acquisition

We use a hyperspectral line scanner that captures 640 pixels per line. Each pixel consists of 224 spectral bands with a 12 bit representation, which spans
<figure><img src="image_4.png" /><figcaption>Fig. 2. HSI Pipeline</figcaption></figure>

between 900–1700 nm. Therefore, in analogy to standard RGB cameras where each pixel is represented by 3 values, in the hyperspectral camera case each pixel is represented by 224 values.

The camera's frame rate and exposure time have been experimentally set to 190 fps and 4 ms respectively, following a trial and error procedure which aimed to minimize the visually observed noise in the collected data.

During operation, line scans are processed in batches. Typically, we capture 1000 lines to construct a hyperspectral cube consisting of (1000 lines) × (640 pixels) × (224 bands), that is used for material detection, localization and categorization. Early visualization of the recorded data can be achieved by following a pseudo-coloring approach that uses 3 bands (out of the 224 recorded) to construct and visualise an ordinary RGB image, as shown in Fig. 3.

## 3.2 Radiometric Calibration

After the acquisition of raw image data, radiometric calibration is essential to ensure the accuracy and repeatability of the data provided by the hyperspectral camera. Relative radiometric calibration is adopted in the present work which means that the output of the sensor is normalized in relation to a reference frame so that a uniform response is obtained for the subsequent frames [5]. Typically, the performance of a hyperspectral camera is characterized by the white and dark frames it captures. These two frames are used as references in radiometric calibration, to enhance the integrity and validity of the obtained data [13, 14].

To record the white reference frame, we use a wooden stick wrapped 10 times with white PTFE, which is a handy and low-cost alternative of the spectralon calibration board. The dark frame is obtained by closing the shutter of the
<figure><img src="image_5.png" /></figure>

<figure><img src="image_6.png" /><figcaption>Fig. 3. Indicative snapshot of the experimental procedure. The left image shows the arrangement of 7 recyclables (plastic categories PP, PVC, LDPE, OTHERS, PS, PET, HDPE) using an ordinary RGB representation. The right image shows the pseudo-colored raw image captured by the hyperspectral camera Specim FX17e.</figcaption></figure>

camera. In both cases 100 frames are captured and then the 2D mean frame is calculated by taking, for each spectral band, the mean of the corresponding values in all 100 frames.

Then, at run time, each line scan capturing raw (R) data is normalized against the corresponding spectral band values in the dark (D) and the white (W) reference frames according to the following formula:

$$Refl. = \frac{R - D}{W - D} \qquad (1)$$

which represents the normalised reflectance at the given spectral band.

## 3.3 Smoothing via Savitzky-Golay Filter

Savitzky-Golay filtering, also called the Digital Smoothing Polynomial (DISPO) filtering, is a smoothing method used to remove noise from a signal [12]. It is a finite impulse response filter that is based on a least squares polynomial fit over a moving window of data. The re-sampling of the fitted polynomial corrects the original recorded data without distorting the information content of the signal.

The Savitzky-Golay filter is frequently used in absorption spectroscopy, [2, 11] because it places more emphasis on preserving spectral properties than eliminating noise. In the current work, Savitzky-Golay filtering is used with a moving window of 8 spectral bands and polynomial order 2 to avoid essential information loss. Indicative results of Savitzky-Golay filtering are shown in Fig. 4.

## 3.4 Standard Normal Variate (SNV)

The Standard Normal Variate (SNV) normalization aims at eliminating the effect that environmental conditions may have on data collection, and thus to make all
<figure><img src="image_7.png" /><figcaption>Fig. 4. Smoothing via Savitzky-Golay filter to PETE spectrum (raw data with red and Savitzky-Golay filtered data with blue) (Color figure online)</figcaption></figure>

gathered spectra more comparable. This is achieved by subtracting each spectrum by its own mean and dividing it by its own standard deviation. After this transformation, every spectrum will have 0 mean, and 1 standard deviation.

In detail, the SNV is implemented by the following equation, where $y_{i,j}$ are the calibrated pixel elements, $i$ represents the pixel, $j$ represents the spectral bands, $y_i$ is the mean value of the spectral signature of the pixel $i$, and $n$ is the number of spectral bands:

$$SNV_{i,j} = \frac{y_{i,j} - y_i}{\sqrt{\sum_{j=1}^{n} \frac{(y_{i,j} - y_i)^2}{n-1}}} \quad (2)$$

SNV is necessary for the correction of the spectra due to light scattering, changes in surface roughness and other environment disturbances. As shown in Fig. 5, SNV normalization can crucially facilitate spectrum comparison and the development of spectrum classifiers.

## 3.5 Dimensionality Reduction

We use Principal Component Analysis (PCA) to reduce the dimension of the 224 measurements included in each hyperspectral observation, while preserving the maximum amount of the information encoded in the recorded spectrum. In short, PCA aims to reduce the size of a dataset through a linear transformation that approximately describes the original data with fewer dimensions, with the algorithm focused on minimizing the loss of information.

In this paper PCA is used to project the recordings obtained in 224 spectral bands onto only the first 4 principal components that can sufficiently preserve most of the data's variation. In that way, the dimension of the hyperspectral
<figure><img src="image_8.png" /><figcaption>Fig. 5. Normalization of PETE spectra before and after the SNV transformation.</figcaption></figure>

data is significantly reduced (from 224 to 4) enabling all subsequent processing steps to be implemented more efficiently and in less time.

## 3.6 Classification

To enable the identification of objects and their categorization to one of the available material types, we examine four different supervised classification methods, applied to categorize separately each pixel of the hyperspectral image. The classification methods considered in the present work are summarized below.

**Support Vector Machines (SVM).** The objective of the SVM algorithm is to find a hyperplane in the *N*-dimensional space (*N* is the number of input features) that distinctly classifies the data points. The SVM marks every training data as belonging to one side of the Hyperplane. Therefore, SVM operates as a binary classification method. For multi-class classification, the same principle is used by dividing the multi-class problem into multiple binary problems.

The current work uses the Radial Basis kernel function which is very common in spectral imaging due to its ability to ignore outliers. The algorithm is applied with a dynamic “gamma” which controls the effect of samples near the separation line and a relatively high “penalty” parameter value which enforces the correction of mis-classified pixels.

**Random Forest (RF).** Random Forest is another supervised machine learning method that is used in classification problems. RF builds inference mechanisms by constructing a multitude of decision trees. During training, the decision tree grows incrementally using randomly selected subspaces of data to improve decision accuracy.

The RF approach aggregates the results of the individual decision trees through a voting mechanism to provide a single output. In that way RF can effectively tackle the well known over-fitting problem of decision trees. In the current work we use forests populated with 10 decision trees each one having a maximum depth of 60. This configuration seems to balance effectively between training speed and high classification accuracy.
**K-Nearest Neighbors (KNN).** This is a relatively simple, instance-based supervised learning algorithm that is very popular in tackling classification problems. According to the KNN algorithm a new data point is assigned to the most common class among its nearest neighbors, where *k* refers to the number of nearest neighbours to include in the majority voting process.

The KNN algorithm has been extensively used in classification problems due to its simplicity and ability to work with multi-class problems dealing with both linear and non-linear data. Still, it is computationally expensive to find the *k* nearest neighbours for new samples and this can affect the use of KNN in hyperspectral imaging applications where the number of pixels (data samples) is very high. In the current work we have used neighborhoods of *k* = 3 neighbors.

**Multi-layer Perceptron Classifier (MLP).** The Multi-layer Perceptron is a well-known feedforward artificial neural network that uses layers of interconnected neurons to transform inputs to targeted values. Each neuron transforms the outputs of the preceding layer using a non-linear activation function, such as the sigmoid function or the rectified linear unit (ReLU) function. The functionality of the network is tuned using the so called “back-propagation” gradient descent optimization algorithm, which aims to adapt neuron parameters and interconnection weights across layers, in the direction that minimizes the output error in relation to a targeted value. In the present work, we develop an MLP classifier with 3 layers of neurons consisting respectively of 150, 100, 50 neurons that use the ReLU function.

## 3.7 Post-processing

The output of the classifiers is used to construct a 2D image, where each material type is visualized with a different color. In this image, several outlier pixels appear as noise which should be cleared out. This is accomplished by implementing a binary image separately for each examined material type (i.e. different colour). Then, connected component analysis is performed to find sufficiently large regions that correspond to the examined material. Regions below 1000 pixels are omitted. Finally, the morphological operations of the dilation and erosion are applied for hole filling and region smoothing. After applying the above steps separately for each examined material, the obtained images are united back into the composite image that is recolored using the original, material specific color map.

# 4 Experimental Results

The data acquisition process took place in the industrial material recovery facility of Heraklion, Crete, Greece, using real recyclables, which were dirty and deformed. On a daily basis, prior to the recording of data, dark and white reference images were acquired, which have been used for radiometric calibration to compensate for environmental variations (see Sect. 3.2).
The dataset captured is associated with all seven plastics categories considered in recycling (PET, HDPE, PVC, LDPE, PP, PS, Others) plus the belt background. Multiple objects for each material type have been used for data acquisition. As mentioned earlier, all captured images consist of 1000 lines, 640 pixels per line, and 224 spectral bands per pixel. The data samples to be processed are collected as individual pixels in the form of a 224-values vector, which are manually associated to the targeted material type represented as a scalar with 8 available options (7 types of plastics + background). In particular, the composition of the dataset is as follows, 6814 pixels for Background, 4507 for PET, 4752 for HDPE, 3337 for PVC, 4224 for LDPE, 4510 for PP, 3852 for PS and 2416 for Others. Following the approach proposed in the current work, all captured pixels are examined one-by-one to be classified into one of the 8 available options.

To minimize execution time, Radiometric Calibration, Spectra Smoothing and Standard Normal Variate normalization are applied per line in parallel running threads. Then, PCA implements dimensionality reduction to compress the initial 224-long vectors to much smaller four-values long vectors that are used as input to the classifiers.

The input-output pairs are randomly divided into two separate sets to be used for the training (70% of samples) and the testing (30% of samples) of the four classifiers discussed above. To facilitate comparisons, all classifiers are optimized and assessed with the same training and testing dataset.

After training, the classifiers are used to separately classify each pixel of the test set. The obtained results are summarised in Table 1, which shows the scores of the algorithms in terms of classification accuracy and the processing time for the whole test set. MLP and SVM have the highest accuracy, as well as the lowest execution times. The Random Forest classifier has the worst results in terms of both the classification accuracy and execution time. Clearly our results do not favour the applicability of HSI in real time applications, since the minimum processing time achieved was 3 s. However, minimizing processing time was not a priority for the current work and there is likely room for further improvement (e.g. by adopting GPU processing).

<table><caption>**Table 1.** Accuracy of the classifiers on the testing dataset.</caption><thead><tr><td>Algorithm</td><td>Accuracy</td><td>Execution Time</td></tr></thead><tbody><tr><td>SVM</td><td>98.05%</td><td>3 s</td></tr><tr><td>RF</td><td>93.16%</td><td>54 s</td></tr><tr><td>KNN</td><td>97.55%</td><td>22 s</td></tr><tr><td>MLP</td><td>99.50%</td><td>7 s</td></tr></tbody></table>
Furthermore, we assess the performance of the classifiers in real-world previously unseen images. The classifiers are again applied pixel-wise, and the output is reconstructed as a 2D image to facilitate visual inspection. To estimate classification accuracy we contrast the result of each classifier with the ground truth image. The obtained results are visually illustrated in Fig. 6. We can easily see that the pixels of the different objects are mostly successfully categorized, with the exception of some edges, which are miss-categorized because of the 3D shape of the objects, which affects light reflectance at the border of the objects.

To improve the classification accuracy, the post-processing steps summarized in Sect. 3.7 are applied on each one of the images shown in Fig. 6. To quantify the improvement accomplished by post-processing, we contrast the accuracy of the result in relation to the ground-truth, before and after post-processing. We consider the commonly used Peak Signal-to-Noise Ratio (PSNR), which quantifies the similarity between the targeted and the actually obtained image. The comparative results are summarized in Table 2. Even if the quantitative comparison do not show drastic improvements in terms of accuracy and PSNR, this is mainly because post-processing is focused on local scale corrections.

<table><caption>**Table 2.** The pixel-wise classification accuracy and PSNR for the whole image, “before” and “after” post-processing, in relation to the ground-truth data.</caption><thead><tr><th rowspan="2">Classifier</th><th colspan="2">Before Post-Processing</th><th colspan="2">After Post-Processing</th></tr><tr><th>Accuracy</th><th>PSNR</th><th>Accuracy</th><th>PSNR</th></tr></thead><tbody><tr><td>SVM</td><td>95.62%</td><td>41.39 dB</td><td>95.83%</td><td>41.98 dB</td></tr><tr><td>RF</td><td>95.05%</td><td>40.25 dB</td><td>95.27%</td><td>40.94 dB</td></tr><tr><td>KNN</td><td>95.65%</td><td>40.81 dB</td><td>95.86%</td><td>41.22 dB</td></tr><tr><td>MLP</td><td>95.33%</td><td>41.12 dB</td><td>95.72%</td><td>41.89 dB</td></tr></tbody></table>

Finally, the current work assumes that the recyclables are spread out on the conveyor belt with minimum overlap, so when two (non-background) materials touch each other with an edge that is longer than the 1/3 of the perimeter of the object, they are consolidated into one object with its material determined by the type of the largest area. This facilitates correct identification and masking of all objects (due to space limitations this is not visualized, as we preferred to dedicate the space to the intermediate steps).
<figure><img src="image_9.png" /><figcaption>**Fig. 6.** The material predicted by each classifier, depicted by a material-specific colormap.</figcaption></figure>
# 5 Conclusions

The current work investigates the applicability of hyperspectral imaging in industrial application and specifically in the challenging environment of recyclable material recovery. We compare four well-known classifiers in sorting plastic packages to the categories officially used in waste recycling. The obtained results demonstrate the high potential of hyperspectral imaging in the given application domain.

Our ongoing work focuses on the integration of the developed technology with the robotic system already installed at the material recovery facility, which will enable the full-day assessment of the composite system.

# References

1. Bashkirova, D., et al.: Zero Waste dataset: towards deformable object segmentation in cluttered scenes. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 21147-21157 (2022)

2. Beitollahi, M., Hosseini, S.A.: Using Savitsky-Golay smoothing filter in hyperspectral data compression by curve fitting. In: Iranian Conference on Electrical Engineering (ICEE), pp. 452-457 (2018). https://doi.org/10.1109/ICEE.2018.8472702

3. Capobianco, G., Bonifazi, G., Serranti, S., Palmieri, R.: Hyperspectral imaging applied to the waste recycling sector. Spectro. Eur. 31, 8-11 (2019)

4. Henriksen, M.L., Karlsen, C.B., Klarskov, P., Hinge, M.: Plastic classification via in-line hyperspectral camera analysis and unsupervised machine learning. Vib. Spectrosc. 118, 103329 (2022)

5. Honkavaara, E., et al.: Digital airborne photogrammetry-a new tool for quantitative remote sensing?-A state-of-the-art review on radiometric aspects of digital photogrammetric images. Remote Sens. 1(3), 577-605 (2009)

6. Karaca, A.C., Ertürk, A., Güllü, M.K., Elmas, M., Ertürk, S.: Automatic waste sorting using shortwave infrared hyperspectral imaging system. In: 2013 5th Workshop on Hyperspectral Image and Signal Processing: Evolution in Remote Sensing (WHISPERS), pp. 1-4 (2013). https://doi.org/10.1109/WHISPERS.2013.8080744

7. Koskinopoulou, M., Raptopoulos, F., Papadopoulos, G., Mavrakis, N., Maniadakis, M.: Robotic waste sorting technology: toward a vision-based categorization system for the industrial robotic separation of recyclable waste. IEEE Robot. Autom. Mag. 28(2), 50-60 (2021). https://doi.org/10.1109/MRA.2021.3066040

8. Kraśniewski, J., Dąbała, L., Lewandowski, M.: Hyperspectral imaging for analysis and classification of plastic waste. In: 2020 25th International Conference on Pattern Recognition (ICPR), pp. 4805-4812 (2021). https://doi.org/10.1109/ICPR48806.2021.9412737

9. Leveziel, M., Laurent, G.J., Haouas, W., Gauthier, M., Dahmouche, R.: A 4-DoF parallel robot with a built-in gripper for waste sorting. IEEE Robot. Autom. Lett. 7(4), 9834-9841 (2022)

10. Raptopoulos, F., Koskinopoulou, M., Maniadakis, M.: Robotic pick-and-toss facilitates urban waste sorting. In: 2020 IEEE 16th International Conference on Automation Science and Engineering (CASE), pp. 1149-1154 (2020). https://doi.org/10.1109/CASE48305.2020.9216746
11. Ruffin, C., King, R.: The analysis of hyperspectral data using Savitzky-Golay filtering—theoretical basis. 1, vol. 2, pp. 756–758, February 1999. https://doi.org/10.1109/IGARSS.1999.774430

12. Savitzky, A., Golay, M.J.E.: Smoothing and differentiation of data by simplified least squares procedures. Anal. Chem. **36**(8), 1627–1639 (1964). https://doi.org/10.1021/ac60214a047

13. Shaikh, M.S., Jaferzadeh, K., Thörnberg, B., Casselgren, J.: Calibration of a hyperspectral imaging system using a low-cost reference. Sensors **21**(11), 3738 (2021)

14. Shuqiang, L., Huang, C., Hou, M.: Reflectance reconstruction of hyperspectral image based on gaussian surface fitting. In: International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences (ISPRS), pp. 1365–1369, August 2020