Major Concepts

 

Sign-Up/Login to access Several ML Models and also Deploy & Monetize your own ML solutions for free

Models Home » Generic Models » Predictive Modelling » Garbage Classification

Garbage Classification

Models Status

Model Overview


Problem:
Increase in water, air, and land pollution by trashes and garbage. Increment in landfills, Eutrophication, Animals consuming the toxic wastes, Leachate, Toxin increment is significant and disastrous results of improper treatment of waste by homo-sapiens.



Fig.1 (L) Recyclable Wastes (R) Organic Garbage


Solution: Classification of garbage into organic and recyclable. Drones and Machines can use these models for classifying Organic and Recyclable wastes into different containers. These architectures will benefit Waste Disposal Authority (WDAs) and Municipalities for the classification of trashes.

Modeling Solution:

Data Source: Dataset was collected from Kaggle, and the dataset is segregated into Recyclable Waste and Organic Garbage. 

Dataset Link:https://www.kaggle.com/techsash/waste-classification-data

The dataset contains 25077 images, where 85% was used for training and 15% for the test set. Table 1 shows the distribution of the dataset.


Table 1. Distribution of dataset



Technology Used

1. Data Pre-Processing:
For refining train and test images, we have used ImageDataGenerator. Rescale, Shear Range, Zoom Range, and Horizontal Flip were used for training, and rescaling was used for testing images.

Rescale: This is a part of pre-processing of data where we reshape the input image pixels for training and testing. For example, in our data generator, we had rescaled value of 1.0/255 as images were in RGB, and it has a range of 0-255, and most of the neural networks use the range between 0-1.


Shear Range: Distortion of the image along the axis and perception angle is created or rectified y this operation. It helps in the rotation of the image in the clockwise and anti-clockwise directions. The shear range for our architectures was 0.2.


Zoom Range: This is an integral part of the Image data generator where float values are used for zooming of images and more fine-tuning of images, and in our implementation, we had a zooming range of 0.2.


Horizontal Flip: Interchanging of rows and columns of images is known as horizontal flipping. For more fine-tuning, it plays a vital role by setting the default value of False to True, and we can use horizontal flipping of our image dataset.


train_datagen = ImageDataGenerator(rescale = 1.0/255, shear_range = 0.2, zoom_range = 0.2, horizontal_flip = True)

2. CNNs and Transfer Learning: CNN is the backbone of deep learning and machine learning. The main operation in a convolutional neural network are Convolution, Pooling, Flattening of the layers of fully connected Neurons. Convolution has the property of translation invariance. Also, convolution is done because the property of the original function might be easily characterized and manipulated in the new function space than the original function space.


ImageNet organizes an event where new transfer learning architectures are trained on large datasets to enrich themselves in various domains and be stable performers in all the fields. So there are approximately 25 transfer learning models, and in our implementation, we have used VGG19 and MobileNeV2.

Models and Analysis: 3 CNNs were self-configured with different AL, CL layers. As all architectures were light and not rich in parameters, they did not gain high accuracy and stability. Transfer learning was implemented, and hose two models were MobileNetV2 and VGG19, which are highly rich in parameters, and VGG 19 performed outstandingly as it had 143,669,242 parameters that configured and correctly classified images. MobileNetV2 was not such a good performer as it had only 3,540,986 parameters, and these parameters could not relate layers with the dataset. So we have VGG19 as the best architecture for further metric evaluation and analysis, and classification of garbage.


model.compile(loss='categorical_crossentropy',optimizer='RMSProp',metrics=['accuracy'])

Result of Selected Architecture:  So, five architectures were implemented where 3 CNNs were proposed and two transfer learning techniques Mobilenetv2 and VGG19 were used. The best architecture was found to be VGG-19 trained on 224x224 input image sizes. VGG19 gained the highest evaluation accuracy of 0.8635 and validation loss of 0.3942, and we had manually frozen all CNN layers. The last layer had Softmax, and Adam was used as an optimizer for VGG19. Fig. 2 shows the training and validation accuracy and loss of our best architecture.


vggmodel191.add(Dense(units=2,activation= 'softmax' ))​

 


vgg19model.compile(loss ="categorical_crossentropy",optimizer = "adam",metrics=['accuracy'])​




Fig.2 Training and Validation Accuracy and Loss Graph of selected Architecture


Metric Evaluation: Table 2 shows our selected architecture's stability and metric evaluation in terms of accuracy, Precision Sensitivity, F1-score Specificity, and MCC. Fig. 3 shows the confusion matrix of VGG-19.


Table 2. Metric Evaluation of Selected Architecture VGG19





Fig. 3 Confusion Matrix of VGG-19


0 comments