Inicio / Tecnologías de la Información y las Comunicaciones

VIDEO: A new artificial intelligence based system warns when a gun appears in a video

Spanish version:

Scientists at the University of Granada design a computer algorithm that could serve to improve security at airports and areas with video surveillance as well as control violent content uploaded on social networks like Facebook, YouTube and Twitter.

The online journal MIT Technology Review chose this work as one of the five most outstanding worldwide in the technology sector.

The researchers tested their system with movies like Pulp Fiction, Mission Impossible and James Bond

Scientists from the University of Granada (UGR) designed a computer system, based on new artificial intelligence techniques, that automatically detects in real time when a subject in a video draws a gun.

Their work, pioneering on a global scale, has numerous practical applications, from improving security in airports and malls, for example, to automatically controlling violent content in which handguns appear in videos uploaded on social networks such as Facebook, Youtube or Twitter, or classifying public videos on the internet that have handguns.

Francisco Herrera Triguero, Roberto Olmos and Siham Tabik, researchers in the Department of Computational and Artificial Intelligence Sciences at the UGR, developed this work. Its relevance was reflected when the MIT Technology Review, an e-journal of the renowned technology-oriented university, selected it as one of the five most stimulating articles of the week worldwide.


To ensure the proper functioning and efficiency of the model, the authors analyzed low-quality videos from YouTube and movies from the 90s such as Pulp Fiction, Mission Impossible and James Bond. This algorithm engineered in the UGR showed an effectiveness of over 96.5% and is capable of detecting guns with high precision, analyzing 5 frames per second, in other words, in real time. When a handgun appears in the image, the system sends an alert in the form of a red box on the screen where the weapon is located.

A fast and inexpensive model

The UGR full professor Francisco Herrera explained that their model can easily be combined with an alarm system and can be implemented inexpensively using video cameras and a computer with moderately high capacities.

Additionally, the system can be implemented in any area where video cameras can be placed, indoors or outdoors, and does not require direct human supervision.

For her part, Siham Tabik, currently under a Ramon y Cajal grant within the National Programme for the Promotion of Talent and its Employability in Research and Development and Innovation, noted that deep learning models like this represent a major breakthrough over the last five years in the detection, recognition and classification of objects in the field of computational.

Deep learning models learn through training by building a model from sample outputs, emulating the nervous system in the neuron connection and use sophisticated optimisation algorithms to learn connections between artificial neurons.

A pioneering system

Until now, the principal weapon detection systems were based on metal detection and found in airports and public events in closed spaces.  Although these systems have the advantage of being able to detect a firearm even when it is hidden from sight (and therefore can, in theory, detect a weapon long before it is used), they unfortunately have several disadvantages.

Among these drawbacks is the fact that these systems can only control the passage through a specific point (if the person carrying the weapon does not pass through this point, the system is useless); they also require the constant presence of a human operator and generate bottlenecks when there is a large flow of people, also detecting everyday metallic objects such as coins, belt buckles and mobile phones.  This makes it necessary to use conveyor belts and x-ray scanners in combination with these systems, which is both slow and expensive. In addition, these systems cannot detect weapons that are not made of metal, which are now possible because of 3D printing.

For this reason, handgun detection through video cameras is a new complementary security system that is useful for areas with video surveillance.

The UGR researchers affirm that, thus far, no published scientific study, patent or commercial product has dealt with the issue of gun detection in videos in real time using «Deep Learning», which makes this a completely pioneer study on a global scale. Not surprisingly, various companies are already interested in this new technology engineered at the University of Granada.

The research received the Fujitsu-UGR Excellence in Innovation and Technology Award in November of 2016, for the Masters project presented by Roberto Olmos.

Attached images:

Siham Tabik, Roberto Olmos, Francisco Herrera-V2

  1. The three authors of this investigation, from left to right: Siham Tabik, Roberto Olmos and Francisco Herrera Triguero.


  1. The system engineered in the UGR establishes an alert in the form of a red box on the screen where the gun is located.

Bibliographical reference:

Automatic Handgun Detection Alarm in Videos Using Deep Learning

1.Olmos, S. Tabik, F. Herrera


Francisco Herrera Triguero, Full Professor

Department of Computer Science and Artificial Intelligence at the UGR

Telephone: (+34) 958 240 598