You are on page 1of 54

CCTV based fight Classification

Final Year Project

2019-2023

A project submitted in partial fulfillment of the degree of

BS in Computer Science

Submitted to
Mr. Hafiz Saud Arshad

Department of Computer Science

Faculty of Computing & Artificial Intelligence (FCAI)

Air University, Islamabad


Project Report: CCTV based fight Classification

Type (Nature of project) [ ] Development [  ] Research

[] WebApp [ ] Mobile App


Area of specialization
[ ] AI based [ ] Embedded System
FYP ID IT-SP-21-18

Project Group Members

Sr.# Reg. # Student Name Email ID *Signature

(i) 181337 Samreen Tabbasam 181337@students.au.edu.pk

Muhammad Ahsan
(ii) 181339 181339@students.au.edu.pk
Farooq

(iii)

*The candidates confirm that the work submitted is their own and appropriate credit has been
given where reference has been made to work of others

Department of Computer Science, Air University, Islamabad, Pakistan ii


Project Report: CCTV based fight Classification

Plagiarism Certificate
This is to certify that, I ________ S/D of ____________________, group leader of FYP under
registration no ______________________________at Computer Sciences Department, Air University. I
declare that my FYP report is checked by my supervisor.

Date:______________ Name of Group Leader: _____________________ Signature:________

Name of Supervisor: Mr. Hafiz Saud Arshad Co-Supervisor: (Not Allocated)


Designation: Lecturer Designation: (N/A)

Signature: ________________ Signature: _________________

HoD: Dr. Awais Ahmad


Signature: _______________

Department of Computer Science, Air University, Islamabad, Pakistan iii


Project Report: CCTV based fight Classification

CCTV based fight Classification

Change Record
Author(s) Version Date Notes Supervisor’s Signature

Department of Computer Science, Air University, Islamabad, Pakistan iv


Project Report: CCTV based fight Classification

APPROVAL

PROJECT SUPERVISOR

Name: Hafiz Saud Arshad

Date:_______________________________ Signature:_________________________

PROJECT MANAGER

Date:_______________________________ Signature:__________________________

CHAIR DEPARTMENT

Date:_______________________________ Signature:__________________________

Department of Computer Science, Air University, Islamabad, Pakistan v


Project Report: CCTV based fight Classification

Dedication

This work is dedicated to our parents who have failed to give us financial and moral support. We
dedicate this project to our supervisor who have worked hard to help us complete this project.
We will always appreciate all they done for helping us develop our technical skills

Department of Computer Science, Air University, Islamabad, Pakistan vi


Project Report: CCTV based fight Classification

Acknowledgements

First of all we would thanks Allah Almighty for giving us the strength and courage to achieve
our goal and blessing us with enough knowledge to complete this project until now. And after
that appreciation goes to prayers and hard work of our parents and our supervisor for his support
in every part of our project and determined supervision His invaluable help of constructive
comments and suggestion throughout the project have kept us motivated throughout the project.
Moreover we are grateful for the faculty of Computer Science Air University for helping and
guiding from the start.

Department of Computer Science, Air University, Islamabad, Pakistan vii


Project Report: CCTV based fight Classification

Abstract

Violence detection has become the active and progressive research topic in the field of computer
vision and Al. Automatic violence detection can be useful in many areas for the security purpose.
Violence detection consist of different domain like activity detection, fight detection, action
recognition, we mainly focus on fight detection for this purpose two approaches are used 1)
Feature Extraction and 2) Classification. There are many researches to transform the semi-
automated systems to fully automated using the different techniques of Artificial Intelligence and
deep learning. Different methods have previously been used to detect the fight in videos.
However the dataset that are used for this detection activity are not the real CCTV videos, they
are taken from the scenes in movies or are performed by actors. So, there is a very less chance
that these algorithms that have trained using those datasets will perform well in the real-time
scenario. Existing work contain Trajectory based methods which contain two phases 1) Motion
estimation using statistical model to extract trajectory features 2) Activity recognition based on
the extracted features. Other than trajectory based methods there is non-object-centric method
that extract features based on behavior and not on motion. Deep learning based method for
classification have achieved more accuracy then trajectory based and non-center-object based
methods. Image Processing and machine learning techniques have proved to be very useful in
extracting the information from the CCTV videos in much efficient and faster way then any
human observer. Our goal is to propose an approach that can detect fight from the real life CCTV
videos of fight. Initially Features were extracted from the videos, those extracted features from
the videos were given to the trained model which predicts the fight or no fight events. The CNN
model prevents overfitting by applying regularization techniques like kernel regularizers and
dropout of 0.5. Moreover, we used VGG16 and Resnet50 to train our model. We have used
Keras deep learning library with TensorFlow backend to implement our desired models and
Flask for the frontend development

Department of Computer Science, Air University, Islamabad, Pakistan viii


Project Report: CCTV based fight Classification

Table of Contents

Plagiarism Certificate.....................................................................................................................iii
Dedication.......................................................................................................................................vi
Acknowledgements.......................................................................................................................vii
Table of Contents............................................................................................................................ix
List of Figures................................................................................................................................xii
List of Tables................................................................................................................................xiii
List of Abbreviations....................................................................................................................xiv
Chapter 1..........................................................................................................................................1
Introduction & Background.............................................................................................................1
1.1. Background [16pt, Bold, Times new Roman]..................................................................2
1.2. Motivations and Challenges..............................................................................................2
1.3. Goals and Objectives........................................................................................................2
1.4. Literature Review/Existing Solutions...............................................................................2
1.5. Gap Analysis.....................................................................................................................2
1.6. Proposed Solution.............................................................................................................2
1.7. Project Plan.......................................................................................................................3
1.7.1. Work Breakdown Structure...........................................................................................3
1.7.2. Roles & Responsibility Matrix......................................................................................3
1.7.3. Gantt Chart....................................................................................................................3
1.8. Report Outline...................................................................................................................3
Chapter 2..........................................................................................................................................4
Software Requirement Specifications..............................................................................................4
2.1. Introduction.......................................................................................................................5
2.1.1. Purpose [14pt, Times new Roman, Bold].....................................................................5
2.1.2. Document Conventions.................................................................................................5
2.1.3. Intended Audience and Reading Suggestions...............................................................5
2.1.4. Product Scope................................................................................................................5
2.2. Overall Description...........................................................................................................6
2.2.1. Product Perspective.......................................................................................................6
2.2.2. User Classes and Characteristics...................................................................................6
2.2.3. Operating Environment.................................................................................................6
2.2.4. Design and Implementation Constraints.......................................................................6
2.2.5. Assumptions and Dependencies....................................................................................7
2.3. External Interface Requirements.......................................................................................7
2.3.1. User Interfaces...............................................................................................................7
2.3.2. Hardware Interfaces......................................................................................................7
2.3.3. Software Interfaces........................................................................................................7
2.3.4. Communications Interfaces...........................................................................................8
2.4. System Features................................................................................................................8
2.4.1. System Feature 1...........................................................................................................8
2.4.1.1. Description and Priority.............................................................................................8
2.4.1.2. Stimulus/Response Sequences...................................................................................8
2.4.1.3. Functional Requirements...........................................................................................8

Department of Computer Science, Air University, Islamabad, Pakistan ix


Project Report: CCTV based fight Classification

2.4.2. System Feature 2...........................................................................................................9


2.4.2.1. Description and Priority.............................................................................................9
2.4.2.2. Stimulus/Response Sequences...................................................................................9
2.4.2.3. Functional Requirements...........................................................................................9
2.4.3. System Feature 3 (and so on)......................................................................................10
2.5. Nonfunctional Requirements..........................................................................................10
2.5.1. Performance Requirements.........................................................................................10
2.5.2. Safety Requirements....................................................................................................10
2.5.3. Security Requirements................................................................................................10
2.5.4. Usability Requirements...............................................................................................10
2.5.5. Reliability Requirements.............................................................................................10
2.5.6. Maintainability/Supportability Requirements.............................................................11
2.5.7. Portability Requirements.............................................................................................11
2.5.8. Efficiency Requirements.............................................................................................11
2.6. Domain Requirements.....................................................................................................11
Chapter 3........................................................................................................................................12
Literature Review..........................................................................................................................12
3.1.1. Example of Subheading Styles...........................................................................................13
3.1.2. Another Subheading Styles Example.................................................................................14
3.1.3. Subheading styles..............................................................................................................14
3.2. Formatting of Equations..................................................................................................15
3.3. Use of Referencing styles...............................................................................................15
Chapter 4........................................................................................................................................16
Use Case Analysis.........................................................................................................................16
4.1. Use Case Model..............................................................................................................17
4.2. Use Cases Description....................................................................................................18
Chapter 5........................................................................................................................................19
Proposed Approach........................................................................................................................19
...................................................................................................................................................20
5.1. Dataset Exploration.........................................................................................................20
5.2. Data Augmentation and Pre-Processing.........................................................................20
Chapter 6........................................................................................................................................21
Implementation & Results.............................................................................................................21
6.1 Different components of your proposed approach..........................................................22
6.2 Implementation of proposed approach............................................................................22
6.3 Deployment Environment...............................................................................................22
6.4 Tools and Techniques.....................................................................................................23
6.5 Best Practices / Coding Standards..................................................................................23
6.6 Version Control...............................................................................................................23
Chapter 7........................................................................................................................................24
Business Plan.................................................................................................................................24
7.1 Business Description.......................................................................................................25
7.2 Market Analysis & Strategy............................................................................................25
7.3 Competitive Analysis......................................................................................................25
7.4 Products/Services Description........................................................................................25

Department of Computer Science, Air University, Islamabad, Pakistan x


Project Report: CCTV based fight Classification

7.5 SWOT Analysis..............................................................................................................25


Chapter 8........................................................................................................................................26
Conclusion & Future Work...........................................................................................................26
8.1 Achievements and Improvements...................................................................................27
8.2 Critical Review...............................................................................................................27
8.3 Future Enhancements/Recommendations.......................................................................27
Chapter 9........................................................................................................................................28
Paper Writing.................................................................................................................................28
9.1. Paper Writing..................................................................................................................29
Appendices....................................................................................................................................30
Appendix A: Information / Promotional Material.........................................................................31
References..................................................................................................................................32

Department of Computer Science, Air University, Islamabad, Pakistan xi


Project Report: CCTV based fight Classification

List of Figures

1.1 Caption of first figure of first chapter 6


1.2 Caption of second figure of first chapter 7
2.1 Caption of first figure of second chapter 14
2.2 Caption of second figure of second chapter 22
2.3 Caption of third figure of second chapter 26
5.1 Caption of first figure of fifth chapter 49
5.2 Caption of second figure of fifth chapter 49

Department of Computer Science, Air University, Islamabad, Pakistan xii


Project Report: CCTV based fight Classification

List of Tables
1.1 label of first table of first chapter 6
1.2 label of second table of first chapter 7
2.1 label of first table of second chapter 14
2.2 label of second table of second chapter 22
2.3 label of third table of second chapter 26
5.1 label of first table of fifth chapter 49
5.2 label of second table of fifth chapter 49

Department of Computer Science, Air University, Islamabad, Pakistan xiii


Project Report: CCTV based fight Classification

List of Abbreviations
1.1 UML Unified Model Notation
1.2 SRE Software Requirement Engineering
2.1 SDR Software Defined Radios

Department of Computer Science, Air University, Islamabad, Pakistan xiv


Project Report: <Project Title>

Chapter 1
Introduction & Background

Department of Computer Science, Air University, Islamabad, Pakistan 1


Project Report: CCTV based fight Classification

Chapter 1: Introduction
Violence detection has become the active and progressive research topic in the field of computer
vision and Al. Automatic violence detection can be useful in many areas for the security purpose.
Violence detection consist of different domain like activity detection, fight detection, action
recognition, we mainly focus on fight detection for this purpose two approaches are used 1)
Feature Extraction and 2) Classification. This chapter contains the means and methods that are
used to achieve the goals and objective of our product.

1.1. Background
Today the society highly depends on CCTV for the security purpose, but the CCTV footage is
not very effective because they are only used after hours or evens days of the occurrence of some
incidents. The systems that are commonly used are semi-automated and human supervision is
needed to monitor the video from the CCTVs which cannot be very reliable in most cases
because human is prone to error and one cannot precisely monitor some fight activity because of
the number of videos from different CTTVS. There are many researches to transform the semi-
automated systems to fully automated using the different techniques of Artificial Intelligence and
deep learning.

1.2. Motivations and Challenges


In the existing system, activities are monitored manually from the screens of the surveillance
camera. To recognize activities like fights or other security-related issues continuous monitoring
is required which is not possible for us human beings. Manual monitoring in case of fight
detection cannot be very effective and useful because of work boredom, lack of concentration of
the person, and quick action cannot be taken if these activities are not timely detected. Fully
automated systems can quickly and easily detect fight activities using computer vision and
machine learning and can be proved more effective and efficient than semi-automated existing
systems. The fight can be raised from different events like hated discussion, hate speech or

Department of Computer Science, Air University, Islamabad, Pakistan 2


Project Report: CCTV based fight Classification

anger, etc. However Human activity recognition can be a challenging task due to the
inconsistency of light, and bad quality of CCTV footage during real-time classification.

1.3. Goals and Objectives


Image Processing and machine learning techniques have proved to be very useful in extracting
the information from the CCTV videos in much efficient and faster way then any human
observer. Our goal is to propose an approach that can detect fight from the real life CCTV videos
of fight because most of the existing work is done on the videos from public datasets that are
manifested as fight The Objectives of our project are
 To automate and facilitate the processing of visual information in terms of security
monitoring and detection of fighting scenes.
 To develop a web application that can be used to feed in an input sequence and get
explicit predictions

1.4. Literature Review/Existing Solutions


Different methods have previously been used to detect the fight in videos. However the dataset
that are used for this detection activity are not the real CCTV videos, they are taken from the
scenes in movies or are performed by actors. So, there is a very less chance that these algorithms
that have trained using those datasets will perform well in the real-time scenario. Existing work
contain Trajectory based methods which contain two phases 1) Motion estimation using
statistical model to extract trajectory features 2) Activity recognition based on the extracted
features. This methodology uses bag of words for feature extraction and K-nearest neighbor for
classification and 86% accuracy was achieved using this methodology but there is the
disadvantage of using bag of words that is it assumes that all the words are independent. Another
trajectory based method that uses Gaussian mixture to extract object direction, speed and
centroid was introduced and 90% accuracy was achieved. However for large videos complex
time rules were required. Other than trajectory based methods there is non-object-centric method
that extract features based on behavior and not on motion, one of the techniques of non-object-
centric method include Gaussian model that extract low-level features and apply SVM classifiers
and 89% accuracy was achieved. Deep learning based method for classification have achieved
more accuracy then trajectory based and non-center-object based methods. Deep learning

Department of Computer Science, Air University, Islamabad, Pakistan 3


Project Report: CCTV based fight Classification

techniques combines the feature selection and classification into one module, CNN, RNN,
LTSM are used for activity recognition in deep learning. The hockey dataset, movie dataset and
other violent flow dataset were used and 90% accuracy was achieved.

1.5. Gap Analysis


Many researchers have used frame-based feature extraction techniques and then used the
discriminative model for classification purposes. There is very little work in which the
spatiotemporal features are extracted from CCTV videos. Moreover, many types of research
don’t contain any strong evaluation mechanisms like K-fold that ensure that the model is
evaluated correctly nor there is any evidence of the performance of the model in the real world
scenario. For this reason, it is necessary to make a new dataset that contains videos of real fights
from the CCTV to ensure the performance of the model and to come up with ha strong
evaluation strategy.

1.6. Proposed Solution


The proposed framework for fight detection is shown in Fig. 1. As in literature review we have
seen that there is not any type of end product that classifies the videos and the dataset that are
used do not contain the real fight videos, the videos used in previous datasets are taken from the
scenes of movies or acted by the actors where the fighting scenes are manifested as real fight and
the result were also not very satisfying. So, we will developed a system, the backend for our
system will be implemented in python and we’ll use some classical features like ORB, HOG to
extract the lower level features. The extracted features from the videos are given to the model
which predicts the fight or no fight events and the prediction is displayed on the UI of the user.
Firstly the model is trained using Logistic Regression, Random Forest and Decision Tress
Classifier are used for the classification purpose. The system is able to achieve the accuracy rate
of 86% while using Random Forest classifier. The experimental result on the dataset shows
significant accuracy and an improvement over the previously proposed methods. When the
favorable results were achieved using classical features then we moved towards the deep
learning techniques. We applied the Resnet50, VGG and inception models deep learning and the
model with highest accuracy will be our final model that will be used in our fight classification

Department of Computer Science, Air University, Islamabad, Pakistan 4


Project Report: CCTV based fight Classification

system. The UI is designed using Html and Css and flask framework is used to develop the web
application. Flask is the light weight framework that is useful for development of web
applications in python. Flask’s Jinja template is used to display the prediction results of model on
the user screen when the predict button is clicked.
The Jinja template uses the same concepts of variables, loops, list and etc. as in python to
dynamically develop the Html pages.

1.7. Project Plan


No. Elapsed Time from start Milestone Deliverables
(in months) of the
project
1 2 months Literature Developing background knowledge
and baseline
2 4 months Classical/baseline Exploring Classical techniques

3 8 months Advanced Models Exploring CNN based architectures


for the work
4 10 months Front end Developing a suitable UI

5 12 months Final Product Final Product

Department of Computer Science, Air University, Islamabad, Pakistan 5


Project Report: CCTV based fight Classification

1.7.1. Work Breakdown Structure

1.7.2. Roles & Responsibility Matrix


Samreen Ahsan
Documentation ✓
UI Design ✓
Backend Development ✓ ✓
Frontend development ✓ ✓

1.7.3. Gantt Chart

Department of Computer Science, Air University, Islamabad, Pakistan 6


Project Report: CCTV based fight Classification

1.8. Report Outline


Problem statement:
 Human operators are overwhelmed with the number of camera feeds and manual
response times are slow, resulting in a strong demand for automated alert systems.
 Similarly, there is increasing demand for automated rating and tagging systems that can
process the great quantities of video uploaded to websites.
 To solve this problem a fight scene classification application can be built to detect fight
scenes so that further actions can be taken for the violent video.
General description:
In a semi-automated system, Fight events are monitored manually through the monitor screen of
a surveillance camera. This is not beneficial because continuous monitoring is required, but
watching screens continuously to recognize fight event is difficult. There is no scope for
carelessness while monitoring such activities because these can occur at any time. There is a
need to transform such semi-automated systems into fully automated intelligent systems that can
detect and recognize violent activities without human supervision. Fully automated systems can
detect human activity through computer vision and machine learning and are more effective and
efficient in detecting object movements and recognizing human activity as compared to semi-
automated systems. Human activity recognition is a difficult task because of many factors such
as real-time classification, low video quality of surveillance cameras, and inconsistent light
intensity during monitoring
Results:
Only the documentation and the front end will be produced for the time being, as that is how the
flow of work will be taken and how our application will appear
Conclusions:
We as a two team members learned a lot from this project as in developing this project many
libraries are being used which helped us in developing the web application and which will also
help us to use these libraries in different project at market place level and we will also be able to
learn to integrate the AL/ML algorithms with the web application

Department of Computer Science, Air University, Islamabad, Pakistan 7


Project Report: CCTV based fight Classification

Department of Computer Science, Air University, Islamabad, Pakistan 8


Project Report: CCTV based fight Classification

Chapter 2
Software Requirement
Specifications

Department of Computer Science, Air University, Islamabad, Pakistan 9


Project Report: CCTV based fight Classification

Chapter 2: Software Requirement Specifications


2.1. Introduction
2.1.1. Purpose
The purpose of the SRS document is to clearly describe the requirements and specification of our
product. Our product is the automatic fight detector that is a desktop application which will take
the video from the CCTV, predict the events and classify them as fight or no fight. This
application can be very useful in the security domain and public areas where there are videos
from many CCTVs that are difficult for humans to monitor. It can be helpful in predicting the
fight activities in schools, prisons, playground streets etc. and timely actions can be taken if such
activities are detected.

2.1.2. Document Conventions


The SRS document uses few different font sizes for clear distinction. For example, 14pt for the
heading and 12pt for the paragraph text. The main headings are numbered with whole numbers
like 1. Purpose 2. Overall description. The subheadings are numbered with decimals like 2.1.1
purpose, 2.1.2 document conventions etc. All the requirements mentioned in the document have
their own priority.

2.1.3. Intended Audience and Reading Suggestions


This article is for the authors, users and developers of this product. The document above already
discusses the paper's purpose, scope, motivation, aims, and objectives. The following is the rest
of this SRS:
 Product perspective
 User interfaces
 Functional requirements
 Non-functional requirements
 System features etc.
This article will give a clear vision and work flow of our project. A reader should start reading
from Introduction, as it will give the reader a clear perception of what our project is. Then the
Goals and objectives and Project plan, to get the idea of how our project work. To know the

Department of Computer Science, Air University, Islamabad, Pakistan 10


Project Report: CCTV based fight Classification

detailed working and flow of the project, the reader should check the diagrams as it will hive the
visual image of the system. To know that how a user will interact with the system, and what will
be the usage scenarios w.r.t the product.

2.1.4. Product Scope


The possible application areas for our product can include different public and private sectors:
 Law enforcements
 Public safety ensuring
 Crowd monitoring
 Surveillance cameras install in schools, prisons, offices, restaurants etc.
The main focus of this technology is to help the law enforcement department in preventing the
breakthrough of fight through automatic fight detection and security alerts.

2.2. Overall Description


2.2.1. Product Perspective
This product is intended to be a replacement for current platforms. Many fight detection projects
are already capable of detecting fighting events in the videos that are collected from movies
scenes or are performed by some actors. The project we're working on is a fight detection
platform with a few differences, such as the dataset is collected from the real surveillance videos
in which the real fights scenes are shown, so it can give the good accuracy if it was to be
extended as the real time fight detection desktop app.

2.2.2. User Classes and Characteristics


All those who are related to security cameras surveillance (e.g. police, security guards etc.) will
be our supreme users. Frequency of use of our platform would be high because our application
would be used by the people who are related to surveillance domain and today security cameras
are almost used everywhere.

Department of Computer Science, Air University, Islamabad, Pakistan 11


Project Report: CCTV based fight Classification

2.2.3. Operating Environment


We have developed a desktop application using Flask framework, our application will run in any
web browser and deice that has access to the internet. For now only the prototype of the project
has been developed that runs on the browser of our localhost.

2.2.4. Design and Implementation Constraints


 The surveillance camera should be connected in order to get video feed for the predictions.
 The fight detection system is running 24 hours a day
 The users can access the webapp from any browsers that has the internet connection

2.3. External Interface Requirements


2.3.1. User Interfaces
The UI of the webapp contains is developed using flask framework and Html, Css is used to
build the UI screen that will be displayed to the user. The screen contains a canvas in which the
video from the webcam would be displayed whenever the user clicks the start button. When the
predict button is clicked the result of prediction will be displayed in the label below the canvas

2.3.2. Hardware Interfaces


The hardware required is the surveillance camera that is used for the video feeds. Other than that
only the recommended configuration (Basic requirements of the computer systems) no other
specific hardware is required to run the application.

2.4. System Features


User will be able to perform these actions in this violent scene detection application.

2.4.1. System Feature 1


Selecting Video

Department of Computer Science, Air University, Islamabad, Pakistan 12


Project Report: CCTV based fight Classification

2.4.1.1. Description and Priority


This feature would be of high priority because this application totally dependent on input
video feed, so the input video is the key to access the features available in the application.
2.4.1.2. Stimulus/Response Sequences
User actions:
User will upload the video from the system. User will open the webcam for the video to be
loaded as the input
System response:
System will allow the user to access the features of the application.
2.4.1.3. Functional Requirements
When the user click on the start button the video from the camera should be displayed on
the left panel of the applications and the features of the video should be extracted

2.4.2. System Feature 2


Predict Fight

2.4.2.1. Description and Priority


This feature is also of high priority as it will perform predictions of fighting scenes in the
video which is the main objective of our project
2.4.2.2. Stimulus/Response Sequences
User actions:
User will press the start button
System response:
System will perform predictions and returns the results to the UI of the user.
2.4.2.3. Functional Requirements
When the user clicks on the predict button the prediction of the CCN model should be
displayed on the bottom right panel of the application in the form of fight/nofight label

Department of Computer Science, Air University, Islamabad, Pakistan 13


Project Report: CCTV based fight Classification

2.5. Nonfunctional Requirements


2.5.1. Performance Requirements
The system should be able to accommodate the different video feeds from multiple cameras

2.5.2. Usability Requirements


 The application will be fully functional mainly on the windows operating system.
 The interface is easy to learn and navigate.
 Goal is easy to accomplish quickly with few errors

2.5.3. Maintainability/Supportability Requirements


 Client will handle all non-technical support issues.
 Company will handle all technical issues related to the application functionality.
 Time-to-time updates of the system will be provided

Department of Computer Science, Air University, Islamabad, Pakistan 14


Project Report: CCTV based fight Classification

Chapter 3
Literature Review

Department of Computer Science, Air University, Islamabad, Pakistan 15


Project Report: CCTV based fight Classification

Chapter 3: Literature Review


Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas porttitor congue massa. Fusce
posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit amet commodo magna eros quis
urna. Nunc viverra imperdiet enim. Fusce est. Vivamus a tellus.
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin
pharetra nonummy pede. Mauris et orci. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Maecenas porttitor congue massa. Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada
libero, sit amet commodo magna eros quis urna. Nunc viverra imperdiet enim. Fusce est. Vivamus a
tellus1.
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
Proin pharetra nonummy pede. Mauris et orci.

3. First Heading
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas porttitor congue massa.
Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit amet commodo
magna eros quis urna. Nunc viverra imperdiet enim. Fusce est. Vivamus a tellus.
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
Proin pharetra nonummy pede. Mauris et orci.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas porttitor congue massa.
Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit amet commodo
magna eros quis urna.
Nunc viverra imperdiet enim. Fusce est. Vivamus a tellus.
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
Proin pharetra nonummy pede. Mauris et orci. Lorem ipsum dolor sit amet, consectetuer
adipiscing elit. Maecenas porttitor congue massa. Fusce posuere, magna sed pulvinar ultricies,
purus lectus malesuada libero, sit amet commodo magna eros quis urna. Nunc viverra imperdiet
enim. Fusce est. Vivamus a tellus.
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
Proin pharetra nonummy pede. Mauris et orci.

3.1.1. Example of Subheading Styles


Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas porttitor congue massa.
Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit amet commodo
magna eros quis urna.Nunc viverra imperdiet enim. Fusce est. Vivamus a tellus.
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
Proin pharetra nonummy pede. Mauris et orci.
Lower Level Heading Example
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas porttitor congue massa.
Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit amet commodo
magna eros quis urna.

1
This is an example footnote.

Department of Computer Science, Air University, Islamabad, Pakistan 16


Project Report: CCTV based fight Classification

Nunc viverra imperdiet enim. Fusce est. Vivamus a tellus. Pellentesque habitant morbi tristique
senectus et netus et malesuada fames ac turpis egestas. Proin pharetra nonummy pede. Mauris et
orci.

Figure 3-1 This is an example figure


Another Lower Level Heading Example
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas porttitor congue massa.
Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit amet commodo
magna eros quis urna.

3.1.2. Another Subheading Styles Example


Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas porttitor congue massa.
Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit amet commodo
magna eros quis urna.Nunc viverra imperdiet enim. Fusce est. Vivamus a tellus. Pellentesque
habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin pharetra
nonummy pede. Mauris et orci.

3.1.3. Subheading styles


Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas porttitor congue massa.
Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit amet commodo
magna eros quis urna.Nunc viverra imperdiet enim. Fusce est. Vivamus a tellus.
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
Proin pharetra nonummy pede. Mauris et orci.

Table 2.1 This is an example table.


College New students Graduating students Change
Undergraduate
Cedar University 110 103 +7
Elm College 223 214 +9
Maple Academy 197 120 +77
Pine College 134 121 +13
Oak Institute 202 210 -8
Graduate
Cedar University 24 20 +4

Department of Computer Science, Air University, Islamabad, Pakistan 17


Project Report: CCTV based fight Classification

Elm College 43 53 -10


Maple Academy 3 11 -8
Pine College 9 4 +5
Oak Institute 53 52 +1
Total 998 908 90
Source: Fictitious data, for illustration purposes only. We have used style “Decimal Aligned” for text within the
table.

3.2. Formatting of Equations


Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas porttitor congue massa.
Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit amet commodo
magna eros quis urna.Nunc viverra imperdiet enim. Fusce est. Vivamus a tellus. This is an inline
equation y ( x ) =sin ( x ) . This is a complex equation:
2
n ( n−1 ) x
( 1+ x )n=1+ nx + +… (2-1)
1! 2!
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
Proin pharetra nonummy pede. Mauris et orci.

3.3. Use of Referencing styles


This is a journal paper [1]. This is a conference paper [2]. This is a book section [3]. This is a
book[4].

Department of Computer Science, Air University, Islamabad, Pakistan 18


Project Report: CCTV based fight Classification

Chapter 4
Use Case Analysis

Department of Computer Science, Air University, Islamabad, Pakistan 19


Project Report: CCTV based fight Classification

Chapter 4: Use Case Analysis


This Chapter consist of the use cases analysis for our product that we have designed by gathering
and analyzing the requirement for the system.

4.1. Use Case Model

Figure 1: Use Case for CCTV based fight classification

Department of Computer Science, Air University, Islamabad, Pakistan 20


Project Report: CCTV based fight Classification

4.2. Use Cases Description


4.2.1. Record Video
Title Record Video
Requirement User’s Camera should be connected
Rational Upload/record a video
Restriction or Risk Camera not connected/Video not uploaded
Dependency Pc, Internet connection
Priority timing

Table 2: Record Video Function


Use case 1
Record Video
Actor
 Regular User/Camera
Preconditions
 Camera should be connected
Basic flow
 User will upload the video from the system or will record the video from the camera
Alternate flows
 User don’t want to view result
Post Condition
 Video is uploaded

Table 3: Record Video Function: Use Case 1

4.2.2. Predict Video


Title Predict Video
Requirement Video must be uploaded
Rational Upload/record a video
Restriction or Risk Camera not connected/Video not uploaded
Dependency Pc, Internet connection
Priority accuracy

Table 4: Predict Video Function

Department of Computer Science, Air University, Islamabad, Pakistan 21


Project Report: CCTV based fight Classification

Use case 1
Predict Video
Actor
 Regular User/Camera
Preconditions
 Camera must be connected/ The video must be uploaded before detection
Basic flow
 User will upload the video from the system the prediction will be made by the pre-trained
model as fight/nofight
Alternate flows
 User don’t want to view result
Post Condition
 The alert will be generated on user’s UI if the fight is detected

Table 5: Predict Video Function: Use Case 1

Department of Computer Science, Air University, Islamabad, Pakistan 22


Project Report: CCTV based fight Classification

Chapter 5
Proposed Approach

Department of Computer Science, Air University, Islamabad, Pakistan 23


Project Report: CCTV based fight Classification

Figure 5.1: Proposed Approach

1.0

1.1

1.2

1.3

1.4
3.
4.
5.
5.1. Dataset Exploration
In this step, we explored our dataset and found the following limitations:
• Imbalanced data
• Inter-class similarities

Department of Computer Science, Air University, Islamabad, Pakistan 24


Project Report: CCTV based fight Classification

• Intra-class variation
5.2. Data Augmentation and Pre-Processing

In this step, we will try to solve issues in our dataset using data augmentation and different data pre-
processing techniques.

Explain all steps of proposed approach in this way

Department of Computer Science, Air University, Islamabad, Pakistan 25


Project Report: CCTV based fight Classification

Chapter 6
Implementation & Results

Chapter 6: Implementation & Results

Department of Computer Science, Air University, Islamabad, Pakistan 26


Project Report: CCTV based fight Classification

We have evaluated our fight detection technology on a 300-video fight dataset. After
preprocessing and features extractions. We split the data into training and testing subsets on the
basis of which the model is trained to give the predictions of fight/nofight events

6.1 Different components of your proposed approach


The software & libraries for the fight classification project are:
 Python (3.7.4)
 Pandas
 Numpy (version 1.16.5)
 openCV (version 3.4.2)
 Keras (version 2.3.1)
 Tensorflow (as keras uses tensorflow in backend and for image preprocessing)

6.2 Implementation of proposed approach


[Paragraph Text 12 pt, Times New Roman, 1.5 Line Spacing, Justified]

6.3 Deployment Environment


We have used Pycharm, Jupyter Notebook and Google for model training and VScode for the
development of frontend. For now the system is deployed on our local machines and runs in the
browser.

Department of Computer Science, Air University, Islamabad, Pakistan 27


Project Report: CCTV based fight Classification

3.
4.
5.
6.
6.1
6.2
6.3

6.4 Tools and Techniques


 Train and validate models and develop a machine learning pipeline on IDE (google colab) using
Python.
 Build a basic front-end with an input form for local machine or webcam
 Build a back-end of the web application using python

6.5 Best Practices / Coding Standards


[Paragraph Text 12 pt, Times New Roman, 1.5 Line Spacing, Justified]

6.6 Version Control


[Paragraph Text 12 pt, Times New Roman, 1.5 Line Spacing, Justified]

Department of Computer Science, Air University, Islamabad, Pakistan 28


Project Report: CCTV based fight Classification

Chapter 7
Business Plan

Department of Computer Science, Air University, Islamabad, Pakistan 29


Project Report: CCTV based fight Classification

Chapter 7: Business Plan


An efficient surveillance system is a large-scale computer vision, data analysis, and decision
making challenge. Hence the ‘smart’ approach to extracting information from the surveillance
footages employs the synergy of several innovative technologies that power the next key
components of the Smart Surveillance Systems.

6
7
7.3
7.1 Business Description
Fight detection will be especially useful for real life applications regarding video surveillance.
Video surveillance equipment and systems can be set up virtually everywhere however, beyond
their ability to record and stream recordings, their capabilities are quite limited. Our product will
solve the problem of continuous monitoring of videos from CCTV and human work by
automatically predicting the fight scenes from CCTV and alerting the authorities about fight. Our
Product will encompass the worth perception that the customers are expecting as there can be
any chance of fight breaking out near shops , neighborhoods , inside buildings and on roads.

Department of Computer Science, Air University, Islamabad, Pakistan 30


Project Report: CCTV based fight Classification

7.2 Market Analysis & Strategy


Fight Detection app provides a useful growth strategy that any application based businesses can
consider. It offers market penetration and diversification. Our aim is to seek attention of the
market by attracting first time users of a product, encouraging existing customers to increase
purchase and winning customers from competitors. By doing this we can increase our products
market value. We would implement Competitive pricing strategy to win customers from
competitors by introducing slight price difference. We will use strategy of communicating with
consumers reminding new, ex-users or non-users that why our product is a “must have.”

7.3 Products/Services Description


With the aim of expanding the range of our fight detection Surveillance Systems solutions that
already cover a fight detection technology that can be easily integrated with any security system.
Its primary function is to ensure public safety through visual crowd surveillance, so any violent
activity generates automatic security and police alert. The fight detection module can be
incorporated into the surveillance systems installed in airports, schools, parking lots, prisons,
shopping malls, and other indoor and outdoor public access areas. Through the application of
image processing and machine learning techniques, Smart Surveillance Systems are able to
extract and interpret the information from the CCTV footages faster and much more efficiently
than any human observer. Moreover, all of the components work together in a flexible
environment so they can be customized to serve a specific purpose that can also change over
time.

Department of Computer Science, Air University, Islamabad, Pakistan 31


Project Report: CCTV based fight Classification

7.4 SWOT Analysis

Department of Computer Science, Air University, Islamabad, Pakistan 32


Project Report: CCTV based fight Classification

Chapter 8
Conclusion & Future Work

Department of Computer Science, Air University, Islamabad, Pakistan 33


Project Report: CCTV based fight Classification

Chapter 8: Conclusion & Future Work

8
8.1 Achievements and Improvements
Initially we used the video sequence as input and generated frames. Some frames were selected
from each video clip using image subtraction and averaging techniques and Histogram of
Oriented Gradient (HOG) is applied to extract lower level features. The extracted features from
the videos were given to the trained model which predicts the fight or no fight events. The model
was trained using Logistic Regression, Random Forest and Decision Tress Classifier are used for
the classification purpose. As the videos were of different resolutions, we have resized them to
be 28 x 28 pixels for our CNN architecture. We down sampled the frame to make the training
faster. Thirty frames have been extracted per second from the videos. The CNN model prevents
overfitting by applying regularization techniques like kernel regularizers and dropout of 0.5. The
cost function of this model is binary cross entropy and the optimizer is ‘adam’
Moreover, we have extracted features from our videos using VGG16 and ResNet50. VGG16 is a
simple deep convolutional neural network architecture. It has a deep stacked layered CNN
followed by two fully connected layers which have 4096 neurons on each of them. The output
layer has a softmax classifier. ResNet50 is a deeper model than VGG19 but it proposes very
interesting architecture consisting residual modules. Interestingly, despite of being deeper than
the VGG models, the model size of ResNet50 is much smaller than them because it uses global
average pooling rather than fully connected layers. We have used Keras deep learning library
with TensorFlow backend to implement our desired models and Flask for the frontend
development.

8.2 Critical Review


[Paragraph Text 12 pt, Times New Roman, 1.5 Line Spacing, Justified]

Department of Computer Science, Air University, Islamabad, Pakistan 34


Project Report: CCTV based fight Classification

8.3 Future Enhancements/Recommendations


Surveillance is a basic requirement for the safety and security of the people and their properties.
With advancements in technology, threats are also bound to increase. Intelligent analysis and
contextual decision making can be highly beneficial in identifying threatening events
beforehand.
Potential topic of interest include but not limited to:

 Techniques to improve the SVAS method to deal with moving cameras and multi-camera
data set

 Selective ID protection for intelligent video surveillance systems.

 Gaussian Mixture Model (GMM) for background modelling in intelligent video


surveillance systems. etc.

Department of Computer Science, Air University, Islamabad, Pakistan 35


Project Report: CCTV based fight Classification

Chapter 9
Paper Writing

Department of Computer Science, Air University, Islamabad, Pakistan 36


Project Report: CCTV based fight Classification

Chapter 9: Paper Writing


6.
7.
8.
9.
9.1. Paper Writing
[You are provided with a template of paper format you will use the details of this report and
write paper according to attached format]

Department of Computer Science, Air University, Islamabad, Pakistan 37


Project Report: CCTV based fight Classification

Appendices

Department of Computer Science, Air University, Islamabad, Pakistan 38


Project Report: CCTV based fight Classification

Appendix A: Information / Promotional Material


[Paragraph Text 12 pt, Times New Roman, 1.5 Line Spacing, Justified]
[Between 4 to 8 lines describe what is this appendix all about]

A.1. Broacher (if any)

A.2. Flyer (if any)

A.3. Standee (if any)

A.4. Banner (if any)

Department of Computer Science, Air University, Islamabad, Pakistan 39


Project Report: CCTV based fight Classification

References
[1] Hina Uttam Keval, Effective design, configuration, and use of digital CCTV, Phd,
University College London, 2009.
[2] Fabian Caba Heilbron, Juan Carlos Niebles, and Bernard Ghanem, “Fast Temporal
Activity Proposals for Efficient Detection of Human Actions in Untrimmed Videos,” in
IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016, pp. 1914–
1923
[3] Shugao Ma, Leonid Sigal, and Stan Sclaroff, “Learning Activity Progression in LSTMs
for Activity Detection and Early Detection,” in IEEE Conference on Computer Vision
and Pattern Recognition (CVPR), 2016, pp. 1942–1950
[4] Sudhakaran, S.; Lanz, O. Learning to detect violent videos using convolutional long
short-term memory. In Proceedings of the 2017 14th IEEE International Conference on
Advanced Video and Signal Based Surveillance (AVSS), Lecce, Italy, 29 August–1
September 2017
[5] S¸. Aktı, G. A. Tataroglu and H. K. Ekenel, ”Vision-based Fight Detection ˘ from
Surveillance Cameras,” 2019 Ninth International Conference on Image Processing
Theory, Tools and Applications (IPTA), Istanbul, Turkey, 2019, pp. 1- 6, doi:
10.1109/IPTA.2019.8936070
[6] M. Baccouche, F. Mamalet, C. Wolf, C. Garcia, and A. Baskurt, “Sequential deep
learning for human action recognition,” in International Workshop on Human Behavior
Understanding. Springer, 2011
[7] Hassner, T., Itcher, Y., Kliper-Gross, O.: Violent flows: real-time detection of violent
crowd behavior. In: 2012 IEEE Computer Society Conference on Computer Vision and
Pattern Recognition Workshops, pp. 1–6 (2012).
https://doi.org/10.1109/CVPRW.2012.6239348
[8] Abdali, A.R., Al-Tuma, R.F.: Robust real-time violence detection in video using CNN
and LSTM. In: 2019 2nd Scientific Conference of Computer Sciences (SCCS), pp. 104–
108 (2019). https://doi.org/10.1109/SCCS.2019.8852616

Department of Computer Science, Air University, Islamabad, Pakistan 40

You might also like