Skip to content

Repo for project : smog detection project at Udacity Project Showcase

Notifications You must be signed in to change notification settings

souravs17031999/SmogDetection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SmogDetection

REPO FOR TEAM PROJECT SHOWCASE AT SPAIC 2019: SMOG DETECTION PROJECT AT #sg_planetearth Udacity Secure and Private AI

You can find my own analysis above in the notebook

Problem statement :

The sudden appearance of smog and/or fog on the highway more often than not causes serious and sometimes fatal accidents. Smog is the main agent for severe air pollution. It can aggravate health problems including problems with breathing and sleeping, as well as it can inversely damage plants and forest cover.

Project objective and solution:

  • Smog is a byproduct of the global climate change scenario. As we move further into the industrialized age, Smog continues to pollute our air, reduce visibility on roads and is a leading cause of accidents on roads. The primary goal of the project is to avoid and help reduce rate of accidents in self driving vehicles by using this classifier model as one of the key components attached on traffic cams, so that the vehicle can automatically be alerted about smog on the roads/streets (highways) be it in heavy, medium or low traffic in order to adjust it's dynamics like speed, steering rotation, lanes etc. We can use the prediction output labels from the model to alert the vehicle / driver.

This is the descriptive summary of Model Architechture we have implemented, and the Data Augmentations we have applied.

Input to model :

Images captured by traffic cam.

Output from model :

Prediction as label '0'(clear view) or '1'(smog detected).

Data Augmentations and Transformations

Model name

Description of model

So, there are five modules which contain deeper sublayers. Let's go through them one by one:

  • CNN layers : 7
  • Linear layers : 2
  • Pooling layers : 4
  • Batch normalization layers : 7

conv1 :

  • CNN layers : Conv2d(3, 32, 3, padding=1), Conv2d(32, 32, 3, stride=2, padding=1)
  • Pooling layer : MaxPool2d(2, 2)
  • Batch normalization layer : BatchNorm2d(32), nn.BatchNorm2d(32),

conv2 :

  • CNN layers : Conv2d(32, 64, 3, padding=1), Conv2d(64, 64, 3, stride=2, padding=1)
  • Pooling layer : MaxPool2d(2, 2)
  • Batch normalization layer : BatchNorm2d(32), nn.BatchNorm2d(64),

conv3 :

  • CNN layers : Conv2d(64, 128, 3, padding=1), Conv2d(128, 128, 3, stride=2, padding=1)
  • Pooling layer : MaxPool2d(2, 2)
  • Batch normalization layer : BatchNorm2d(128), BatchNorm2d(128)

conv4 :

  • CNN layers : Conv2d(128, 256, 3, padding=1)
  • Pooling layer : MaxPool2d(2, 2)
  • Batch normalization layer : BatchNorm2d(256)

fc :

  • Linear layers : Linear(256, 128), Linear(128, 2)

Dropout has been applied in conv4 and linear layer where probability = 0.35 in conv4 and 0.5 in fc.

Activation functions :

mila activation has been used. Activation Mila (@Diganta's new activation) https://github.com/digantamisra98/Mila

Optimizer :

Adam optimizer is used here.

Loss function :

CrossEntropyLoss is used.

Learning rate (with lr scheduler) :

  • lr schedular = StepLR(optimizer, step_size=10, gamma=0.5)
  • lr = 0.001

Epochs :

epoch : 50

Results

Test loss :

Test Loss:36.734721

Test Accuracy :

Accuracy: 99.0000

Class wise loss :

  • Test Accuracy of 0: 98% (389/393)
  • Test Accuracy of 1: 98% (378/382)

Overall testing accuracy :

Test Accuracy (Overall): 98% (767/775)

Model working :

smog image
clear image

Contributors:

No Name Slack Handle
1 Shudipto Trafder @Shudipto Trafder
2 Berenice Terwey @Berenice
3 Agata Gruza @Agata [OR, USA]
4 Ingus Terbets @Ingus Terbets
5 Akash Antony @Akash Antony
6 Alexander Villasoto @Alexander Villasoto
7 Pooja Vinod @Pooja Vinod
8 Ramkrishna Acharya @Viper
9 Sourav Kumar @sourav kumar
10 George Christopoulos @George Christopoulos
11 Sayed Maheen Basheer @Sayed Maheen Basheer
12 Abhishek Lalwani @Abhishek Lalwani
13 Laura Truncellito @LauraT

Note: Above folders are just for showcasing type of data used but it's ofcourse not the complete dataset. For complete dataset, you can mail me.

Highlights :

  • We came 2nd in Udacity's Project Showcase Challenge
    mewinning