1 of 20

Automatic Detection of Firearm in Surveillance Camera

Group 13

108502502 邱孟儒

108502522 黃煒勛

108502560 沈凱翔

110582609 Vaitheeshwari Rajendran

2 of 20

Project Goal

  • To design a system that detects guns in CCTV cameras
  • To alert the surrounding about the incident by creating a police siren alarm

3 of 20

The datasets is collected from Roboflow Universe: the Computer Vision Community under the public dataset domain.

Dataset Description

Positive Dataset

(Image with Gun)

Negative Dataset

(Image without Gun)

4 of 20

Results

Analysis

Architecture

Outline

01

02

03

5 of 20

Architecture

01

6 of 20

Xception Deep Learning Model

Input Images

(Gun

No Gun)

Xception

Pre-Trained

Model

Global Average Pooling Layer

Dense Layer

Output Layer

(Dense with Sigmoid)

Predicted

Class

(Gun/ No Gun)

Gun detected frame in video

If

P(k) >0.8

End

Execute Siren sound implementation

No

Yes

7 of 20

Normal Convolution

The number of multiplication

required is 178x3x3x3x75x75=27,033,750 multiplications

149

149

149

149

Conv-Output = (W – F +2P) / (S) +1

Where, W- width of image (299x299)

F- Filter size(3x3)

p- padding (0)

S- Stride (2)

8 of 20

Why Depth Wise Convolution?

Depth wise Convolution and Pointwise convolution

For depth-wise it requires 3x3x3x1x75x75=151,875

For pointwise convolution it requires 178x1x1x3x75x75=3,003,750

Total is 3,155,625 multiplications

149

149

149

149

149

149

149

149

149

149

9 of 20

Mathematics behind Computation

Where, W is the weight matrix, Y(i,j) is the image pixel coefficient, k,l,m is width, height and channel of the image respectively.

10 of 20

Analysis

02

11 of 20

Analysis of Xception Model

Method

Accuracy

Sensitivity

Loss

Computation time

Layer Trainable False

86

0.51

0.3

215s/epoch

Layer Trainable True

97.9

0.61

0.002

510s/epoch

12 of 20

Hyperparameters Considered

Parameter

Optimal Chosen Value

Scope

Epoch

50

To iterate through all features

Learning Rate

5e-3 and 5e-4

To determine the step size at each iteration while moving towards a min loss function

Optimizer

Adam

To update and tune the weights

Batch Size

32 and 16

To consider number of sample at each epoch

Weight Initializer

Golorot

To initialize the weight value

13 of 20

Results

03

14 of 20

Classification Results

15 of 20

Classification Results

Label: No Gun, 100%

16 of 20

Classification Results

17 of 20

Accuracy and Loss Plot

Accuracy v.s. Epoch

Loss v.s. Epoch

18 of 20

Demo

19 of 20

Demo in Real Time

20 of 20

Thanks!�Q & A