Professional Documents
Culture Documents
2019-2023
BS in Computer Science
Submitted to
Mr. Hafiz Saud Arshad
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
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.
Change Record
Author(s) Version Date Notes Supervisor’s Signature
APPROVAL
PROJECT SUPERVISOR
Date:_______________________________ Signature:_________________________
PROJECT MANAGER
Date:_______________________________ Signature:__________________________
CHAIR DEPARTMENT
Date:_______________________________ Signature:__________________________
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
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.
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
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
List of Figures
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
List of Abbreviations
1.1 UML Unified Model Notation
1.2 SRE Software Requirement Engineering
2.1 SDR Software Defined Radios
Chapter 1
Introduction & Background
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.
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.
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.
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.
Chapter 2
Software Requirement
Specifications
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.
Chapter 3
Literature Review
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.
1
This is an example footnote.
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.
Chapter 4
Use Case Analysis
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
Chapter 5
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
• 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.
Chapter 6
Implementation & Results
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
3.
4.
5.
6.
6.1
6.2
6.3
Chapter 7
Business Plan
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.
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.
Techniques to improve the SVAS method to deal with moving cameras and multi-camera
data set
Chapter 9
Paper Writing
Appendices
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