Skip to content

abdullahahsann/VideoEnhancementForSurviellance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 

Repository files navigation

VISION AI

Realtime Video Enhancement For Surviellance using Machine Learning

Table of Contents

Special thanks to my supervisors: DR. Syed Sohaib Ali & Dr. Akber Abid Gardezi without whose guidance this wouldn't had been possible.

Introduction

Under bad weather conditions, such as fog and haze, the quality of images degrades severely due to the influence of particles in the atmosphere. Suspended particles will scatter light and result in attenuation of reflected light from the scene and the scattered atmospheric light will also mix with the light received by the camera and change the image contrast and color. In surveillance systems this can obstruct the whole feed in weathers as such, and infiltrations can be done by potential intruders, using this to their advantage. And we are not just referring to home surveillance, but on industry level. Clear video feed will help in smooth running of operations even during the worst of weathers.

In production there aren’t any specific surveillance products that offer such functionality. Or an all-around solution for all the bad weather conditions that might happen. Our software will provide all the functionalities in one package and in real time. Thus, providing a clean video feed no matter the condition of the weather. Along with this our model will also have an autonomous security system that will notify the user about any intrusion or unwanted activity that it detects during the time that the user specifies.

Problem Solution

For our enhanced video output feed, we are providing three different Machine Leaning models:

  1. Image Dehazing
  2. Image Deraining
  3. Low Light Image Enhancement

We have a desktop application system (coded in PyQt) for the user through which they’ll be getting the video feed of their surveillance camera. The user will have options to apply any of the filter using our models to enhance the output quality in bad weather conditions. The history of the video will also be saved. And user will have access to it and can go back and review the past footage. And if needs be, apply any filter during any point in time of the video.

For our automated security surveillance, the user will define which camera feeds need to be checked for any unusual activity. And from the choice of filters: Human detection or Movement detection, pick one. And based on the user’s choice the AI will detect any human related activity, or any activity at all whatsoever. And if anything is detected will instantly report to the user.

Advantages of proposed system

The product will help in many computer vision related tasks. It can be deployed in any field that requires clearer images/video outputs in such bad weather condition. The uses can range from being used in a cars ADAS system to being used by firefighters for a clearer video feed.We implement the model in CCTV, which can drastically enhance the work performance capacity even in the worst of weathers and increase security alongside it.

The product will work not in just one, but all of the most worst weather conditions possible, being: Hazy, fogy, raining. And our low light enhancement model will make the CCTV work just as perfectly even in the darkest of night scenarios. It can help in smooth running of operations, that require overlooking, even when the weather is not favorable. It can be installed in remote areas where humans cannot reach.

Along with that the intruder detection (object detection) module can enhance the security aspect of a CCTV system, and that combined with a clearer video feed, even during bad weather or nighttime, can greatly increase the security system.

Results

These all results also work on real time, videos will be uploaded soon. (2 test videos are available after the images section though)

Low Light Enhancement

image

image

Dehazing

TEST SET: Screenshot from 2021-07-11 19-28-33

Screenshot from 2021-07-11 19-28-45

IMAGES FROM GOOGLE:

Screenshot from 2021-07-11 19-27-19 Screenshot from 2021-07-11 19-26-51 Screenshot from 2021-07-11 19-26-06 Screenshot from 2021-07-11 19-27-45

Videos for Low Light Enhacnement:

Night Parking Lot: https://user-images.githubusercontent.com/62840383/191882489-a15aea75-4ba9-40e7-942c-b2f1905beaf0.mp4

During Testing Video Output: https://user-images.githubusercontent.com/62840383/191882550-97cc75eb-aa3e-45d8-9ab7-0f9679fae26d.mp4

Desktop Application

(Coded in PyQt)

Main Menu

Capdcdcdcdture

Camera Feeds - (LLE Model in action, it works in real time)

1 2

Human/Movement Detection

Capturddddde Capddddture Captcccccccure WhatsApp Image 2021-12-21 at 00 04 27

Video Player

Captdfdfdfdure

How to test yourself

If you want to test the model. The simplest way is to run the Desktop application , as it will run in real time. Simply run the main.py file in that folder. You might have to change the values of cv2.VideoCapture. If you want to procecss a custom video, put it in the same directory and put the name of that video inside brackets with " ".

For testing the dehazer, LLE or derainer model independently. You can run the evaluation.py file in the Evaluation directory in their respective folders. I've made functions to evaluate video, custom video or a set of images. Just run the appropriate function and it'll give the result. If there's any issue at all or you just wanna ask something do let me know :D.

I'll soon add a whole tutorial detailing how i coded all of this, what libraries, api's, datasets used to train the models etc were used and a basic changes section to have the application up and running in no time.

Papers that have helped me a lot

  1. An All-in-One Network for Dehazing and Beyond (https://arxiv.org/abs/1707.06543)
  2. Generic Model-Agnostic Convolutional Neural Network for Single Image Dehazing (https://arxiv.org/abs/1810.02862)
  3. Low-Light Image and Video Enhancement Using Deep Learning: A Survey (https://arxiv.org/abs/2104.10729)
  4. A great resource for Low Light models: (https://github.com/cxtalk/You-Can-See-Clearly-Now)
  5. A great resource for deraining models: (https://github.com/nnUyi/DerainZoo)

Other Great Resources

  1. Learning PyQt: (https://www.youtube.com/c/SpinnTV) - best place to learn pyqt
  2. Deep Learning: (https://www.coursera.org/specializations/deep-learning) - best courser to start ML journey
  3. Deep Learning Concepts: (https://www.youtube.com/c/deeplizard) - best place for ML DL Concepts
  4. Deep Learning Practical: (https://www.youtube.com/c/sentdex/featured) - the person who started it all for me :D

Code

Code for the Desktop Application as well as the ML models can be requested. Kindly reach me on my email :D.