Introduction

Addressing the challenging issues of waste management in modern society mitigates environmental pollution in land, water, soil, and air contaminations. MSW management vastly contributes to waste management, which inevitably improves the quality and guarantees safe living environment for the people. As civilization progresses, the amount of waste produced in society also increases exponentially. Subsequently, the societies can no longer afford the traditional waste management system of burying waste or disposing them in open dumps and landfills (Lu et al. 2017). Furthermore, the improper handling of wastages in society causes health hazards such as skin irritations, bacillary dysentery, respiratory problems, cholera, jaundice, hepatitis, growth problems, and so on (Nastaran et al. 2018). Anirban et al. (2021) reviewed the effects of improper waste management, the importance of proper waste management process, waste disposal, and management process followed by various countries. The processing steps of a proper waste management system consist of waste generation and disposal rate prediction, waste classification during collection, and converting them into reusable and/or recyclable substances for effective disposal. First step in the waste management process comprises waste generation and disposal rate prediction. Maryam and Ali (2016) presented artificial intelligence models for accurately forecasting monthly waste generation and organized waste disposal using system algorithms. The estimation of waste generation assists in planning urban environments for waste disposal through waste collection, transportation, and treatment, as well as predicting disposal rates. Hoang et al. (2021) presented the neural network models to estimate waste disposal rates in Canadian cities based on climatic, socioeconomic, and COVID-19 related daily variables. Second step in the waste management process is classification, which categorizes the waste into biodegradable and non-biodegradable types. Separating wastes before being collected by sanitary workers simplifies waste management through the conversion of wastes into usable energy via source reduction and reuse, animal feeding, recycling, composting, and biological treatments (Lalitha and Fernando 2019). Manually processing such a complex sorting process is impractical in today’s modern society. In addition, lack of knowledge about the source of waste leads to inaccurate and erroneous waste classification. Technology-aided smart waste classification model provides the solution to the issues of sorting wastages precisely using computer vision (Jiang et al. 2021).

Related work

In recent years, advanced technologies like computer vision, IoT, and machine learning play a significant role in identifying and classifying wastages in variety of waste management domains. Computer vision is the most recent field of ongoing research in which algorithms help computers understand and classify digital images in the same way that humans do. Deep learning as a subset of machine learning performs feature learning based on brain simulations known as artificial neural networks (ANN). A deep learning structure consists of infinite number of layers, in which each layer with a fixed size implements practical applications of waste classification. Maoliang and Lin (2021) presented a comprehensive examination on the use of deep learning techniques and algorithms in developing image classification model to categorize waste for MSW systems. Furthermore, Rami et al. (2021) used a Gaussian dispersion model in conjunction with various classification models based on decision tree (DT) and support vector machine (SVM) algorithms to categorize and dispose waste accordingly. The algorithms were used to categorize the remotely sensed datasets. At the same, their performance metrics were evaluated. In practice, the SVM algorithm underperforms with large datasets due to noise and data overlapping. Susceptibility to overfitting makes DT algorithm inaccurately categorize the wastes.

Sonali et al. (2020) proposed a smart household waste management system for green society using IoT and machine learning technologies. A machine learning–based classification model using K-nearest neighbor (KNN) algorithm and various combinations of sensors predicted and classified the waste. The KNN model aimed to reduce pollution through proper classification of the collected wastages for decomposing and reusing. Furthermore, the model sends alert messages as biodegradable or non-biodegradable waste to the user based on the classification results. However, KNN-based system produced lower level of testing accuracy and limited performance metrics due to the sensitivity of the system in scaling large datasets. Mamun et al. (2015) developed integrated sensing systems and algorithms with a smart waste bin model to develop an efficient MSW system. The system model indicates waste classification, bin loading, overloading, and requirement of unloading with an optimal execution. Continuous tracking of waste and bins for status requires a large set of sensor modules and memory for information storage, which are the main constraints of the waste classification system developed by Mamun et al. The increasing computational complexity of the system resulted in increased classification loss due to incorrect waste identification. Feng et al. (2020) developed a parameter estimation mechanism using Naive Bayes (NB) continuous learning algorithm to reduce computational complexity in classification.

Lu et al. (2017) proposed a two-stage waste collection and classification system based on radio-frequency identification (RFID) and multi-constrained and multi-compartment roll-on and roll-off (MCMC-RORO) algorithm. The two-stage MSW management system through best routing strategies improved the efficiency in differentiated waste collection. Different measures suggested deploying hook-lift trucks to carry out the exchange-trip service. The model was evaluated in real-time at the zone of Shenzhen, China. However, the model is insufficient in simultaneously executing data classification and waste collection. Waste must be separated and tagged with RIFD before sending it to the collection system. Another limitation of the model is its inability to sense the variation in quantity of waste collected at each point every day.

David et al. (2019) attempted to solve the problem of waste classification through automated machine learning techniques. A model has been developed to classify the waste and measure amount of waste-filled in the container with the help of sensors attached. An iterative data-driven approach was utilized to attain higher accuracy, and the confusion matrix is used to access the performance of binary classification model. The research gap of the technique is identified as follows. First, the iterative approach failed to quantify the extent to which accurate and inaccurate detection of the wastage container in the emptying process occurred. Second, the system uses multiple sensors to measure the filling levels of the waste container. Finally, the complexity of the solutions is not discussed and compared to existing solutions. Imran and Kim (2020) presented a real-life smart waste management system with additional features to measure and empty the waste collection container. Descriptive and predictive data analysis methods were applied to the datasets for effective waste management planning. A Quantum Geographic Information Systems (QGIS)-based data visualization, and visual analysis have been performed to allocate bins for waste collection. Ruibo et al. (2021) proposed a construction waste management model using SVM-based predictive analysis to classify the wastages into inorganic/organic, metal, composite, and hazardous waste. Predictive data analysis fails in advanced time series prediction and defining a non-linear relationship of waste fill details.

Maruful and Tauhid (2020) presented a waste classification model based on ANN to predict solid waste and estimate landfill area with the least number of input variables in Bangladesh. The ANN model was implemented and compared with an adaptive neuro-fuzzy inference system to show the efficiency of landfill estimation. The classification model was tested and reported with a moderately acceptable accuracy range. Ahmad et al. (2021) presented a classification model for carrot fruit using the CNN algorithm. It is a simple approach to improve the accuracy issue encountered by deep neural networks. For extracting image features, oriented gradient histograms and local binary pattern methods were used followed by classification using multi-layer perceptron, gradient boosting Tree, and KNN algorithms. In the simulation results, CNN model effectively classifies the carrot fruit and controls the waste products. However, the application of the proposed algorithm is limited to a single type of product classification.

Cong et al. (2021) proposed a smart MSW management method based on IoT and deep learning for classifying, monitoring, and collecting solid waste such as kitchen, plastic/glass/metal, and other recyclable wastes. Deep CNN architecture was used to build the classification model and Jetson Nano developer kit gave the functional platform to deploy the classification algorithm. It also employs a set of sensors such as gas and ultrasonic wave sensors for real-time tracking in garbage bins for proper collection of garbage. Rahman et al. (2020) used a CNN architectural framework with a smart trash system to develop a model that classifies waste as digestible or indigestible. The major limitation of the model includes classification accuracy and requirement of a large set of sensors for smart trash bins. An IoT module used for the smart trash system enables the real-time data to be monitored by the Bluetooth module with the aid of android applications.

Li and Deng (2019) presented a deep CNN-based object classifier to extract and classify the features from millions of digital images using ImageNet. Prevalent algorithms used in the ImageNet classifier failed to classify small and thin objects and distorted images from modern digital cameras. Martin et al. (2021) fine-grained classes of CNN object classifier to improve the performance of image classification for smart MSW management systems. Martin et al. evaluated various factors of the image of municipal waste portions in the Czech Republic at the regional, micro-regional, and municipal levels. Multi-variable linear regression, comprehensive linear models, and tree-based machine learning models like the random forest, regression trees, and gradient boosted regression trees were used by Xia et al. (2020) to predict input image factors in the CNN model. In addition, transfer learning increased the learning rate, to reduce the storage need, and avoid the use of rebuilding the learning problems in the CNN model. Pan et al. (2019) proposed a CNN-based automatic waste classification system that sorts waste into four categories such as recyclable, harmful, dry, and wet waste. Das et al. (2021) presented a CNN-based waste management system with improved learning rate that could classify wastes faster with much higher accuracy. However, learning rate, classification accuracy, reduced loss, and evaluation standards are still challenging issues in waste classification.

Table 1 compares the existing solid waste management system with different learning structures and classification algorithms.

Table 1 Summary of classifying algorithms used for solid waste management

General architecture of CNN

Among the existing methods, a CNN-based MSW management system provides reasonably good accuracy. However, designing a system with a CNN model requires large datasets to increase accuracy. A CNN comprises one input and one output layer with more than one hidden layer as shown in Fig. 1. Each layer of hidden layers in CNN is organized as a series of layers with the multiplication of convolution or other dot product. The first layer of CNN is known as ReLU layer which has an activation function. Pooling layers are the hidden layers placed followed by ReLU to perform additional convolutions consecutively. As a result, activation function and final convolution in CNN hide the input and output layers. The main advantage of CNN is that neurons in the same receptive field share the same filter. Therefore, each receptive field with a similar filter uses single-bias and single-weight vectors (Shabir et al. 2020). This feature triggers the activation function faster to classify the images. With these features, CNN-based deep learning (Cao et al. 2021) can be used effectively for object identification, pose assessment, script recognition, sensing, visual saliency spotting, activity identification, and scenery grouping. In CNN-based classifiers, high-precision image detection and classification are significant segments attained through sorting, pre-processing, segmenting, extracting key features, and identity recognition.

Fig. 1
figure 1

Architecture of convolutional neural network

This paper presents a novel CNN architecture for a solid waste management system that performs waste classification by analyzing extracted features of the images. The CNN framework for MSW management was developed based on literature review using machine learning and IoT techniques for high accuracy and reliability. The objectives of developing a sophisticated model of MSW management system are to (1) establish a machine learning and IoT based framework for smart waste management system using the available datasets, (2) apply the proposed framework to evaluate various factors of MSW images to separate the collected wastages as biodegradable or non-biodegradable, (3) perform the accuracy and loss analysis to identify the effectiveness of the design in waste classifications, and (4) compare the performance metrics of the proposed model with existing MSW models to ensure the effectiveness of classifier in image classification. This research work intends to develop an effective MSW management system for sustainable planning of treatment and recycling of wastages in metro cities. The following sections provide the detailed development and classification process of waste products for a smart waste management system.

Proposed methodology

This paper proposes a CNN-based design approach for MSW management aiming higher accuracy and low error rate in waste classifications. The CNN-based approach primarily performs classification of collected waste products. The subsequent sections explain the workflow, procedure of building a CNN-based ML model, training and retraining of the model, and evaluation standards.

Work flow

Figure 2 shows the flow diagram and hardware system model of the proposed solid waste classification system. The classification model has two phases in waste classification. The first phase of the design is the collection of solid waste and capturing the images in a camera for image acquisition. A proximity sensor detects the presence of waste in the inlet and power up the camera module to capture the image of garbage with the help of the Raspberry Pi Camera Module v2 connected to the board. In addition, the images can be accessed through third-party libraries including the Pi Camera Python library. The camera module switches to sleep mode when the inlet is empty to save power consumption. The second phase includes waste classification based on the images captured and loaded into the pre-trained waste classification module. Based on the analysis, the image classification module validates the captured images and classifies the solid wastes to send them into the appropriate bin. The model also informs the people regarding the type of waste products collected through an automatic prerecorded voice message. Pre-programmed control unit delivers information automatically to play pre-recorded audio stored in the cloud. In specific, the system requests the sanitary workers to define the unknown or unpredictable waste particles by displaying the images. Based on the input received from sanitary workers, the proposed model self-trains the system for future prediction. Further human interventions are not required for the same (this is a one-time process). The pre-trained waste classification model uses CNN architecture to classify waste products. “Building 201 a machine learning model” explains the design and development of the CNN-based waste classification model. “Training and Evaluation” describes the training/retraining procedure of the CNN using transfer learning and evaluation metrics of classification. “Evaluation standard” provides the evaluation standards for the balanced assessment and statistical reliability of classifiers.

Fig. 2
figure 2

a Working principle of the waste classification model, (b) hardware system model

Building a machine learning model

Building a machine learning model from scratch has three levels such as building a model using deep learning algorithm, digital data collection and pre-processing, and classification. TensorFlow supports building a deep learning–based classification model from scratch for waste management systems. TensorFlow also provides a high-level programming interface to build a neural network. CNN is one of the most popular deep learning algorithms, which can learn datasets in the form of weights and biases. Neurons of the extracted input features allow for monitoring real-time training images through learnable weights and biases. A deep-learning model requires a large set of training data for effective waste classification. Kaggle provides a web-based data collection environment to train the learning model using large image datasets. Data pre-processing is perhaps the most significant and difficult step in building a successful machine-learning model. This process is also called data cleaning. Data pre-processing ensures that the model is not fed or trained with any unwanted/unreliable data. Feature scaling, resizing, and data augmentation are considered as subsets of data pre-processing. Rescaling and resizing reduce the loss function by providing the best fit. Also, it offers independent, flexible, and precise data processing pipelines. Keras pre-processing layers are used in data pre-processing to rescale the pixels and resize the images into reliable shapes. Data augmentation improves the diversity of the trained data through a random transformation like horizontal/vertical shifting, horizontal/vertical flipping, clipping and cropping, padding, randomly rotating, and random zoom. This process increases abstraction, performance, and accuracy of image classification. Images from typical field conditions are used for data augmentation to improve the diversity of the trained data. The training folder in the sample form of data augmentation contains nearly 13,000 images of organic waste and 10,000 images of recyclable waste, whereas the test folder contains approximately 1000 images of both organic and recyclable waste. The proposed pre-processing model is created and trained using the data augmentation technique to significantly increase the diversity of data available for training models, with no additional data.

Model selection is the most time-consuming process, which selects the best model through the hit-and-trial approach and fine-tunes its hyper-parameters. CNN architecture has proven to be extremely effective at image classification. CNN is significantly slower to perform the operations like Maxpool and the training of large datasets. In the proposed waste management system, a CNN architecture was built by the Inception Resnet V2 architecture from Google to classify the waste. Resnet V2 has the capability to handle large datasets like training of 1.2 million images and testing of 50,000 images from ImageNet without increasing the training error percentage. The inception of Resnet V2 in CNN provides easy and fast computation, a strong gradient to descend, and high-performance output of an Inception network.

The proposed CNN model is configured with convolution layers, normalization technique, rectified linear unit (ReLU), pooling layers, flattening layer, dropout, dense layers, and fully connected layers. The pre-trained convolution layers recognize the neuron patterns and extract the important features of the input images. The extracted images of solid waste are divided into two sets. One set of the data used to train the framework of the learning model and another set of data constitutes testing. Normalization is the next layer that offers improved network performance, increased learning rate, simple weight activation, and regularize image identification with neural networks. Batch normalization is a technique used in the proposed model to normalize the input layers by readjusting and rescaling the undesirable changes before periodically moving into new distribution. Batch normalization used between convolution layers and a non-linear layer, ReLU increases the learning rate of the classifier without reducing feasibility, speed, and stability of the feature extraction. ReLU is a non-linear activation function that reduces the growth computational requirement in multi-layer neural networks.

Pooling is the next layer, and it plays an important role in reducing network parameters and smoothing feature extraction. CNN typically employs local or global pooling to speed up computation. Pooling layers are classified into three types such as max pooling, min pooling, and average pooling. Max pooling layer considers the maximum value from each cluster of neurons to learn the parameters at the prior layer which selects important features faster with reduced computational cost. The use of max pooling function increases accuracy of classification model but misses the distinguishing features of the image. Whereas, the min pooling layer considers the minimum value from each cluster of neurons at the prior layer. Because of computational cost, min pooling layers are not used in CNN. In the average pooling method, the average value of all the clusters of neurons is considered to extract the features smoothly but sharp features may not be identified during pooling. The proposed model uses mixed Max and average pooling layers to achieve faster computation and extract the features smoothly even from invariant properties. The mixed hybrid pooling introduced in the CNN model provides a boost in invariance properties relative to yield state-of-the-art performance. Flattening layer combines all the resulting 2-dimensional arrays from pooled feature maps into a single long feature vector. In addition, dropout regularizes the learning by reducing the overfitting by setting input units to zero or removing neurons temporarily in Keras. The fully connected layers are used to connect the neurons in the CNN model. The fully connected layers allow the CNN model to learn from the dataset with non-linear combinations and sub-areas of the previous layer called the receptive field. Extracting features through convolution, pooling, and fully connected layers provide high-level knee joint image classification results on the output side.

In addition, a multiple neuron model of the proposed learning model reduces the utilization. All the neurons in the neural network have the learnable weights and biases to determine features of the input values and classify the images. Learning in a neural network progresses by making iterative alterations to biases and weights of the image. The learning model is designed as multiple neurons accessing the same filter to reduce resource utilization. It is also a distinct advantage of this model. Now, the next step is to train and evaluate the CNN model.

Training and evaluation

The CNN model was trained and evaluated using 25,077 images. In the dataset, 80% of images were used for training, 10% of images were used for testing, and 10% of images were used for validation. Precisely captured, and preprocessed images provide good accuracy with 10% of testing and 10% of validation sets. Split validation is performed for accurate model fit. Cross-validation is the most commonly used data splitting approach. K-fold cross-validation performed using Keras helps to evaluate the models with limited data samples and improved performance. A fivefold cross-validation used in the proposed model splits the trained datasets to test the model with optimized performance parameters. Also, it prevents the training model from overfitting and delivers accurate image classification during evaluation. The entire training dataset is fed into the model as input for fifty epochs where the model achieves its global optima. Epoch is a training cycle that can be selected based on the minimal variation of loss and accuracy functions. The proposed CNN model is trained through a transfer learning paradigm to effectively classify the generic type of images captured from visual objects. Transfer learning trains the classification model faster with the limited dataset and validates accurately by extracting relatively useful spatial features. Furthermore, it customizes the training model through feature extraction and fine-tuning. Fine-tuning trains both newly added layer and previous layer together to increase efficiency and save resources. After the training model, the weights are adjusted appropriately through normalization. The system model is then fed with a new set of sample data to check how the model performs on new and different data. This technique helps to determine the fitness of the classification model as over-fitted or under-fitted or just right.

Retraining is an effective method for improving the performance of the pruned model. The proposed CNN model is retrained through transfer learning on a specific dataset. Transfer learning in retaining the neural network improves accuracy significantly. Retraining of the learning model uses existing image classifier knowledge, followed by fine-tuning to classify waste products more precisely in a waste management system. CNN by the inception of ResNet V2 model from Google is retrained with the same set of images. The retrained networking model is created using a 164-layer deep analytical process that can classify images into thousands of different object categories. And, the model is tested using the trained ImageNet dataset for accuracy improvement in waste classification. The entire retraining data is also fed as input to the model fifty times where the system achieves its global optima. After the model is retrained, all the weight is adjusted appropriately through normalization. New and different datasets are also retrained to check the performance and fitness of the data samples. After the completion of retraining and normalization process, the convolutional weights are kept constant, so that the system can work only on observation and evaluation modes.

Evaluation standard

The accuracy and loss function of the proposed MSW management model is evaluated for waste classification. To identify the balanced view of the proposed model, F1 score was calculated from each design models precision and recall metrics. F1 score of the learning model is expressed as

$${\text{F1}} = {2}{\text{.}}\frac{{{\text{Precision}} \times {\text{Recall}}}}{{{\text{Precision}} + {\text{Recall}}}}$$
(1)

where, Precision = TP / TP + FP), Recall = TP/(TP + FN), TP is true positive, TN is true negative, FP is false positive, FN is false negative.

In addition, Matthews correlation coefficient (MCC) values are also calculated from the confusion matrix of the model for statistical reliability as follows,

$$MCC = \frac{{{\text{(TP}} \times {\text{ TN)}} - {\text{(FP }} \times {\text{ FN) }}}}{{\sqrt {{\text{(TP + FP) }} \times {\text{ (TP + FN) }} \times {\text{ (TN + FP) }} \times {\text{ (TN + FN)}}} }}$$
(2)

Results and discussion

Training

The architecture of CNN designed from Scratch describes the performance of a pre-trained classification model. The complete architecture of the CNN is developed, trained, and tested using Tensorboard. Tensorboard is a web app extension of Tensorflow that creates log files of all metric changes (like accuracy and loss) and then uses these metrics to give very intuitive plots. The images are primarily described by weight deviations and bias distribution over the trained epochs. Every slice in the image represents the parameter’s dissemination at a specific epoch. Fifty epochs have been used to develop and test the presented model. Figure 3 shows the learning rate of the CNN model through histograms in which weight and bias distributions are certainly learned. Figure 3 (a) shows the input layer histogram of the CNN classification model. The input layer histogram shows the identities of waste products as a distribution of weights in kernel and biases. The first and second hidden layer histograms are shown in Fig. 3 (b) and (c), respectively. These histograms show the learning rate of CNN model in continuous training of the images with increased sharpness and accuracy. The hidden dense layer histogram shown in Fig. 3 (d) represents the cluster for localization of the input and output points. The output layer histogram in a convolutional neural network is shown in Fig. 3 (e). Similar to CNN model, the images are trained and retrained in CNN by the Inception of ResNet using Tensorboard. After the completion of the retraining, the system is normalized and convolutional weights are kept constant to set the system into evaluation mode. The pre-trained classification model is evaluated using test set images to analyze the performance in terms of loss and accuracy. Loss and accuracy functions are observed relating to number of samples trained in the system. Increasing the training datasets improves the accuracy of the classification model. Furthermore, self-training of the images in the evaluation mode supports to increase accuracy. Accuracy and loss functions of the proposed CNN and CNN by the inception of ResNet-based MSW models are tested in the evaluation mode using test set images.

Fig. 3
figure 3

a Input layer histogram, (b) first hidden layer histogram, (c) second hidden layer histogram, (d) hidden dense layer histogram, and (e) output layer histogram

Performance analysis

Accuracy and loss functions of the CNN and CNN by the inception of ResNet models are evaluated using test images. Popular classification algorithms like ANN, SVM, KNN, DT, and NB algorithms are used to carry out the performance comparison. ANN, SVM, KNN, DT, and NB algorithms–based waste classification models are also developed, trained, and tested using the same datasets. Accuracy and loss functions of ANN, SVM, KNN, DT, and NB-based classification models are compared with the proposed CNN-based solid waste management systems. The performance metrics observed for the proposed and existing classification models are plotted in Fig. 4. In addition, Table 2 presents the numerical results received. In comparison, the proposed CNN by the inception of ResNet model reveals higher accuracy than other solid waste classification models. Figure 4 (a) and (b) show the graphical form of accuracy and loss of the classification models through training and validation. In training and validation, the proposed CNN-based MSW model provided 87.99% accuracy and 16.72% loss against the 50 epochs in the entire training dataset. In training and validation, the CNN by the inception of ResNet-based MSW models provided 94.44% accuracy and 9.26% loss against the 50 epochs in the entire training dataset. The inception of ResNet in CNN classification model delivers 6.45% improvement in accuracy and 7.46% loss reduction. In comparison with existing models, the proposed CNN model achieved 12.63% improved accuracy than the lowest accuracy model, KNN, and 27.25% reduced loss than the highest loss model, NB. The proposed CNN by the inception of ResNet model achieved 19.08% improved accuracy than the lowest accuracy model, KNN, and 34.97% reduced loss than the highest loss model, NB.

Fig. 4
figure 4

Comparison of (a) training and validation accuracy, (b) training and validation loss, (c) means plot for accuracy, (d) means plot for loss, (e) standard deviation (error bars) plot for accuracy, (f) standard deviation (error bars) plot for loss

Table 2 The descriptive statistics on accuracy and loss functions

Statistical analysis is one of the most important requirements in the performance analysis of ML-based systems to identify best algorithm for the classification model. A one-way analysis of variance (ANOVA) is performed to point out the unique features of each classification model through the observations of the statistical differences among the test results. Figure 4 (c) and (d) show the bar chart of mean comparison for accuracy and loss, respectively. The bar chart explicates the statistical differences between the means of the waste classification models. Figure 4 (e) and (f) show the standard deviation (error bars) plot for accuracy and loss, respectively. Error bars represent the variability of data and goodness of fit in loss and accuracy. A most precise estimate is observed with a smaller confidence level in the accuracy of ResNet. Table 2 also presents the descriptive statistical observations from analysis of variance test called mean, standard deviation, SE of mean. A mean in the accuracy of CNN by the inception of ResNet model shows 21.9% improvement compared to the lowest mean occurred in the KNN model. The mean of loss in CNN by the inception of ResNet model is 3.8 times less compared to the highest mean of loss model, NB. The standard error of mean represents the measure of dispersion of sample means in the accuracy. The standard error of the mean in loss of CNN by the inception of ResNet is comparatively less than other models referred in Table 2. Table 3 shows the overall ANOVA test results of the classification models. The F value was calculated with the significance level of 0.05 by dividing the numerator degrees of freedom defined between the model count of 6, and denominator degrees of freedom defined within the model count of 343. F value in the statistical test of the ANOVA table is extremely larger than the critical F value in the F distribution table, which indicates the rejection of the null hypothesis. Large F value of the proposed CNN-based classification models provides statistical evidence for significant performance improvement in waste classification compared to the performance of other six models.

Table 3 Overall ANOVA

Table 4 shows the F1 and MCC scores of proposed and existing design models. In comparison, the optimized CNN by the inception of ResNet model has the largest improvement in F1 score and MCC score than other waste classification models. A large number of F1 and MCC scores showed that the proposed CNN models have classified the wastes with a more reliable statistical rate than other algorithms.

Table 4 The performance comparison

Testing on Raspberry Pi

Testing of the proposed solid waste classification model is performed on the Raspberry Pi. The classification model is loaded with the test samples, as listed in Fig. 5 (a) to make predictions on those images. Here, the system model classifies the 10 images based on organic and non-organic substances. In the sample images shown below, 5 images belong to digestible waste products and the next 5 belong to indigestible. The output of the image classifications received in binary form is shown in Fig. 5 (b). In test output, the waste classification model correctly predicted nine images out of ten different images to their respective classes. Although, the wrongly predicted result might argue that the plastic cover wrapped around image 01 affected the prediction. The images captured from the open dump, mass public wastages, mass-market wastages are also tested to check the reliability of the proposed model. The loaded samples and their observations are shown in Fig. 5 (c) and (d), respectively. In the samples, except image 7, all other images have been predicted correctly. Large portion of image covered by the digestive wastes in sample 7 can be considered a possible reason for the prediction. The proposed waste classification model is more suitable to classify the waste in the source end like household waste sources. MSW system provides an accurate prediction for the images representative to waste products. In prefilled dust bins or pre-dumped open field conditions, the proposed model requires additional waste loading arms to pick and place on waste collection containers, since the wastes are often mingled, compacted, and contaminated in the storage fields.

Fig. 5
figure 5

Testing of the proposed model using sample images. (a) Sample images loaded in set-1, (b) predicted results of set-1, (c) sample images loaded in set-2, (d) predicted results of set-2

Conclusion

This paper presents a design model of an MSW management system for waste identification and classification using CNN architecture and CNN by the inception of ResNet. The CNN model is built from scratch and trained to learn and classify the images of wastages. In evaluation, the MSW management model using CNN architecture achieved a classification accuracy of 87.99%. To increase the accuracy of the image classification in MSW management, the Inception ResNet V2 derived CNN model is built, trained, and tested with the same set of data samples. The proposed CNN Inception ResNet model provided an improvement in accuracy to 94.44% during image classification, which is about a 6.45% improvement from CNN architecture. In comparison, the CNN model by Inception of ResNet V2 revealed 19.08% high accuracy and 34.97% reduced loss over the existing models. The comparison of the proposed model with existing algorithms also showed that the proposed CNN by the inception of ResNet is classifying biodegradable wastages from non-biodegradable wastages with high accuracy, F1 score, and MCC score. The pre-trained model used also enhanced prediction of images in milliseconds. Implementation of this waste classification model in MSW management reduces the amount of waste accumulated in landfills unsegregated. Perhaps, the proposed model can mitigate the harmful effects on the environment due to the improper disposal of the unsegregated wastages accumulated in landfills.