# Precision Measurement for Industry 4.0 Standards towards Solid Waste Classification through Enhanced Imaging Sensors and Deep Learning Model

Authors: Leow Wei Qin; Muneer Ahmad; Ihsan Ali; Rafia Mumtaz; Syed Mohammad Hassan Zaidi; Sultan S. Alshamrani; Muhammad Ahsan Raza; Muhammad Tahir
Journal: Wireless Communications and Mobile Computing
 (2021)

---

## Abstract

Achievement of precision measurement is highly desired in a current industrial revolution where a significant increase in living standards increased municipal solid waste. The current industry 4.0 standards require accurate and efficient edge computing sensors towards solid waste classification. Thus, if waste is not managed properly, it would bring about an adverse impact on health, the economy, and the global environment. All stakeholders need to realize their roles and responsibilities for solid waste generation and recycling. To ensure recycling can be successful, the waste should be correctly and efficiently separated. The performance of edge computing devices is directly proportional to computational complexity in the context of nonorganic waste classification. Existing research on waste classification was done using CNN architecture, e.g., AlexNet, which contains about 62,378,344 parameters, and over 729 million floating operations (FLOPs) are required to classify a single image. As a result, it is too heavy and not suitable for computing applications that require inexpensive computational complexities. This research proposes an enhanced lightweight deep learning model for solid waste classification developed using MobileNetV2, efficient for lightweight applications including edge computing devices and other mobile applications. The proposed model outperforms the existing similar models achieving an accuracy of 82.48% and 83.46% with Softmax and support vector machine (SVM) classifiers, respectively. Although MobileNetV2 may provide a lower accuracy if compared to CNN architecture which is larger and heavier, the accuracy is still comparable, and it is more practical for edge computing devices and mobile applications.


---

## Body

## 1. Introduction

Industry 4.0 standards require cutting-edge solutions to prevent, reduce, and even eradicate solid waste to ensure a pollution-free and sustainable environment [1]. As defined by the Environmental Protection Agency (EPA), municipal solid waste (MSW) is a trash from sources that include residential, commercial, and institutional locations, such as businesses, schools, and hospitals [2]. However, the definition of MSW by EPA does not include industrial, hazardous, or construction and demolition (C&D) waste. MSW is locally handled by each municipality [3].Municipal solid waste (MSW) can generally be classified into two categories: organic and inorganic categories [4]. To break it down further, organic waste consists of food waste and yard waste, while inorganic waste contains plastics, metal, cans, paper, glass, and others [5]. The waste composition differs from country to country as they are subjected to the influence of many factors, such as level of economic development, cultural norms, geographical location, energy sources, and climate. Inorganic waste such as plastics, paper, and aluminium increases while the relative organic waste decreases when a country urbanizes and populations become wealthier [6]. On the other hand, for low- and middle-income countries, organic waste would form the majority percentage in the urban waste stream, ranging from 40 to 85% of the total [7]. Paper, plastic, glass, and metal fractions increase in the waste stream of the middle- and high-income countries [8].Significant advancement in the standard of living will inevitably increase MSW generation [9]. This is because when the population’s spending power increases, consumption of goods and services increases as well [10]. When consumption increases, the population will demand more resources like water, energy, minerals, and land which will give rise to the amount of waste generated [11]. Along with a higher standard of living, the increasing population from rural areas to urban areas had also contributed to a higher MSW generation rate [12]. Based on an estimation by World Bank, currently, 1.3 billion tons of waste is generated annually over the world, and this amount will increase to 2.2 billion tons annually by 2025 [13]. Thus, if waste is not managed properly, it would bring about an adverse impact on health, the economy, and the global environment. It was also reported that improper management of waste will result in a cost higher than what it would have cost if waste was managed appropriately in the first place. As such, like it or not, all parties will need to assume more responsibility for waste generation and disposal, specifically, product design and waste separation [14].Considering that waste is mainly a by-product of consumer-based lifestyles that is the main driver of the world’s economies, in most cases, the fastest way to reduce waste generation is to reduce economic activity [15]. However, a reduction in economic activity would not be attractive [16]. With that, EPA has recognized MSW recycling as the second most environmentally sound strategy for dealing with urban waste [17].The recent ICT-driven solutions have played a substantial role in MSW management. The state-of-the-art technologies, i.e., computer vision, edge computing, IoT, machine learning, and deep learning, have been proven to be an enormous support to achieve industry 4.0 standards [18]. The current industry employs the latest MSW management tools that are economically and computationally inexpensive and efficient [19].The accurate classification of MSW employing machine learning models has considerably benefited the MSW stakeholders. [20] proposed machine learning as a useful tool for accurate prediction and management of solid waste in Canada based on socio-economic and demographic variables. The study applied decision trees and neural networks to build the models. Ultimately, the study developed an integrated framework for accurate classification and management of municipal solid waste of 220 municipalities of Ontario. Similarly, [21] developed algorithms to understand the patterns of solid waste generations using machine learning and small area estimation techniques. The study incorporated the prediction of MSW to quantify the future estimates of waste generation to ease the recycling of waste materials for reusability. With these advancements, the ML algorithms, i.e., regression classification, naïve Bayes classification, support vector machine classification, decision trees, KNN, random forests, and CNN, have bestowed computationally inexpensive and fruitful solutions for MSW classifications. As the main advantages of these solutions, efficient resource utilisation has given economical solutions to local and urban waste management [22]. Thus, significantly assisted in achieving a sustainable and pollution-free environment and enhanced the quality and standards of lives of common people [23].


## 2. Related Works

The study observes many citations related to forecasting future solid waste generation and its quantification, e.g., [24]. Similarly, another good number of citations can be observed for MSW using sensors and IoT devices, e.g., [25, 26]. On contrary, the study could find a little citable work related to optimization or enhancement of solid waste classification methods developed for edge computing devices or other lightweight applications. Among the recent citations, [27] developed an automated recognition system employing a deep learning algorithm for the classification of solid waste objects as biodegradable and nonbiodegradable.Moving on, [28] used two models, namely, support vector machine (SVM) and CNN for waste image classification. SVM was used based on the principle of processing features in space higher than the original features space. Using a higher feature space, the data was divided into different categories using a hyperplane. SVM computed the selection of planes to develop the largest separation of different categories among the data. For CNN, the study had implemented an architecture that was similar to AlexNet but smaller due to computational constraints. At that point, there were no publicly available datasets, and the study initially found Flickr Material Database and Google Images. However, the images could not accurately represent the state of recycled goods. Such issues resulted in the creation of a new dataset named TrashNet that contained around 2400 images with six different classes. Data augmentation techniques such as random rotation, random brightness control, random translation, random scaling, and random shearing were applied to increase the dataset size. Surprisingly, SVM performed better than CNN even though SVM is a much simpler model. The authors believed that the poor performance of CNN was due to suboptimal hyperparameters.Another work done by [29] proposed an image classification model related to MSW management. The study employed a camera to picture the solid waste and categorize it according to five defined waste categories trained on a dataset of 400-500 images. In a similar context, [30] employed SVM for the supervised classification of solid waste. The study segregated the solid waste images into recyclable or nonrecyclable.The study done by [31] leveraged the transfer learning using a pretrained network utilizing AlexNet, GoogLeNet, VGG-16, and ResNet to classify waste images with different categories with the TrashNet dataset. In the final output layer of the CNN, different classifiers were used, namely, Softmax and support vector machine (SVM). The study segregated training and testing data into equal halves without performing any further data augmentation.[32] used VGG-19 for the waste image classification. The study used data augmentation such as shear, rotation, zooms, and shifts in addition to resizing images to 224×224×3 dimensions before feeding the network. The classification layer of pretrained VGG-19 was removed and replaced by a fully connected layer of 256 neurons with ReLU activation function with a dropout of 0.6 and batch normalization. The model was trained using a batch size of 32, and the authors observed a learning rate between 0.001 and 0.0001 bestowed better results. The lower validation accuracy depicted the overfitting of the model even though [31] and [32] had managed to train the CNN model with high accuracy. The CNN architecture used, e.g., AlexNet, contained about 62,378,344 parameters, and over 729 million FLOPs required classifying a single image. A deep architecture as AlexNet or VGG increases the model complexity. As a result, the deployment of these huge CNN models is often unaffordable for common computers and mobile devices. Thus, this had given rise to the need for a lightweight CNN architecture that could still achieve good results when compared to huge CNN models such as AlexNet and VGG.To create a lightweight deep neural network that could be used for embedded vision applications and mobile applications, [33] proposed a new architecture named MobileNet which is based on depthwise separable convolution. Depthwise separable convolution is a depthwise convolution followed by a pointwise convolution. Using a depthwise separable layer, the number of multiplication operations required is reduced significantly compared to normal convolution. Although being smaller in size, MobileNet has managed to achieve good results compared to other popular models such as VGG and GoogLeNet.Following the success of MobileNet, [34] proposed an improved version of MobileNet named MobileNetV2. The study incorporated two changes to MobileNet. The first change is to incorporate an expansion layer before the depthwise convolution. This module takes a low-dimensional compressed representation which is first expanded to high dimensions and later on pass-through 1×1 convolution to project it back to a low-dimensional representation. Hence, the expansion layer will always have more output channels than the input. The second change proposed by [34] is to include a residual block similar to ResNet. Each layer has batch normalization, and the activation function used is ReLU6. Only the output of the projection layer does not have an activation function. This is because the projection layer produces a low-dimensional output, and applying nonlinearity on it will destroy useful information.The magnitude of expansion is defined by the expansion factor, which is known as the width multiplier,α in MobileNet. For example, if there is an input with 24 channels and α is 6, the expansion layer will create a new feature with 24×6=144 channels. Subsequently, the depthwise convolution will be applied followed by the projection layer (1×1 convolution) which will project the 144 channels back into a smaller number, e.g., 24. The expansion and projection module is named as bottleneck layer [35]. Ideally, the number of channels should be large so that more information can be extracted. Combining both the expansion layer and projecting layer enables the model to extract more information while keeping the feature dimension rather small.


## 3. Methodology

In this research, we intend to develop an enhanced image classification model based on the lightweight feature extraction model MobileNetV2 to classify waste images into different categories according to their material. The prevailing citations of referred work in waste image classification employed convolution neural network models that were found to be larger and computationally expensive.Let us consider a collectionS=x1,x2,x3,x4,⋯.,xn,n≤N contains n images from N image space. Here, an image x is a vector such that xϵRD with D number of dimensions. Let us consider xϵRA×B×C where each A, B, and C represent the row vector, column vector, and color vector having specific indices i, j, k defined by 0≤i≤D, 0≤j≤D, and 0<k≤3.Figure1 depicts a general architecture of the proposed classification model. The input vector x is passed through a series of preprocessing steps explained below. The feature extraction of output vector x′ assists in accurate classification.Figure 1
General architecture of the proposed classification model.We breakdown the preprocessing steps of image vectorx as follows:
(1)
We apply the horizontal and vertical shearing to imagex with coordinates a and b as described in Equations (1) and (2)
(1)a′b′=a+mbb=1m01ab,(2)a′b′=amx+b=10m1ab.The horizontal and vertical shear displace the point of interest to adjust imagex for the desired shear.(2)
We apply the zooming to image vectorx and achieve another image x′ such that x is (z∗10%) of vector x. Here, z is a particular point in image x having coordinates a and b. We can assume that zooming will give us zoomed image with points (za,zb) that specify zooming points with a displacement z. It is important to note down that various zooming can be applied to predict the network better(3)
The horizontal flip applied to image vectorx with coordinates a and b produces an image x with coordinates a′ and b′ such that a′=widthvectorx–a–1 while b′=b. We can describe this phenomenon as followsCode 1
Loop (1):a in range (until the width of vector x)Loop (2):b in range (until the height of vector x)a′=widthvectorx–a–1End Loop (2):End Loop (1):Let us define the component-based scenario of our convolution neural network as(3)xP→wP→xQ→wQ→xZ→wZ→oT.Here, vectorx is an input image that is handled by the first layer of the network with weight w (the vector that processes the input x by applying weight w, and the result of this computation is forwarded to the second layer). Next, the vector xQ, which was the output of the first layer, now serves as an input for the second layer managed by weight wQ. This process keeps on going for a defined number of layers until the outcome OT (where T represents the number of output channels, i.e., prediction of an image in two or more classifications) is reached. It is important to describe that oT is a trade-off between the last predicted value of vector xZ with the desired target (e.g., M) defined by Euclidean distance d=1/2M−oT2. The distance d can also be measured using other measures, e.g., Manhattan distance.In an ideal scenario, the number of channels should be larger so to extract more information. Integration of two layers, i.e., expansion and projection layer, can significantly enable the model for extracting additional information. This holds an added value of keeping the feature dimension even small in size. The activation function ReLU6 can also be significant in this context.Figure2 showed the summarized components based on various scenarios of the proposed classification model. The adjustment of weights is essentially important to reduce the error; a gradient descent can be adopted as described in Figure 3 and below algorithm.Figure 2
Component-based scenarios of the proposed classification model.Figure 3
Gradient descent in the proposed approach.Let us consider slope and intercept to be defined by m_curr and b_curr, respectively, and both initialized to 0. Let us assume the initial learning rate as 0.01. Letn represent the length of vector x defined by n=lenx.Code 2
Loop vari in range(10000):y_predicted=m_curr∗x+b_currmd=−2/n∗∑x∗y−y_predictedyd=−2/n∗∑y−y_predictedm_curr=m_curr−rate∗mdb_curr=b_curr−rate∗ydEnd LoopThe range specifies the number of iterations; we can change the range to ensure a considerable reduction in the corresponding error value.Image preprocessing, simulation of model, and classification are an end-to-end process described as follows:(1)
Split the entire dataset into a training set and test set whereby the training set can be denoted as setS of n labelled examples: S=xi,i=1,2,3⋯n where n=2,019 or ~80% of the entire dataset, while the test set has 508 images(2)
Perform data augmentation only on the training set to increase the number of training images. Types of augmentation performed: shearing, zooming, and horizontal flipping of images(3)
Upon performing data augmentation, the number of the training set is doubled wheren=4,038(4)
The training set is fed to a pretrained MobileNetV2 CNN, which acts as a feature extractor. Note that the final output layer of the pretrained MobileNetV2 is removed(5)
The extracted features are used as input to two classifiers, i.e., Softmax and SVM, with 10-fold crossvalidation(6)
Both models are evaluated using the test set


## 4. Results and Discussion

We have employed TrashNet [32] in the research. The dataset contains 2,527 images of six waste category, namely, cardboard, glass, metal, paper, plastic, and thrash. The images were resized to dimension 224×224×3 as required by the MobileNetV2. Data Augmentation such as shear, rotation, zooms, and shifts were used. We split the dataset into training and test sets for comparative analysis.We train the model using system hardware with 16 GB RAM equipped with NVIDIA RTX 2060 GPU (6GB). To utilize GPU via Python, NVIDIA CUDA, and cuDNN are installed on the system.


### 4.1. Performance of MobileNetV2 Using Softmax

The feature extracted by the pretrained MobileNetV2 obtained from Keras was flattened and input into the newly trained Softmax classifier. As there are six classes for the waste image dataset, the Softmax classifier layer has 6 nodes. This model will be used as the base model which will be compared with MobileNetV2 using an SVM classifier. Table1 shows the accuracy, loss, precision, and recall throughout the 10-fold crossvalidation. The 10-fold crossvalidation is a good approximation method that gives unbiased and equal chance to all data points to be used fairly in the training of the model, and it ultimately enhances the accuracy, precision, and recall.Table 1
Training result (10-fold crossvalidation) for MobileNetV2 using Softmax classifier.
FoldAccuracyLossPrecisionRecallFold 191.8321.6050.9150.914Fold 292.5741.1120.9110.910Fold 387.1291.7040.9120.910Fold 485.3963.1240.9150.913Fold 591.5841.3230.9170.916Fold 691.3371.5060.9150.914Fold 789.8511.8310.9150.914Fold 884.9012.7140.9130.912Fold 985.8562.0130.9060.904Fold 1088.0892.0520.9230.922Average88.8551.8980.9140.913In terms of accuracy, the average accuracy for the 10-fold validation is 88.85%, with an average precision of 0.91 and an average recall of 0.91 as well. Generally, precision and recall close to 1 indicate that the model performs well in predicting all 6 different categories contained in our dataset. The accuracy of the model on the test set is 79.53%.Figure4 presents the confusion matrix of different objects and their classification. The blue cells depict the correct identification of objects related to other objects. Further, the precision and recall are shown in Table 2.Figure 4
Confusion matrix (test set) using Softmax classifier.Table 2
Precision and recall (test set) for MobileNetV2 using Softmax classifier.
CategoryPrecisionRecallCardboard0.9570.827Glass0.7240.752Metal0.7970.768Paper0.8260.916Plastic0.7690.722Trash0.6130.679Average0.7810.777


### 4.2. Performance of MobileNetV2 Using SVM Classifier

Similar to the base model presented above, the MobileNetV2 SVM model received the same features extracted by the pretrained MobileNetV2. Instead of using the Softmax function, SVM was used as the classifier.C parameter in SVM dictates the amount of regularization performed. Small C values led to the SVM classifier setting a larger margin when performing classification, while a larger C value led to a smaller margin. A larger margin (smaller C values) increased the misclassification rate on the training set but tended to perform better on the test set as it is more generalized. In this study, the default C value of 1.0 is used.Table3 shows the accuracy, loss, precision, and recall throughout the 10-fold crossvalidation for SVM. The SVM model resulted in an average accuracy of 94.28%, average precision of 0.947, and recall of 0.931 which are higher than the 10-fold crossvalidation of the base model (Softmax classifier).Table 3
Training result (10-fold crossvalidation) for MobileNetV2 using SVM classifier.
FoldAccuracyPrecisionRecallFold 194.3070.9540.943Fold 293.8120.9420.923Fold 394.8020.9560.937Fold 491.5840.9260.901Fold 594.3070.9310.939Fold 695.0500.9590.935Fold 792.5740.9340.907Fold 895.0500.9480.954Fold 995.7820.9620.944Fold 1095.5330.9600.927Average94.2800.9470.931Figure5 presents the confusion matrix of different objects and their classification. The blue cells depict the correct identification of objects related to other objects. Further, the precision and recall are shown in Table 4.Figure 5
Confusion matrix (test set) using SVM classifier.Table 4
Precision and recall (test set) for MobileNetV2 using SVM classifier.
CategoryPrecisionRecallCardboard0.9320.840Glass0.8310.733Metal0.7910.878Paper0.8440.908Plastic0.7940.835Trash0.8400.750Average0.8390.824The MobileNetV2 using the SVM model is then evaluated using the test set, and it provided an accuracy of 83.26%, which is approximately 4% higher than the base model. This is aligned with the result obtained by [31], which had also stated that using the SVM classifier is more accurate when paired together with AlexNet, GoogLeNet, ResNet, and VGG-16 if compared to the Softmax classifier.


### 4.3. Performance of MobileNetV2 with Global Average Pooling Using Softmax Classifier

Based on the results above, it was shown that the SVM model is more accurate than the base model. However, the base model could be further enhanced to increase the accuracy.A global average pooling layer is added to the model. To illustrate how the global average pooling layer works, given the feature extracted by the pretrained MobileNetV2 model has a dimension of7×7×1280, after applying global average pooling, the output dimension will be 1×1280.Table5 depicts the training result of 10-fold crossvalidation using global average pooling with Softmax classifier with the global average-pooling layer, the model provided an average accuracy of 87.59%, average precision of 0.913, and an average recall of 0.819 from 10-fold crossvalidation. The training accuracy is slightly lower than the base model.Table 5
Training result (10-fold crossvalidation) global average pooling using Softmax classifier.
FoldAccuracyLossPrecisionRecallFold 188.8610.3230.9090.820Fold 287.6240.3840.9130.816Fold 385.8910.4370.9140.819Fold 482.4260.4990.9180.828Fold 589.6040.3020.9110.813Fold 689.1090.3730.9130.821Fold 788.6140.3010.9120.819Fold 885.8910.3490.9130.819Fold 989.5780.3360.9110.817Fold 1088.3370.3720.9140.820Average87.5940.3680.9130.819However, the accuracy on the test set is 81.10%, which is higher than the base model. This could be due to the global average-pooling layer which may enable the model to generalize better on the test set.Figure6 presents the confusion matrix of different objects and their classification. The blue cells depict the correct identification of objects related to other objects. Further, the precision and recall are shown in Table 6.Figure 6
Confusion matrix (test set) using Softmax classifier global average pooling layer.Table 6
Precision and recall (test set) for MobileNetV2 using Softmax classifier global average pooling layer.
CategoryPrecisionRecallCardboard0.9070.840Glass0.8730.683Metal0.8270.817Paper0.8310.908Plastic0.7120.866Trash0.6400.571Average0.7980.781


### 4.4. Performance of MobileNetV2 with Additional Fully Connected Layer

Using the model with a global average pooling layer, an additional fully connected layer of 64 neurons was added. The new fully connected layer was added so that the model could pick up more complex features, which may be helpful for the waste image dataset.Table7 presents the training result of 10-fold crossvalidation for MobileNetV2 with an additional fully connected layer. With 10-fold crossvalidation, MobileNetV2 with an additional fully connected layer provided an average accuracy of 90.93%, average precision of 0.934, and an average recall of 0.887.Table 7
Training result (10-fold crossvalidation) for MobileNetV2 with an additional fully connected layer.
FoldAccuracyLossPrecisionRecallFold 191.3370.2050.9360.889Fold 291.3370.3480.9360.894Fold 388.3660.3870.9340.887Fold 494.0590.1720.9330.885Fold 589.6040.3930.9310.883Fold 689.8510.2950.9340.886Fold 791.0890.2740.9340.887Fold 891.5840.2490.9320.881Fold 991.0670.2550.9360.891Fold 1091.0670.2820.9350.888Average90.9360.2860.9340.887Figure7 presents the confusion matrix of different objects and their classification. The blue cells depict the correct identification of objects related to other objects.Figure 7
Confusion matrix (test set) using MobileNetV2 using Softmax classifier with an additional fully connected layer.Table8 describes the precision and recall (test set) for MobileNetV2 using Softmax classifier with an additional fully connected layer. With the newly added fully connected layer, the model achieved an accuracy of 83.46% on the test set, which was higher than the model with a global average pooling layer (81.10%).Table 8
Precision and recall (test set) for MobileNetV2 using Softmax classifier with an additional fully connected layer.
CategoryPrecisionRecallCardboard0.8970.864Glass0.8440.802Metal0.8210.841Paper0.860.874Plastic0.880.753Trash0.4780.786Average0.7970.820


## 4.1. Performance of MobileNetV2 Using Softmax

The feature extracted by the pretrained MobileNetV2 obtained from Keras was flattened and input into the newly trained Softmax classifier. As there are six classes for the waste image dataset, the Softmax classifier layer has 6 nodes. This model will be used as the base model which will be compared with MobileNetV2 using an SVM classifier. Table1 shows the accuracy, loss, precision, and recall throughout the 10-fold crossvalidation. The 10-fold crossvalidation is a good approximation method that gives unbiased and equal chance to all data points to be used fairly in the training of the model, and it ultimately enhances the accuracy, precision, and recall.Table 1
Training result (10-fold crossvalidation) for MobileNetV2 using Softmax classifier.
FoldAccuracyLossPrecisionRecallFold 191.8321.6050.9150.914Fold 292.5741.1120.9110.910Fold 387.1291.7040.9120.910Fold 485.3963.1240.9150.913Fold 591.5841.3230.9170.916Fold 691.3371.5060.9150.914Fold 789.8511.8310.9150.914Fold 884.9012.7140.9130.912Fold 985.8562.0130.9060.904Fold 1088.0892.0520.9230.922Average88.8551.8980.9140.913In terms of accuracy, the average accuracy for the 10-fold validation is 88.85%, with an average precision of 0.91 and an average recall of 0.91 as well. Generally, precision and recall close to 1 indicate that the model performs well in predicting all 6 different categories contained in our dataset. The accuracy of the model on the test set is 79.53%.Figure4 presents the confusion matrix of different objects and their classification. The blue cells depict the correct identification of objects related to other objects. Further, the precision and recall are shown in Table 2.Figure 4
Confusion matrix (test set) using Softmax classifier.Table 2
Precision and recall (test set) for MobileNetV2 using Softmax classifier.
CategoryPrecisionRecallCardboard0.9570.827Glass0.7240.752Metal0.7970.768Paper0.8260.916Plastic0.7690.722Trash0.6130.679Average0.7810.777


## 4.2. Performance of MobileNetV2 Using SVM Classifier

Similar to the base model presented above, the MobileNetV2 SVM model received the same features extracted by the pretrained MobileNetV2. Instead of using the Softmax function, SVM was used as the classifier.C parameter in SVM dictates the amount of regularization performed. Small C values led to the SVM classifier setting a larger margin when performing classification, while a larger C value led to a smaller margin. A larger margin (smaller C values) increased the misclassification rate on the training set but tended to perform better on the test set as it is more generalized. In this study, the default C value of 1.0 is used.Table3 shows the accuracy, loss, precision, and recall throughout the 10-fold crossvalidation for SVM. The SVM model resulted in an average accuracy of 94.28%, average precision of 0.947, and recall of 0.931 which are higher than the 10-fold crossvalidation of the base model (Softmax classifier).Table 3
Training result (10-fold crossvalidation) for MobileNetV2 using SVM classifier.
FoldAccuracyPrecisionRecallFold 194.3070.9540.943Fold 293.8120.9420.923Fold 394.8020.9560.937Fold 491.5840.9260.901Fold 594.3070.9310.939Fold 695.0500.9590.935Fold 792.5740.9340.907Fold 895.0500.9480.954Fold 995.7820.9620.944Fold 1095.5330.9600.927Average94.2800.9470.931Figure5 presents the confusion matrix of different objects and their classification. The blue cells depict the correct identification of objects related to other objects. Further, the precision and recall are shown in Table 4.Figure 5
Confusion matrix (test set) using SVM classifier.Table 4
Precision and recall (test set) for MobileNetV2 using SVM classifier.
CategoryPrecisionRecallCardboard0.9320.840Glass0.8310.733Metal0.7910.878Paper0.8440.908Plastic0.7940.835Trash0.8400.750Average0.8390.824The MobileNetV2 using the SVM model is then evaluated using the test set, and it provided an accuracy of 83.26%, which is approximately 4% higher than the base model. This is aligned with the result obtained by [31], which had also stated that using the SVM classifier is more accurate when paired together with AlexNet, GoogLeNet, ResNet, and VGG-16 if compared to the Softmax classifier.


## 4.3. Performance of MobileNetV2 with Global Average Pooling Using Softmax Classifier

Based on the results above, it was shown that the SVM model is more accurate than the base model. However, the base model could be further enhanced to increase the accuracy.A global average pooling layer is added to the model. To illustrate how the global average pooling layer works, given the feature extracted by the pretrained MobileNetV2 model has a dimension of7×7×1280, after applying global average pooling, the output dimension will be 1×1280.Table5 depicts the training result of 10-fold crossvalidation using global average pooling with Softmax classifier with the global average-pooling layer, the model provided an average accuracy of 87.59%, average precision of 0.913, and an average recall of 0.819 from 10-fold crossvalidation. The training accuracy is slightly lower than the base model.Table 5
Training result (10-fold crossvalidation) global average pooling using Softmax classifier.
FoldAccuracyLossPrecisionRecallFold 188.8610.3230.9090.820Fold 287.6240.3840.9130.816Fold 385.8910.4370.9140.819Fold 482.4260.4990.9180.828Fold 589.6040.3020.9110.813Fold 689.1090.3730.9130.821Fold 788.6140.3010.9120.819Fold 885.8910.3490.9130.819Fold 989.5780.3360.9110.817Fold 1088.3370.3720.9140.820Average87.5940.3680.9130.819However, the accuracy on the test set is 81.10%, which is higher than the base model. This could be due to the global average-pooling layer which may enable the model to generalize better on the test set.Figure6 presents the confusion matrix of different objects and their classification. The blue cells depict the correct identification of objects related to other objects. Further, the precision and recall are shown in Table 6.Figure 6
Confusion matrix (test set) using Softmax classifier global average pooling layer.Table 6
Precision and recall (test set) for MobileNetV2 using Softmax classifier global average pooling layer.
CategoryPrecisionRecallCardboard0.9070.840Glass0.8730.683Metal0.8270.817Paper0.8310.908Plastic0.7120.866Trash0.6400.571Average0.7980.781


## 4.4. Performance of MobileNetV2 with Additional Fully Connected Layer

Using the model with a global average pooling layer, an additional fully connected layer of 64 neurons was added. The new fully connected layer was added so that the model could pick up more complex features, which may be helpful for the waste image dataset.Table7 presents the training result of 10-fold crossvalidation for MobileNetV2 with an additional fully connected layer. With 10-fold crossvalidation, MobileNetV2 with an additional fully connected layer provided an average accuracy of 90.93%, average precision of 0.934, and an average recall of 0.887.Table 7
Training result (10-fold crossvalidation) for MobileNetV2 with an additional fully connected layer.
FoldAccuracyLossPrecisionRecallFold 191.3370.2050.9360.889Fold 291.3370.3480.9360.894Fold 388.3660.3870.9340.887Fold 494.0590.1720.9330.885Fold 589.6040.3930.9310.883Fold 689.8510.2950.9340.886Fold 791.0890.2740.9340.887Fold 891.5840.2490.9320.881Fold 991.0670.2550.9360.891Fold 1091.0670.2820.9350.888Average90.9360.2860.9340.887Figure7 presents the confusion matrix of different objects and their classification. The blue cells depict the correct identification of objects related to other objects.Figure 7
Confusion matrix (test set) using MobileNetV2 using Softmax classifier with an additional fully connected layer.Table8 describes the precision and recall (test set) for MobileNetV2 using Softmax classifier with an additional fully connected layer. With the newly added fully connected layer, the model achieved an accuracy of 83.46% on the test set, which was higher than the model with a global average pooling layer (81.10%).Table 8
Precision and recall (test set) for MobileNetV2 using Softmax classifier with an additional fully connected layer.
CategoryPrecisionRecallCardboard0.8970.864Glass0.8440.802Metal0.8210.841Paper0.860.874Plastic0.880.753Trash0.4780.786Average0.7970.820


## 5. Conclusion

With the significant increase of human living standards, solid waste management, especially recycling, must be emphasised to prevent the adverse environmental problem before it is too late. As the recycling effort requires proper waste segregation by the public, data science, specifically deep learning paired with smart mobile phones, could be a tool to aid the effort in recycling. The development and advancement of CNN and the ability to perform transfer learning are crucial for image classification and model development purposes. Architecture such as VGG16 performs very accurately for image classification. However, the sheer size of a large CNN model, i.e., the number of parameters and operations required, is not feasible for mobile applications.Although the accuracy of the MobileNetV2 with SVM classifier for waste image classification (83.46%) is lower than the accuracy of the VGG16 model with SVM classifier (97%), using MobileNetV2, which is a more lightweight CNN architecture, is perhaps more practical if the image classification model is to be implemented on mobile devices. Moreover, MobileNetV2 is indeed specifically designed for mobile applications.In the current research, the feature extracted from MobileNetV2 is directly fed into the SVM classifier. To further improve the MobileNetV2 model SVM classifier, the hyperparameters could be tuned, and perhaps the feature extracted could be fed into multiple layers of the neural network before using SVM so that more complex features or relationships could be extracted. On top of that, the Softmax classifier could be further enhanced by adding more layers as well. The scope of this study is limited to solid waste classification only. We have used cardboard, glass, metal, paper, plastic, and trash but it can be scaled to a large variety of solid waste classification.



---

*Source: 9963999-2021-05-17.xml*