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

Department of Information Systems, Faculty of Computer Science & Information Technology, Universiti Malaya, 50603 Kuala Lumpur, Malaysia Department of Computer System and Technology, Faculty of Computer Science & Information Technology, Universiti Malaya, 50603 Kuala Lumpur, Malaysia National University of Sciences and Technology (NUST), School of Electrical Engineering and Computer Science (SEECS), Islamabad, Pakistan Department of Information Technology, College of Computer and Information Technology, Taif University, P.O. Box 11099, Taif 21944, Saudi Arabia Department of Information Technology, Bahauddin Zakariya University, Multan 60000, Pakistan Department of Computer Science, Abdul Wali khan University, Mardan, 23200, KPK, Pakistan


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 middleincome 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].

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.

Wireless Communications and Mobile Computing
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, Mobile-Net 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 Loop var i in range (10000):  Figure 3: Gradient descent in the proposed approach. 4 Wireless Communications and Mobile Computing 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.

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 differ-ent 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 collection S = fx 1 , x 2 , x 3 , x 4 , ⋯:,x n g, n ≤ N contains n images from N image space. Here, an image x is a vector such that x ϵ R D with D number of dimensions. Let us consider x ϵ R A×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. Figure 1 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.
We breakdown the preprocessing steps of image vector x as follows: (1) We apply the horizontal and vertical shearing to image x with coordinates a and b as described in Equations (1) and (2) The horizontal and vertical shear displace the point of interest to adjust image x for the desired shear.
(2) We apply the zooming to image vector x 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 vector x with coordinates a and b produces an image x with coordinates a ′ and b ′ such that a ′ = width ðvector xÞa -1 while b ′ = b. We can describe this phenomenon as follows Let us define the component-based scenario of our convolution neural network as Here, vector x 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 x Q , which was the output of the first layer, now serves as an input for the second layer managed by weight w Q . This process keeps on going for a defined number of layers until the outcome O T (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 o T is a trade-off between the last predicted value of vector x Z with the desired target (e.g., M) defined by Euclidean distance d = 1/2 jM − o T j 2 . 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. Figure 2 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.
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. Let n represent the length of vector x defined by n = lenðxÞ.   The 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:

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.

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 Mobile-NetV2 using an SVM classifier. Table 1 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.
In 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    Table 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. Table 3 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). Figure 5 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.
The 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.

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 of 7 × 7 × 1280, after applying global average pooling, the output dimension will be 1 × 1280. Table 5 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. However, 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. Figure 6 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.

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. Table 7 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.   Figure 7 presents the confusion matrix of different objects and their classification. The blue cells depict the correct identification of objects related to other objects. Table 8 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%).

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 Mobi-leNetV2 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.

Data Availability
The data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
The authors have no conflict of interest in this research.