Back to Guides
    Guide · Datasets compared

    Weapon and Knife Detection Datasets Compared

    The public gun and knife datasets engineers actually use, what is in them, why look-alike objects decide your false positive rate, and the licence questions to settle before a model ships.

    By Fredrik Hegardt
    October 24, 2026
    8 min read

    What a weapon detection dataset needs to teach

    A weapon detection dataset is a set of images or video frames with bounding boxes around firearms, knives and the people holding them, used to train a detector that raises an alert.

    The detector itself is the easy part: any modern YOLO or DETR model will find a large, well-lit pistol. The hard part is the data distribution. On a ceiling camera a handgun can be a few dozen pixels, partly covered by a hand, blurred and compressed. Next to it, every second person is holding a phone. A useful dataset has to cover both: weapons as small as they appear on real cameras, and the everyday objects that look like them.

    The public datasets compared

    These are the sets most often cited in weapon detection papers. Counts come from the papers and repositories listed under Sources; image counts for the Granada sets are the files in the public repository.

    DatasetSizeClassesImage sourceLicenceKnown problems
    Granada pistol detection (Olmos, Tabik, Herrera, 2018)3,000 imagesPistolPhotos from diverse websitesCC BY-SA 4.0 (repository README)Mostly large, well-lit pistols; not CCTV
    Granada knife detection (Castillo et al., 2019)2,078 imagesKnifeSee the paperCC BY-SA 4.0 (repository README)Single class; no person boxes
    Sohas (Pérez-Hernández et al., 2020)About 5,000 train + 857 test images (detection)Pistol, knife, smartphone, bill, purse, cardClose-range hand-held objectsCC BY-SA 4.0 (repository README)Look-alikes included, but filmed close up rather than from CCTV height
    Mock Attack Dataset (Salazar González et al., 2020)5,149 annotated frames + Unity synthetic sets (500 / 1,000 / 2,500 images)Weapons; synthetic set has 11 classes incl. handguns, rifles, knife, smartphoneThree real CCTV cameras in a university building (staged attacks)CC BY-NC 4.0; commercial use by contacting the authorsOne building, three cameras; non-commercial
    YouTube-GDD (Gu, Liao, Qin, 2022)5,000 images from 343 videos; 16,064 guns, 9,046 peopleGun, person (all firearm types share one class)YouTube videosApache-2.0 on the repository; frames are third-party YouTube contentNo handgun / rifle split; mostly hand-held and close cameras
    Kaggle gun and knife sets (various)Hundreds to a few thousand images eachVaries (gun, knife, pistol)Mostly web search, movies and social mediaSet by the uploader: e.g. GPL 2, CC0 or UnknownProvenance usually undocumented; duplicates across sets

    Notes on each

    • University of Granada sets (published together as OD-WeaponDetection) are the most reused academic baseline. The pistol set was built for an alarm system in which the authors framed detection as a false-positive problem; their test videos were film clips, not CCTV. The repository README states CC BY-SA 4.0 while the GitHub metadata shows CC BY 4.0, so if you redistribute derived data, treat the ShareAlike term as binding.
    • Sohas (Small Objects Handled Similarly to a weapon) is the one public set built around look-alikes: pistols and knives next to smartphones, banknotes, purses and cards held the same way. It is the right starting point for studying confusion between hand-held objects.
    • Mock Attack Dataset is the closest public set to a real deployment: staged attacks recorded on three working CCTV cameras covering two corridors and an entrance, annotated at 2 frames per second, plus a Unity-generated synthetic set. The real part covers one building, so it is better as a test set than as training data.
    • YouTube-GDD has rich context and many instances per image, but it puts handguns, rifles and machine guns in one class and its frames come from YouTube videos.
    • Kaggle and Roboflow sets are convenient and plentiful. Many reuse the same scraped images under different names, so check for duplicates between your training and test sets.

    Why look-alikes drive false positives

    A look-alike, or hard negative, is a harmless object that shares the shape, size, colour or grip of a weapon at the resolution the camera sees.

    A detector trained only on positive weapon images learns whatever separates those images from background: a dark compact object in one hand, or a long thin object held across the body. In the field that description fits phones, wallets, black crisp packets, drills, bottles, closed umbrellas, tripods and walking sticks. Because these objects are far more common than weapons, even a low per-object false positive rate turns into many alerts per camera per day.

    This is not hypothetical. In October 2025, police handcuffed a student at Kenwood High School in Baltimore County after the school's AI gun detection system flagged a bag of crisps as a possible firearm. The vendor said the process of alert plus human verification worked as designed; the student was still handcuffed.

    The fix is in the data. Include the look-alikes your cameras will see, either labelled as their own classes (so you can measure the confusion) or as explicit negatives, and keep a held-out set of them for evaluation. Report precision on that set separately from your overall mAP, because the overall number is dominated by easy positives.

    Licence traps

    A dataset licence can only grant rights the publisher holds, and most public weapon images belong to someone else.

    • Scraped frames. YouTube-GDD's code and labels are Apache-2.0, but its images are frames from YouTube videos whose rights belong to the uploaders. The same applies to sets built from films or the Internet Movie Firearms Database.
    • Non-commercial terms. The Mock Attack Dataset is CC BY-NC 4.0, and its authors ask commercial users to contact them. Research-only terms usually cover the trained model too, because the model is derived from the data.
    • ShareAlike. CC BY-SA 4.0 lets you use the Granada sets commercially, but any adapted dataset you distribute must carry the same licence.
    • Uploader-chosen licences. On Kaggle the licence field is whatever the uploader picked. Popular weapon sets show GPL 2, CC0 or Unknown, often for images collected from search engines. A permissive label does not clear the source images.

    What to look for in a commercial dataset

    A commercial weapon dataset should match your deployment cameras, contain the objects that cause false alarms, and come with a licence from the party that owns every image.

    • Ceiling, wall and pole-mounted viewpoints, with weapons small and distant as well as close.
    • Separate classes for handgun, rifle and knife if your response differs by type.
    • Boxes for the person carrying the weapon, so you can track and re-identify.
    • Hard negatives in a known share of the images: phones, wallets, bottles, umbrellas, bags and tools.
    • Day, night and monochrome IR images, with compression and motion blur.
    • A fixed validation split and a dataset card that says how the images were made and checked.
    • A perpetual licence that covers models you train and sell.

    Our weapon and knife datasets

    All four are synthetic CCTV images, so there are no real people and no third-party footage in them.

    • CCTV Weapon Detection Dataset: 1,000 images, boxes for person, handgun, rifle, shotgun and scoped rifle, about a fifth hard negatives, YOLO and COCO, 900 / 100 split.
    • CCTV Knife Detection Dataset: 1,000 images, classes person and knife, mostly small knives, about a fifth hard negatives (phones, wallets, bottles, umbrellas).
    • Rifles vs Umbrellas: 1,000 images, a 50/50 split of rifles and umbrellas, classes person, rifle and umbrella.
    • Handgun vs Bag of Chips: 1,100 images of handguns against crisp packets held the same way, classes person, handgun and chip bag, built after the Baltimore incident.

    Each is sold with a Research licence ($149) or a Commercial licence ($590); see pricing. If you already have a detector, the False-Positive Stress Test ($1,500, five working days) runs it against our hard-negative and edge-case set and sends a ranked report of every failure.

    Frequently asked questions

    What is the largest public gun detection dataset?

    Among the commonly cited sets, YouTube-GDD has 5,000 images with 16,064 annotated guns, and the University of Granada pistol detection set has 3,000 images. Larger collections exist, but most mix web photos and movie frames rather than CCTV footage.

    Is there a public weapon dataset recorded on real CCTV cameras?

    Yes. The Mock Attack Dataset from the University of Seville has 5,149 annotated frames from three real CCTV cameras in a university building, recorded during staged attacks. It is licensed CC BY-NC 4.0, so commercial use needs the authors' permission.

    Why does my weapon detector flag phones and umbrellas?

    Because it learned shape and grip, not the object. A phone held in one hand, a dark wallet or a crisp packet looks like a handgun at CCTV resolution, and a closed umbrella looks like a rifle. Training with these look-alikes labelled as negatives or as their own classes is what fixes it.

    Can I use Kaggle weapon datasets commercially?

    Only if the uploader had the rights to grant the licence shown. Many Kaggle and Roboflow weapon sets are scraped from search engines, movies or YouTube, so a CC0 or GPL label on the page does not clear the underlying images. Check the provenance before shipping a model trained on them.

    What should I look for in a commercial weapon detection dataset?

    CCTV viewpoints and small, distant weapons; explicit hard negatives such as phones, wallets, bottles, umbrellas and tools; boxes for the person as well as the weapon; day, night and IR images; a fixed validation split; and a licence from someone who owns every image.

    Also on Simuletic

    Sources

    1. OD-WeaponDetection repository (University of Granada): pistol, knife and Sohas sets, licence
    2. Weapons detection project page, University of Granada (paper list)
    3. Olmos, Tabik, Herrera, Automatic handgun detection alarm in videos using deep learning (arXiv)
    4. Castillo et al., Brightness guided preprocessing for automatic cold steel weapon detection, Neurocomputing 2019
    5. Pérez-Hernández et al., Object detection binary classifiers methodology (Sohas), Knowledge-Based Systems 2020
    6. Mock Attack Dataset repository and terms (University of Seville)
    7. Mock Attack Dataset description
    8. Salazar González et al., Real-time gun detection in CCTV: An open problem, Neural Networks 2020
    9. Gu, Liao, Qin, YouTube-GDD: A challenging gun detection dataset with rich contextual information
    10. YouTube-GDD repository (licence)
    11. Kaggle: Guns Object Detection (licence GPL 2)
    12. Kaggle: Weapon Detection Dataset (licence Unknown)
    13. Kaggle: Weapon Detection Dataset (licence CC0)
    14. ABC7: Student handcuffed after Doritos bag mistaken for a gun by school's AI security system

    Find out what your detector flags before your customers do

    Train on CCTV-angle weapons with look-alikes, or send us your model for a False-Positive Stress Test.